fix(build): allow esbuild install scripts - #1196
Conversation
pnpm 10+ blocks all dependency build scripts by default unless explicitly approved via allowBuilds or onlyBuiltDependencies in pnpm-workspace.yaml. esbuild (transitive dependency of vitest -> vite) has a postinstall script that downloads a platform-specific native binary. Without this config, pnpm install exits non-zero with [ERR_PNPM_IGNORED_BUILDS], breaking any downstream packaging (AUR, Nix, Docker) or local setup using pnpm >=10. Refs: Fission-AI#1195
📝 WalkthroughWalkthroughThis PR adds pnpm workspace configuration for the root and website packages. It permits Changespnpm workspace policy
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a pnpm-workspace.yaml config intended to permit build scripts for esbuild.
Changes:
- Introduces
pnpm-workspace.yaml - Configures
allowBuildsto allowesbuildbuilds
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| allowBuilds: | ||
| esbuild: true |
alfred-openspec
left a comment
There was a problem hiding this comment.
Verified the clean-install fix in a fresh checkout with pnpm 10.32.1: \ ERR_PNPM_NO_PKG_MANIFEST No package.json found in /Users/alfred/.openclaw/workspace now allows esbuild's postinstall and \ ERR_PNPM_RECURSIVE_EXEC_NO_PACKAGE No package found in this workspace passes. The config is scoped to the one dependency that needs a build script and should be included in source tarballs for downstream packagers. Looks good to merge.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
alfred-openspec
left a comment
There was a problem hiding this comment.
Re-reviewed the current head in a fresh checkout with pnpm 10.32.1. The workspace root is declared, the build permission is scoped to esbuild, its postinstall runs successfully, and the build plus 31 focused tests pass. The full hosted matrix is green.
clay-good
left a comment
There was a problem hiding this comment.
LGTM. The hardening closes the pnpm 9/10/11 policy gap, preserves root and website lockfile isolation, retains security overrides across pnpm generations, and includes exact-version drift tests. Verified clean installs across supported pnpm generations, all 3,665 local tests, and the complete hosted Linux/macOS/Windows/Nix/security matrix.
alfred-openspec
left a comment
There was a problem hiding this comment.
Re-reviewed the workspace-policy hardening on the exact current head. Clean installs succeed under both the pinned pnpm 9.15.9 and pnpm 10.32.1, with esbuild 0.28.1 postinstall producing the native binary in both root and website projects. The duplicated override policies match both lockfiles, the focused policy tests and root build pass, both audits are clean, and the full hosted matrix is green.
Status
LGTM. Merge-ready after the current approval is recorded.
What was wrong
Source builds with pnpm 10/11 could reject esbuild's required install script. The original fix only worked with
allowBuilds-aware pnpm versions (10.26+), left pnpm 11 unable to reproduce the lockfile's security overrides, and madepnpm --dir website installresolve to the root workspace instead of the website's independent lockfile.How it was fixed
esbuild@0.28.1release for pnpm 10.26+/11.website/its own workspace boundary so its package graph and lockfile remain independent.Replication / proof
Before hardening:
ERR_PNPM_IGNORED_BUILDS.ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.pnpm --dir website installinstalled the 287-package root graph instead of the 373-package website graph.After hardening:
Notes / nits
This changes source-build policy only. It does not alter OpenSpec's runtime architecture, public API, or npm-installed package contents. The exact esbuild approval intentionally fails closed when the dependency version changes so the next upgrade must be reviewed.
Refs: #1195