chore: migrate to official shadcn registry workflow - #105
Open
hasanharman wants to merge 1 commit into
Open
Conversation
Replace the hand-rolled registry pipeline with shadcn's official registry support (shadcn@4.12.0), which is the now-recommended, simpler approach. What changed: - Add root `registry.json` (official `registry.json` schema) as the single source of truth for the 16 custom components, now with proper titles and descriptions. - Add `registry:build` script -> `shadcn build --output public/registry`, preserving the existing `/registry/<slug>.json` install URLs so no consumer's `npx shadcn add` command breaks. - Add `shadcn` as a devDependency. - Remove the obsolete custom pipeline: `registry/schema.ts`, `registry/registry-components.ts`, `registry/index.ts`, and `scripts/build-registry.ts`. Nothing in the app imported these. - Regenerate `public/registry/*.json` with the official builder. Output is strictly richer (adds `$schema`, `title`, `description`) and now emits a combined `public/registry/registry.json` index for free. DRY/cleanup: - Drop redundant per-file `target` fields. shadcn defaults `registry:ui` files to the consumer's `ui` alias, so the explicit target only duplicated the default and force-pinned `components/ui` even when a consumer remapped their alias. Output now matches the canonical shape. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates the project's component registry from a hand-rolled pipeline to shadcn's official registry workflow (
shadcn@4.12.0) — the now-recommended, simpler approach.Why
The old setup duplicated shadcn's types and build logic by hand:
registry/schema.ts— a custom Zod copy of shadcn's registry schemaregistry/registry-components.ts+registry/index.ts— the item listscripts/build-registry.ts— a bespoke JSON buildershadcn now ships first-class registry support, so all of that is dead weight.
Changes
registry.json(officialregistry.jsonschema) as the single source of truth for the 16 custom components, with propertitle/descriptionper item.registry:buildscript →shadcn build --output public/registry. Output stays inpublic/registry/, so existing install URLs (https://www.shadcn-form.com/registry/<slug>.json) keep working — no consumer'snpx shadcn addcommand breaks.shadcnas a devDependency.registry/schema.ts,registry/registry-components.ts,registry/index.ts,scripts/build-registry.ts). Verified nothing in the app imported these.public/registry/*.jsonwith the official builder. Output is strictly richer (adds$schema,title,description) and emits a combinedpublic/registry/registry.jsonindex for free.DRY / cleanup
targetfields. shadcn defaultsregistry:uifiles to the consumer'suialias, so the explicittargetonly duplicated the default — and was behaviorally worse, force-pinningcomponents/uieven when a consumer remapped their alias. Output now matches the canonical shadcn shape.Reviewer notes
registry/ui/*.tsxcomponent sources are unchanged — this PR is registry config + tooling only..tsxinregistry/ui/, add one entry toregistry.json, runpnpm registry:build.typeand per-filetypeboth beingregistry:uiis required schema (not redundant) — removing the file-leveltypefails the build.🤖 Generated with Claude Code