Skip to content

[CLI] Add opt-in app theme imports - #6874

Merged
josephfarina merged 1 commit into
mainfrom
agent/t291109887-app-themes
Oct 7, 2026
Merged

josephfarina merged 1 commit into
mainfrom
agent/t291109887-app-themes

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

User need

Apps need to use installed theme packages without forking their source. Existing apps also need theme add to keep working while that change rolls out in two steps.

What this does

  • Keeps theme add <slug> [target-path] as the released source-copy command. It keeps bundled and package lookup, every option, every theme.add data field, stdout, and exit status.
  • Adds theme add <slug> --import [--package] for built-theme import through one generated app module. It returns theme.app and rejects copy-only options before writing.
  • Adds theme list, theme use, theme remove, and theme eject for the app-theme lifecycle.
  • Keeps theme list and themes-only search working outside a package project with no Core through the read-only theme adapter.
  • Makes theme search results name astryx theme add --import <slug> while source copying remains the deprecated default.
  • Adds the generated theme record, package and local-theme discovery, migration for existing copies, doctor checks, integration exports, and packed-package verification.
  • Exports font stylesheets from the seven first-party theme packages.
  • Makes theme build write <out>.css.d.ts and report it as cssDts. Check mode still accepts released output sets without that file.
  • Keeps source-only and incomplete integration export sets packable with warnings. Missing declared paths fail. Staleness warns for an incomplete set and fails for the complete importable module and stylesheet pair.
  • Updates theme docs and generated agent instructions for import, use, remove, and eject.
  • Stops reading the unsupported ASTRYX_THEME variable. With a generated module, component metadata reads the record's default. Without one, the released package.json#astryx.theme lookup keeps its exact behavior.

Updates the pending search release note to match current AST-050 FR14 and the shipped search output. It's an exact one-line substitution, nothing else.

Plain source copying now reports DEP-0005 with theme eject and theme add --import replacements. Human output gets at most one warning, and JSON output gets the additive meta.deprecations entry. theme add --list is unchanged.

The later minor change that makes import the default is intentionally not part of this patch.

Doctor compatibility

In a project with no generated theme module, the released themes warning becomes theme-management at info level. Once a module exists, doctor reports the ten theme-* checks. A released app holding a theme copied by an earlier theme add changes from themes=warn to theme-management=info plus theme-unmigrated-copies=warn. The exit status is unchanged and it still reports exactly one warning, but the check ids change. This follows AST-050 FR12.

Why this is one change

The generated record, lifecycle commands, integration exports, migration, doctor checks, and docs all describe the same app-theme state. Landing only part of that path would either record imports that do not resolve or create state that apps cannot inspect, update, or recover.

The implementation follows the current app-theme record in docs/specs/AST-050-app-themes/spec.md. It updates architecture:cli-surface INV19 to match that current record. It does not edit AST-050.

theme add --list delegates to the exported themeListCopySources() API. That API keeps the released JSON fields and excludes local app state, while themeListAvailable() backs the richer theme list command. The parity runner binds both CLI routes to their matching API functions.

Writing rubric results

  • R1: Pass. INV19 states current behavior in present tense.
  • R2: Pass. Research and rollout history stay out of the record.
  • R3: Pass. INV19 names public behavior and files, not review artifacts.
  • R4: Pass. No decision or rejected alternative is added.
  • R5: Pass. The record edit has no pull request or issue references.
  • R6: Pass. The record edit leaves no ruled question or option list open.

Testing

Rebased onto current main with no change to this pull request's own lines: git range-diff reports the single commit as identical (=).

Automated review was unavailable for this head; an independent exact-head review, the full suite, and a released-input comparison against published 0.6.5 stand in for it.

  • Full CLI Node suite: 380 files, 6,013 passed, 2 expected failures
  • pnpm build
  • ESLint with no errors
  • CLI strict, template-doc, JSON API, and authoring typechecks
  • Export loading, export sync, generated README, Changeset, CLI structure, i18n, setup, copyright, token-doc, and lab-readiness checks
  • Published CLI type-surface verification
  • Docsite generation, typecheck, and tests: 49 files passed, 1 skipped; 580 tests passed, 6 skipped
  • API to CLI parity: 374 passed
  • Audit follow-up tests for copy-list compatibility and bundled-theme eject: 18 passed

The Git-dependent file-mode, portable-script, and canonical-fixture checks need a Git checkout, so CI runs those. This local checkout uses Sapling. The equivalent fixture tests passed except for the direct git ls-files call.

@vercel

vercel Bot commented Oct 1, 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 7, 2026 8:35pm UTC

Request Review

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

astracat-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 1, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 1, 2026
@josephfarina
josephfarina marked this pull request as ready for review October 1, 2026 23:36
@github-actions

github-actions Bot commented Oct 1, 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.

Visual Regression

19 of 436 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 155,733
Chat Full AI Chat probe dark 155,005
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,229
Chat With Attachments probe dark 11,065
SideNav Resizable in AppShell probe dark 3,208
Markdown Default probe dark 897
Markdown Default probe light 897
Markdown Default neutral dark 882
Markdown Default neutral light 858
FileInput Default neutral light 44
FileInput Default neutral dark 42

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 for the detailed write-up and the test inventory. This change is not being approved yet for one governing reason, plus one preserved scope concern.

Approval needs a maintainer spec decision first. On current main, the CLI architecture record still describes integration themes as packaged editable source that theme add copies into the consumer. This PR intentionally replaces that model with importing an installed package's built outputs, and the spec it cites for the new model is still an open proposal rather than current authority. A maintainer needs to either merge that proposed spec (or update the existing record) on main, or identify the existing current claim that already authorises: importing built themes as the default, the new theme remove / theme use / theme eject subcommands and generated app theme module, the built-module and stylesheet and /fonts.css package exports, and dropping ASTRYX_THEME. Once that is settled, the breaking costs already documented in the changeset can be accepted consciously with it.

Preserved scope concern for after that decision: at 7,657 changed lines spanning the state foundation, discovery, commands, doctor checks, pack verification, a migration codemod, docs, and seven theme packages, the change will need decomposition or necessity evidence tying each part to the governing claim, or a split — whichever the spec decision makes appropriate.

I could not rerun the listed build, typecheck, or test commands in this environment, so those remain as reported rather than independently confirmed. Nothing else is being asked to be removed or reworked at this stage.

[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 for the detailed write-up and the test inventory. This change is not being approved yet for one governing reason, plus one preserved scope concern.

Approval needs a maintainer spec decision first. On current main, the CLI architecture record still describes integration themes as packaged editable source that theme add copies into the consumer. This PR intentionally replaces that model with importing an installed package's built outputs, and the spec it cites for the new model is still an open proposal rather than current authority. A maintainer needs to either merge that proposed spec (or update the existing record) on main, or identify the existing current claim that already authorises: importing built themes as the default, the new theme remove / theme use / theme eject subcommands and generated app theme module, the built-module and stylesheet and /fonts.css package exports, and dropping ASTRYX_THEME. Once that is settled, the breaking costs already documented in the changeset can be accepted consciously with it.

Preserved scope concern for after that decision: at 8,339 changed lines spanning the state foundation, discovery, commands, doctor checks, pack verification, a migration codemod, docs, and seven theme packages, the change will need decomposition or necessity evidence tying each part to the governing claim, or a split — whichever the spec decision makes appropriate.

I could not rerun the listed build, typecheck, or test commands in this environment, so those remain as reported rather than independently confirmed. Nothing else is being asked to be removed or reworked at this stage.

[Automated review]

@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from 64e37d0 to bd0f28c Compare October 2, 2026 02:23

@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 for the detailed write-up and the test inventory. This change is not being approved yet for one governing reason, plus one preserved scope concern.

Approval needs a maintainer spec decision first. On current main, the CLI architecture record still describes integration themes as packaged editable source that theme add copies into the consumer. This PR intentionally replaces that model with importing an installed package's built outputs, and the spec it cites for the new model is still an open proposal rather than current authority. A maintainer needs to either merge that proposed spec (or update the existing record) on main, or identify the existing current claim that already authorises: importing built themes as the default, the new theme remove / theme use / theme eject subcommands and generated app theme module, the built-module and stylesheet and /fonts.css package exports, and dropping ASTRYX_THEME. Once that is settled, the breaking costs already documented in the changeset can be accepted consciously with it.

Preserved scope concern for after that decision: at 8,485 changed lines spanning the state foundation, discovery, commands, doctor checks, pack verification, a migration codemod, docs, and seven theme packages, the change will need decomposition or necessity evidence tying each part to the governing claim, or a split — whichever the spec decision makes appropriate.

I could not rerun the listed build, typecheck, or test commands in this environment, so those remain as reported rather than independently confirmed. Nothing else is being asked to be removed or reworked at this stage.

[Automated review]

@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from e3eb07b to 91ceeff Compare October 6, 2026 22:50
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from 91ceeff to afa028f Compare October 6, 2026 23:17
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from afa028f to 3db3c45 Compare October 6, 2026 23:39
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from 3db3c45 to b2c7089 Compare October 6, 2026 23:47
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from b2c7089 to 14d8ebd Compare October 7, 2026 00:10
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from 14d8ebd to b414cee Compare October 7, 2026 00:36
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from b414cee to f016856 Compare October 7, 2026 00:45
@josephfarina
josephfarina force-pushed the agent/t291109887-app-themes branch from f016856 to 7083552 Compare October 7, 2026 19:35
Summary:
Keep `theme add` as the source-copy command and add `--import` for built themes. Add the generated app module, list, use, remove, and eject flows, migration and checks, package exports, and font stylesheets. Stop reading the unsupported `ASTRYX_THEME` variable.

Test Plan:
- Full CLI Vitest suite
- Repository build, lint, type checks, export checks, and docsite tests

@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 for the careful two-step rollout and the thorough test inventory. The app-theme model is now fully governed — the spec it implements is current on main, the opt-in --import path and the deprecated copy default both follow it, and no further maintainer decision is needed for the direction.

The previously requested parity correction is in place: theme add --list delegates to the exported themeListCopySources(), keeping its released JSON unchanged, and the parity runner again binds both list routes to their matching API functions.

Everything else checks out on static review: the copy default and deprecation metadata, generated-module record, lifecycle commands, package font exports, migration codemod, packed verification and doctor checks all line up with the governing spec. I could not rerun the listed build and test commands in this environment, so those remain as reported rather than independently confirmed.

[Automated review]

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9b2d470

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 7, 2026
@josephfarina
josephfarina merged commit 71cf6cd into main Oct 7, 2026
46 checks passed
@github-actions
github-actions Bot deleted the agent/t291109887-app-themes branch October 8, 2026 06:25

This branch was successfully deployed

1 active deployment
Preview — 9b2d4707 Deployed Oct 7, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant