Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a3a1d67
Chore(deps): Bump tmp from 0.2.5 to 0.2.7 (#694)
dependabot[bot] May 28, 2026
c042ea3
Chore(deps): Bump shell-quote from 1.8.3 to 1.8.4 (#711)
dependabot[bot] Jun 10, 2026
38e127b
Chore(deps-dev): Bump launch-editor from 2.13.1 to 2.14.1 (#723)
dependabot[bot] Jun 20, 2026
04d2e1f
Chore(deps-dev): Bump form-data from 4.0.5 to 4.0.6 (#722)
dependabot[bot] Jun 20, 2026
0b78a88
Chore(deps-dev): Bump @babel/core from 7.29.0 to 7.29.6 (#724)
dependabot[bot] Jun 21, 2026
06cfa09
Chore(deps): Bump ws and @wp-playground/cli (#735)
dependabot[bot] Jul 15, 2026
e6389b3
Chore(deps-dev): Bump websocket-driver from 0.7.4 to 0.7.5 (#738)
dependabot[bot] Jul 16, 2026
51e805d
Chore(deps): Bump svgo (#740)
dependabot[bot] Jul 24, 2026
35d8cc1
Chore(deps): Bump shell-quote from 1.8.4 to 1.10.0 (#742)
dependabot[bot] Jul 25, 2026
9e9a5a3
Chore(deps-dev): Bump immutable from 5.1.5 to 5.1.9 (#745)
dependabot[bot] Jul 25, 2026
8d752b1
Chore(deps): Bump fast-xml-parser from 5.10.0 to 5.10.1 (#741)
dependabot[bot] Jul 25, 2026
5091d70
Chore(deps): Bump fast-uri from 3.1.3 to 3.1.4 (#743)
dependabot[bot] Jul 25, 2026
46c16a4
Chore(deps): Bump postcss from 8.5.10 to 8.5.22 (#744)
dependabot[bot] Jul 25, 2026
de346d6
Chore(deps): Bump fast-uri from 3.1.4 to 3.1.5 (#754)
dependabot[bot] Aug 6, 2026
394fa03
Chore(deps): Bump postcss from 8.5.22 to 8.5.25 (#755)
dependabot[bot] Aug 7, 2026
61d0956
Run Copilot code review on GitHub-hosted runners
rtBot Aug 13, 2026
22f0b7d
Merge pull request #757 from rtCamp/add/copilot-code-review-runner
iamimmanuelraj Aug 13, 2026
e1d1f6d
Chore(deps): Bump postcss-selector-parser (#760)
dependabot[bot] Sep 2, 2026
29d92b6
Chore(deps): Bump fast-uri from 3.1.5 to 3.1.7 (#762)
dependabot[bot] Sep 3, 2026
5845704
Chore(deps-dev): Bump @humanfs/node from 0.16.7 to 0.16.8 (#763)
dependabot[bot] Sep 3, 2026
793bcb1
Chore(deps-dev): Bump joi from 18.0.2 to 18.2.8 (#764)
dependabot[bot] Sep 9, 2026
5212b87
Chore(deps-dev): Bump baseline-browser-mapping from 2.10.0 to 2.11.21…
dependabot[bot] Sep 10, 2026
f67a3f3
Chore(deps): Bump svgo (#765)
dependabot[bot] Sep 10, 2026
65cfc6b
Chore(deps): Bump js-yaml (#766)
dependabot[bot] Sep 10, 2026
cca09f4
Chore(deps): Bump adm-zip and @wordpress/scripts (#780)
dependabot[bot] Sep 20, 2026
4bfa8ff
Chore(deps): Bump markdown-it and @wordpress/scripts (#783)
dependabot[bot] Sep 30, 2026
44c657b
Chore(deps-dev): Bump brace-expansion from 1.1.12 to 1.1.21 (#784)
dependabot[bot] Oct 1, 2026
f091e6b
Merge branch 'main' into theme-elementary-v2
aryanjasala Oct 1, 2026
43553c1
fix(deps): clear every npm security advisory
aryanjasala Oct 1, 2026
4fa0d25
test(js): assert the duplicate-entry warning with jest-console
aryanjasala Oct 1, 2026
0d91cae
fix(deps): update squizlabs/php_codesniffer to 3.13.6
aryanjasala Oct 1, 2026
a0ffc5b
build(deps): match plugin-elementary's security setup
aryanjasala Oct 1, 2026
1b5a745
test(php): run PHPUnit in a separate wp-env config
aryanjasala Oct 1, 2026
02d6ec3
Merge branch 'theme-elementary-v2' into test/wp-env-tests-config
aryanjasala Oct 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/scaffold/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ Then report:
**Test env + linters (`wp-env`):**
- Always use `npx wp-env` (or `node_modules/.bin/wp-env`), never bare `wp-env`.
- **Run PHP linters inside wp-env (PHP 8.2).** The host PHP may be newer than the pinned `wp-coding-standards/wpcs` supports, which makes the sniffs throw deprecation errors and abort. Run e.g. `npx wp-env run cli --env-cwd=/var/www/html/wp-content/themes/$(basename "$PWD") -- vendor/bin/phpcs <files>` (PHPStan tolerates newer PHP, so `composer phpstan` is fine on the host).
- If `wp-env start` reports a port already allocated, start on free alternates: `WP_ENV_PORT=8890 WP_ENV_TESTS_PORT=8891 npm run wp-env start` (find a free pair with `lsof -nP -iTCP:<port> -sTCP:LISTEN`). The theme's default ports are 5890 (dev) / 5891 (tests).
- If `wp-env start` reports a port already allocated, start on a free alternate: `WP_ENV_PORT=8890 npm run wp-env start`, or `WP_ENV_PORT=8891 npm run test:php` for the test environment (find a free port with `lsof -nP -iTCP:<port> -sTCP:LISTEN`). The theme's default ports are 5890 (dev, `.wp-env.json`) and 5891 (tests, `.wp-env.tests.json`).
- `wp-env start` can flake on a transient image pull (TLS timeout); one retry is allowed, and exit 0 does not mean "up" - confirm the start output reports success.
- `pretest:php` runs `composer install --no-interaction --no-scripts` in `tests-cli`. Resolve installation errors before testing; see [Local development](../../../docs/local-development.md#check-a-change) for the tested commands.
- `pretest:php` starts the test environment and runs `composer install --no-interaction --no-scripts` in its `cli` container. Resolve installation errors before testing; see [Local development](../../../docs/local-development.md#check-a-change) for the tested commands.

**Generated-code quirks (write the code right up front; these survive `composer phpcs:fix`):**
- **Fully-qualify WP global classes** (`\WP_Error`, `\WP_REST_Request`, `\WP_REST_Response`) everywhere they appear - in code AND docblocks - with NO `use` statement for them. Reason: `composer phpcs:fix` force-qualifies `WP_Error` (Slevomat `FullyQualifiedExceptions` treats `*Error` as an exception) and then strips the now-unused imports, including docblock-only ones; PHPStan (scanning `inc/`) then reports `class.notFound`. Writing them fully-qualified avoids the fix -> phpstan round-trip.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
.env
.env.local
.wp-env.override.json
.wp-env.tests.override.json

# Build
assets/build/
Expand Down
9 changes: 1 addition & 8 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@
"phpVersion": "8.2",
"themes": [ "." ],
"port": 5890,
"env": {
"tests": {
"port": 5891,
"config": {
"WP_DEBUG": true
}
}
}
"testsEnvironment": false
}
10 changes: 10 additions & 0 deletions .wp-env.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"core": null,
"phpVersion": "8.2",
"themes": [ "." ],
"port": 5891,
"testsEnvironment": false,
"config": {
"WP_DEBUG": true
}
}
1 change: 0 additions & 1 deletion docs/internal/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Status recorded on **2026-09-15** for theme baseline `27860f1`, framework `v1.0.
| Active procedure | Why it is needed | Retire when |
| --- | --- | --- |
| Run the explicit commands under [Checks](#checks). | The aggregate scripts include watch, fix, or recursive commands. | Both aggregates terminate and run only their intended checks without modifying files. |
| Apply the [test-only `WP_DEBUG` override](../local-development.md#check-a-change). | Logger tests require debug mode, which wp-env disables in its test environment. | The maintained test setup passes the logger tests without a per-project override. |
| Log diagnostics instead of displaying them when checking login. | Early feature-description translation notices can interrupt login headers. | Translation timing is fixed and login succeeds with diagnostics displayed. |

### Record validation results
Expand Down
25 changes: 7 additions & 18 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ npm run wp-env start
npm run wp-env run cli -- wp theme activate acme-blog
```

The development site is `http://localhost:5890`; the separate test site uses `http://localhost:5891`. Activation uses the mounted **folder name**, not the theme display name or text domain. When you finish, stop the environment with:
The development site is `http://localhost:5890`. PHP tests use a separate environment, defined in `.wp-env.tests.json`, on `http://localhost:5891` with its own database; `npm run test:php` starts it when needed. Activation uses the mounted **folder name**, not the theme display name or text domain. When you finish, stop the environments with:

```bash
npm run wp-env stop
npm run wp-env -- stop --config=.wp-env.tests.json
```

For an existing local WordPress installation, use its normal startup and activation process instead, then run the theme-local commands from this directory.
Expand Down Expand Up @@ -77,28 +78,16 @@ Use PHP compatible with the project's installed checks (PHP 8.2 is the wp-env ba
npm run wp-env -- run cli --env-cwd=/var/www/html/wp-content/themes/acme-blog -- vendor/bin/phpcs
```

With wp-env running, the theme's PHP test command runs inside `tests-cli`; its pretest hook installs Composer dependencies there without scripts.

The wp-env test environment keeps `WP_DEBUG` disabled by default. The logger tests require it, so merge this test-only setting into `.wp-env.override.json` before running PHP tests:

```json
{
"env": {
"tests": {
"config": { "WP_DEBUG": true }
}
}
}
```
The theme's PHP test command runs inside the test environment's `cli` container; its pretest hook starts that environment and installs Composer dependencies there without scripts. The test environment has `WP_DEBUG` on, which the logger tests need.

```bash
npm run test:php
```

For a focused PHP test after that setup:
For a focused PHP test:

```bash
npm run wp-env -- run tests-cli --env-cwd=/var/www/html/wp-content/themes/acme-blog -- vendor/bin/phpunit --filter AuthorBioTest
npm run wp-env -- run --config=.wp-env.tests.json cli --env-cwd=/var/www/html/wp-content/themes/acme-blog -- vendor/bin/phpunit --filter AuthorBioTest
```

Use the relevant test name if the example was removed. Keep smoke projects outside this repository so Jest does not discover another project's tests. Use the explicit commands above for a terminating review check; aggregate-script details belong in [maintenance](internal/maintenance.md#checks).
Expand All @@ -117,10 +106,10 @@ Review visible behavior and checks before feature integration; make a separate f

| Symptom | Check → next action |
| --- | --- |
| wp-env cannot start | Run `docker info`; start Docker and retry if unavailable. For occupied ports, start with `WP_ENV_PORT=5892 WP_ENV_TESTS_PORT=5893 npm run wp-env start`. |
| wp-env cannot start | Run `docker info`; start Docker and retry if unavailable. For an occupied port, set `WP_ENV_PORT`, for example `WP_ENV_PORT=5892 npm run wp-env start` or `WP_ENV_PORT=5893 npm run test:php`. |
| Frontend assets return 404 | Check `assets/build/`; run `npm run build:dev` and confirm the theme is active. |
| CSS rebuilds but no live reload | Confirm local environment type, watcher, and BrowserSync port; see [HMR](hmr.md). |
| HTTPS reload is blocked | Check that `WP_SSL_KEY` and `WP_SSL_CERT` point to trusted certificates for the site hostname; see [HMR](hmr.md). |
| Site Editor ignores a template file edit | Check for a customized template saved in WordPress; review/reset that customization before testing the file version. |
| PHP tests cannot connect | Start wp-env and rerun `npm run test:php`; confirm the `tests-cli` environment is used. |
| PHP tests cannot connect | Start wp-env and rerun `npm run test:php`. |
| New PHP feature does not load | Check namespace/path and `Main::CLASSES`; see [Development](../DEVELOPMENT.md#adding-a-new-class). |
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@
"lint:staged": "lint-staged",
"pot": "composer run pot",
"prepare": "npm run sync-ai",
"pretest:php": "wp-env run tests-cli --env-cwd=/var/www/html/wp-content/themes/${PWD##*/} composer install --no-interaction --no-scripts",
"pretest:php": "wp-env start --config=.wp-env.tests.json && wp-env run --config=.wp-env.tests.json cli --env-cwd=/var/www/html/wp-content/themes/${PWD##*/} composer install --no-interaction --no-scripts",
"start": "npm-run-all --parallel start:assets start:blocks",
"start:assets": "wp-scripts start --experimental-modules --config webpack.config.js",
"start:blocks": "wp-scripts start --hot --experimental-modules --config ./webpack.blocks.config.js --webpack-src-dir=./src/blocks/ --output-path=./assets/build/blocks/",
"test": "npm-run-all --parallel test:js test:php",
"test:js": "wp-scripts test-unit-jest --config=tests/js/jest.config.js --passWithNoTests",
"test:js:watch": "npm run test:js -- --watch",
"test:php": "wp-env run tests-cli --env-cwd=/var/www/html/wp-content/themes/${PWD##*/} composer exec 'phpunit --do-not-cache-result --verbose'",
"test:php": "wp-env run --config=.wp-env.tests.json cli --env-cwd=/var/www/html/wp-content/themes/${PWD##*/} composer exec 'phpunit --do-not-cache-result --verbose'",
"wp-env": "wp-env"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion tests/js/dev-tools.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const setup = (basePlugins, kind = 'theme') => {
const root = fs.mkdtempSync(path.join(fixtures, 'dev-tools-'));
const base = basePlugins
? { env: { development: { plugins: basePlugins } } }
: { core: null, themes: ['.'], env: { tests: { port: 5891 } } };
: { core: null, themes: ['.'], port: 5890, testsEnvironment: false };
write(root, WP_ENV, `${JSON.stringify(base, null, '\t')}\n`);
write(root, 'composer.json', '{\n\t"name": "acme/demo"\n}\n');
write(root, 'package.json', '{\n\t"name": "demo"\n}\n');
Expand Down