Repository navigation
Move to Node 24 and clear critical npm audit findings - #28
Merged
Merged
Conversation
Node 20 reached end of life in April 2026, and GitHub warned on every run that checkout, setup-node and cache v4 target it. It already cost a CI failure in #25: node --test globs need Node 21+. .nvmrc pins 24 (the current LTS, and what @wordpress/scripts 36 needs for #26). All three Node jobs read it through node-version-file, so local development and CI cannot drift apart again. Actions move to the majors that run on Node 24: checkout v7, setup-node v7, cache v6, action-gh-release v3 (its v3 only changes the runtime). setup-php@v2 already does. Refs #27 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
npm audit fix (without --force) updates transitive dev dependencies within their existing ranges. It clears both critical advisories (proxy-addr, websocket-driver, from the webpack dev-server tree) and takes the total from 96 to 85. Lockfile only; no direct dependency changes. Refs #26 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@wordpress/scripts 36.1.0 is what npm audit recommended for the high findings in its tree. Installing it over the existing lockfile failed on an optional-peer conflict deep in its vitest/vite tree, so the lockfile is regenerated from a clean resolve. lint-staged 17 drops the micromatch/braces chain from our own direct dependency. prettier is now aliased to wp-prettier. The plain "prettier": "^3.1.1" from the first commit sat at node_modules/prettier, and wp-scripts 36's format refuses to run unless that resolves to the WordPress fork. The old lockfile happened to hoist the fork; a clean resolve did not, and the pre-commit hook caught it. Removing the dependency was not enough: @wordpress/prettier-config and the ESLint plugin peer-depend on prettier, so npm installs the plain one anyway. The alias satisfies both, as the WordPress docs recommend. npm audit: 85 -> 37 (0 critical, 20 high, 14 moderate, 3 low). The remaining high findings are all inside @wordpress/scripts 36.1.0, the latest release, and none are reachable from what this plugin runs (format, lint-pkg-json, plugin-zip): - braces <=3.0.3 (GHSA-vfj7-8cjw-p6xm) has no patched release; 3.0.3 is the latest. micromatch, fast-glob, globby, chokidar, stylelint and npm-package-json-lint are flagged only for depending on it. - serialize-javascript <7.0.5 is pinned at 6.x by the webpack plugins. An override would force a major version into webpack's minifier, which this plugin never runs and CI could not exercise. engines.node mirrors @wordpress/scripts 36's requirement, so an old local Node warns instead of failing obscurely; .nvmrc (24) satisfies it. Verified by exit code: npm test, lint:pkg-json, wp-scripts format with no drift, and the release zip has the same 148 entries as before. Refs #26 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CLAUDE.md now says to use Node 24 from .nvmrc, why prettier must stay aliased to wp-prettier, and why the remaining npm audit findings are not worth chasing with overrides. README adds nvm use to the setup steps. ROADMAP gains the v1.3.0 milestone and ticks #26 and #27. Refs #26, #27 Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Moves CI and releases to Node 24 (#27) and clears npm audit's critical findings in the dev toolchain (#26). Nothing in the release zip changes.
Closes #26
Closes #27
What changed
Node 24 (#27)
.nvmrc: pins24, the current LTS.ci.yml(two jobs) andrelease.ymlread it withnode-version-file: .nvmrc, replacing three hard-codednode-version: 20lines.actions/checkoutv7,actions/setup-nodev7,actions/cachev6 andsoftprops/action-gh-releasev3.shivammathur/setup-php@v2already runs on Node 24. Each one'saction.ymlwas checked. action-gh-release v3's only change is the runtime.npm audit (#26): 96 → 37 findings, 0 critical
npm audit fix, no--force(lockfile only)@wordpress/scripts^34 → ^36.1.0, lockfile regenerated from a clean resolvelint-staged^15 → ^17.6.0prettieris nownpm:wp-prettier@^3.9.6.wp-scripts36'sformatrefuses to run unlessnode_modules/prettieris the WordPress fork. The plainprettier@^3.1.1from the first commit took that spot once the lockfile was regenerated. Removing it wasn't enough, because@wordpress/prettier-configand the ESLint plugin peer-depend onprettier. The alias satisfies both, as WordPress's docs recommend. The pre-commit hook caught this.engines.nodecopies@wordpress/scripts36's requirement (^22.22.2 || ^24.15.0 || >=26.0.0), so an old local Node warns instead of failing obscurely.Why
node --testglobs need Node 21+.npm cireported 2 critical and 35 high findings. They're dev-only (npm ls --omit=devis empty) but run on every install, locally and in CI.Left as-is, on purpose. The 20 remaining high findings are all inside
@wordpress/scripts36.1.0, the latest release:braces <=3.0.3(GHSA-vfj7-8cjw-p6xm) has no patched release; 3.0.3 is the latest.micromatch,fast-glob,globby,chokidar,stylelintandnpm-package-json-lintare flagged only for depending on it.serialize-javascript <7.0.5is pinned at 6.x bycopy-webpack-plugin/ the terser plugin. Anoverridesentry would force a major version into webpack's minifier. This plugin never runs webpack (there's nosrc/), so CI couldn't catch it if that broke.None of these are reachable from what this plugin runs:
format,lint-pkg-jsonandplugin-zip.How to test
Release zip:
composer install --no-dev && npm run zip && unzip -Z1 jc-core-functionality.zip. It has the same 148 entries as before the upgrade, including the singlejc-core-functionality/root folder,vendor/,acf-json/andLICENSE. Restore dev dependencies withcomposer install.CI: this PR is the first run on Node 24 and the new action majors. All three jobs should pass with no Node.js deprecation warning.
Release workflow: not exercised by this PR. Before relying on it for a real release, push a
vX.Y.Z-rc.Ntag. It should publish a Pre-release withjc-core-functionality.zipattached, which confirmsaction-gh-releasev3 and the.nvmrcread.Breaking changes
npm installwarns on older versions, andnvm usepicks up.nvmrc.prettierresolves towp-prettier. That's the formatter WordPress's own tooling expects, and it changes no files in this repo.Migration steps
nvm use(or install Node 24), thennpm ci.🤖 Generated with Claude Code