refactor: migrate from Yarn 3.8.7 to pnpm#3228
Conversation
Remove Yarn artifacts (.yarnrc.yml, .yarn/, yarn.lock, constraints.pro) and set up pnpm equivalents: pnpm-workspace.yaml, .npmrc with shamefully-hoist, and updated root package.json (packageManager, engines, pnpm.overrides, workspace:* protocol, pnpm.onlyBuiltDependencies, script rewrites from yarn workspace to pnpm --filter). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace yarn with pnpm in build scripts, postinstall script, and husky git hooks (pre-commit, commit-msg). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add pnpm/action-setup@v4 step, replace yarn cache with pnpm store, switch install command to pnpm install --frozen-lockfile, and update all yarn command invocations to pnpm equivalents. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update lint-staged, jest configs, svgr template, storybook and design-system package.json scripts to use pnpm instead of yarn. Add yaml, rcfile, prettier as explicit devDependencies to design-system (previously phantom deps via yarn hoisting). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace Yarn's Prolog-based constraints.pro with a Node.js script that validates license, repository, and publishConfig fields across all workspace packages. Used in CI and postinstall. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update AGENTS.md, CONTRIBUTING.md, Percy README, generator templates, generator CLI binaries (spawnSync yarn→pnpm), test snapshots, and ~70 component README install instructions (yarn add → pnpm add). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regenerated icon components with updated svgr template comment (pnpm generate-icons). Fix pre-existing incorrect deep import @commercetools-uikit/constraints/src in dropdown-menu stories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| # Hoist all dependencies to root node_modules (matches previous Yarn behavior). | ||
| # TODO: tighten with public-hoist-pattern[] for specific packages later. | ||
| shamefully-hoist=true |
There was a problem hiding this comment.
This caught my attention and I read up on it.
When determining what would needed to be done to allow pnpm's default to prevent phantom dependencies, I encountered no errors at all.
Perhaps this file isn't even needed atm?
| @@ -1,2 +1,2 @@ | |||
| <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. --> | |||
| <!-- This file is created by the `yarn generate-readme` script. --> | |||
There was a problem hiding this comment.
I can see that the source for this was updated here, but it's not actually generating the changes in any of the README.md files. 🤔
|
Closing for now, we might pick it up at a later time. |
Caution
This PR was created to try out the freshly added AI Agent tooling. Do not merge without thorough review and CI validation.
Summary
.yarnrc.yml,.yarn/,yarn.lock,constraints.pro)pnpm-workspace.yaml,.npmrc,pnpm-lock.yaml)package.json(packageManager,engines,pnpm.overrides,pnpm.onlyBuiltDependencies, scripts)yarntopnpmmanypkg run/execwith nativepnpm --filter/pnpm -r execconstraints.prowith a Node.js validation scriptyamlin design-system) exposed by pnpm's stricter isolation@commercetools-uikit/constraints/src)Known trade-offs
shamefully-hoist=trueis enabled in.npmrcto match Yarn's flat hoisting behavior — many cross-workspace type references rely on it. Can be tightened later with targetedpublic-hoist-pattern[]entries.pnpm.onlyBuiltDependenciesallowlist may need tuning if build script warnings persist in CI.Test plan
pnpm installsucceedspnpm buildsucceedspnpm typecheckpasses (0 errors)pnpm testpasses (1402 tests, 125 suites)pnpm lintpasses (1307 files)node scripts/check-workspace-constraints.jspassesyarnreferences in source filesReview Navigator
270 files changed across 7 commits; ~25 are substantive, ~38 are README
yarn add→pnpm addreplacements, ~17 are regenerated icon comment updates, and ~20 are AI tooling files from the base branch (not part of the migration).File Relationships & Review Order
flowchart TB subgraph "1️⃣ Core Configuration" A["① package.json<br/><i>packageManager, overrides, scripts</i>"] B["② pnpm-workspace.yaml<br/><i>workspace package globs</i>"] C["③ .npmrc<br/><i>shamefully-hoist=true</i>"] D["④ .gitignore<br/><i>remove .yarn patterns</i>"] end subgraph "2️⃣ Deleted Yarn Artifacts" E["⑤ .yarnrc.yml<br/><i>deleted</i>"] F["⑥ constraints.pro<br/><i>deleted, replaced by ⑭</i>"] G["⑦ .yarn/*<br/><i>deleted (plugins, releases)</i>"] end subgraph "3️⃣ Scripts & Hooks" H["⑧ scripts/build.sh<br/><i>yarn→pnpm, manypkg→filter</i>"] I["⑨ scripts/postinstall.sh<br/><i>yarn→pnpm</i>"] J["⑩ .husky/pre-commit<br/><i>yarn→pnpm</i>"] K["⑪ .husky/commit-msg<br/><i>yarn→pnpm</i>"] end subgraph "4️⃣ CI/CD Workflows" L["⑫ main.yml<br/><i>pnpm setup, cache, install</i>"] M["⑬ publish-release.yml<br/><i>pnpm setup, changeset cmds</i>"] N[" preview-release-on-comment.yml<br/><i>pnpm setup, snapshot cmds</i>"] end subgraph "5️⃣ Constraints Replacement" O["⑭ check-workspace-constraints.js<br/><i>new: replaces constraints.pro</i>"] end subgraph "6️⃣ Config Files & Workspace Packages" P["⑮ lint-staged.config.js<br/><i>yarn→pnpm</i>"] Q["⑯ jest-puppeteer.config.js<br/><i>yarn→pnpm</i>"] R["⑰ svgr.config.js<br/><i>template comment update</i>"] S["⑱ design-system/package.json<br/><i>+yaml,rcfile,prettier devDeps</i>"] T["⑲ storybook/package.json<br/><i>yarn→pnpm in scripts</i>"] end subgraph "7️⃣ Generators" U["⑳ generators/*/bin/cli.mjs<br/><i>spawnSync yarn→pnpm</i>"] V["㉑ generators/readme/src/index.ts<br/><i>template: yarn→pnpm</i>"] W["㉒ generators/readme/test/*.spec.ts<br/><i>snapshot updates</i>"] end subgraph "8️⃣ Documentation" X["㉓ CONTRIBUTING.md<br/><i>yarn→pnpm throughout</i>"] Y["㉔ test/percy/README.md<br/><i>yarn→pnpm throughout</i>"] end subgraph Bulk ["9️⃣ Bulk Changes (spot-check only)"] Z["~38 component READMEs<br/><i>yarn add → pnpm add</i>"] AA["~17 generated icons<br/><i>comment: yarn→pnpm</i>"] end subgraph "🔧 Bugfix" BB["㉕ dropdown-menu.stories.tsx<br/><i>fix: /constraints/src import</i>"] end A --> H A --> L A --> I F -.->|replaced by| O L --> O R --> AA V --> Z V -.->|tested by| W style O fill:#e8f5e9 style BB fill:#fff3e0 style Bulk fill:#f5f5f5,stroke:#bdbdbd,stroke-dasharray: 5 5Suggested Review Order
package.jsonpnpm-workspace.yaml.npmrc.gitignore.yarnrc.ymlconstraints.proscripts/build.shscripts/postinstall.sh.husky/pre-commit.github/workflows/main.yml.github/workflows/publish-release.yml.github/workflows/preview-release-on-comment.ymlscripts/check-workspace-constraints.jsdesign-system/package.jsonlint-staged.config.jssvgr.config.jsgenerators/package-json/bin/cli.mjsgenerators/readme/bin/cli.mjsgenerators/readme/src/index.tsgenerators/readme/test/generate-readme.spec.tsCONTRIBUTING.mdtest/percy/README.mddropdown-menu.stories.tsx@commercetools-uikit/constraints/src→@commercetools-uikit/constraintsREADME.mdfilesyarn add→pnpm addinstall instructions.tsxfilesyarn generate-icons→pnpm generate-icons.agents/,.claude/,AGENTS.md,CLAUDE.mdfiles🤖 Generated with Claude Code