Skip to content

chore(node): drop 8 unused devDependencies - #2286

Merged
ArthurZucker merged 1 commit into
mainfrom
chore/prune-node-devdeps
Aug 5, 2026
Merged

chore(node): drop 8 unused devDependencies#2286
ArthurZucker merged 1 commit into
mainfrom
chore/prune-node-devdeps

Conversation

@ArthurZucker

Copy link
Copy Markdown
Collaborator

Follow-up to #2285. That PR removed the wasm example's package-lock.json (12 alerts). This one goes after the other npm manifest.

Context

All 45 open Dependabot alerts on this repo are npm. Zero from cargo, zero from pip. After #2285, all 33 remaining live in bindings/node/yarn.lock.

Worth stating up front: none of it ships. bindings/node/package.json has an empty dependencies and "files": ["index.d.ts", "index.js"]. Everything in that lockfile is lint/test/build tooling. Dependabot marks 23 of these "runtime", which is misleading — that's the transitive package's own dependency type, not reachability from the published artifact.

What's removed

8 devDependencies that nothing in the repo invokes — 109 packages gone, 687 → 578:

dep why
ava dead test runner; scripts.test is jest. Its inline ava config block went too
benny, chalk, @swc-node/register only used by scripts.bench, which pointed at benchmark/bench.tsa file that does not exist, so the script was already broken. Dropped the script
@swc/core only a peerDependency of @swc-node/register; jest transforms via preset: 'ts-jest', not swc
husky no .husky/ dir, no prepare script — the git hook was never installed
lint-staged had an inline config block, but with husky absent nothing ever ran it
npm-run-all only supplied run-p for format, now a plain && chain

Security impact — measured, not assumed

Resolves 2 open alerts, both shell-quote, one of them CRITICAL. npm-run-all was its sole source.

The other 31 are not reachable by deletion, and I'd rather say so than imply otherwise:

tar (12) <- cacache, node-gyp <- fsevents <- jest-haste-map <- jest
js-yaml (5) <- eslint, @napi-rs/cli
brace-expansion (6) <- minimatch <- eslint, glob
@babel/core (1) <- @jest/transform

They hang off jest, eslint and @napi-rs/cli, which are all genuinely needed. Note fsevents is a macOS-only optional dependency — the entire tar/cacache/socks/ip-address cluster (16 alerts) never installs on Linux CI in the first place. Clearing those needs a jest major bump, which is a separate and riskier change.

Verification

  • yarn install — exit 0, lockfile regenerated with the vendored yarn 3.5.1
  • yarn lint — exit 0, clean
  • jest --listTests — all 6 suites still discovered
  • eslint / prettier / taplo / jest / napi binaries all still resolve

Unrelated bug spotted

bindings/node/Makefile has check-style: npm run lint-check, but there is no lint-check script in package.json — that target is already broken on main. Left alone here to keep this PR scoped.

Removes dev tooling that nothing in the repo invokes, cutting 109 packages
(687 -> 578) from yarn.lock.

- ava            dead test runner; `scripts.test` is jest. The `ava` config
                 block and its `@swc-node/register` require went with it.
- benny, chalk   only used by `scripts.bench`, which pointed at
- @swc-node/reg. `benchmark/bench.ts` -- a file that does not exist, so the
                 script was already broken. Dropped the script too.
- @swc/core      only a peerDependency of @swc-node/register; jest transforms
                 via `preset: 'ts-jest'`, not swc.
- husky          no `.husky/` directory, no `prepare` script -- the git hook
                 was never installed.
- lint-staged    had an inline config block, but with husky absent nothing
                 ever ran it.
- npm-run-all    only supplied `run-p` for the `format` script, now a plain
                 `&&` chain. It was the sole source of shell-quote, which
                 carried a CRITICAL advisory.

Resolves 2 open dependabot alerts (both shell-quote, one critical). The
remaining 31 are not reachable by deletion: tar/cacache/socks/ip-address all
hang off node-gyp <- fsevents <- jest-haste-map, and fsevents is a macOS-only
optional dep of jest, so it never installs on Linux CI at all. Clearing those
needs a jest major bump, not a dependency removal.

None of this ever shipped: `dependencies` is empty and `files` is
["index.d.ts", "index.js"].

Verified: yarn install, yarn lint, jest --listTests (6 suites), and
eslint/prettier/taplo/jest/napi binaries all resolve.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ArthurZucker
ArthurZucker merged commit b26727f into main Aug 5, 2026
22 of 25 checks passed
@ArthurZucker
ArthurZucker deleted the chore/prune-node-devdeps branch August 5, 2026 04:20
ArthurZucker added a commit that referenced this pull request Aug 5, 2026
Conflict was in bindings/node/yarn.lock only. main's #2286 dropped the same
8 unused devDependencies this branch had already dropped, so the merged
package.json is byte-identical to this branch's. Kept this branch's lockfile,
which carries the security resolutions on top of that same dependency set.

Verified with `yarn install --immutable`.
ArthurZucker added a commit that referenced this pull request Aug 5, 2026
main's #2286 dropped 8 unused devDependencies; this branch had already
dropped those same 8 plus jest/ts-jest/@types/jest (#2288) and added the
security resolutions. The branch's package.json is therefore a strict
superset of main's changes, so both files resolve to the branch side.

Note: git's auto-merge silently re-added "jest": "^29.5.0" to
devDependencies, since main still lists it and the surrounding lines moved.
That was dropped deliberately in #2288 and is removed here.

Verified with `yarn install --immutable`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants