Remove unused devtool dependencies; fix undeclared phantom deps - #761
Merged
Conversation
Audited all 115 top-level dependencies for real usage across our own
code, npm scripts, and tool config (eslint plugin/extends shorthand,
postcss plugin wiring, jest environment shorthand, peer-dep
requirements). Removed everything confirmed dead:
- autoprefixer, postcss, postcss-calc, postcss-color-function,
postcss-custom-properties, postcss-preset-env - never passed into
the actual PostCSS pipeline in scripts/rollup.generic.js, which only
wires up rollup-plugin-postcss + postcss-prefix-selector directly.
(A "devDependencies_to_remove" key already flagged 4 of these as
known-dead but never finished the removal - completing that here
and dropping the placeholder key.)
- rollup-plugin-styles - zero usage, and the actual package causing
the ERESOLVE peer conflict that forced --legacy-peer-deps on every
install. Plain `npm install` now succeeds without that flag.
- rollup-plugin-terser - superseded by @rollup/plugin-terser, which is
what scripts/rollup.js actually imports.
- eslint-plugin-prettier - commented out in .eslintrc since Jan 2025
("Remove prettier/prettier rule in eslint") after running Prettier
through ESLint produced too much formatting noise. Formatting is
handled by the standalone `prettier` CLI via `npm run format`/`fix`;
eslint-config-prettier (which just disables conflicting ESLint
stylistic rules) stays, only the ESLint-integration package goes.
- react-circular-progressbar, vinyl, vinyl-fs, node-domexception - no
references anywhere; node-domexception isn't even a transitive
dependency of anything else in the tree.
- jest-config, jest-resolve, @jest/test-sequencer - Jest's own
internal packages, already pulled in transitively by @jest/core at
the identical pinned version; no custom resolver/sequencer config
references them.
- testing-library (bare, 0.0.2) - not the real Testing Library org
package, looks like a typo from the same commit that added the real
@testing-library/* packages.
- babel (bare, ^6.23.0) - ancient deprecated Babel 6 meta-package;
the project fully uses scoped @babel/* v7 packages now.
- babel-plugin-syntax-hermes-parser - zero parents in the tree, not
referenced by babel.config.js or @babel/preset-flow. `flow check`
doesn't invoke Babel plugins at all, so this has zero effect on
typechecking regardless (verified: identical 8059-error count
before/after removal).
Also declared three phantom dependencies found during the audit -
chalk, @codedungeon/messenger, and lodash.debounce are require()'d
directly in scripts/rollup.js and scripts/rollup.generic.js but were
never in package.json. They only worked because something else
happened to install them transitively; pinned to their currently
resolved versions so they don't silently break on an unrelated bump.
Verified: plain `npm install` succeeds with no ERESOLVE (previously
needed --legacy-peer-deps); full test suite passes (198 suites, 4553
tests); flow check error count unchanged (8059, confirmed via stash
comparison); eslint runs clean (pre-existing 207069 problems, also
confirmed identical via stash comparison, unrelated to this change);
built both a plain plugin (np.Templating) and a React-webview plugin
(jgclark.Dashboard, exercising the postcss/rollup-plugin-postcss path)
end-to-end via the real npc CLI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
That flag existed to work around the ERESOLVE conflict between rollup-plugin-styles's peer range (rollup ^2.63.0) and our actual rollup version (^4.28.0). With rollup-plugin-styles removed, plain npm ci/npm install resolve cleanly on their own - verified via a fresh npm ci in this branch (no errors, same 2019 packages installed, full test suite and a real plugin build still pass). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Follow-up to #759. Audited all 115 top-level dependencies for real usage across our own code, npm scripts, and tool config (ESLint plugin/extends shorthand, PostCSS plugin wiring, Jest environment shorthand, peer-dep requirements) and removed everything confirmed dead.
Removed
PostCSS family —
autoprefixer,postcss,postcss-calc,postcss-color-function,postcss-custom-properties,postcss-preset-env. None of these are passed into the actual PostCSS pipeline inscripts/rollup.generic.js, which only wires uprollup-plugin-postcss+postcss-prefix-selectordirectly. A"devDependencies_to_remove"key already sitting inpackage.jsonhad flagged 4 of these as known-dead but the removal was never finished — completed that here and dropped the placeholder key.rollup-plugin-styles— zero usage anywhere, and it's the actual package causing theERESOLVEpeer conflict that's forced--legacy-peer-depson every install. Plainnpm installnow succeeds with no flag needed.rollup-plugin-terser— superseded by@rollup/plugin-terser, which is whatscripts/rollup.jsactually imports.eslint-plugin-prettier— commented out in.eslintrcsince Jan 2025 ("Remove prettier/prettier rule in eslint") after running Prettier through ESLint produced too much formatting noise. Formatting is handled separately by the standaloneprettierCLI vianpm run format/fix;eslint-config-prettier(disables ESLint's conflicting stylistic rules) stays — only the ESLint-integration package goes.react-circular-progressbar,vinyl,vinyl-fs,node-domexception— no references anywhere.node-domexceptionisn't even a transitive dependency of anything else in the tree.jest-config,jest-resolve,@jest/test-sequencer— Jest's own internal packages, already pulled in transitively by@jest/coreat the identical pinned version (^29.7.0). No custom resolver/sequencer config references them.testing-library(bare,0.0.2) — not the real Testing Library org package. Looks like a typo from the same commit that added the real@testing-library/*packages.babel(bare,^6.23.0) — ancient deprecated Babel 6 meta-package. The project fully uses scoped@babel/*v7 packages now.babel-plugin-syntax-hermes-parser— zero parents in the dependency tree, not referenced bybabel.config.jsor@babel/preset-flow.flow checkdoesn't invoke Babel plugins at all, so this has zero effect on typechecking regardless of whether it's installed — verified via an identical 8059-error count before/after removal (compared withgit stash).Also fixed: 3 undeclared phantom dependencies
Found during the audit —
chalk,@codedungeon/messenger, andlodash.debouncearerequire()'d directly inscripts/rollup.js/scripts/rollup.generic.jsbut were never declared inpackage.json. They only worked because something else in the tree happened to install them transitively; pinned to their currently-resolved versions so an unrelated dependency bump can't silently break the build scripts.Verification
npm installsucceeds with noERESOLVEerror (previously required--legacy-peer-deps)npm test)flow checkerror count unchanged: 8059 before and after (confirmed viagit stashcomparison)eslint .output unchanged: pre-existing 207069 problems, confirmed identical viagit stashcomparison (unrelated repo-wide lint debt, not introduced by this change)npcCLI (np.Templating)jgclark.Dashboard), exercising thepostcss/rollup-plugin-postcsspath specificallynode index.js --help(CLI smoke test) still works🤖 Generated with Claude Code