Migrate the monorepo from Yarn 4.x to pnpm 10.28.1. This migration enforces strict dependency management by fixing ghost dependencies individually, updating Dockerfiles, and migrating GitHub Actions.
- GitIgnore: Add
.pnpm-storeto .gitignore. - Enforce pnpm v10: Update root package.json with
"packageManager": "pnpm@10.28.1"and setengines. - Consolidate Overrides: Move all
resolutionsfrom the root and sub-package package.json files into thepnpm.overridessection of the root package.json. - Migrate Scripts: Replace
yarn workspace <pkg> <cmd>withpnpm --filter <pkg> <cmd>and all otheryarncalls withpnpmin all package.json files. - Update Dockerfiles: Modify Dockerfile and Dockerfile to install
pnpm@10.28.1and usepnpm dlx turboandpnpm install --frozen-lockfile. - Update CI/CD Workflows: Update shared and specific workflows in .github/workflows/ to use
pnpmusing corepack, setcache: "pnpm", and replaceyarncommands. - Fix Ghost Dependencies: Execute
pnpm installandpnpm -r build. For every "module not found" error, explicitly add the missing dependency until all builds succeed without usingpublic-hoist-pattern. - Artifact Cleanup: Delete .yarn, .yarnrc.yml, and yarn.lock.
- Minor Fixes: Upgrade vscode settings and all README.md to reflect changes.
- Dependency Check Removal: Remove
dependency-checkfrom devDependencies and eliminate any related build scripts in all package.json files.
Add these settings to pnpm-workspace.yaml
cleanupUnusedCatalogs: false
linkWorkspacePackages: true
packageImportMethod: clone-or-copyImportant: when adding missing dependencies, use pnpm add or pnpm add -D instead of manually editing package.json files to ensure proper lockfile updates.
Important: once done, run pnpm test in loop at the root of the monorepo and fix any issues until all tests pass successfully across the monorepo.
When modifying Dockerfiles and/or GitHub Actions workflows, prefer to use corepack to install pnpm instead of installing it via npm: pnpm version is specified in the root package.json file.
- pnpm-workspace.yaml: Verify that the existing pnpm-workspace.yaml correctly covers all
apps/*andpackages/*folders. - CI Cache Keys: Ensure that the
cache-dependency-pathin GitHub Actions points to pnpm-lock.yaml to ensure reliable caching after the migration. - Peer Dependency Issues: pnpm 10 is strict about peer dependencies; some packages might require
pnpm.peerDependencyRulesin the root package.json if upstream packages have poorly defined peers.