Repository navigation
fix: stop writing pnpm onlyBuiltDependencies on scaffold - #1955
Conversation
pnpm 12 ignores package.json#pnpm settings; keep allowBuilds in pnpm-workspace.yaml only. Fixes #1953. Co-authored-by: Yam Borodetsky <[email protected]>
🦋 Changeset detectedLatest commit: 51b39e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@arkenv/agent-plugin
arkenv
@arkenv/build
@arkenv/bun-plugin
@arkenv/core
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/nuxt
@arkenv/rsbuild-plugin
@arkenv/standard
@arkenv/tanstack-addon
@arkenv/vite-plugin
commit: |
There was a problem hiding this comment.
ℹ️ No critical issues — the core change is correct. One changelog wording nit and one compatibility note below.
Reviewed changes
- Stop mutating
package.jsonfor pnpm —configurePnpmBuildsinpackages/arkenv/src/features/scaffold/executor.tsno longer reads or writespackage.json#pnpm.onlyBuiltDependencies; it only writes/mergespnpm-workspace.yaml#allowBuilds(esbuild: true). - Test coverage for the yaml-only path — the pnpm case in
executor.test.tsnow asserts nopackage.jsonwrite happens and that theallowBuildsyaml write still occurs; the npm case asserts nopackage.jsonwrite. - Detection fixtures bumped —
pnpm/9.x→pnpm/12.5.1user agents inreporters.test.tsandspawner.test.ts; family-level detection is unchanged, so this is cosmetic. - Changeset —
arkenvpatch describing the behavior change.
I verified the upstream contract this rests on: pnpm-workspace.yaml#allowBuilds is a real build-approval key (added in pnpm 10.26.0, per https://pnpm.io/settings/build#allowbuilds and https://github.com/pnpm/pnpm/releases/tag/v10.26.0), and since pnpm v11 pnpm no longer reads settings from package.json#pnpm (https://pnpm.io/package_json), so the removed write was genuinely dead on 12.5.1.
ℹ️ Scaffold build approval is narrowed for pnpm 10.0–10.25
Before this change the scaffold wrote both paths, so on pnpm 10.0–10.25 — which still read package.json#pnpm and predate allowBuilds — the package.json write was the only recognized one. After this change those users get no approval and will see pnpm's "ignored build scripts" warning after scaffolding esbuild. This is likely acceptable given the pnpm 12 target, but the repo documents no minimum pnpm version, so it may be worth either stating the floor or noting it in the changeset text.
Technical details
# pnpm build-approval compatibility floor
## Affected sites
- `packages/arkenv/src/features/scaffold/executor.ts:302` — `configurePnpmBuilds` now writes only `pnpm-workspace.yaml#allowBuilds`.
- `.changeset/pnpm12-scaffold-allowbuilds-only.md:7` — says "pnpm 12 ignores" but the field stopped being read in pnpm 11.
## Evidence
- `allowBuilds` introduced in pnpm 10.26.0 (https://github.com/pnpm/pnpm/releases/tag/v10.26.0); consolidated replacement for `onlyBuiltDependencies` in v11 (https://pnpm.io/migration).
- `package.json#pnpm` no longer read since v11 (https://pnpm.io/package_json).
## Required outcome
- Decide and, if needed, document the supported pnpm floor for scaffolded projects (or confirm 10.0–10.25 is out of scope).
## Open questions for the human
- Is pnpm < 10.26 in scope for scaffold output? If yes, the pre-`allowBuilds` `onlyBuiltDependencies` key (in `pnpm-workspace.yaml`, honored by pnpm 10.x) would need to be considered, not only `allowBuilds`.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Align changelog and comments with pnpm 11+ ignoring package.json#pnpm and allowBuilds since 10.26.0. Co-authored-by: Yam Borodetsky <[email protected]>
|
Addressed Pullfrog review feedback:
|
|
@pullfrog review |
There was a problem hiding this comment.
ℹ️ No critical issues — one assertion nit and a scope note.
Reviewed changes
- Drop dead
package.json#pnpmscaffold write —configurePnpmBuildsno longer rewritespackage.json#pnpm.onlyBuiltDependencies;pnpm-workspace.yaml#allowBuildsis now the only build-approval path. - Tests updated — the pnpm whitelisting test now asserts
package.jsonis never written andallowBuildsis; the npm negative assertion was widened toexpect.any(String). - Detection fixtures refreshed —
reporters/spawneruser-agent fixtures bumped frompnpm/9.xtopnpm/12.5.1; family-level detection is unchanged. - Changeset — new
arkenvpatch documenting the yaml-only path and the 10.26.0 floor.
ℹ️ pnpm 10.0–10.25 scaffolds lose their only working build-approval path
The removal is correct for pnpm 11+/12, where v11 deleted onlyBuiltDependencies in favour of allowBuilds, and the changeset's 10.26.0 floor is accurate per the pnpm docs. But the deleted block was also the fallback that pnpm 10.0–10.15 actually honored, and allowBuilds is only recognized from 10.26.0. A scaffold run under pnpm 10.0–10.25 therefore gets neither path, so esbuild builds are left unapproved and strictDepBuilds (default on since 10.3.0) can fail the install. This matches the scoped target (12.5.1) the PR and issue call out, so it's an acknowledgement rather than a request — just flagging that the window is now silent for those users.
Technical details
# pnpm 10.0–10.25 build-approval gap after package.json removal
## Affected sites
- `packages/arkenv/src/features/scaffold/executor.ts:302` — `configurePnpmBuilds` now only calls `updatePnpmWorkspaceYaml`, which emits `allowBuilds` unconditionally (no version guard).
- `.changeset/pnpm12-scaffold-allowbuilds-only.md:7` — documents only the 10.26.0 floor, not the loss of the pre-10.16 `package.json#pnpm` path.
## Required outcome
- Confirm that dropping pre-10.26 pnpm build approval is intended (the issue lists 10.0–10.25 as out of scope).
- If pre-10.26 support matters later, the only reliable signal would be a version check, since CLI detection is family-level.
## Open questions for the human
- Is pnpm 10.0–10.25 officially unsupported for scaffolding, or should the changeset note the regression explicitly?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The stronger not-called-with package.json + any(String) already covers the onlyBuiltDependencies case. Co-authored-by: Yam Borodetsky <[email protected]>
|
Addressed latest Pullfrog review:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run covers the delta since the prior Pullfrog review at a99961e7 — one test-only commit:
- Dropped the redundant
onlyBuiltDependenciesassertion —executor.test.tsnow keeps onlyexpect(mockWorkspace.writeFile).not.toHaveBeenCalledWith(expect.stringContaining("package.json"), expect.any(String)). That form is strictly stronger than the removedonlyBuiltDependencies-scoped assertion, so the "never mutatespackage.json" contract is preserved with no coverage loss. This implements the prior review's suggestion exactly; that thread is resolved.
The runtime change (configurePnpmBuilds writing only pnpm-workspace.yaml#allowBuilds) is unchanged from the previously reviewed commit. The pnpm 10.0–10.25 compatibility window remains an acknowledged, human-confirmed scope decision (issue #1953 Path 2 targets 12.5.1), so no further action is requested.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Fixes #1953
Summary
Path 2 compat audit for pnpm 12.5.1 (Nub stays monorepo identity):
package.json#pnpm.onlyBuiltDependencies(ignored under pnpm 11+).pnpm-workspace.yaml#allowBuildsfor approved native deps (esbuild) — supported since pnpm 10.26.0.package.jsonis not mutated for pnpm whitelisting.pnpm/12.5.1(family-level detection unchanged).pnpm dlx/pnpm add) left as-is after review..pnpmfile.mjsreintroduced; rootpackageManagerremains[email protected].Review follow-up
package.json#pnpm;allowBuildsfrom 10.26.0.onlyBuiltDependenciestest assertion (covered by strongerpackage.jsoncheck).Validation