Repository navigation
fix(cli): restore the astryx layout command removed before its deprecation - #6887
Conversation
`astryx layout expand`, `astryx layout check` and `astryx layout grammar` shipped in published `@astryxdesign/[email protected]`, as ordinary registered top-level commands with documented examples, manifest entries, a `layout` docs topic, and the `layout.expand` / `layout.check` / `layout.grammar` response schemas. Four fixes to them (#6564, #6569, #6565, #6572) are in 0.6.4's changelog. They are a stable released CLI surface under `spec:AST-017` FR3. #6615 removed that surface in one step. `spec:AST-017` (authority: current) does not allow this yet: - FR28 requires a replacement-first deprecation patch and a public `DEP-*` record before a removal becomes eligible. There is none. - FR31 allows a removal only when its `DEP-*` and `CLN-*` ids appear in a frozen minor manifest. There is no such manifest. - FR37 requires an owner-approved public minor plan before freeze. There is no approved minor plan. - FR22 forbids retroactively demoting a released stable surface to experimental. `layout` was never behind an experimental boundary: FR27 requires a dedicated experimental namespace, and only the `experimental.xle.components` config key had one — the command did not. So this reverts #6615 and drops its `[breaking]` Changeset. Effect on the next release, measured with `changeset status`: - before: all ten fixed-group packages bump **minor** -> 0.7.0 - after: all ten bump **patch** -> 0.6.5 The ten manifests read 0.6.4, which is the published base; the target is derived from that base plus the highest pending bump. One `minor` Changeset in a `fixed` group moves all ten, which is why a single unplanned removal re-targeted the whole release. This is compatibility restoration, not new behavior. Nothing is invented and no deprecation metadata is added: `layout` returns to exactly its 0.6.4 shape, and its deprecation is left to be decided explicitly under AST-017. Because the removal was never published, main after this change is identical to 0.6.4 for consumers, so the restoration needs no Changeset of its own. The retained `@astryxdesign/cli/xle` barrel and the `experimental.xle.components` config key are untouched. Conflicts with later main commits were resolved toward main, not toward the revert: - `packages/cli/README.md` keeps main's rewritten descriptions and is regenerated, so the `layout` row and config row come from the restored docs. - `packages/cli/test/docs-graph.test.mjs` stays deleted; #6737 removed it for unrelated reasons. - `doc-routes.ids.json` keeps both `integration verify` (#6737) and the layout ids. Note for a follow-up: #6737 re-added the layout ids to `packages/cli/test/doc-routes.ids.json` while the command stayed deleted, so main currently claims four layout commands and three layout functions that do not exist. This change makes that file honest again. Test plan: - `npx vitest run --root . packages/cli` — 5314 passed, 0 failed - `pnpm check:repo` — passes, including `check:changesets` - `npx changeset status` — all ten packages at patch (0.6.5), none at minor - `astryx layout grammar|check|expand` run again from the built CLI - `astryx manifest --json` reports 17 top-level commands, matching the restored `spec:AST-042` text
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression15 of 420 shot(s) changed. A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Restoring astryx layout is the right fix. The commands, the layoutExpand / layoutCheck / layoutGrammar functions, and the layout.* JSON responses shipped as stable surface, so removing them without a replacement-first deprecation would break existing projects on upgrade — and cancelling the unreleased removal also keeps the next release patch-compatible instead of forcing a minor for every package.
No changes are requested. The restored surface matches the released shape, the docs and tests come back with it, and the previously inert layout config works again as documented. Whether to deprecate layout in the future can stay a separate, deliberate decision with its own replacement and migration path.
[Automated review]
|
/approve-spec 81bf552 |
#6887 restored the layout command, so the layout half this PR dropped for #6615 applies again: layout expand splices template blocks and replaces their demo media without saying so (AST-028 FR11). This restores it as it was before that drop, with one change: the count comes from replaceDemoMedia in the template adapter, the same pass template copy uses, so one reference counts once however many fixture paths its URL carries.
…#6567) * fix(cli): say when a template copy replaced demo media Copying a template swaps Astryx demo images and video for placeholders, but the receipt never said so. `template.copy` now reports `demoMediaReplaced`, and the text output names the file whose media the consumer has to supply. * fix(cli): say when layout expand replaced demo media Expanding a layout splices template blocks through the same demo media replacement as a template copy, but `layout.expand` never said so. It now reports `demoMediaReplaced` from the copy path's shared count, and the text output states it, as a trailing comment when the code is printed. * fix(cli): count each replaced demo media reference once; drop the layout half Review fix. The count was the drop in '/template-assets/' substrings, so one reference whose query held a second fixture path counted twice. The count now comes from the replacement pass itself (replaceDemoMedia in the template adapter, the same code as #6870, so the two PRs merge cleanly), one per replaced reference. copy.mjs uses it instead of its own helper. The layout half is gone: #6615 removes the layout command, so layout expand no longer gets a receipt field, and the changeset names template only. * docs(cli): regenerate the README tables on current main * fix(cli): layout expand says when it replaced demo media again #6887 restored the layout command, so the layout half this PR dropped for #6615 applies again: layout expand splices template blocks and replaces their demo media without saying so (AST-028 FR11). This restores it as it was before that drop, with one change: the count comes from replaceDemoMedia in the template adapter, the same pass template copy uses, so one reference counts once however many fixture paths its URL carries. * docs(cli): regenerate the README tables on current main --------- Co-authored-by: Joey Farina <[email protected]>
User impact
A project on published
@astryxdesign/[email protected]usesastryx layout expand,astryx layout checkandastryx layout grammartoday, callslayoutExpand/layoutCheck/layoutGrammarfrom@astryxdesign/cli/api, and reads thelayout.expand,layout.checkandlayout.grammarresponse schemas from--json. On currentmainall of that is gone, so the next release would break those consumers with no deprecation, no replacement, and no codemod.It would also break them in a patch. The removal's
[breaking]Changeset is the onlyminorentry among the 22 pending ones, and the ten packages are afixedgroup — so that single entry re-targets the entire release:changeset statusmain@f0355e3This PR restores the surface and drops that Changeset, so the next release is patch-compatible again.
Problem and solution fit
Why does the defect occur? #6615 removed the command in one step, describing it as experimental and unused.
Why does that harm the task? It was neither.
astryx layoutshipped in published 0.6.4 as one of 17 ordinary registered top-level commands, with manifest entries, documented examples, alayoutdocs topic, and three response schemas. Four fixes to it — #6564, #6569, #6565, #6572 — are in 0.6.4's changelog, so it was actively maintained right up to the last release.Why does that matter? It is a stable released CLI surface under
spec:AST-017FR3, which makes stable CLI command names, options, exit behavior, and machine-readable schemas contractual. Removing it is a breaking change against a released victim (FR1), and nothing authorised it yet.Expected behavior and authority
spec:AST-017(authority: current) does not permit this removal in its present form:DEP-*record before removal becomes eligible. There is none.DEP-*andCLN-*ids appear in a frozen minor manifest. There is no such manifest.experimental.xle.componentsconfig key ever had one. The command itself never did.This PR therefore rests on authority that is already current. It does not depend on any new policy landing.
Smallest restoration
A revert of #6615 and deletion of its
[breaking]Changeset. Nothing else.No replacement behavior is invented, and no deprecation metadata is added —
layoutreturns to exactly its 0.6.4 shape. Whether and how to deprecate it is left as a separate, explicit decision under AST-017's lifecycle, because creating aDEP-*record here would be the very product decision this PR is restoring the ability to make deliberately.Deliberately untouched: the retained
@astryxdesign/cli/xlebarrel (checkExpression,expandExpression) and theexperimental.xle.componentsconfig key, both of which #6615 kept.No Changeset accompanies this PR. Classification is against the latest stable release (
spec:AST-017FR2), and the removal was never published — so after this change,mainis identical to 0.6.4 for consumers. There is no consumer-visible delta to describe.Three conflicts with later
maincommits were resolved towardmain, not toward the revert:packages/cli/README.mdkeeps main's rewritten command descriptions and is regenerated, so both thelayoutrow and theexperimental.xle.componentsrow come from the restored docs.packages/cli/test/docs-graph.test.mjsstays deleted — cli docs: integration guides, a last pass on every doc, andintegration verify#6737 removed it for unrelated reasons.packages/cli/test/doc-routes.ids.jsonkeeps bothintegration verify(added by cli docs: integration guides, a last pass on every doc, andintegration verify#6737) and the layout ids.Evidence
main,astryx layout grammarexits with an unknown-command error;layoutExpandis not exported from@astryxdesign/cli/api;npx changeset statusreports all ten packages bumping minor.astryx layout grammar,layout checkandlayout expandrun again; the three/apifunctions are exported and type-verified by.github/scripts/cli-api-types-verify.mjs;npx changeset statusreports all ten at patch.@astryxdesign/cli/xleandexperimental.xle.componentsbehave exactly as onmain; theERR_LAYOUT_PARSE/ERR_LAYOUT_INVALIDcodes stay registered, asarchitecture:cli-surfaceINV3 requires.layout.test.mjs(297 lines),layout.error-codes.test.mjs,layout.exit-parity.test.mjs,layout.path-help.test.mjs,layout.stdin-cap.test.mjs,layout.text-fields.test.mjs,expand.path-safety.test.mjs.astryx manifest --jsonreports 17 top-level commands, matching the restoredspec:AST-042text, andcheck:cli-structureindependently confirms 17 handlers and 17 api folders.Incidental finding, fixed here
#6737 re-added the layout ids to
packages/cli/test/doc-routes.ids.jsonwhile the command stayed deleted, somaincurrently claims four layout commands and three layout functions that do not exist. This change makes that file honest again rather than leaving the inconsistency behind.Scope
Testing
No real-browser states are involved: this is a CLI and programmatic-API surface with no rendered output.