Repository navigation
fix: update node, regenerate the lockfile and run the audit pass - #13
Merged
Merged
Conversation
The `engines` value is the same as in video.js. The v1 lockfile did not list `phantomjs`, which the pinned `run-browser` commit needs. npm 11 adds it to the v3 lockfile. npm 11 also moves `@babel/runtime` from 7.5.5 to 7.29.10, because `@videojs/babel-config` has a peer dependency on `^7.11.2`.
`run-browser` is not maintained. The lockfile pins a `run-browser` commit from 2016 that runs the tests in phantomjs 1.9. The tests did not start, because the lockfile did not include `phantomjs`. Newer `run-browser` versions read the browser console only after the page loads. Short test files then print no TAP output and still pass. The new runner bundles each test file with `browserify` and runs it in the installed Chrome, or in the browser at `CHROME_BIN`. It writes TAP to stdout and sets the exit code. The new runner does not need `tap-spec`.
The mocky.io URL in the test does not exist anymore, so the test always failed. The mock server now sends a CORS 404 response on a second origin. The request stays cross-origin and does not use the network.
GitHub deprecated the node12, node16 and node20 action runtimes. The workflow writes to `$GITHUB_OUTPUT`, because GitHub deprecated the `set-output` command. The tests use only headless Chrome. The workflow does not need xvfb, the Firefox audio packages or the BrowserStack secrets.
All versions stay inside the declared ranges. The lockfile now resolves a fixed runtime version of `min-document`. `npm audit fix` moves `crypto-browserify` from 3.12.1 to 3.3.0 to remove a low `elliptic` finding. `crypto-browserify` 3.3.0 uses `sha.js` 2.2.6, which has a critical advisory. The override keeps `crypto-browserify` on 3.12.
`pre-commit` 1.2.2 depends on a `cross-spawn` version with a high advisory. `pre-commit` installs the hook from a dependency install script. npm 11 shows a warning for these scripts, and npm 12 blocks them by default. husky installs the hook from the `prepare` script of the package. The hook continues to run `npm test`.
`@babel/cli` 7 uses `chokidar` 3, which depends on `braces`. All `braces` versions have a high advisory. `chokidar` 4 has no `braces` dependency and keeps the `FSWatcher` API that `babel --watch` uses.
`@babel/core` 7.29.0 and older have a low advisory. These versions also allow `@babel/traverse` and `@babel/helpers` versions with known advisories. video.js uses the same range.
`npm publish` shows a warning for the string form and changes it. GitHub does not serve the `git://` protocol anymore.
`@babel/preset-env` 7.14 installs deprecated proposal plugins, and npm shows a warning for each plugin. The only change in `lib/` is one pair of braces in an inline Babel helper.
1 of 3 tasks
spuppo-mux
approved these changes
Oct 28, 2026
spuppo-mux
left a comment
There was a problem hiding this comment.
typings points to ./lib/index.d.ts, but the package does not contain that file. The types file is ./index.d.ts.
Lets add this on this PR. Otherwise, lgtm
|
Also opened #14 with the follow up items |
The typings field pointed to ./lib/index.d.ts. The build does not make that file, so TypeScript users did not get the types.
Essk
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
xhr still uses Node 10 and a v1 lockfile, so a new release needs a toolchain update first. The steps are the same as in videojs/video.js#9231 and videojs/video.js#9232:
Before, using
v10.24.16.14.12npm auditshowed:npm 11 counts vulnerabilities per package, not per path. With npm 11, the same lockfile shows
51 vulnerabilities (2 low, 9 moderate, 27 high, 13 critical).Now, using
v24.21.011.19.0npm auditshows5 low severity vulnerabilities. Oneellipticadvisory causes all of them, and the advisory has no patched release. It affects only dev dependencies.The tests did not run on main. The lockfile pinned a
run-browsercommit from 2016 that needs phantomjs, and the lockfile did not include phantomjs. Newerrun-browserversions read the browser console only after the page loads. Short test files then print no TAP output and still pass. This PR replacesrun-browserwith a small runner. All 151 assertions pass.The runtime dependency ranges do not change. The runtime advisories in
@babel/runtimeandmin-documenthave fixes inside the current ranges.Replaces #11 for its security goal.
min-document2.19.1 fixes the advisory, andglobal ~4.4.0already allows that version.Specific Changes proposed
From the third commit, each commit passes the install, the build and
npm testby itself. xhr has no lint setup..nvmrcand addedengines. Theenginesvalue is the same as in video.js.@babel/runtimefrom 7.5.5 to 7.29.10, because@videojs/babel-confighas a peer dependency on^7.11.2.run-browserwithtest/runner.js.browserify17 and runs it in the installed Chrome throughplaywright-core.CHROME_BINsets a different browser binary.tap-spec.npm run browserstill serves the tests for a manual run.$GITHUB_OUTPUT, because GitHub deprecated theset-outputcommand.npm audit fix. Result:11 vulnerabilities (5 low, 6 high)crypto-browserify.npm audit fixmoves it to 3.3.0, which uses asha.jsversion with a critical advisory.pre-commitwith husky 9.pre-commitdepends on across-spawnversion with a high advisory.pre-commitinstalls the hook from a dependency install script. npm 12 blocks these scripts by default.preparescript installs the hook from.husky/pre-commit. The hook continues to runnpm test.chokidar.@babel/cli7 useschokidar3, which depends onbraces. Allbracesversions have a high advisory.chokidar4 keeps the API thatbabel --watchuses.npm startworks.@babel/corerange to^7.29.7. Older versions have a low advisory. video.js uses the same range.repositoryinpackage.jsonto the object form.npm publishshows a warning for the string form.@babel/preset-envto^7.29.7. Version 7.14 installs deprecated proposal plugins, and npm shows a warning for each plugin.typingsinpackage.jsonto./index.d.ts. The old value./lib/index.d.tspoints to a file that the build does not make, so TypeScript did not find the types.npm pack --dry-runshows that the package containsindex.d.ts.Built files / package checks:
lib/from main is byte identical to thelib/in the published 2.7.0 package.lib/has the same AST for all code fromsrc/. The differences are format changes from newer Babel versions.lib/interceptors.jsalso has newer versions of the inline for-of helpers from Babel. The helpers do the same checks.lib/from the published 2.7.0 package passes the new test suite.npm pack --dry-rungives the same 15 files as npm 6 on main.Follow-up items:
crypto-browserifyshim inbrowserify..idea/files that git does not track. A publish from a clean clone prevents this.ubuntu-latest, setCHROME_BINin the workflow.Requirements Checklist