Repository navigation
fix(cli): retire generate --output, which was declared, documented and never read (objectui#11476) - #11487
Conversation
…and never read (objectui#11476) `objectui generate` declared `--output DIR` (documented default `schemas/`), but the action called `generate(type, name)` without it, so the flag did nothing: files always landed in the generator's per-type layout. Triage ruled it retired with no alias window. The option line and its docs row are removed; commander's default refusal of unknown options now rejects it. Pins in cli-bin.test.ts, through the built bin: `g page Probe --output custom/` exits non-zero naming the option and writes nothing; `g page Probe` still writes `pages/probe.json`; `generate --help` no longer lists `--output`. Claude-Session: https://claude.ai/code/session_01YLg8XqWGJ785fwQ5v4pH37 Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: PR objectui#11487 (card objectui#11476), judged against triage's ruling ① Derived judgments
Nothing in the diff is judged wrong. ② Semver level
③ Boundary flagsDev report
Check-runs on the head43 check-runs on Implemented-by: VERDICT: PASS |
Fixes #11476
Clause-②: yes
What
objectui generatedeclared--output DIR(documented defaultschemas/), and the CLI docs listed it. The action never read it. It callsgenerate(type, name), and the generator writes in its own per-type layout under the current directory. Triage ruled the flag retired at once, with no alias window (ruling comment5955124315on the card). This PR:--outputoption line from thegeneratecommand inpackages/cli/src/cli.ts;--outputrow from thegenerateflag table incontent/docs/utilities/cli.mdx. Only that row is touched, region-disjoint from draft PR objectui#11069, which edits the same file elsewhere;--outputfrom thegeneraterow of the "exposes the documented flags" table incli-bin.test.ts, and adds three built-CLI pins;.changeset/11476-retire-generate-output.md(@object-ui/climinor, BREAKING banner, a FROM → TO line, a Clause-② line).No new refusal code was needed. The program sets no
allowUnknownOption,passThroughOptionsorallowExcessArguments, so commander's default refusal applies once the option is undeclared. I measured this on the BASE build before touching anything:g page Probe --bogus custom/exits 1 witherror: unknown option '--bogus'and writes nothing.Serial: PR objectui#11473 (the same generator, triage's named predecessor) landed as
5429e6c74and is an ancestor of this branch (merge-base --is-ancestorexit 0).generate.tsis not edited here.Contract notes
objectuibin'sgeneratecommand no longer accepts--output. FROMobjectui generate TYPE NAME --output DIR(exit 0, flag ignored, file written in the per-type layout) TO a non-zero exit with commander's unknown-option error and nothing written. There is no alias, no deprecation window and no silent accept.generatewrites exactly where it wrote before:pages/NAME.jsonfor a page,objects/NAME.jsonfor an object,plugins/NAME/for a plugin. No exported symbol of@object-ui/climoves, becausecli.tsis the bin entry and not part of the package'sexports.--from SOURCEis untouched. It is a separate declared-but-unimplemented flag (see Acceptance notes), and not this card's.Pins
They live in
packages/cli/src/__tests__/cli-bin.test.tsand run through the builtdist/cli.js, undergenerate refuses the retired --output flag (objectui#11476):exits non-zero naming --output as an unknown option, and writes nothing: runsg page Probe --output custom/in an empty temp directory. It asserts a non-zero exit, that stderr names the kind (unknown option) and the option (--output), and that the directory stays empty.still writes pages/NAME.json when the flag is absent: the control the refusal is read against. It is the same command without the flag, and it asserts exit 0 and a tree of exactlypagesandpages/probe.json.does not list --output in generate --help: carries a lit control that the help text read is generate's own (--from SOURCEis listed).Reverse verification
I wrote each prediction down before its run.
2c0ddf226, before the fix was built. Predicted: pins 1 and 3 red, pin 2 green. Observed:Tests 2 failed | 41 passed (43). Pin 1 failed onexpected +0 not to be +0, with stdout✓ Generated page schema: …/pages/probe.json. Pin 3 failed onexpected 'Usage: objectui generate|g [options] …' not to match /--output\b/.c0dad4b52. The option line was then planted back through objectstack'sscripts/ablation-replace.mjsin wrap mode, with its restore trap. Anchor count wentx1 -> x0, replacementx0 -> x1, blob6b9bbbbf7eb6 -> 3b73365ae916, which is byte-for-byte the BASE blob ofcli.ts. Mutant source marker 1; CLI rebuilt; mutantdist/cli.jsmarker 1. Predicted the same two reds. Observed:Tests 2 failed | 41 passed (43), failing on the same two names.git checkout HEAD --on the absolute path. Blob after restore equals the HEAD blob (6b9bbbbf7eb6),git diff HEADis empty andgit status --porcelainis empty. CLI rebuilt; restoreddist/cli.jsmarker 0;Tests 43 passed (43).ablation-replacerefused it (anchor count1 -> 1) and restored before the wrapped leg ran. I re-anchored across the line boundary and ran it again; that is the run above.ablation-dist-preflight.mjsis rooted in the objectstack tree, so I proved the dist side by hand:grep -cof the option spelling inpackages/cli/dist/cli.js, on both legs.Tests and gates
Everything below ran on final head
c0dad4b52.pnpm --filter @object-ui/cli build: exit 0. The dist carries 0 hits of the--output DIRspelling, against 1 for the--from SOURCEcontrol.pnpm --filter @object-ui/cli type-check(tsc --noEmit): exit 0.--listFilesshows it covers bothcli.tsandcli-bin.test.ts.pnpm exec vitest run packages/cli/plus four cross-package readers ofcli.mdxor of the generator (page-node-headings-drawn-11436,toc-anchor-parity,nested-page-children-11223,body-dialect-census):Test Files 28 passed (28),Tests 497 passed (497).node packages/cli/dist/cli.js g page Probe --output custom/exits 1 witherror: unknown option '--output', and the directory stays empty. The same command without the flag exits 0 and writespages/probe.json.pnpm docs:check-links:Links are valid across 17 scan roots.pnpm check:doc-fences: ✅node scripts/markdown-test-inputs.mjs --audit:all adjudicated … all present.pnpm check:control-bytes: ✅ OKpnpm check:new-line-citations:VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0node scripts/check-changeset-presence.mjs: ✅.check-changeset-no-major.mjs: ✅.check-changeset-overwrite.mjs: ✅pnpm check:changeset-claims(report-only): two pending changesets name a file this change touches.7658-toc-code-span-anchor-paritynamescli.mdxfor its headings, and7694-chart-series-chart-type-alias-refusalnamescli.tsas the home ofobjectui validate. I re-read both paragraphs, and both are still true.check-doc-component-types.mjsandcheck-doc-example-ids.mjs: ✅turbo run lint, which runs@object-ui/cli'seslint srcagainst the rooteslint.config.js(the package has no config of its own). I ran that sameeslint src. ②--format jsoncounts 51 files linted, equal to the 51 tracked ts/js files underpackages/cli/src. It reports 0 errors and 5no-explicit-anywarnings, all in untouched files; both edited files read 0/0. ③ Invariance: the config enables no type-aware linting (noparserOptions.projectorprojectService) and no import-graph plugin, and no rule undereslint-rules/reads the filesystem. So this diff cannot move a verdict on a file it does not touch.cli.mdxand the changeset sit outside every eslintfilesglob. The repo-widepnpm lintis left to CI.check-doc-snippet-types(the docs edit removes one table row and touches no fenced block), and the fullpnpm test(CI's).origin/mainhas since moved by PR objectui#11481 (sidebar, shadcn patches, an e2e spec), which shares no file with this diff. I did not merge it, because the merge queue rebuilds on currentmain.Acceptance notes
--from SOURCEon the same command, measured on the BASE build:g page Probe --from openapi.yamlprints "not yet implemented", exits 0 and writes nothing. Its docs row marks it experimental. It is a separate declared-not-enforced flag. It is left untouched here and reported to the dispatching seat.Implemented by the os-dev agent dispatched by the
domain:uiseat 1 PM, sessionhttps://claude.ai/code/session_01YLg8XqWGJ785fwQ5v4pH37.Generated by Claude Code