feat: add shadcn component registry#723
Conversation
Expose UI components, form fields, hooks, and utilities as a shadcn-compatible registry so they can be installed individually in other projects via the CLI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds a shadcn-compatible component registry: new Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant PNPM as pnpm
participant Shadcn as shadcn CLI
participant FS as File System (public/r)
participant Consumer as Consumer (dlx / browser)
Dev->>PNPM: run `pnpm registry:build` or `pnpm build`
PNPM->>Shadcn: invoke `shadcn build`
Shadcn->>FS: generate JSON files under `public/r/`
FS-->>PNPM: files available
Dev->>Consumer: share URL `http://localhost:3000/r/<component>.json`
Consumer->>FS: fetch component JSON (install via `pnpm dlx shadcn add <url>`)
Consumer-->>Dev: component installed
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Ensures public/r/ JSON files are generated before vite build so the registry is included in every deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CONTRIBUTING.md`:
- Line 52: Fix the typographical error in CONTRIBUTING.md: replace the string
"you PR" with "your PR" so the sentence reads "You only need to maintain the
english and french translations for your PR." Locate the sentence in
CONTRIBUTING.md and update the wording accordingly, keeping capitalization and
punctuation consistent with surrounding text.
In `@package.json`:
- Line 22: Update the package.json "registry:build" npm script so it doesn't
assume a globally installed shadcn binary; replace the current "registry:build"
script command with one that uses pnpm dlx to fetch and run the CLI (i.e.,
change the command invoked by the "registry:build" script to use pnpm dlx
shadcn@latest build) so the script works in environments without a global shadcn
installation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c9dd0b82-c6c5-40e5-9401-6bf684c3e87e
📒 Files selected for processing (6)
.claude/rules/registry.md.gitignoreCONTRIBUTING.mdREADME.mdpackage.jsonregistry.json
| ## Translations | ||
|
|
||
| You only need to maintain the english and french translations for you PR. | ||
| You only need to maintain the english and french translations for you PR. |
There was a problem hiding this comment.
Fix typo: "you PR" → "your PR".
✏️ Proposed fix
-You only need to maintain the english and french translations for you PR.
+You only need to maintain the English and French translations for your PR.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| You only need to maintain the english and french translations for you PR. | |
| You only need to maintain the English and French translations for your PR. |
🧰 Tools
🪛 LanguageTool
[grammar] ~52-~52: Ensure spelling is correct
Context: ...the english and french translations for you PR. Other language translations are not...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CONTRIBUTING.md` at line 52, Fix the typographical error in CONTRIBUTING.md:
replace the string "you PR" with "your PR" so the sentence reads "You only need
to maintain the english and french translations for your PR." Locate the
sentence in CONTRIBUTING.md and update the wording accordingly, keeping
capitalization and punctuation consistent with surrounding text.
shadcn is not in devDependencies, so invoke it via pnpm dlx to avoid relying on a global installation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package.json (1)
22-22: Pin the shadcn version to ensure reproducible builds.Using
shadcn@latestmeans builds are not fully reproducible—if shadcn releases a breaking change, CI builds could unexpectedly fail. Pin to a specific version instead.♻️ Suggested change
- "registry:build": "pnpm dlx shadcn@latest build", + "registry:build": "pnpm dlx shadcn@3.2.1 build",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 22, The "registry:build" npm script currently uses shadcn@latest which makes builds unreproducible; update the script value in package.json (the "registry:build" entry) to use a pinned shadcn version (e.g., replace shadcn@latest with shadcn@<specific-version>) and commit the updated package.json (and regenerate lockfile if applicable) so CI uses that exact version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@package.json`:
- Line 22: The "registry:build" npm script currently uses shadcn@latest which
makes builds unreproducible; update the script value in package.json (the
"registry:build" entry) to use a pinned shadcn version (e.g., replace
shadcn@latest with shadcn@<specific-version>) and commit the updated
package.json (and regenerate lockfile if applicable) so CI uses that exact
version.
| /dist | ||
| /build | ||
| /public/storybook | ||
| /public/r |
There was a problem hiding this comment.
This is the standard way of exposing registry components:
When building the registry, json files are created and placed in public/r/<comp>.json
Since it is generated automatically via the registry.json file, no need to push it on the repo
There was a problem hiding this comment.



Summary
registry.jsondefining all 62 UI components, form fields, hooks, and utilities as a shadcn-compatible registrypnpm registry:buildscript that generates JSON files inpublic/r/(served athttps://demo.start-ui.com/r/<name>.json).claude/rules/registry.md) to enforce registry updates when components are modifiedREADME.mdand maintenance instructions inCONTRIBUTING.mdTest plan
pnpm registry:buildsucceeds and generates 62 JSON files inpublic/r/pnpm dlx shadcn@latest add https://demo.start-ui.com/r/button.jsonhttps://demo.start-ui.com/r/button.jsonafter deployment🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores