Skip to content

[WOODPECKER-4406] Migrate package manager from npm to pnpm#4789

Merged
kerrie-wu merged 10 commits into
mainfrom
revert-4787-revert-4738-WOODPECKER-4406
Jul 6, 2026
Merged

[WOODPECKER-4406] Migrate package manager from npm to pnpm#4789
kerrie-wu merged 10 commits into
mainfrom
revert-4787-revert-4738-WOODPECKER-4406

Conversation

@viktor-yang

@viktor-yang Viktor Yang (viktor-yang) commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Revert the revert of #4738

Last time, we have merged that PR into main. But it throw an error:
image

Reason:
In the original PR, we have updated the pnpm cache for the pr.yaml and _build.yml and forgot to update the main.yml release.yml and dev-release.yml

In the main.yml, the cache key for the storybook build artifact is different:

  • Create-Build-Cache: The cache key is computed before running pnpm install, so hashFiles() only sees the source files, resulting in the 76ad... key.
  • _build.yml / PercyTests: The cache key is computed after pnpm install, so hashFiles() also includes the package-local node_modules, resulting in the c9bb... key.

Fixed:
In this PR, we replaced the shared node_modules cache (the Create-NPM-Cache job and the Restore NPM Cache steps) with setup-node’s built-in pnpm store cache, together with an unconditional pnpm install --frozen-lockfile in every job, matching pr.yml.

This ensures that every job computes the build-cache hashFiles() key against the same on-disk state, which fixes the PercyTests cache miss in main.yml, where the cache-saving job previously skipped the install step.
See a734163

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@skyscanner-backpack-bot

skyscanner-backpack-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.js) were updated, but snapshots weren't. Have you checked that the tests still pass?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against abfca7a

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@viktor-yang Viktor Yang (viktor-yang) added dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code ai: claude labels Jul 2, 2026
@viktor-yang Viktor Yang (viktor-yang) marked this pull request as ready for review July 2, 2026 09:11
Copilot AI review requested due to automatic review settings July 2, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/backpack-web/jest.config.js
Comment thread libs/backpack-storybook-host/.storybook/webpack.config.js
Comment thread .github/workflows/_build.yml Outdated
Comment thread DEV_RELEASE.md
Comment thread .specify/templates/plan-template.md
@viktor-yang Viktor Yang (viktor-yang) added the minor Non breaking change label Jul 2, 2026
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

Comment thread DEV_RELEASE.md
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

@kerrie-wu kerrie-wu Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we keep npm publish here, Could we change it to pnpm publish

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change npm publish to pnpm publish ?

run: |
cd packages/backpack-web/dist
npm version $RELEASE_VERSION --no-git-tag-version
npm publish

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment thread .github/workflows/dev-release.yml Fixed
Comment thread .github/workflows/release.yml Fixed
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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.
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4789 to see this build running in a browser.

@kerrie-wu kerrie-wu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kerrie-wu kerrie-wu merged commit 7f21ff7 into main Jul 6, 2026
15 checks passed
@kerrie-wu kerrie-wu deleted the revert-4787-revert-4738-WOODPECKER-4406 branch July 6, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: claude dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code minor Non breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants