Build/Test Tools: Remove npx commands in 6.6 - #13112
Conversation
npx with npm exec --no in Grunt tasks.Backport of r63309 to the 6.6 branch. `npx` installs a package and its dependencies, and runs every install script, when the binary is not already installed. The `wp-packages:update` and `browserslist:update` tasks now run the local binaries instead. Adds `update-browserslist-db` to `devDependencies`, so `browserslist:update` does not depend on npm hoisting it out of `browserslist`.
f7c79a3 to
404147e
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
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. |
Backport of r63309, already in trunk via #13021, to the
6.6branch. It replaces the two remainingnpxcalls inGruntfile.jswithnpm exec --no, which runs an installed binary instead of downloading and installing one, and addsupdate-browserslist-dbas a direct dev dependency.Trac ticket: https://core.trac.wordpress.org/ticket/65864
Testing instructions
No workflow runs
wp-packages:updateorbrowserslist:update. Both are reached only throughgrunt sync-gutenberg-packages, a manual release-lead task. CI therefore does not exercise this change, so check it locally.npm ci.npm exec --no -- update-browserslist-db --version. It printsbrowserslist-lint 1.0.16and downloads nothing.npm exec --no -- wp-scripts --version. It printsScript name is missing.That message comes from the installed binary, and nothing is downloaded.rm -rf node_modules/update-browserslist-db, then runnpm exec --no -- update-browserslist-db --versionagain. It now fails withnpx canceled due to missing packages and no YES optioninstead of fetching the package. Runnpm cito restore the tree.npm ls update-browserslist-db. It reports one copy at 1.0.16, both as a direct dev dependency anddedupedunderbrowserslist.npx --no grunt jshint:grunt. It reports1 file lint free.Step 4 is the point of the change.
npxinstalls the missing package and runs its install scripts.npm exec --norefuses.Use of AI Tools
AI assistance: Yes — Claude Code (Claude Opus 5) applied r63309 to the
6.6branch and verified the changeset.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.