Repository navigation
Update @wordpress/env to v12 and @wordpress/scripts to v32 - #580
Merged
Merged
Conversation
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>
|
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 Core Committers: Use this line as a base for the props when committing in SVN: 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>
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>
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.
Updates
@wordpress/envfrom 10 to 12. Version 12 deprecates the separatetestsenvironment 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 andtests/e2e/pluginsmapped as before.npm run wp-env-testscript (wp-env --config .wp-env.test.json). Use it to start, stop or check the test site.playwright.config.tsreads the port from.wp-env.test.json.WP_BASE_URLandWP_ENV_TESTS_PORTstill override it."testsEnvironment": false. wp-env 12 still creates the legacy tests site unless this is explicitlyfalse, and that site would then clash with port 8889..wp-env.test.override.jsonis git-ignored, like.wp-env.override.json.AGENTS.mdlists the new commands.@wordpress/scriptsalso moves from 30 to 32. Version 30 declares@wordpress/env^10 as a peer, which makesnpm cifail on CI; 32 is the first version that accepts>=10. That upgrade brings ESLint 9, so:.eslintignoreis replaced by aneslint.config.cjsthat extends the default@wordpress/scriptsconfig with the same ignore list.@types/reactis added as a dev dependency, which the import rule now resolves forreactimports.toHaveStyle().Replaces #366, which made the same changes for wp-env 11. Thanks @ockham for the original work!
Testing
npm cisucceeds with npm 10, the version CI uses.npm run buildsucceeds, andnpm run test:unitpasses (959 tests).npm run wp-env-test startstarts the test site on 8889 with the SCF test plugins available.npm run wp-env startruns the dev site on 8888 at the same time.npm run test:e2ewith thefield-type-text,command-palette,block-testimonialandfield-type-repeaterspecs: 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