Skip to content

fix: stop writing pnpm onlyBuiltDependencies on scaffold - #1955

Merged
yamcodes merged 3 commits into
v1from
cursor/pnpm12-scaffold-compat-24f0
Sep 22, 2026
Merged

yamcodes merged 3 commits into
v1from
cursor/pnpm12-scaffold-compat-24f0

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1953

Summary

Path 2 compat audit for pnpm 12.5.1 (Nub stays monorepo identity):

  • Scaffold no longer mutates package.json#pnpm.onlyBuiltDependencies (ignored under pnpm 11+).
  • Scaffold still writes / merges pnpm-workspace.yaml#allowBuilds for approved native deps (esbuild) — supported since pnpm 10.26.0.
  • Tests assert the yaml path and that package.json is not mutated for pnpm whitelisting.
  • Detection fixture user agents bumped to pnpm/12.5.1 (family-level detection unchanged).
  • Public install tabs (pnpm dlx / pnpm add) left as-is after review.
  • No .pnpmfile.mjs reintroduced; root packageManager remains [email protected].

Review follow-up

  • Clarified changeset / comments: pnpm 11+ ignores package.json#pnpm; allowBuilds from 10.26.0.
  • Dropped redundant onlyBuiltDependencies test assertion (covered by stronger package.json check).
  • pnpm 10.0–10.25 left out of scope for scaffold build approval (matches Path 2 / 12.5.1).

Validation

  • Scaffold executor tests green after review fixes
  • Prior full suite / typecheck / check green on earlier commits
Open in Web Open in Cursor 

pnpm 12 ignores package.json#pnpm settings; keep allowBuilds in
pnpm-workspace.yaml only. Fixes #1953.

Co-authored-by: Yam Borodetsky <[email protected]>
@changeset-bot

changeset-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 51b39e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
arkenv Patch

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

@yamcodes yamcodes added @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI arkenv Changes to the `arkenv` npm package. dependencies Pull requests that update a dependency file enhancement New feature or improvement maintenance Routine tasks, tooling, and syncs tests This issue or PR is about adding, removing or changing tests labels Sep 22, 2026 — with Cursor
@github-actions github-actions Bot added docs Adds or changes documentation, or acts as documentation in and of itself and removed @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI labels Sep 22, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@arkenv/agent-plugin

npm i https://pkg.pr.new/@arkenv/agent-plugin@1955

arkenv

npm i https://pkg.pr.new/arkenv@1955

@arkenv/build

npm i https://pkg.pr.new/@arkenv/build@1955

@arkenv/bun-plugin

npm i https://pkg.pr.new/@arkenv/bun-plugin@1955

@arkenv/core

npm i https://pkg.pr.new/@arkenv/core@1955

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/@arkenv/fumadocs-ui@1955

@arkenv/nextjs

npm i https://pkg.pr.new/@arkenv/nextjs@1955

@arkenv/nuxt

npm i https://pkg.pr.new/@arkenv/nuxt@1955

@arkenv/rsbuild-plugin

npm i https://pkg.pr.new/@arkenv/rsbuild-plugin@1955

@arkenv/standard

npm i https://pkg.pr.new/@arkenv/standard@1955

@arkenv/tanstack-addon

npm i https://pkg.pr.new/@arkenv/tanstack-addon@1955

@arkenv/vite-plugin

npm i https://pkg.pr.new/@arkenv/vite-plugin@1955

commit: 51b39e2

@yamcodes yamcodes removed the docs Adds or changes documentation, or acts as documentation in and of itself label Sep 22, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the core change is correct. One changelog wording nit and one compatibility note below.

Reviewed changes

  • Stop mutating package.json for pnpm — configurePnpmBuilds in packages/arkenv/src/features/scaffold/executor.ts no longer reads or writes package.json#pnpm.onlyBuiltDependencies; it only writes/merges pnpm-workspace.yaml#allowBuilds (esbuild: true).
  • Test coverage for the yaml-only path — the pnpm case in executor.test.ts now asserts no package.json write happens and that the allowBuilds yaml write still occurs; the npm case asserts no package.json write.
  • Detection fixtures bumped — pnpm/9.x → pnpm/12.5.1 user agents in reporters.test.ts and spawner.test.ts; family-level detection is unchanged, so this is cosmetic.
  • Changeset — arkenv patch 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`.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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]>
@yamcodes

Copy link
Copy Markdown
Owner Author

Addressed Pullfrog review feedback:

  • Clarified changeset wording: package.json#pnpm ignored on pnpm 11+; yaml allowBuilds from 10.26.0
  • Matched JSDoc / test comments to the same floor
  • Confirmed pnpm 10.0–10.25 is out of scope for this scaffold change (Path 2 / 12.5.1 target)

@github-actions github-actions Bot added the docs Adds or changes documentation, or acts as documentation in and of itself label Sep 22, 2026
@yamcodes

Copy link
Copy Markdown
Owner Author

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one assertion nit and a scope note.

Reviewed changes

  • Drop dead package.json#pnpm scaffold write — configurePnpmBuilds no longer rewrites package.json#pnpm.onlyBuiltDependencies; pnpm-workspace.yaml#allowBuilds is now the only build-approval path.
  • Tests updated — the pnpm whitelisting test now asserts package.json is never written and allowBuilds is; the npm negative assertion was widened to expect.any(String).
  • Detection fixtures refreshed — reporters/spawner user-agent fixtures bumped from pnpm/9.x to pnpm/12.5.1; family-level detection is unchanged.
  • Changeset — new arkenv patch 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?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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]>
@yamcodes

Copy link
Copy Markdown
Owner Author

Addressed latest Pullfrog review:

  • Dropped the redundant onlyBuiltDependencies not.toHaveBeenCalledWith (covered by the stronger package.json assertion)
  • Reconfirmed: pnpm 10.0–10.25 scaffold build-approval gap is intentional / out of scope for Path 2 (12.5.1)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 onlyBuiltDependencies assertion — executor.test.ts now keeps only expect(mockWorkspace.writeFile).not.toHaveBeenCalledWith(expect.stringContaining("package.json"), expect.any(String)). That form is strictly stronger than the removed onlyBuiltDependencies-scoped assertion, so the "never mutates package.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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@yamcodes
yamcodes merged commit ae3039a into v1 Sep 22, 2026
19 checks passed
@yamcodes
yamcodes deleted the cursor/pnpm12-scaffold-compat-24f0 branch September 22, 2026 18:18
@arkenv-bot arkenv-bot Bot mentioned this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arkenv Changes to the `arkenv` npm package. dependencies Pull requests that update a dependency file docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement maintenance Routine tasks, tooling, and syncs tests This issue or PR is about adding, removing or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate / adopt pnpm 12 (deferred from #1944)

2 participants