Skip to content

[CLI] Show where Theme comes from wherever the CLI shows the wrapper - #7182

Merged
josephfarina merged 2 commits into
mainfrom
josephfarina/show-theme-import
Oct 8, 2026
Merged

josephfarina merged 2 commits into
mainfrom
josephfarina/show-theme-import

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

User need

A first-time user following astryx init sees <Theme theme={...}> but not where Theme comes from. The natural guess, @astryxdesign/core/Theme, fails, because Core exports ./theme (lowercase) and re-exports Theme from 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 init next steps
  • the theme add --import wiring block, shown the first time a theme is added
  • the deprecated copying theme add output
  • both theme build install examples
  • doctor's fix when no project source imports the generated theme module
  • build help
  • the dense theme guide and the built-theme example in the theme authoring guide

Compatibility

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 fix on the theme-module-import check, and one build help rule.

Testing

  • New packages/cli/test/taught-core-imports.test.mjs:

    • every @astryxdesign/core import in the CLI docs and in the command output above matches an entry in Core's package.json exports, case included;
    • each of those command modules shows where Theme comes from wherever it shows the wrapper.

    Dropping the init import line fails it, and so does a @astryxdesign/core/Theme specifier 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

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 8, 2026 8:51pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 8, 2026
@astracat-bot

astracat-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 8, 2026, 8:54 PM UTC

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@josephfarina josephfarina reopened this Oct 8, 2026
@josephfarina josephfarina reopened this Oct 8, 2026
@josephfarina
josephfarina merged commit ca2b7e3 into main Oct 8, 2026
94 of 101 checks passed
@github-actions
github-actions Bot deleted the josephfarina/show-theme-import branch October 9, 2026 06:25

This branch was successfully deployed

1 active deployment
Preview — 14b96101 Deployed Oct 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant