Skip to content

feat(sdk): shadcn theme and component registry exports - #1512

Open
GarthDB wants to merge 15 commits into
mainfrom
feat/shadcn-registry-theme-export
Open

GarthDB wants to merge 15 commits into
mainfrom
feat/shadcn-registry-theme-export

Conversation

@GarthDB

@GarthDB GarthDB commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Add shadcn registry output for Spectrum: a light/dark registry:theme exporter (export --format shadcn-theme) and a shadcn registry subcommand that generates metadata-only registry:component items from SDD component declarations, plus a top-level registry.json index. shadcn registry --base-url URL writes a flat layout for static hosting (folded in from #1536), and the generator reads the platform-merged catalog when a platform manifest is selected.

The component generator supports one component or the full catalog, omits absent optional metadata, and retains implementation, option, and state details. It does not synthesize component source files or Code Connect mappings. This PR is exporter-only: canonical component data comes from main, including its Spectrum 2 implementation metadata.

Related Issue

Beads: spectrum-design-data-78yg (update and merge), spectrum-design-data-t19s (non-color theme vars), spectrum-design-data-ajc7 (hosting, folded in from #1536), spectrum-design-data-rj00 (theme export), spectrum-design-data-3sn7 (component export), spectrum-design-data-ja03 (remove S1 component data from this PR). Follow-ups: spectrum-design-data-ajc7 (static hosting and spectrum-theme dependency), spectrum-design-data-4et4 (verify CSS variable keys), spectrum-design-data-kpzv (failure-path tests), spectrum-design-data-hlac (implementation backfill), spectrum-design-data-f5s7 (Code Connect).

Motivation and Context

This makes both halves of the shadcn proof of concept reproducible from SDD data. The component registry uses the component declaration path rather than TokenExporter, whose contract is limited to resolved token graph data. Component items reference spectrum-theme, which is generated separately; hosting is out of scope here.

How Has This Been Tested?

  • moon run sdk:test: passed (1610 run, 1610 passed, 2 skipped), after merging main.
  • Verified against @shadcn/registry@0.2.0 transformCssVars (Tailwind v4): keys in cssVars.theme are written literally to @theme inline; non-color keys in light/dark became --k: var(--k).
  • design-data shadcn registry --platform react-spectrum --component action-button adds the platform implementation row (cli_shadcn.rs).
  • moon run sdk:lint: passed.
  • moon run sdk:fmt-check: passed.
  • moon run sdk:codegen-check: passed.
  • moon run sdk:test-doc: passed (no doctests in the shadcn crate).
  • pnpm install: no lockfile changes. moon run root:ai-check: passed.
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings: 1 valid, 0 warnings, 0 errors.
  • Failure-path tests (invalid id, missing component, malformed JSON, name mismatch, write failure) cover both sdk/plugins/shadcn/src/lib.rs and sdk/cli/tests/cli_shadcn.rs.
  • Theme: light and dark now resolve per scheme (previously identical), and keys are unprefixed. Checked against npx shadcn@latest add in a scratch Tailwind v4 project.

Screenshots (if appropriate):

N/A (CLI/JSON output).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Adds a TokenExporter implementation emitting Spectrum tokens as a shadcn
registry:theme item (cssVars.light/dark), reusing the existing pure-exporter
plugin seam (sdk/plugins/PLUGINS.md) instead of a new abstraction. Settles
the "one mode context per call" open question by re-resolving the second
color scheme internally via cascade::resolve_dataset.

- sdk/plugins/shadcn: new crate, ShadcnThemeExporter (format_id "shadcn-theme"),
  reuses design-data-dtcg's leaf resolution for CSS-ready values.
- sdk/cli: register the exporter (exporters(), ExportFormat::ShadcnTheme,
  export --format shadcn-theme).
- sdk/Cargo.toml: add plugins/shadcn to the workspace.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5805318

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@adobe/design-data-tui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (0)

Original Branch: main


This comment was automatically generated by the token diff tool. 🤖

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🧩 Component Schema Changes Report

No component schema changes detected.

This comment was automatically generated by the component schema diff tool. 🤖

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Run report for 5805318a

Total time: 3m 11s | Comparison time: 5m 24s | Estimated savings: 2m 12s (40.8% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0.1ms Skipped
🟩 SyncWorkspace 11.5ms Passed
🟩 SyncProject(sdk) 0.5ms Passed
⬛️ SetupToolchain(node:20.17.0) 167.6ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 168.7ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.4ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 482.2ms Skipped
🟩 SetupEnvironment(rust, sdk) 142.7ms Passed
⬛️ InstallDependencies(rust, sdk) 9ms Skipped
🟩 RunTask(sdk:fmt-check) 1.7s Passed
🟩 InstallDependencies(javascript, sdk) 4.5s Passed
🟩 RunTask(sdk:codegen-check) 132.1ms Passed
🟩 RunTask(sdk:lint) 1m 1s Passed
🟩 RunTask(sdk:test-doc) 2m 5s Passed SLOW
🟩 RunTask(sdk:test) 3m 6s Passed SLOW
Changed files
.ai/inventory.json
.changeset/shadcn-registry.md
.github/workflows/deploy-docs.yml
docs/repo-index.md
llms.txt
sdk/Cargo.lock
sdk/Cargo.toml
sdk/cli/Cargo.toml
sdk/cli/src/main.rs
sdk/cli/tests/cli_shadcn.rs
sdk/moon.yml
sdk/plugins/PLUGINS.md
sdk/plugins/figma/tests/fixtures/figma/s2-web-variables.baseline.json
sdk/plugins/shadcn/AGENTS.md
sdk/plugins/shadcn/Cargo.toml
sdk/plugins/shadcn/examples/README.md
sdk/plugins/shadcn/examples/action-button.registry-item.sample.json
sdk/plugins/shadcn/examples/shadcn-theme.sample.json
sdk/plugins/shadcn/src/lib.rs

test and others added 2 commits September 25, 2026 17:22
Sample artifacts from the validation spike, checked in so they have a stable
link to share back to the thread this spike came from. Not built by CI, not
consumed by any code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GarthDB GarthDB changed the title feat(sdk): shadcn registry:theme export (validation spike) feat(sdk): shadcn theme and component registry exports Sep 28, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GarthDB GarthDB mentioned this pull request Sep 28, 2026
7 of 10 tasks
test and others added 9 commits October 13, 2026 14:00
Use main's canonical component data; keep the PR exporter-only, refresh the
action-button sample, derive catalog test expectations, trim the changeset.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add --base-url to shadcn registry, a hosted theme item, the
sdk:shadcn-registry moon task and a deploy-docs step publishing /r/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
test and others added 2 commits October 13, 2026 15:41
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge main and fold the hosting work into the registry PR.
- Read the platform-merged catalog when a platform manifest is selected.
- Put scheme-independent non-color vars in cssVars.theme (t19s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GarthDB
GarthDB marked this pull request as ready for review October 21, 2026 22:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant