Skip to content

Make the design-system registry installable and versioned - #45

Merged
s3rot0n1n merged 1 commit into
mainfrom
design-system-registry-adoption
Nov 22, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
design-system-registry-adoption

Conversation

@s3rot0n1n

Copy link
Copy Markdown
Contributor

Why

Products should install design-system components with the shadcn CLI (components.json + shadcn add) instead of copying files by hand. Three things blocked that:

  1. Registry items had no install target, so shadcn add @codelit/button overwrote a stock components/ui/button.tsx.
  2. The registry was served from GitHub main, so installs weren't tied to a release.
  3. public/r was rebuilt by hand and had drifted: all 17 built files were stale against their sources.

What changed

  • Targets: every item in registry.json installs to @ui/codelit/<name>.tsx → <ui alias>/codelit/. Needs shadcn CLI ≥ 4.21.0.
  • Versioning: public/r now ships in the npm package. Apps pin the registry to the same version as their npm dependency:
    https://cdn.jsdelivr.net/npm/@codelitdev/design-system@<version>/public/r/{name}.json
    check-package-contents.mjs now requires public/r and still forbids registry/ sources.
  • Drift check: scripts/check-registry.mjs, run in verify, rebuilds the registry into a temp dir, diffs it against public/r, and fails on a missing @ui/codelit/ target. Stale public/r rebuilt.
  • README registry section rewritten; ADR 0020 records the decision; minor changeset for @codelitdev/design-system.

Testing

  • bun run verify passes.
  • Installed button and dialog from the built JSON into a throwaway Next app with shadcn 4.21.0. Both landed in components/ui/codelit/, an existing components/ui/button.tsx was untouched, and cn resolved through the app's alias.
  • The jsDelivr URL can't be tested until the release that ships public/r is published. The README assumes that release is 0.14.0.

Follow-up (per product, after release)

Add the @codelit registry to components.json, delete the hand-copied files in components/ui/codelit/, and reinstall them with shadcn add. They install to the same paths, so imports don't change.

🤖 Generated with Claude Code

- Give every registry item an `@ui/codelit/` install target so `shadcn add`
  no longer overwrites stock shadcn components.
- Ship the built registry (`public/r`) in the npm package so apps pin it to a
  release via jsDelivr instead of tracking GitHub `main`.
- Add `scripts/check-registry.mjs` to `verify`; it fails on a stale
  `public/r` or a missing target. Rebuild the already-stale registry JSON.
- Document the CLI-based adoption flow and record it as ADR 0020.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T07:23:36.514459Z 3a2a0bf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@s3rot0n1n
s3rot0n1n merged commit 3ee45ed into main Nov 22, 2026
1 check passed
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