Draft
Conversation
## Summary This migrates the Gatsby monorepo's own tooling from Yarn 1 to pnpm 10. The scope is intentionally narrow: - repo tooling only - no user-facing package manager behavior changes - no package manager support test changes - no examples, starters, demos, or fixture migrations Lerna stays in place as the orchestration/release layer, but it now runs on top of pnpm instead of Yarn. ## What changed - added pnpm root/workspace config: - `packageManager: pnpm@10.x` - `pnpm-workspace.yaml` - `pnpm-lock.yaml` - root `.npmrc` - removed root Yarn 1 plumbing - configured Lerna to use pnpm - converted workspace-local dependencies to `workspace:` ranges so pnpm links local packages correctly - updated repo-owned bootstrap, CI, Gitpod, and lockfile-check flows from Yarn to pnpm - moved workspace build hooks from `prepare` to `prepack` - updated bootstrap to run `lerna run prepack` explicitly - added pnpm 10 build approvals for required dependency install scripts - ignored `.pnpm-store/` ## Why the `prepare` change matters This repo had been using package `prepare` as a monorepo build hook. That was mostly tolerated by Yarn 1, but under pnpm it makes a normal install behave badly by trying to build large parts of the workspace during `pnpm install`. This PR fixes that by moving those workspace build hooks to `prepack`, which gives us cleaner semantics: - `pnpm install` installs dependencies and runs approved dependency build scripts - `pnpm bootstrap` is the explicit install + workspace build entrypoint That keeps normal developer workflow unsurprising while preserving the repo's build/release behavior. ## pnpm 10 build approvals pnpm 10 blocks dependency build scripts unless they are explicitly approved. This PR opts into explicit approvals for the packages this repo already relies on during install, instead of using blanket script bypasses or a global "allow everything" setting. That keeps `pnpm install` working normally without bringing back `--ignore-scripts` as a required workflow. ## Validation Ran successfully: - `pnpm install --force --no-frozen-lockfile` - `pnpm ignored-builds` - `node scripts/check-versions.js` - `pnpm check-repo-fields` - `sh scripts/check-lockfile.sh` - `pnpm bootstrap --skip-install --concurrency=2` ## Notes - Normal install/bootstrap flows no longer rely on `--ignore-scripts`. - The special `release-next-major` publish path still passes `--ignore-scripts`; that is unchanged from the normal day-to-day contributor workflow and is separate from the install/bootstrap migration. - No files under `examples/`, `starters/`, `e2e-tests/`, or `integration-tests/` were modified by this change.
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.
Summary
This migrates the Gatsby monorepo's own tooling from yarn v1 to pnpm 10.
The scope is intentionally narrow:
Lerna stays in place as the orchestration/release layer, but it now runs on top of pnpm instead of yarn.
What changed
workspace:ranges so pnpm links local packages correctlypreparetoprepack(see blow)lerna run prepackexplicitlyWhy the
preparechange mattersThis repo had been using package
prepareas a monorepo build hook.That was mostly tolerated by yarn v1, but under pnpm it makes a normal install behave badly by trying to build large parts of the workspace during
pnpm install. This sort of happened to work because of how work was delegated across yarn and lerna.This PR fixes that by moving those workspace build hooks to
prepack, which gives us cleaner semantics:pnpm installinstalls dependencies and runs approved dependency build scriptspnpm bootstrapis the explicit install + workspace build entrypointThat keeps normal developer workflow unsurprising while preserving the repo's build/release behaviour.
pnpm 10 build approvals
pnpm 10 blocks dependency postinstall scripts unless they are explicitly approved.
This PR opts into explicit approvals for the packages this repo already relies on during install.
Validation
Ran successfully:
pnpm install --force --no-frozen-lockfilepnpm ignored-buildsnode scripts/check-versions.jspnpm check-repo-fieldssh scripts/check-lockfile.shpnpm bootstrap --skip-install --concurrency=2Notes
release-next-majorpublish path still passes--ignore-scripts; that is unchanged from the normal day-to-day contributor workflow and is separate from the install/bootstrap migration.examples/,starters/,e2e-tests/, orintegration-tests/were modified by this change.