Skip to content

Update @wordpress/env to v12 and @wordpress/scripts to v32 - #580

Merged
cbravobernal merged 3 commits into
trunkfrom
update/wp-env-12
Oct 27, 2026
Merged

cbravobernal merged 3 commits into
trunkfrom
update/wp-env-12

Conversation

@cbravobernal

@cbravobernal cbravobernal commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Updates @wordpress/env from 10 to 12. Version 12 deprecates the separate tests environment in favor of running a second config with --config, so the E2E site gets its own config file:

  • .wp-env.json: the dev site (port 8888).
  • .wp-env.test.json: the E2E site (port 8889), with the plugin and tests/e2e/plugins mapped as before.
  • New npm run wp-env-test script (wp-env --config .wp-env.test.json). Use it to start, stop or check the test site.
  • The E2E workflow starts and stops the test config.
  • playwright.config.ts reads the port from .wp-env.test.json. WP_BASE_URL and WP_ENV_TESTS_PORT still override it.
  • Both configs set "testsEnvironment": false. wp-env 12 still creates the legacy tests site unless this is explicitly false, and that site would then clash with port 8889.
  • .wp-env.test.override.json is git-ignored, like .wp-env.override.json.
  • AGENTS.md lists the new commands.

@wordpress/scripts also moves from 30 to 32. Version 30 declares @wordpress/env ^10 as a peer, which makes npm ci fail on CI; 32 is the first version that accepts >=10. That upgrade brings ESLint 9, so:

  • .eslintignore is replaced by an eslint.config.cjs that extends the default @wordpress/scripts config with the same ignore list.
  • @types/react is added as a dev dependency, which the import rule now resolves for react imports.
  • The BlockPreview test checks the inline style directly, because jsdom no longer resolves it through toHaveStyle().

Replaces #366, which made the same changes for wp-env 11. Thanks @ockham for the original work!

Testing

  • npm ci succeeds with npm 10, the version CI uses.
  • npm run build succeeds, and npm run test:unit passes (959 tests).
  • npm run wp-env-test start starts the test site on 8889 with the SCF test plugins available.
  • npm run wp-env start runs the dev site on 8888 at the same time.
  • npm run test:e2e with the field-type-text, command-palette, block-testimonial and field-type-repeater specs: 16 passed.

Use of AI Tools

Claude Code helped compare the change with #366, write the config, dependency and test changes, and run the checks above. I reviewed the changes and take responsibility for them.

🤖 Generated with Claude Code

wp-env 12 deprecates the separate "tests" environment in favor of
running a second config with --config. Move the E2E site to
.wp-env.test.json (port 8889, with the test plugins mapped), keep
.wp-env.json for the dev site, and add an `npm run wp-env-test` script.

The E2E workflow starts the test config, Playwright reads its port, and
AGENTS.md lists the new commands.

Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props cbravobernal.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@wordpress/scripts 30 declares @wordpress/env ^10 as a peer, which makes
`npm ci` fail with ERESOLVE on CI. Version 32 accepts >=10.

Version 32 ships ESLint 9, so move the .eslintignore entries into an
eslint.config.cjs that extends the default config, and add @types/react,
which the import rule now resolves for `react` imports. Check the inline
style directly in the BlockPreview test, since jsdom no longer resolves
it through toHaveStyle().

Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cbravobernal cbravobernal changed the title Update @wordpress/env to v12 and split the test environment config Update @wordpress/env to v12 and @wordpress/scripts to v32 Oct 27, 2026
The legacy wp-env tests environment set WP_DEBUG and SCRIPT_DEBUG to
false. Set them explicitly in .wp-env.test.json so the E2E site keeps
running with the same configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cbravobernal
cbravobernal merged commit a907874 into trunk Oct 27, 2026
20 checks passed
@cbravobernal
cbravobernal deleted the update/wp-env-12 branch October 27, 2026 14:56
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.

1 participant