Skip to content

build(deps): upgrade @wordpress/scripts to 36 and keep Jest - #29

Merged
AnuragVasanwala merged 3 commits into
mainfrom
chore/wp-scripts-36
Oct 1, 2026
Merged

AnuragVasanwala merged 3 commits into
mainfrom
chore/wp-scripts-36

Conversation

@AnuragVasanwala

Copy link
Copy Markdown
Member

What this PR does

Upgrades @wordpress/scripts from 32.3.0 to 36.0.0, which Dependabot proposed in #19, and fixes the JS test setup that 36.0.0 breaks. Stacked on #28; GitHub retargets it to main once #28 merges.

Why #19 failed

@wordpress/scripts 36.0.0 makes test-unit-js run Vitest and removes the bundled Jest preset, Babel transform and GitHub Actions reporter that tests/js/jest.config.js imported. The Jest job failed with "requires Vitest 5".

Changes

  • @wordpress/scripts 36.0.0 (the same package.json and lock result as build(deps): bump basic-ftp and @wordpress/scripts #19).
  • Keep Jest through the maintained test-unit-jest adapter: test:js now calls wp-scripts test-unit-jest, and jest 30.5.0 is a direct dev dependency.
  • tests/js/jest.config.js no longer imports the removed @wordpress/scripts config files. The suite is pure Node, so it uses testEnvironment: 'node' and Jest's built-in github-actions reporter.
  • Removes @wordpress/jest-preset-default, which is deprecated and not needed by this suite.
  • Removes the get-uri > basic-ftp override from fix(deps): patch 69 Dependabot security alerts #28: 36.0.0 no longer depends on get-uri.

Vitest is not used yet: the shared ci-test-js workflow passes --ci and --cacheDirectory, which Vitest rejects.

Security

With this PR on top of #28, none of the open npm Dependabot alerts remain. It removes the markdown-it, linkify-it, extract-zip and @opentelemetry/core chains that #28 could not fix.

How I verified

Node 22.19:

  • npm ci leaves the lockfile unchanged.
  • lint:js, lint:css and lint:package-json pass.
  • npm run test:js passes 19 of 19, and so does the CI form npm run test:js -- --ci --cacheDirectory=<dir>.
  • build:prod passes. CSS and the *.asset.php dependency lists match main; the block bundles differ only in webpack runtime code, and the asset files are now multi-line.

@wordpress/scripts 36 declares Node ^22.22.2 || ^24.15.0. CI's node-version: 22 resolves to a newer 22.x and satisfies it. Older local Node 22 versions only print an EBADENGINE warning.

Once this merges, Dependabot closes #19 as up to date.

36.0.0 moves test-unit-js to Vitest and drops the bundled Jest preset. Run the suite through test-unit-jest with jest 30.5.0, drop the deprecated @wordpress/jest-preset-default, and remove the get-uri override that no longer matches.
Base automatically changed from fix/security-dependencies to main October 1, 2026 20:08
aryanjasala
aryanjasala previously approved these changes Oct 1, 2026
Without @wordpress/jest-preset-default the config only found tests/js/**/*.test.js in a node environment, so a test next to the code would be skipped silently. Use the preset's testMatch patterns, jest-environment-jsdom and a CSS/SCSS module mock.
scripts 36 ships markdownlint-cli 0.49.1, which needs minimatch 10, so the minimatch 3.1.4 override from #28 broke lint-md-docs. Replace it with js-yaml 5.4.1, which fixes GHSA-r3ph-w7gj-g6xm in the js-yaml 5.2.3 it pulls in.
@AnuragVasanwala
AnuragVasanwala merged commit 75dafc7 into main Oct 1, 2026
1 check passed
@AnuragVasanwala
AnuragVasanwala deleted the chore/wp-scripts-36 branch October 1, 2026 20:28
@aryanjasala aryanjasala mentioned this pull request Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants