Repository navigation
Document why NodeJS is needed to run the tests - #347
Conversation
Explains that the build step downloads the pinned Gutenberg artifact from ghcr.io and copies the block editor files into src/, which the tests load. Also notes engine-strict and that the production build is not needed for PHPUnit. Fixes WordPress#243. 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. Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @iarif4u, @mindctrl. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Make it a standalone ### section, open with why a PHP suite needs Node.js, list the Gutenberg steps in order, and add a summary sentence (from the review). Keep the ghcr.io network requirement, the changeset and issue references, and the build:dev note. Mention that devEngines also enforces the npm version.
|
Thanks @dhruvang21, your version reads better. I reworked the section in 3632464 and used your structure:
I kept a few things that your text left out, because hosts need them:
I also added that |
|
@iarif4u The technical details here are useful, but I think the section could be improved for clarity, flow, and grammatical accuracy. Rather than making several small edits, could we replace the current section with the version suggested in the change? It keeps the technical details while making the explanation easier to follow. |
Base the section on the wording suggested in review, and use real headings for Versions and Extra work (review suggestions). Keep the facts hosts need: the build commands, changeset 61438, gutenberg.sha, the ghcr.io connection, the routes.php example, devEngines with the EBADDEVENGINES error, and Core's build:dev workflow.
|
@dhruvang21 Done in 148566c. The section now uses your version, with your sentences. I only added back the facts that your version left out, each as a short clause in your text:
I also applied @mindctrl's two heading suggestions. Could you take another look? |
GHCR answers the blob request with a 307 to pkg-containers.githubusercontent.com, so a host with an outbound allowlist needs both domains.
4814a42 recorded the deletion of 22 files that were missing from my local working copy. Restore them unchanged. The only change left from that commit is the ghcr.io redirect sentence in README.md.
routes.php is in version control again since r62118, so cite WordPress#292 as something that happened instead of a current example.
Since WordPress#351, prepare.php runs npm run build:dev, so name that command and replace the note that compared it with the full build.
|
#351 is merged, so as agreed I updated the wording in 47af3de. The section now says that |
`grunt build --dev` runs build:js and build:css, which minify into src/. It only skips build:files (the build/ directory), replace:source-maps and verify:build.
Fixes #243.
Purpose
Hosts ask why a PHP test suite needs NodeJS. This adds a short "Why NodeJS is needed" section under the NodeJS installation steps in the README.
What it explains
prepare.phprunsnpm install && npm run build. The step the tests need isbuild:gutenberg. It downloads the pinned Gutenberg artifact fromghcr.ioand copies the block editor PHP files, routes, blocks, scripts, styles andtheme.jsonintosrc/.src/. Those files left version control in changeset 61438, so without the build, WordPress fails to load (example: PHPUnit tests fail: routes.php generated under build/ but tests bootstrap from src/ #292).ghcr.io. This is new information for firewalled hosts.engine-strict = trueinwordpress-develop/.npmrcmeans thatnpm installstops on an older Node.js version.npm run build(copy tobuild/, minify) is not used by PHPUnit. Core's own PHPUnit workflow usesnpm ciandnpm run build:dev. Links to Find ways to reduce the need for NodeJS #244 for the follow-up.Sources (wordpress-develop trunk)
Gruntfile.js: thebuild,build:gutenbergandgutenberg:downloadtasks, and the comment that references changeset 61438 and ticket 64393tools/gutenberg/utils.jsanddownload.js: version check, auto-download,ghcr.ioURLspackage.json(gutenberg.sha,engines) and.npmrc(engine-strict).github/workflows/reusable-phpunit-tests-v3.yml:npm ciandnpm run build:devbefore PHPUnitwp-tests-config-sample.php:ABSPATHissrc/Contributed at WordCamp Contributor Day.