Repository navigation
[CLI] Show where Theme comes from wherever the CLI shows the wrapper - #7182
Conversation
|
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. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Thanks — this closes a real first-run dead end: the printed wiring showed <Theme> without saying where it comes from, and the natural guess does not resolve. Showing import {Theme} from '@astryxdesign/core' in the init next steps, both theme add modes, theme build, the doctor fix, build help, and the theme guides makes each snippet work as copied, with no change to commands, JSON shapes, or exit codes.
The new guard test is a good fit: it checks taught Core specifiers against Core's actual exports (case included) and fails on the old text. Two small optional follow-ups, neither blocking: the guard checks that specifiers resolve but not that named bindings exist, and the Chinese dense guide could gain the same parenthetical for parity.
[Automated review]
There was a problem hiding this comment.
Thanks — this closes a real first-run dead end: the printed wiring showed <Theme> without saying where it comes from, and the natural guess @astryxdesign/core/Theme does not resolve. Showing import {Theme} from '@astryxdesign/core' in the init next steps, both theme add modes, theme build, the doctor fix, build help, and the theme guides makes each snippet work as copied, with no change to commands, JSON shapes, or exit codes.
The guard test is a good fit: it checks taught Core specifiers against Core's actual exports (case included), fails on the old text, and now checks each wrapper against its own import rather than a neighbor's. Two small optional follow-ups, neither blocking: the guard checks that specifiers resolve but not that named bindings exist, and the Chinese dense guide could gain the same parenthetical for parity.
[Automated review]
There was a problem hiding this comment.
Approving at this head. The delta from the approved 4a6bbe5 is the test only (+14/-5): each <Theme theme= wrapper is now checked against the text between the previous wrapper and the end of its own line, so a neighbouring example's import cannot stand in for it. Red arm: dropping the second import in the theme build output fails the new check at that wrapper and passes under the old 400-character window; the test file against main fails 5/7 and passes 7/7 here. Ran the head CLI: init next steps, theme add in both modes, both theme build examples, the doctor fix, build help, the dense theme guide and the author-a-theme built example each show import {Theme} from '@astryxdesign/core' beside the wrapper, and the cli patch Changeset lists exactly those surfaces.
[Automated review]
User need
A first-time user following
astryx initsees<Theme theme={...}>but not whereThemecomes from. The natural guess,@astryxdesign/core/Theme, fails, because Core exports./theme(lowercase) and re-exportsThemefrom its root.What this does
Wherever the CLI shows the
<Theme>wrapper, it now also shows the exact import,import {Theme} from '@astryxdesign/core':astryx initnext stepstheme add --importwiring block, shown the first time a theme is addedtheme addoutputtheme buildinstall examplesbuildhelpCompatibility
Text only. Each change adds an import line to a printed example or sentence. JSON shapes, response types, exit codes and command options are unchanged. Two string fields carry the new text: doctor's
fixon thetheme-module-importcheck, and onebuildhelp rule.Testing
New
packages/cli/test/taught-core-imports.test.mjs:@astryxdesign/coreimport in the CLI docs and in the command output above matches an entry in Core's package.jsonexports, case included;Themecomes from wherever it shows the wrapper.Dropping the
initimport line fails it, and so does a@astryxdesign/core/Themespecifier in a doc.Full CLI suite
Knowledge, Changeset, CLI structure, published type-surface, README, copyright and repository checks, and API to CLI parity
Manifest compared with published 0.6.6: no response type changes from this pull request