chore(deps): upgrade @wordpress/scripts to 33 and refresh the lockfile - #235
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Every open Dependabot alert is npm, in package-lock.json, and transitive through @wordpress/scripts. None are Composer, so the ranges pinned in #232 are not involved. Two changes, no overrides: 1. Lift the version cap. .github/dependabot.yml held @wordpress/scripts below 32.3.0 and @wordpress/e2e-test-utils-playwright below 1.47.0, because those releases pointed their package "exports" at TypeScript source that the Playwright runner cannot load. Upstream reverted that: 1.46.0 exports["."].default = ./build/index.cjs 1.47.0 exports["."].default = ./src/index.ts <- the breakage 1.48.0 exports["."].default = ./src/index.ts 1.50.0 exports["."].default = ./build/index.js <- fixed 1.51.0 exports["."].default = ./build/index.js So the cap is removed and both packages track latest again. 2. npm update, which moves the tree to patched releases already allowed by the ranges the parents declare. The lockfile had simply gone stale. Distinct advisories drop from 34 to 17. Measured across four installs, each npm ci followed by npm audit: main, untouched 34 upgrade alone 33 upgrade + npm update (this commit) 17 upgrade + 18 forced overrides 6 An earlier revision of this branch took the last route. It was dropped: half the reduction needs no overrides at all, and the remaining eleven advisories can only be bought by forcing majors upstream never tested together - webpack-dev-server 4->5, uuid 8->11, serialize-javascript 6->7, markdown-it 12->14, linkify-it 3->5, adm-zip 0.5->0.6 - in chains this project never executes. There is no build step and no dev server, so webpack, postcss and svgo are installed but never run. Those alerts will clear as @wordpress/scripts moves, without forced pins to maintain. Note that npm audit's total rises from 43 to 64 while distinct advisories halve: it counts packages affected, and the unfixable brace-expansion advisory cascades widely. Only 5.0.8+ is patched there, and v5 exports { expand } instead of the callable default v1/v2 exported, so forcing it throws "expand is not a function" in minimatch. Verified by running it. Verified: npm ci exits 0, test:unit-js 9 tests, PHPUnit 1808 tests, Playwright 72 passed with 1 pre-existing failure - document-types.spec.js fails identically on main with no changes applied, so it is not a regression from this upgrade.
erseco
force-pushed
the
chore/npm-security-overrides
branch
from
July 28, 2026 07:49
d9e2b4f to
cfe7ba1
Compare
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.
Reduces the open Dependabot alerts by lifting an obsolete version cap and refreshing a stale lockfile. No
overrides.Every open alert is npm, in
package-lock.json, and transitive through@wordpress/scripts. None are Composer — the ranges pinned in #232 are not involved.The version cap was obsolete
.github/dependabot.ymlheld@wordpress/scriptsbelow 32.3.0 and@wordpress/e2e-test-utils-playwrightbelow 1.47.0, because those releases pointed their packageexportsat TypeScript source the Playwright runner cannot load. Upstream reverted it:So the cap is removed and both packages track latest again, confirmed by running the E2E suite on the uncapped toolchain — the job the cap existed to protect.
Result
main, untouchednpm update(this PR)Half the advisories go away with no unusual machinery: the lockfile had simply gone stale, and
npm updatemoves the tree to patched releases the parents' own ranges already allow.An earlier revision of this branch took the last route, forcing 18 versions through
overrides. It was dropped. The extra eleven advisories can only be bought by crossing majors upstream never tested together —webpack-dev-server4→5,uuid8→11,serialize-javascript6→7,markdown-it12→14,linkify-it3→5,adm-zip0.5→0.6 — inside chains this project never executes. There is no build step and no dev server inpackage.json, so webpack, postcss and svgo are installed but never run. Those alerts will clear as@wordpress/scriptsmoves, with no forced pins left behind to maintain.npm audit fixwas not an option either: every remaining fix needs--force, which would have lifted the cap blindly rather than after checking upstream had fixed the entry point.Two numbers that look wrong and are not
npm audit's total rises from 43 to 64 while distinct advisories halve. It counts packages affected, not advisories, and the one unfixable advisory below cascades widely through the changed tree.brace-expansioncannot be fixed. Only 5.0.8+ is patched, but v5's CommonJS entry exports{ expand }instead of the callable default v1/v2 exported.minimatch@3and@9callexpand(pattern), so forcing it throwsexpand is not a functionand takes glob, jest and eslint with it. Verified by running it, not assumed. It needs upstreamminimatchto migrate.Verification
Rebased onto
mainafter #236 merged, and re-verified there.The E2E failure is
document-types.spec.js:17. It is not a regression: a full run onmainwith no changes applied fails the same test with the same 72/1/21 counts. Root cause found while investigating —DocumentTypesPage.create()registerswaitForResponseafter clicking submit, so a fast response arrives before the listener exists. Left for a separate fix rather than folded in here.What still shows up
The 17 remaining advisories, all transitive and all needing a major crossing this PR declines to force:
webpack-dev-server@wordpress/scriptsstartscript that does not existminimatchrimraf→glob,lighthouseserialize-javascriptcopy-webpack-pluginlinkify-itmarkdown-it←markdownlintbrace-expansionminimatchadm-zip@wordpress/envmarkdown-it,uuid,@opentelemetry/coremarkdownlint,sockjs,@sentry/nodeadm-zipis the only one in a chain CI actually executes, and the advisory is a crafted ZIP triggering a large allocation — the ZIP being WordPress itself, fetched from wordpress.org.path-to-regexpandbody-parser, present before, were resolved by the upgrade.Not included
@playwright/testis used but not declared —require()d intests/e2e/playwright.config.js, resolving by hoisting. Declaring it would be more honest, but Playwright breaks badly when the runner and the config resolve two different copies, so pinning it independently of what@wordpress/scriptsexpects carries its own risk. Flagged for a deliberate decision.Worth considering separately
@wordpress/scriptsis used for exactly two subcommands,test-playwrightandtest-unit-js, but it brings webpack, eslint, babel and jest in full — includingwebpack-dev-server, the dev server for astartscript this project does not have. Most of the remaining advisories live in that unused surface. Replacing those two subcommands with directplaywright testandjestinvocations would remove the bulk of them at the root, with no pins to maintain.