From 2c029a971da83a33158e4887a457b77fe61cef26 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Mon, 23 Feb 2026 18:14:16 +0100 Subject: [PATCH] Update @wordpress/env to v11, split .wp-env.json --- .github/workflows/e2e.yml | 4 ++-- .wp-env.json | 15 ++------------- .wp-env.test.json | 14 ++++++++++++++ package-lock.json | 8 ++++---- package.json | 5 +++-- 5 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 .wp-env.test.json diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 16540b4a..6a6aec33 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -65,7 +65,7 @@ jobs: - name: Start wp-env and install PCOV env: PHP_COVERAGE_ENABLED: true - run: npm run wp-env start + run: npm run wp-env-test start - name: Install Playwright browsers run: npx playwright install --with-deps @@ -113,4 +113,4 @@ jobs: - name: Stop wp-env if: always() - run: npm run wp-env stop + run: npm run wp-env-test stop diff --git a/.wp-env.json b/.wp-env.json index e651b56e..4ff7647a 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,16 +1,5 @@ { "$schema": "https://schemas.wp.org/trunk/wp-env.json", - "plugins": ["."], - "lifecycleScripts": { - "afterStart": "bash ./scripts/install-pcov.sh" - }, - "env": { - "tests": { - "mappings": { - "wp-content/plugins/secure-custom-fields": ".", - "wp-content/plugins/scf-test-plugins": "./tests/e2e/plugins", - "wp-content/mu-plugins/php-coverage-collector.php": "./tests/e2e/mu-plugins/php-coverage-collector.php" - } - } - } + "testsEnvironment": false, + "plugins": ["."] } diff --git a/.wp-env.test.json b/.wp-env.test.json new file mode 100644 index 00000000..2a5c7af4 --- /dev/null +++ b/.wp-env.test.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://schemas.wp.org/trunk/wp-env.json", + "testsEnvironment": false, + "port": 8889, + "plugins": ["."], + "lifecycleScripts": { + "afterStart": "bash ./scripts/install-pcov.sh" + }, + "mappings": { + "wp-content/plugins/secure-custom-fields": ".", + "wp-content/plugins/scf-test-plugins": "./tests/e2e/plugins", + "wp-content/mu-plugins/php-coverage-collector.php": "./tests/e2e/mu-plugins/php-coverage-collector.php" + } +} diff --git a/package-lock.json b/package-lock.json index 7e87a66a..0fc1a118 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@testing-library/react": "^14.1.2", "@wordpress/dependency-extraction-webpack-plugin": "^6.20.0", "@wordpress/e2e-test-utils-playwright": "^1.20.0", - "@wordpress/env": "^10.39.0", + "@wordpress/env": "^11.0.0", "@wordpress/icons": "^10.26.0", "@wordpress/prettier-config": "^4.22.0", "@wordpress/priority-queue": "^3.22.0", @@ -8054,9 +8054,9 @@ } }, "node_modules/@wordpress/env": { - "version": "10.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.39.0.tgz", - "integrity": "sha512-Hgl2RQAAzXFMqkpegGWT1/KkX88OVikRroPidWkij1WtU8p+AZniTcncWmlWqbdLdfGbPqQS5ZkqDZCzrQjgnA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-11.0.0.tgz", + "integrity": "sha512-JUTur4ptTHDzM2PxSQI9hqkWsbqrFtBrj0v+ytwpE00wqmNMkqUQ3NIii+vMDYAPdKr6c4/nQAX2YTEBuohlSA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { diff --git a/package.json b/package.json index ef09f198..47ac7592 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "test:unit": "wp-scripts test-unit-js", "test:unit:watch": "wp-scripts test-unit-js --watch", "watch": "webpack --watch", - "wp-env": "wp-env" + "wp-env": "wp-env", + "wp-env-test": "wp-env --config .wp-env.test.json" }, "dependencies": { "@wordpress/icons": "^10.26.0", @@ -31,7 +32,7 @@ "@testing-library/react": "^14.1.2", "@wordpress/dependency-extraction-webpack-plugin": "^6.20.0", "@wordpress/e2e-test-utils-playwright": "^1.20.0", - "@wordpress/env": "^10.39.0", + "@wordpress/env": "^11.0.0", "@wordpress/icons": "^10.26.0", "@wordpress/prettier-config": "^4.22.0", "@wordpress/priority-queue": "^3.22.0",