Repository navigation
fix(package): require the oldest supported LTS (node >= 22) - #280
Conversation
The declared node floor permits end-of-life releases - node 14 and 16 reached EOL in 2023, 18 on 2025-04-30, and 20 on 2026-04-30. The oldest line still receiving security fixes is 22, which is also the version CI runs. Raise engines.node to >=22 so the declaration matches the runtimes this package is tested and supported on. Verification: the only package.json change is the engines.node value, and CI runs on node 22.
There was a problem hiding this comment.
Reviewed the full base...main diff (package.json only: engines.node raised from ">=10" to ">=22") plus hardening checks at the head: lockfile present, secrets scan, npm audit against the head lockfile, and repo-level config. This repo lags the org hardening baseline in several places that the engines bump makes worse, reported below. CI (build (lts/fermium)) is green on the head - but that check name is itself finding 1. Findings:
-
package.json:10-11 - engines ">=22" contradicts both CI workflows: .github/workflows/build.yml:16 and npmpublish.yml:17 still run "node-version: [lts/fermium]" (node 14), and package-lock.json:53-55 still records engines ">=10" (not regenerated). The declared floor of 22 is tested nowhere: CI runs on 14, the lockfile says 10, the manifest says 22. In fact node 14 cannot even install this tree under the new engines (npm warns; engine-strict consumers are hard-blocked), and the release workflow would fail its own package's floor. Update the matrices to 22 (or 22 plus newest LTS) and regenerate the lockfile root.
-
package.json:67 - "node-sass": "7.0.3" does not support node 22: node-sass 7.0.3's own support table tops out at Node 17 (ABI 102; verified in the published package's extensions.js), and its install script tries to fetch a binding for the runtime ABI, falling back to a source build that fails on modern toolchains. node-sass 9.0.0 is the first release supporting newer ABIs (its table covers up to Node 20; engines >=16). Since react-scripts 5 + sass-loader 12 prefer the pure-JS "sass" package when resolvable (verified in sass-loader's getDefaultSassImplementation: sass first, then node-sass), and "sass": "^1.52.2" is already a devDependency, the cleanest fix consistent with the engines bump is to drop node-sass entirely (react-scripts will use sass), or pin node-sass to 9.x if the native path must stay. As-is, npm ci on node 22 will attempt a compile and most likely fail.
-
Repo hardening baseline (present in the org's other repos, missing here entirely): no .npmrc (no ignore-scripts=true / save-exact=true), no .pre-commit-config.yaml (the standing requirement is a gitleaks hook pinned to an exact release tag), no gitleaks or npm audit step in CI, no dependency pinning (all ranges, ^x.y.z throughout), and devDependency "node-sass" plus the ^-ranges on react/react-dom peer pairs (react ^17 dev vs peer ^16) are drift-prone. The engines bump touches none of these, so they are pre-existing - but this PR is the natural moment to note the repo has no secret-scanning or audit gate at all. Advisory, listed for the maintainer's prioritisation rather than as a demand attached to a one-line engines change.
-
Commit subject "fix(package): require the oldest supported LTS (node >= 22)" is conventional and release-driving; the repo releases via the semantic-release action in npmpublish.yml. No finding on the commit.
4 findings above for review.
Two follow-ups of the same shape as the other engine bumps:
- package-lock.json still recorded "engines": {"node": ">=10"} at the root
while the manifest said >=22. npm ci does not rewrite it, so regenerate it.
- CI ran [lts/fermium], which is node 14, so nothing tested the declared floor.
build.yml is now [22, lts/*]. npmpublish.yml is [22] rather than a two-entry
matrix on purpose: that job releases, so a second entry would run
semantic-release twice against the same commit.
node-sass 7.0.3 supports node up to 17 (ABI 102), so with the floor now >=22 its install script would try a source build on node 22 and most likely fail - which the new [22, lts/*] CI matrix would hit on its first run. Nothing here needs it. The components import .scss and microbundle-crl compiles them; `sass` is already a devDependency for the react-scripts path, and sass-loader prefers `sass` whenever it resolves. Verified with node-sass removed: - npm ci with scripts enabled: exit 0, 1822 packages (was 1958) - npm run build: exit 0, identical bundle sizes
|
Findings 1 and 2 fixed. Finding 3 acknowledged and deliberately not folded in.
|
There was a problem hiding this comment.
Re-review at the head 9f4c4e3; the delta since the prior review at 05a262e is exactly the two fixes the prior review asked for: the CI matrices now run [22, lts/] (build.yml:18, npmpublish.yml:19), the lockfile engines root is synced (package-lock.json ">=22"), and node-sass is dropped from devDependencies (with the lockfile regenerated - no node_modules/node-sass entry remains; only the optional peerDependenciesMeta reference inside sass-loader's entry at package-lock.json:18391-18402, which is inert). CI (build (22), build (lts/)) is green on the head, so node 22 actually installs and builds the tree - the node-sass concern is resolved by observation. The remaining items from the prior review are the repo-level hardening baseline, which this PR does not touch and which remains open for the maintainer's prioritisation:
-
.npmrc (missing) - no ignore-scripts=true / save-exact=true repo-wide, so local installs run dependency install scripts and manual edits reintroduce ranges.
-
.pre-commit-config.yaml (missing) - the standing requirement is a gitleaks hook pinned to an exact release tag; the repo has no secret-scanning hook at all.
-
CI audit gate (missing) - no npm audit step in build.yml or npmpublish.yml, and no dependency pinning (all ^ ranges throughout, e.g. "sass": "^1.52.2").
Advisory: these predate this PR, but it is the natural moment to adopt them - the org's sibling repos (adapter, cli, lint, utils) all carry the .npmrc, the gitleaks pre-commit config and a strict audit step.
3 findings above for review.
|
Thanks - agreed on all three, and agreed that they predate this PR. I have not folded them in here. Adopting They are worth doing - this repo is the outlier in the org on all three - and I will put them up as a separate change rather than leave them as a note on this one. |
What
The declared node floor permits end-of-life releases. From the nodejs/Release schedule:
engines.nodeis now>=22, matching the oldest line still receiving security fixes and the version CI runs on.Verification
package.jsonchange is theengines.nodevalue