Repository navigation
fix(release): keep the pack-app config inside the packed project - #12801
Conversation
The Release job for 11.10.0 failed at the Publish `@pnpm/exe` step with ERR_PNPM_PACK_APP_ENTRY_OUTSIDE_PROJECT: the pack-app hardening from #12669 rejects entry/output paths that escape the project directory, and the `@pnpm/exe` build config used exactly that shape (entry "../../pnpm.cjs", outputDir ".." relative to pnpm11/pnpm/artifacts/exe). Move the pnpm.app config to pnpm11/pnpm/package.json (entry "pnpm.cjs", outputDir "artifacts") and run pack-app from the pnpm package root in build-artifacts.ts. Output paths are unchanged (pnpm11/pnpm/artifacts/<target>/pnpm), and the guard stays strict instead of being loosened to a workspace-root anchor, which would re-allow embedding files from outside the packed project.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe pnpm.app bundling configuration (entry, outputDir, outputName, targets) is moved from artifacts/exe/package.json to the root package.json. The build-artifacts.ts script's execa.sync call now runs with cwd set to pnpmRootDir instead of exeDir, and related comments are updated. Changespnpm.app Configuration Relocation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix release pack-app config to stay within pnpm project
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require review
Previous review resultsReview updated until commit cf5d5f2 Results up to commit cf5d5f2
Great, no issues found!Qodo reviewed your code and found no material issues that require review
|
|
Code review by qodo was updated up to the latest commit cf5d5f2 |
Summary
The 11.10.0 Release job failed at the "Publish
@pnpm/exe" step withERR_PNPM_PACK_APP_ENTRY_OUTSIDE_PROJECT. The pack-app hardening introduced in #12669 rejects entry and output-dir paths that escape the project directory, and our own@pnpm/exebuild config used exactly that shape:entry: "../../pnpm.cjs"andoutputDir: ".."relative topnpm11/pnpm/artifacts/exe. This path is only exercised by the Release workflow, which is why CI didn't catch it before the release ran.Fix: keep the guard strict and restructure the config so nothing escapes the project.
pnpm.appblock topnpm11/pnpm/package.jsonwithentry: "pnpm.cjs"andoutputDir: "artifacts"(the app being packed is pnpm, so the config now lives on the package that owns the entry).build-artifacts.ts(cwd: pnpmRootDirinstead ofexeDir).Output paths are unchanged: binaries still land in
pnpm11/pnpm/artifacts/<target>/pnpm, so the copy/publish steps downstream are unaffected. Thepnpmfield is stripped frompackage.jsonon publish, so nothing new ships in the publishedpnpmpackage, and the config reader already whitelistspnpm.appas an actively-read key (no unknown-field warning on install).Verified by running
node dist/pnpm.mjs pack-app --runtime [email protected] --target darwin-arm64frompnpm11/pnpm— the invocation shapebuild-artifacts.tsnow produces. Both guards pass and the SEA binary is built at the same output path as before.Loosening the guard to a workspace-root anchor was considered and rejected: it would re-allow embedding files from outside the packed project (e.g. a workspace-root
.npmrc) into a distributable binary, and would require mirroring the behavior change in pacquet's pack-app port.Squash Commit Body
Checklist
pacquet/port, or the description notes what still needs porting.(No pacquet change needed: the pack-app guard itself is untouched; this
only moves pnpm11 release configuration.)
pnpm changeset) if this PR changes any publishedpackage. (No changeset: the
pnpmfield is stripped on publish andscripts/is not in@pnpm/exe's files list, so published packagecontents are unchanged.)
configuration; verified by running pack-app end-to-end locally.)
Written by an agent (Claude Code, claude-fable-5).
Summary by CodeRabbit