[WOODPECKER-4406] Migrate package manager from npm to pnpm#4789
Conversation
… pnpm (#…" This reverts commit af210a9.
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Migrates the repo’s package manager and CI workflows from npm to pnpm (reverting prior npm-based changes per the PR description).
Changes:
- Switch root tooling to pnpm (workspace config, engines/packageManager, scripts, overrides).
- Update CI/GitHub Actions workflows and Nx run-commands to install/build with pnpm.
- Update documentation and developer runbooks to reference pnpm commands.
Reviewed changes
Copilot reviewed 35 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| token-sync/src/build-css.ts | Updates formatting and error guidance to reference pnpm. |
| token-sync/src/build-css-cli.ts | Updates CLI comments to reference pnpm commands. |
| token-sync/RUNBOOK.md | Updates runbook commands from npm to pnpm. |
| token-sync/README.md | Updates setup/build instructions to pnpm. |
| pnpm-workspace.yaml | Adds pnpm workspace package globs. |
| packages/backpack-web/src/bpk-stylesheets/README.md | Updates build instructions to pnpm. |
| packages/backpack-web/src/bpk-component-floating-notification/src/BpkFloatingNotification.tsx | Refactors timeout cleanup for clarity. |
| packages/backpack-web/package.json | Adjusts dependency declarations for pnpm/workspaces. |
| packages/backpack-web/jest.config.js | Adjusts Jest transform ignore patterns for pnpm layout. |
| packages/backpack-adoption-guard/project.json | Updates Nx run-commands to use pnpm filtering. |
| package.json | Declares pnpm packageManager/engines, updates scripts, pnpm overrides, and Jest mapping. |
| libs/backpack-storybook-host/package.json | Switches deps to workspace protocol and adds typing dev dep. |
| libs/backpack-storybook-host/.storybook/webpack.config.js | Updates webpack exclude regex for pnpm node_modules layout. |
| decisions/imports-ts-suppressions.md | Updates referenced commands to pnpm. |
| DEV_RELEASE.md | Updates build step to pnpm install/build. |
| CONTRIBUTING.md | Updates contributor instructions to pnpm. |
| AGENTS.md | Updates agent context to pnpm and corresponding commands. |
| .specify/templates/tasks-template.md | Updates template validation commands to pnpm. |
| .specify/templates/plan-template.md | Updates template package manager requirement to pnpm. |
| .specify/scripts/bash/update-agent-context.sh | Updates generated JS/TS commands to pnpm. |
| .specify/memory/constitution.md | Updates supported package manager to pnpm. |
| .npmrc | Adds engine-strict and relaxes strict peer deps for pnpm installs. |
| .gitignore | Ignores pnpm debug logs and package-lock.json. |
| .github/workflows/sync-figma-variables.yml | Switches token sync workflow installs/runs to pnpm. |
| .github/workflows/release.yml | Removes npm cache job and switches build flow to pnpm with pnpm caching. |
| .github/workflows/pr.yml | Removes npm cache job and switches PR workflow to pnpm with pnpm caching. |
| .github/workflows/main.yml | Removes npm cache job and switches main workflow to pnpm with pnpm caching. |
| .github/workflows/dev-release.yml | Switches dev release workflow to pnpm install/build. |
| .github/workflows/backpack-adoption-guard-release.yml | Switches adoption guard release workflow to pnpm install. |
| .github/workflows/_build.yml | Switches shared build workflow to pnpm; updates React 19 override step. |
| .github/actions/figma-token-sync-pr/action.yml | Updates composite action to run pnpm tokens build. |
| .github/actions/figma-token-sync-pr/README.md | Updates composite action docs to pnpm install/build-css. |
| .claude/skills/backpack-external-component-migration/SKILL.md | Updates verification commands to pnpm. |
| .claude/skills/backpack-code-review-checklist/agents/agent3-a11y.md | Updates CI/test command reference to pnpm. |
| .claude/guidelines/bpk-token-value-lookup.md | Updates prerequisite install guidance to pnpm. |
| .claude/guidelines/bpk-new-component-workflow.md | Updates build/check commands to pnpm. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
| 3. **Build** — `pnpm install --frozen-lockfile` and `pnpm run build` run against the PR's HEAD | ||
| commit, producing `packages/backpack-web/dist`. | ||
| 4. **Publish** — only when `dry_run=false`. Bumps the version with | ||
| `npm version --no-git-tag-version` and runs `npm publish --tag dev`. This |
There was a problem hiding this comment.
Why we keep npm publish here, Could we change it to pnpm publish
There was a problem hiding this comment.
Hi Kerrie. Nice catch! Our goal is to switch the package manager from NPM to PNPM (pnpm install). npm build should still work, and we'll continue publishing to the npm registry.
If we also want to switch the publish command to pnpm publish, that's certainly possible, but it will require some extra work and involve a bit more risk.
Do you prefer pnpm publish?
There was a problem hiding this comment.
Agree , keep npm publish first
| - name: Publish dev release to npm | ||
| if: ${{ inputs.dry_run != true }} | ||
| working-directory: packages/backpack-web/dist | ||
| run: npm publish --ignore-scripts --tag dev |
There was a problem hiding this comment.
Could we change npm publish to pnpm publish ?
| run: | | ||
| cd packages/backpack-web/dist | ||
| npm version $RELEASE_VERSION --no-git-tag-version | ||
| npm publish |
This reverts commit 061f722.
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
…38-WOODPECKER-4406
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
…lution pnpm does not hoist transitive @types packages to the root node_modules, so tsc running from the repo root could not resolve the Node.js global type 'global' used in intersection-observer.ts.
|
Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser. |
Revert the revert of #4738
Last time, we have merged that PR into main. But it throw an error:

Reason:
In the original PR, we have updated the pnpm cache for the
pr.yamland_build.ymland forgot to update themain.ymlrelease.ymlanddev-release.ymlIn the
main.yml, the cache key for the storybook build artifact is different:pnpm install, sohashFiles()only sees the source files, resulting in the76ad...key._build.yml/PercyTests: The cache key is computed afterpnpm install, sohashFiles()also includes the package-localnode_modules, resulting in thec9bb...key.Fixed:
In this PR, we replaced the shared
node_modulescache (theCreate-NPM-Cachejob and theRestore NPM Cachesteps) withsetup-node’s built-in pnpm store cache, together with an unconditionalpnpm install --frozen-lockfilein every job, matchingpr.yml.This ensures that every job computes the
build-cachehashFiles()key against the same on-disk state, which fixes the PercyTests cache miss inmain.yml, where the cache-saving job previously skipped the install step.See a734163