Skip to content

chore: migrate to official shadcn registry workflow - #105

Open
hasanharman wants to merge 1 commit into
mainfrom
chore/migrate-official-shadcn-registry
Open

chore: migrate to official shadcn registry workflow#105
hasanharman wants to merge 1 commit into
mainfrom
chore/migrate-official-shadcn-registry

Conversation

@hasanharman

Copy link
Copy Markdown
Owner

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 schema
  • registry/registry-components.ts + registry/index.ts — the item list
  • scripts/build-registry.ts — a bespoke JSON builder

shadcn now ships first-class registry support, so all of that is dead weight.

Changes

  • Add root registry.json (official registry.json schema) as the single source of truth for the 16 custom components, with proper title/description per item.
  • Add registry:build scriptshadcn build --output public/registry. Output stays in public/registry/, so existing install URLs (https://www.shadcn-form.com/registry/<slug>.json) keep working — 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, scripts/build-registry.ts). Verified nothing in the app imported these.
  • Regenerate public/registry/*.json with the official builder. Output is strictly richer (adds $schema, title, description) and emits a combined public/registry/registry.json index for free.

DRY / cleanup

  • Dropped 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 was behaviorally worse, force-pinning components/ui even when a consumer remapped their alias. Output now matches the canonical shadcn shape.

Reviewer notes

  • The registry/ui/*.tsx component sources are unchanged — this PR is registry config + tooling only.
  • Adding a component going forward: drop the .tsx in registry/ui/, add one entry to registry.json, run pnpm registry:build.
  • The per-item type and per-file type both being registry:ui is required schema (not redundant) — removing the file-level type fails the build.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shadcn-form Ready Ready Preview, Comment Jun 28, 2026 3:57pm

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