Frontend: replace Yarn with pnpm#1359
Merged
gusthoff merged 18 commits intoMay 25, 2026
Merged
Conversation
Declare pnpm@11.3.0 as the package manager in the `packageManager` field of package.json (was yarn@4.12.0). Add pnpm-lock.yaml (9297 lines, 1018 resolved packages) generated by running `pnpm import` against the existing yarn.lock, preserving the same resolved versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/lock-file'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove all Yarn-specific files now that pnpm is the declared package manager: - frontend/yarn.lock (replaced by frontend/pnpm-lock.yaml) - frontend/.yarnrc.yml (set nodeLinker: node-modules; no pnpm equivalent needed — pnpm uses node_modules by default) - frontend/.yarn/ (install-state cache; untracked, deleted locally) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/remove-yarn'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- webpack-production: yarn run production → pnpm run production - webpack-sandbox: yarn run sandbox → pnpm run sandbox - local target comment: yarn run dev → pnpm run dev Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In all three workflows (typescript-tests, sphinx-books-tests, sphinx-content-tests): - cache: 'yarn' → cache: 'pnpm' - cache-dependency-path: 'frontend' → 'frontend/pnpm-lock.yaml' - yarn --immutable → pnpm install --frozen-lockfile In typescript-tests only: - yarn run cover → pnpm run cover Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e and CI Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/makefile-ci'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In both web and epub VM provisioners, replace: yes | yarn set version berry yarn with: pnpm install --frozen-lockfile corepack enable is kept — with packageManager: "pnpm@11.3.0" declared in package.json, corepack downloads and activates pnpm@11.3.0 automatically on first invocation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/vagrantfile'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pnpm 11 no longer reads the "pnpm" field in package.json; project-level settings now live in pnpm-workspace.yaml. Set allowBuilds for the two packages that have postinstall scripts: - @parcel/watcher: compiles native file-watching bindings (needed by webpack-dev-server for efficient file watching) - es5-ext: prints a message only; approved to keep pnpm install clean Without this file, pnpm install exits with ERR_PNPM_IGNORED_BUILDS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/validation'. Validated on web VM: pnpm install --frozen-lockfile exits cleanly, make webpack-production succeeds (exit 0, 3 pre-existing size warnings). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace `yarn run dev` with `pnpm run dev` in the Getting started section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/readme'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The "cover" script in package.json called `c8 yarn run test`, causing the CI typescript-tests job to fail: `pnpm run cover` invokes this script, which would then call yarn (no longer installed). Changed to `c8 pnpm run test`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/cover-script'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace `yarn run dev` with `pnpm run dev` in frontend/web_tests/README.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yarn-error.log is Yarn's error log; pnpm-debug.log is the pnpm equivalent. Update .gitignore accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… .gitignore Merges branch 'topic/infrastructure/pnpm/setup/20260525/pnpm-migration/feat/docs-cleanup'. Co-Authored-By: Claude Sonnet 4.6 <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.
Rationale
Yarn 4 is configured in legacy
nodeLinker: node-modulesmode (.yarnrc.yml),which means it gets none of the speed benefits of Yarn Berry's Plug'n'Play
resolver. Every cold install reads, links, and validates a 275 MB
node_modulestree built from a 10,619-line lock file. On CI, where no cache survives between
runs, this cost is paid in full on every job.
pnpm addresses this directly:
node_modules, so disk space is shared across projects on the same machine.missing hard-links are created.
node_moduleslayout (only declared dependencies areaccessible), eliminating a class of hidden-dependency bugs.
Changes
yarn.lockwithpnpm-lock.yaml, generated viapnpm importtopreserve existing resolved versions. Declare
pnpm@11.3.0as thepackageManager.yarn.lock,.yarnrc.yml, and.yarn/.yarn runinvocations withpnpm runinMakefile,package.jsonscripts, and CI workflows; switch CI node caching fromyarnto
pnpm.pnpm-workspace.yamlto approve build scripts for@parcel/watcher(native bindings) and
es5-ext(pnpm 11 moved this setting out ofpackage.json).README.md,frontend/web_tests/README.md, andfrontend/.gitignore.Validation
Tested on the web VM (Node 24.14.1, pnpm 11.3.0):
pnpm install --frozen-lockfile— exits cleanly, both approved buildscripts run
make webpack-production— exit 0; 3 asset-size warnings (pre-existing)Notes
pnpmkey inpackage.json; project-levelsettings now live in
pnpm-workspace.yaml. This is whyallowBuildsisconfigured there rather than in
package.json..yarnentry in the root.gitignoreis intentionally kept as asafeguard against accidentally re-initialising Yarn.
pnpm-lock.yamlwas generated withpnpm import(best-effort conversionfrom
yarn.lock) rather than a freshpnpm install, preserving the resolvedversions from the existing lock file.
Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com