Bump NPM version and configure it to be more secure against supply chain attacks#1694
Bump NPM version and configure it to be more secure against supply chain attacks#1694sequba wants to merge 6 commits into
Conversation
✅ Deploy Preview for hyperformula-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Performance comparison of head (06b351a) vs base (72205bd) |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 06b351a. Configure here.
| # Pin exact versions (no ^ or ~) so installs are deterministic | ||
| save-exact=true | ||
| # Enforce the Node/npm range declared in package.json "engines" | ||
| engine-strict=true |
There was a problem hiding this comment.
Engine strict without engines
Medium Severity
This commit enables engine-strict=true to enforce Node/npm ranges from package.json, but package.json has no engines field. The node/npm constraints exist only under the root entry in package-lock.json, which npm does not use for engine checks, so installs are not blocked on unsupported runtimes despite the stated hardening.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 06b351a. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1694 +/- ##
========================================
Coverage 97.16% 97.16%
========================================
Files 176 176
Lines 15322 15322
Branches 3387 3387
========================================
Hits 14887 14887
Misses 435 435 🚀 New features to boost your workflow:
|


Context
Security hardening + maintenance for the npm setup:
.npmrcto reduce supply-chain risk and make installs reproducible..nvmrc, and docs.full-icudependency (Node ships full ICU built-in).Changes
1. npm supply-chain hardening
New
.npmrcignore-scripts=truepre/post-installlifecycle scripts from dependencies — the most common malware vector.audit-level=lownpm audit.package-lock=truemin-release-age=30save-exact=true^/~) for deterministic installs.2. Default Node version → 26
.nvmrc:v18→v26test,lint,audit,build-docs,publish,performance): Node22→26build.ymlmatrix:[20, 22, 24]→[22, 24, 26](consistent withengines.node >=22)docs/guide/building.md: build-chain recommendation updated to Node 263. Remove
full-icufull-icudevDependency.NODE_ICU_DATA=node_modules/full-icufromtest:jestandtest:ciscripts.full-icuwas dead weight (and itspostinstallwas incompatible withignore-scripts=true).Notes / caveats for reviewers
min-release-ageis best-effort: only active on npm ≥ 11.10.0. Withengines.npm >=10, environments on npm 10 silently skip the cooldown. Bumpengines.npmto>=11.10.0if enforcement everywhere is desired.min-release-age=30is aggressive: installs may reject very recent dependency releases until they age in; expect friction right after dependency bumps.ignore-scripts=trueis repo-wide: affects all contributors/CI.full-icuscript concern is resolved by removing the package.esbuild(transitive, VuePress docs) ships its binary viaoptionalDependencies, so docs builds appear to work without itspostinstall— verify with a cleanrm -rf node_modules && npm ciacross all OSes before relying on it.setup-nodecan resolve Node 26 and thatbuilding.md's "LTS" wording fits the release timeline.How did you test your changes?
rm -rf node_modules && npm cilocallynpm run test:jestpasses withoutNODE_ICU_DATA(ICU-dependent tests still green) locallynpm run buildpasses on Node 26 locallybuild.ymlmatrix (Node 22/24/26, all OSes, bothnpm iandnpm ci)Note
Medium Risk
ignore-scriptsandmin-release-agecan break installs or block fresh dependency versions; Node 26 and droppingfull-icuneed CI/matrix validation across OSes andnpm ivsnpm ci.Overview
Adds a committed
.npmrcthat tightens installs:ignore-scripts=true, stricteraudit-level, lockfile enforcement,min-release-age=30,save-exact, andengine-strict.Node 26 becomes the default for
.nvmrc, most GitHub Actions workflows, anddocs/guide/building.md; thebuild.ymlmatrix shifts from[20, 22, 24]to[22, 24, 26].Removes the
full-icudevDependency and dropsNODE_ICU_DATAfromtest:jest/test:ci, relying on Node’s built-in ICU.package-lock.jsonreflects the dependency removal plus minor transitive updates and documentsengines(node >=22,npm >=10) at the lockfile root.Reviewed by Cursor Bugbot for commit 06b351a. Bugbot is set up for automated code reviews on this repo. Configure here.