Skip to content

fix(scripts): spell pnpm flags so a global pnpm 11+/12 frontend parses them (--config.production=false, --silent) - #23777

Merged
hotlong merged 1 commit into
mainfrom
claude/pnpm-frontend-flag-spellings
Oct 16, 2026
Merged

hotlong merged 1 commit into
mainfrom
claude/pnpm-frontend-flag-spellings

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Problem

A contributor whose globally installed pnpm is a newer @pnpm/exe frontend (11.x / 12.x) cannot get pnpm dev past check:console-sha once the objectui pin moves. The repo pins packageManager: pnpm@10.31.0, and pnpm --version dutifully reports 10.31.0 — but the new frontend parses the argv itself (clap-style) before it hands off to the pinned version, and it rejects two spellings this repo's scripts use:

spelling where new frontend says
pnpm install … --prod=false scripts/build-console.sh (pnpm objectui:build) error: unexpected value 'false' for '--prod' found; no more were expected — exit 2, nothing installed
pnpm -s SCRIPT packages/spec/scripts/check-generated.ts (every check:generated gate), scripts/check-regen-pending.mjs (the pre-commit regen gate), ownerRunCommand({ silent }) error: unexpected argument '-s' found — exit 2, which those callers read as "stale"

CI never sees it: Corepack runs the real pnpm 10.31 binary directly, which accepts all of these.

Change

  • build-console.sh: --prod=false → --config.production=false.
  • Every spawned pnpm -s → pnpm --silent (the long form of the same flag): check-generated.ts, check-regen-pending.mjs, regen-artifacts.mjs ownerRunCommand, and the self-test pin for it in git-merge-regen.mjs. Comments that describe the spawn follow; two comments that record a historical measurement taken with pnpm -s are left as written.
  • dispatch-gates.mjs names pnpm -s ${script} as a live specimen of the shell-form class; the specimen and its self-test fixture string now read --silent.

No workflow change: every .github/workflows/** call already spells --silent.

Evidence

All probes in a scratch workspace pinned to packageManager: pnpm@10.31.0, run with both binaries: OLD = the real pnpm 10.31.0 @pnpm/exe binary (what CI runs), NEW = the global @pnpm/exe 12.3.4 frontend.

Install: which spelling parses on both AND still installs devDependencies. One dependency + one devDependency; dev= is whether the devDependency landed. First, the controls — what actually turns production mode on under pnpm 10.31 (measured, OLD, no flag):

context dev
nothing yes
NODE_ENV=production yes — pnpm 10 does not skip devDependencies on NODE_ENV alone
npm_config_production=true no
.npmrc production=true no
--prod no

Then each candidate, against the two contexts that do skip devDependencies (identical rows for both contexts, so shown once):

spelling OLD NEW
(none) rc 0, dev no rc 0, dev no
--prod=false rc 0, dev yes rc 2, unexpected value
--production=false rc 0, dev yes rc 2, unexpected value
--no-production rc 0, dev yes rc 2, unexpected argument
--no-prod rc 0, dev yes rc 0, dev yes
--config.production=false rc 0, dev yes rc 0, dev yes

--config.production=false is chosen over --no-prod because the new frontend's own help documents --config.KEY=VALUE as a universal rc-option, and it names the exact setting being overridden.

Run: --silent is byte-identical to -s. For a root script and a --filtered one, each both passing and failing (exit 3 / 4): stdout, stderr and exit code of OLD -s compared with cmp against OLD --silent and NEW --silent — 8/8 identical (--reporter=silent also 8/8). Control: -s vs no flag differs, so the comparison is live. --loglevel=silent is NOT equivalent (still prints the > pkg script header).

Sweep: nothing else the repo spells is rejected. Every other option shape the repo's scripts pass to pnpm (--filter/--filter=, -r list --depth -1 --json, exec … -e, trailing script args such as --maxWorkers=2 --update -e x, run x -- --y, install --no-frozen-lockfile / --offline, pack --pack-destination … --silent, store path --silent, -v) parses identically under OLD and NEW.

Repo, under the global 12.3.4 shim, no PATH workaround (command -v pnpm → ~/Library/pnpm/bin/pnpm):

command before (main 0326b32952) after (this branch)
pnpm objectui:build exit 2 at the objectui install rc 0 — install ran (Packages: +1566, devDependencies included), console dist built; pnpm check:console-sha then passes, so pnpm dev gets past it
pnpm --filter @objectstack/spec check:generated rc 1, 14/14 gates red, each unexpected argument '-s' rc 0, 14/14 up to date
node scripts/check-regen-pending.mjs --self-test rc 1 (the stub-gate cases red) rc 0
node scripts/git-merge-regen.mjs --self-test — rc 0
node scripts/pm/dispatch-gates.mjs --self-test — rc 0, 2144 cases

The "before" column is the same command with only the touched file restored from main into the working tree, after the fix was committed.

Repo, under the real pnpm 10.31.0 binary first on PATH (what CI runs): check:generated rc 0 (14/14), pnpm check:merge-driver rc 0, pnpm objectui:build rc 0. (In that run the objectui install was a no-op over the already-populated cache tree; the install semantics under 10.31 are the scratch table above.)

eslint over the six changed JS/TS files: clean. bash -n scripts/build-console.sh: clean.

Notes

  • No changeset: only scripts/** and packages/spec/scripts/** change, and neither ships in any published package (@objectstack/spec's files does not include scripts/) — skip-changeset.

Generated by Claude Code

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4fe8b3def02ff9803a52c2fb8b97778d5bf45597 → packageMentionDocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant