Repository navigation
Build Tooling: Migrate from Yarn to npm - #741
Merged
Merged
Conversation
… to use npm instead of yarn
Member
|
Suggestion (non-blocking): consider
( |
Member
|
Suggestion (non-blocking): redundant install in The job runs |
Address PR review feedback: - build.yml, tests.yml, linters.yml: install deps with `npm ci` instead of `npm install`. With a committed lockfile, `npm ci` is reproducible and fails loudly on drift rather than silently rewriting package-lock.json. - tests.yml: drop the `setup:tools` wrapper that duplicated the npm and composer installs in the following step; the generated lint configs it produced are not used by the PHPUnit run. - linters.yml: replace `setup:tools` with explicit `npm ci`, `composer install`, and `update-configs` (the lint configs are needed for stylelint/eslint) so it uses the reproducible install too. `setup:tools` intentionally keeps `npm install`, since it is also the local first-time-setup path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardizes the project on a single Node package manager by replacing Yarn (Classic) with npm. The repository already shipped npm-oriented developer docs and a partly-npm
build.ymlworkflow, so this removes the remaining Yarn usage and the mixed-tooling ambiguity.Why
The project carried two package managers at once: a
yarn.lock,yarn-based CI inlinters.yml/tests.yml, and asetup:toolsscript invokingyarn install— while the README documentednpm run …andbuild.ymlalready usednpm install. A single package manager removes the lockfile-drift risk of two resolvers, matches the existing documentation, and lowers the barrier for new contributors.What changes
yarn.lock; addpackage-lock.json(generated with Node 20 / npm 10, per.nvmrc).package.json:setup:toolsnow runsnpm install; add apreinstallguard (npx --yes only-allow npm) so the project can't be installed with Yarn/pnpm again.build.yml,linters.yml,tests.yml): switchcache: yarn→cache: npmand replaceyarn …invocations with theirnpm run …/npxequivalents.bin/font-subset-cjk.js: update theyarnreferences in the usage comments to npm.README.md: drop the documentednpm run build:rtlcommand, which has no matching script (npm run buildalready producesstyle-rtl.css).No application/runtime code is touched, and no dependency versions change: a fresh npm resolve produces the same lint-relevant tree (
@wordpress/eslint-plugin@18.1.0,prettier@3.0.3) as the previousyarn.lock.Test plan
npm installsucceeds and generatespackage-lock.json; thepreinstallguard blocksyarn installnpm run buildbuilds all block styles including RTLnpm run lint:csspassesnpm run lint:jsshows only pre-existing findings (verified identical to ayarn lint:jsrun ontrunk)🤖 Generated with Claude Code