Skip to content

Commit a2f7fd2

Browse files
dd32claude
andauthored
Migrate to wp-env v11, require Node 20+, remove lock files (#6)
* Migrate to wp-env v11, require Node 20+, remove lock files - Bump @wordpress/env from ^10 to ^11 - Add engines.node >= 20 to package.json - Remove package-lock.json and add lock files to .gitignore - Update CI to use npm install instead of npm ci Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Accommodate wp-env v11 removing test environment - Use cli container instead of tests-cli (removed in v11) - Remove env.tests section from .wp-env.json - Auto-detect test library path (/wordpress-phpunit or /tmp/wordpress-tests-lib) - Use --legacy-peer-deps for wp-scripts peer dep on wp-env ^10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add @testing-library/dom as explicit dependency Required when using --legacy-peer-deps since peer deps of @testing-library/react are not auto-installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4af0a51 commit a2f7fd2

6 files changed

Lines changed: 26 additions & 29004 deletions

File tree

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
uses: actions/setup-node@v4
2727
with:
2828
node-version: '20'
29-
cache: 'npm'
29+
# No cache — lock file is not committed.
3030

3131
- name: Install dependencies
32-
run: npm ci
32+
run: npm install --legacy-peer-deps
3333

3434
- name: Run JS unit tests
3535
run: npm run test:unit
@@ -55,10 +55,10 @@ jobs:
5555
uses: actions/setup-node@v4
5656
with:
5757
node-version: '20'
58-
cache: 'npm'
58+
# No cache — lock file is not committed.
5959

6060
- name: Install dependencies
61-
run: npm ci
61+
run: npm install --legacy-peer-deps
6262

6363
- name: Override PHP version
6464
run: |
@@ -71,10 +71,10 @@ jobs:
7171
WP_ENV_LIFECYCLE_TIMEOUT: 300
7272

7373
- name: Install Composer dependencies
74-
run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts -- composer install --no-interaction
74+
run: npx wp-env run cli --env-cwd=wp-content/plugins/multi-author-posts -- composer install --no-interaction
7575

7676
- name: Run PHP tests via wp-env
77-
run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts -- vendor/bin/phpunit
77+
run: npx wp-env run cli --env-cwd=wp-content/plugins/multi-author-posts -- vendor/bin/phpunit
7878

7979
- name: Stop wp-env
8080
if: always()

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ node_modules/
22
vendor/
33
build/
44
*.log
5+
package-lock.json
6+
composer.lock
57
.wp-env.override.json

.wp-env.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,5 @@
77
"WP_DEBUG_LOG": true,
88
"SCRIPT_DEBUG": true,
99
"WP_ALLOW_MULTISITE": true
10-
},
11-
"env": {
12-
"tests": {
13-
"config": {
14-
"WP_DEBUG": false
15-
}
16-
}
1710
}
1811
}

0 commit comments

Comments
 (0)