Repository navigation
Conversation
📝 WalkthroughWalkthroughThis PR extends the ChangespackageManager Propagation in Deploy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
.packageManager from the workspace to the deployed package.json
There was a problem hiding this comment.
Pull request overview
This PR updates pnpm deploy to preserve the workspace root packageManager setting by copying it into the generated/deployed package.json, addressing pnpm issue #9079 (Corepack selecting an unintended pnpm version in deployed outputs).
Changes:
- Pass the workspace root manifest into the shared-lockfile deploy flow so the deployed manifest can inherit
packageManager. - Extend deploy file generation to set
manifest.packageManagerfrom the root manifest (fallback to the selected project manifest if needed). - Add a changeset to publish the fix as a patch.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| releasing/commands/src/deploy/deploy.ts | Passes rootProjectManifest into createDeployFiles() during shared-lockfile deploy. |
| releasing/commands/src/deploy/createDeployFiles.ts | Writes packageManager into the deployed package.json based on the root manifest. |
| .changeset/deploy-copy-package-manager.md | Release note for the deploy behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lockfileDir, | ||
| patchedDependencies: opts.patchedDependencies, | ||
| rootProjectManifest: opts.rootProjectManifest, | ||
| selectedProjectManifest: selectedProject.manifest, |
| dependencies: targetSnapshot.dependencies, | ||
| devDependencies: targetSnapshot.devDependencies, | ||
| optionalDependencies: targetSnapshot.optionalDependencies, | ||
| packageManager: rootProjectManifest?.packageManager ?? selectedProjectManifest.packageManager, | ||
| }, |
| "@pnpm/releasing.commands": patch | ||
| "pnpm": patch | ||
| --- | ||
|
|
||
| `pnpm deploy` should copy the `packageManager` from the workspace `package.json` to the deployed `package.json`. |
Benchmark Results
Run 26787569224 · runs per scenario · triggered by @zkochan |
|
Quite a few subtle parts of this change apparently and I don't have the context to test that deeply. Happy for someone to continue on, sorry for drafting here rather than on my own fork. |
(Hopefully a) fix for #9079
Summary by CodeRabbit
Bug Fixes
pnpm deploycommand now correctly copies thepackageManagerfield from the workspace root configuration to the deployed package.json, ensuring consistent package manager settings across deployments.