chore: .npmrc supply-chain hardening + esbuild 0.19 upgrade#238
Conversation
The weekly Enigma supply-chain audit (SC-12282) flagged this repo: the committed .npmrc was missing the required hardening directives. Add ignore-scripts, strict-ssl, save-exact, audit-level, engine-strict and legacy-peer-deps. access=restricted is omitted intentionally — this is a public repository, so the restricted-access directive does not apply. ignore-scripts=true blocks dependency lifecycle scripts on install, including esbuild's postinstall that downloads its native bundler binary. Rebuild esbuild explicitly in the dependencies_unix job (the only CI job that runs `npm ci`) so the cached node_modules carries the binary to build_unix. chromedriver is unaffected — CI fetches it via browser-driver-manager, not the npm install script. patch-package still applies because build_unix runs `npm run prepare` explicitly, and ignore-scripts only suppresses pre/post hooks around an explicit `npm run`, not the invoked script itself. Document the local-dev post-install steps in the developer guide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The .npmrc supply-chain hardening sets ignore-scripts=true, which skips esbuild's postinstall that fetches its native bundler binary. Every path that installs deps and then builds (grunt -> esbuild) therefore broke: - GitHub Actions `build` job (test.yml) failed with "esbuild: Failed to install correctly" at the esbuild:core grunt task. - The standard-version `postbump` hook re-runs `npm ci` (wiping the binary) before `sri-update` -> `grunt build`, breaking the release / next_release pipelines (CircleCI release jobs and GitHub release.yml). - The nightly `npm install w3c/...` steps re-resolve the whole dependency tree under ignore-scripts, skipping native postinstalls. Fixes, keeping all six audit-required directives intact (access=restricted is omitted because this is a public repo): - test.yml: `npm rebuild esbuild --ignore-scripts=false` between ci and build - package.json postbump: rebuild esbuild after its inner `npm ci` - nightly jobs: `--ignore-scripts=false` on the trusted w3c installs - .npmrc: drop internal tool/ticket reference from the comment Verified: under ignore-scripts=true esbuild installs broken, and `npm rebuild esbuild --ignore-scripts=false` runs install.js and restores the working native binary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Nightly jobs used `npm install w3c/...#main --ignore-scripts=false`, which re-enabled lifecycle scripts for the whole re-resolved dependency tree and the untrusted w3c/*#main installs — defeating the ignore-scripts=true hardening. Those jobs only consume the prebuilt artifact (test:act/test:apg are mocha), so esbuild isn't needed there; drop the flag. Also remove the verbose AXE-3444 comment blocks from the CI configs per review feedback. The targeted `npm rebuild esbuild --ignore-scripts=false` steps (single trusted package) stay, matching the tech spec's sanctioned approach. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The AXE-3444 .npmrc hardening sets ignore-scripts=true, which suppressed
esbuild 0.10.2's postinstall that downloads its native binary, breaking
`npm run build` ("esbuild: Failed to install correctly"). esbuild 0.16+
ships its binary as @esbuild/* optionalDependencies with no install
script, so ignore-scripts=true no longer breaks the build and no
`npm rebuild esbuild` workaround is needed.
[a11y-critical]: build tooling for axe.js bundle; affects all packages.
Build verified on Node 22; axe.run smoke under jsdom passes (memoize/#1433
ordering OK, image-alt + link-name detected). Full Karma suite and
real-browser color-contrast validation still pending.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rajathmr2000
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 3 inline finding(s). Full report in the PR comment below. Verdict: Failed - see PR comment.
Claude Code PR ReviewPR: #238 • Head: bc587ba • Reviewers: stack:code-review SummaryHardens the committed Review Table
Findings
Positive notes from the reviewer: the esbuild 0.10 → 0.19 jump itself is safe (the sole invocation in Reviewer questions for the PR thread: (1) Has a full Verdict: FAIL — the release postbump chain and two other install→build paths silently lose the bundled colorjs.io patch under |
No description provided.