Repository navigation
fix(cli): retire generate --from, a declared flag whose no-op exited 0 (objectui#11488) - #11495
Conversation
…d 0 (objectui#11488)
`objectui generate` declared `--from <source>` ("Generate schema from
external source (openapi.yaml, prisma.schema)") and the CLI docs listed
it as experimental. Its branch printed "not yet implemented", exited 0
and wrote nothing, so a script read the no-op as success. Triage ruled
it retired at once, on the precedent of `--output` (objectui#11476).
- cli.ts: drop the option and its unreachable `options.from` branch;
commander's default unknown-option refusal now applies.
- cli.mdx: drop the generate flag table, whose last row it was.
- cli-bin.test.ts: the documented-flags row for generate now asserts
its positional arguments; the built-CLI refusal pin covers --from
next to --output, and the help pin asserts neither is listed.
- changeset: @object-ui/cli minor, BREAKING, FROM -> TO, Clause-②.
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#11495 (card objectui#11488), 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 #11488
Clause-②: yes
What
objectui generatedeclared--from SOURCE("Generate schema from external source (openapi.yaml, prisma.schema)"), and the CLI docs listed it as experimental. Its action branch printed "not yet implemented", exited 0 and wrote nothing, so a script or CI step read the no-op as success. Triage ruled it retired at once, with no placeholder and no alias (ruling comment5957399263on the card), on the precedent of--output(objectui#11476, PR objectui#11487). This PR is the same move for--from:packages/cli/src/cli.ts: removes the--fromoption line from thegeneratecommand, and theoptions.frombranch, which nothing can reach once the option is gone. The action now takes(type, name)only.content/docs/utilities/cli.mdx:--fromwas the last row of thegenerateflag table, so the whole table goes (header, separator and row). The section now reads like the other flagless commands (add,doctor): the headingobjectui generate TYPE NAME (alias g), "Generate new resources.", and the three-line example block. That matches whatobjectui generate --helpprints today: the two arguments and-h, --help, nothing else. Only that table is touched, region-disjoint from draft PR objectui#11069, which edits thevalidateandchecksections of the same file.packages/cli/src/__tests__/cli-bin.test.ts: thegeneraterow of "flag contracts (locked-in by docs)" now asserts the documented positional arguments (TYPE NAMEin the usage line), since it has no documented flag left. The objectui#11476 pins are extended to--from(see Pins)..changeset/11488-retire-generate-from.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(agrepofcli.tsfor those three spellings exits 1;allowUnknownOptionalone has 4 hits in commander's ownlib/command.js, so the pattern is live). Measured on the BASE build before any edit:g page Probe --bogus openapi.yamlexits 1 witherror: unknown option '--bogus'and writes nothing, andg page Probe --from openapi.yamlexits 0, prints the two "not yet implemented" lines and writes nothing (the card's reproduction, confirmed).Serial: PR objectui#11487 (objectui#11476) landed as
9de0b3483, which is this branch's base.Contract notes
objectuibin'sgeneratecommand no longer accepts--from. FROMobjectui generate TYPE NAME --from SOURCE(exit 0, "not yet implemented", nothing written) TO a non-zero exit with commander's unknown-option error and nothing written. No alias, no deprecation window, no placeholder that exits non-zero, 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.generate.tsis not edited. No exported symbol of@object-ui/climoves, becausecli.tsis the bin entry and not part of the package'sexports.git grep -n -- '--from'andgit grep -n -i 'not yet implemented'overpackages/cli,content/docs,packages/*/README.md,scriptsandexamples. Thegeneratehits are the four this PR edits (the option, the branch's message, the docs row, the two test lines). The other hits are unrelated spellings and are left alone: the DockerfileCOPY --from=builderline incontent/docs/guide/deployment.md, the--from claims.jsonflag ofscripts/render-changeset-claims-comment.mjsand its test, and the ObjectMap "API provider not yet implemented" sentence incontent/docs/plugins/plugin-map.mdx.packages/cli/README.mddocumentsgeneratewithout flags and needs no change.Pins
They live in
packages/cli/src/__tests__/cli-bin.test.tsand run through the builtdist/cli.js, in the describe now titledgenerate refuses its retired flags (objectui#11476, objectui#11488):exits non-zero naming %s as an unknown option, and writes nothing, anit.eachover--output custom/and--from openapi.yaml. Each case runsg page Probe FLAG VALUEin an empty temp directory and asserts a non-zero exit, that stderr names the kind (unknown option) and the flag, and that the directory stays empty. The--outputcase keeps the exact test name objectui#11476 gave it.still writes pages/NAME.json when the flag is absent: unchanged. It is the control both refusals are read against.lists neither --output nor --from in generate --help(wasdoes not list --output in generate --help). Its lit control used to be "--from SOURCEis listed", which this PR makes false, so the control moved to generate's own usage line (objectui generate|g … TYPE NAME).Reverse verification
I wrote each prediction down before its run.
9de0b3483, before the fix was built. Predicted: the--fromrefusal case and the help pin red, everything else green,Tests 2 failed | 42 passed (44). Observed:Tests 2 failed | 42 passed (44). The refusal case failed onexpected +0 not to be +0; the help pin failed onexpected 'Usage: objectui generate|g [options] …' not to match /--from\b/.5d1d51704. The option line and its branch were then planted back through objectstack'sscripts/ablation-replace.mjsin wrap mode, inside a script that also carries its owntraprestore on an absolute path. Anchorx1 -> x0, replacementx0 -> x1, blobab22eb7e6fa6 -> 6b9bbbbf7eb6, which is byte-for-byte the BASE blob ofcli.ts. Mutant source carried the option spelling once; the CLI was rebuilt; the mutantdist/cli.jscarried it once too. Predicted the same two reds. Observed:Tests 2 failed | 42 passed (44), on the same two names.git checkout HEAD --on the absolute path: blob after restoreab22eb7e6fa6equals the HEAD blob,git diff HEADis empty,git status --porcelainis empty. The CLI was rebuilt; the restoreddist/cli.jscarries the option spelling 0 times;Tests 44 passed (44).ablation-dist-preflight.mjsis rooted in the objectstack tree, so the dist side was proven by hand: agrep -cof the option spelling inpackages/cli/dist/cli.json each leg (BASE 1, mutant 1, fix and restore 0).Tests and gates
Everything below ran on final head
5d1d51704.pnpm --filter @object-ui/cli build: exit 0. The dist carries 0 hits of the--from SOURCEspelling and 0 of "not yet implemented", against 2 for the--watchcontrol.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 the 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 498 passed (498).node packages/cli/dist/cli.js g page Probe --from openapi.yamlexits 1 witherror: unknown option '--from', 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:115 candidate test files, all adjudicated; 82 declared entries, all present.pnpm check:control-bytes: ✅ OK. A self-scan of the four edited files for control bytes also comes back empty.pnpm 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, and this PR moves no heading.7694-chart-series-chart-type-alias-refusalnamescli.tsas the home ofobjectui validate, which it still is. I re-read both paragraphs, and both are still true.check-doc-component-types.mjs,check-doc-example-ids.mjs,check-shell-escape-residue.mjs,check-test-path-roots.mjs,check-vi-mock-override-shape.mjs: ✅node scripts/check-governed-queue-guard.mjs --testover the four paths:NOT GOVERNED.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 5 warnings, all in untouched files; both edited files read 0/0. ③ Invariance: the config enables no type-aware linting (noparserOptions,projectorprojectService) and no import 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 package'seslint src. The repo-widepnpm lintis left to CI.check-doc-snippet-types, reason: it exits 2 (PRECONDITION NOT MET, the 34 packages its snippets import are not built in this worktree). The docs edit removes one table and touches no fenced block, so the gate reads no changed input. CI runs it. The fullpnpm testis CI's as well.Acceptance notes
objectui add Inputprints "Feature not implemented yet.", exits 0 and writes nothing, while the docs say it adds "a new component renderer scaffold to your project". 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