Skip to content

Migrate to pnpm - #2166

Merged
kibertoad merged 4 commits into
masterfrom
chore/pnpm
Jun 17, 2026
Merged

Migrate to pnpm#2166
kibertoad merged 4 commits into
masterfrom
chore/pnpm

Conversation

@kibertoad

Copy link
Copy Markdown
Contributor

pnpm is both a more secure and faster alternative to npm

@kibertoad
kibertoad requested a review from jaylinski June 14, 2026 20:46

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

This PR migrates the repository’s developer/CI workflows from npm to pnpm to improve install performance and align with a pinned package manager version.

Changes:

  • Switches CI/release pipelines, local scripts, and test harnesses from npm/npx to pnpm/pnpm exec/pnpm dlx.
  • Updates contributor and test documentation to use pnpm commands and adds a packageManager pin in package.json.
  • Introduces pnpm-workspace.yaml to configure build-script allowlisting.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/rspack/rspack.test.js Uses pnpm run build to ensure dist artifacts exist before rspack tests.
tests/browser/README.md Updates Docker-based browser test instructions to pnpm.
tests/browser/playwright.config.js Runs the Playwright web server via pnpm script.
tests/bench/size.js Updates the “run build first” message to reference pnpm.
tasks/version.js Uses pnpm for the build step during versioning workflow.
README.md Updates benchmark usage examples from npm to pnpm.
pnpm-workspace.yaml Adds pnpm workspace configuration (allowBuilds).
package.json Converts scripts to pnpm, switches npx to pnpm dlx, pins packageManager.
CONTRIBUTING.md Documents pnpm/Corepack-based setup and command updates.
.github/workflows/release.yml Migrates release workflow install/publish steps to pnpm with caching.
.github/workflows/ci.yml Migrates CI to pnpm with caching and adjusts Node test matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pnpm-workspace.yaml
Comment on lines +1 to +2
allowBuilds:
husky: true

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.

this is wrong, packages is optional

Comment thread CONTRIBUTING.md
Before building, you need to make sure that the Git submodule `spec/mustache` is included (i.e. the directory `spec/mustache` should not be empty). To include it, if using Git version 1.6.5 or newer, use `git clone --recursive` rather than `git clone`. Or, if you already cloned without `--recursive`, use `git submodule update --init`.

Project dependencies may be installed via `npm install`.
This project uses [pnpm](https://pnpm.io/) as its package manager (the required version is pinned in the `packageManager` field of `package.json`). The easiest way to get the right version is via [Corepack](https://nodejs.org/api/corepack.html), which ships with Node.js: run `corepack enable` once, and pnpm commands will automatically use the pinned version.

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.

addressed

Comment thread package.json
"test:serve": "npx serve -l 9999 .",
"test:integration": "npm run build && ./tests/integration/run-integration-tests.sh",
"test:serve": "pnpm dlx serve -l 9999 .",
"test:integration": "pnpm run build && ./tests/integration/run-integration-tests.sh",

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.

Intentional. The fixtures (rollup-test, webpack-test, multi-nodejs-test) deliberately use npm/nvm to simulate real downstream consumers installing the published package with different toolchains. Migrating them to pnpm would change what's being tested.

Comment thread tests/browser/README.md Outdated
pnpm run build
docker pull mcr.microsoft.com/playwright:focal
docker run -it --rm --volume $(pwd):/srv/app --workdir /srv/app --ipc=host mcr.microsoft.com/playwright:focal npm run test:browser
docker run -it --rm --volume $(pwd):/srv/app --workdir /srv/app --ipc=host mcr.microsoft.com/playwright:focal pnpm run test:browser

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.

addressed

Comment thread .github/workflows/ci.yml
Comment on lines 39 to +42
# https://nodejs.org/en/about/releases/
node-version: ['20', '22', '24']
# Node 20 is supported at runtime (see "engines" in package.json) but is
# not exercised in CI because pnpm >=11 requires Node >=22.13.
node-version: ['22', '24']

@jaylinski jaylinski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I'm very much in favor of switching to pnpm. npm is waking up regarding security, but who knows how long it will take them to actually ship those security features that pnpm already has.

Please have a look at the Copilot review, but from my point of view the PR is approved.

@kibertoad
kibertoad merged commit 6888645 into master Jun 17, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants