chore: compile pnpm CLI bundle before tests that use it#11059
Merged
Conversation
Packages whose tests spawn the local pnpm CLI (pnpm/bin/pnpm.mjs) need the bundle (pnpm/dist/pnpm.mjs) to exist. Add `pnpm --filter pnpm run compile` to their test scripts so the bundle is built before tests run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures packages whose tests invoke the workspace pnpm CLI (pnpm/bin/pnpm.mjs) build the bundled CLI output (pnpm/dist/pnpm.mjs) before running tests, so package-level pnpm test works in isolation.
Changes:
- Updated affected packages’
testscripts to compile the pnpm CLI bundle before running.test/jest. - Taught
.meta-updaterto keep thosetestscripts in sync for the 8 public packages. - Updated
@pnpm/test-ipc-server(private util) manually to do the same.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| store/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| releasing/exportable-manifest/package.json | Prepends pnpm CLI compile to test script before running .test. |
| releasing/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| lockfile/make-dedicated-lockfile/package.json | Prepends pnpm CLI compile to test script before running .test. |
| exec/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| deps/inspection/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| cache/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| building/commands/package.json | Prepends pnpm CLI compile to test script before running .test. |
| utils/test-ipc-server/package.json | Prepends pnpm CLI compile to test script before running jest. |
| .meta-updater/src/index.ts | Adds a maintained package set that gets the augmented test script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm/bin/pnpm.mjs) need the bundle (pnpm/dist/pnpm.mjs) to exist. This addspnpm --filter pnpm run compileto theirtestscripts so the bundle is built before tests run.meta-updaterto maintain this for the 8 public packages, and directly edited@pnpm/test-ipc-server(private/util, skipped by meta-updater).Affected packages:
@pnpm/building.commands,@pnpm/cache.commands,@pnpm/deps.inspection.commands,@pnpm/exec.commands,@pnpm/lockfile.make-dedicated-lockfile,@pnpm/releasing.commands,@pnpm/releasing.exportable-manifest,@pnpm/store.commands,@pnpm/test-ipc-serverTest plan
pnpm run meta-updater --test— confirms meta-updater produces the expected outputpnpm --filter @pnpm/cache.commands test(or any affected package) — verifies the CLI bundle is compiled before tests🤖 Generated with Claude Code