You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an exact copy of the source component here so it can be used in the docs/showcase site.
29
-
3.**`registry/config.ts`**
30
-
Update the registry config to include the new component, specifying its dependencies (e.g.,`["motion", "clsx", "tailwind-merge"]`), tailwind properties, and files.
29
+
3.**`registry/components/[component-name].json`**
30
+
Create the per-component manifest with a `registry` block (dependencies e.g. `["motion", "clsx", "tailwind-merge"]`, `files`, optional tailwind config) and a `docs` block (name, props, scenarios). Add the slug to `order`and `docsOrder` in `registry/manifest.json`.
31
31
4.**`apps/www/app/page.tsx`**
32
32
Add a functional showcase/demo block of your new component on the main page.
Always commit `registry.json` and the generated files under `apps/www/public/r/` (and the rest of the synced paths) after adding or modifying components, as required by your branch / CI.
98
99
99
-
### Docs Metadata Storage Decision
100
+
### Registry Metadata Storage Decision
100
101
101
-
`registry/docs.json` remains centralized for now (single source authoring model). This aligns with the current build flow where one registry build command composes and syncs docs artifacts.
102
+
Registry metadata is authored as **one manifest per component** under `registry/components/<slug>.json`, with cross-cutting config (demos `sourceFile`, install `order`, docs `docsOrder`) in `registry/manifest.json`. `pnpm build:registry` aggregates these into the generated artifacts.
102
103
103
-
- Author docs metadata in the centralized file.
104
-
- Generated runtime artifacts can still be split per component for delivery.
105
-
- Revisit splitting authoring into per-component metadata files only when scaling triggers are hit (see `docs/adr/0001-registry-docs-metadata-storage.md`).
104
+
- Each `registry/components/<slug>.json` holds a `registry` block (deps, files, tailwind) and a `docs` block (name, props, scenarios).
105
+
- This supersedes the former centralized `registry/config.ts` + `registry/docs.json` model — see [`docs/adr/0002-per-slug-registry-manifests.md`](docs/adr/0002-per-slug-registry-manifests.md) (supersedes ADR 0001).
2.Add entry to `registry/config.ts` (name, dependencies, files array, optional `tailwindConfig` for custom keyframes)
178
-
3. Add docs metadata to `registry/docs.json`
179
-
4. Add demo to `apps/www/config/demos.tsx` (`componentDemos`)
180
+
2.Create `registry/components/{slug}.json` (see ADR 0002 for the shape): a `registry` block (`dependencies`, `files`, optional `tailwindConfig`/`tailwindCss` — do **not** list the shared `cn` util; the build script appends it) and a `docs` block (name, description, icon, props, optional `docs.overview`/`docs.scenarios`).
181
+
3. Add the slug to both `order` and `docsOrder` in `registry/manifest.json`.
182
+
4. Add demo to `apps/www/config/demos.tsx` (`componentDemos`) — via the `registry/demos.tsx` source.
180
183
5. Add an entry to `registry/changelogs.json` under the new slug — at minimum `[{ "version": "1.0.0", "date": "YYYY-MM-DD", "changes": ["Initial release."] }]`. The build script reads `entries[0]` as the component's `meta.version`; entries must be newest-first (descending semver).
181
184
6. Run `pnpm build:registry` from root to regenerate `registry.json`, refresh `apps/www/public/registry/*` and **`apps/www/public/r/*`**, sync `apps/www/components/ui/{component-name}.tsx`, and generate `apps/www/config/components.ts` plus `apps/www/config/docs-scenarios.ts`
└── {component-name}.tsx ← Copy used in the docs site
@@ -307,8 +308,8 @@ uniqueui add typewriter-text
307
308
308
309
## Contributing a New Component
309
310
310
-
1. Create `registry/{component-name}.tsx`
311
-
2.Add entry to `registry/config.ts` with dependencies and tailwind config
311
+
1. Create `registry/{slug}/component.tsx`
312
+
2.Create `registry/components/{slug}.json` (dependencies, tailwind config + docs metadata) and add the slug to `order`/`docsOrder` in `registry/manifest.json`
312
313
3. Run `pnpm build:registry` to regenerate `registry.json`
313
314
4. Add a showcase demo in `apps/www/app/page.tsx`
314
315
5. Test with `uniqueui add {component-name}` in a fresh project
1. Create `registry/<component-name>/component.tsx` with the component source
40
-
2.Add an entry to `registry/config.ts` with `name`, `dependencies`, `files`, and optional `tailwindConfig`
41
-
3. Add docs metadata to `registry/docs.json` for the component page and scenarios
41
+
2.Create `registry/components/<slug>.json` — a `registry` block (`dependencies`, `files`, optional `tailwindConfig`/`tailwindCss`; the shared `cn` util is appended automatically, so don't list it) and a `docs` block (name, description, icon, props, optional `docs.overview`/`docs.scenarios`). See [ADR 0002](docs/adr/0002-per-slug-registry-manifests.md)
42
+
3. Add the slug to both `order` and `docsOrder` in `registry/manifest.json`
42
43
4. Add the live demo mapping to `registry/demos.tsx`
43
44
5. Run `pnpm build:registry` from the root — this regenerates `registry.json`, refreshes `apps/www/public/registry/*` and **`apps/www/public/r/*`** (shadcn registry URLs), syncs `apps/www/components/ui/*`, and generates `apps/www/config/components.ts`, `apps/www/config/docs-scenarios.ts`, and `apps/www/config/demos.tsx`
44
45
6. Test in the docs site: `cd apps/www && pnpm dev`
@@ -47,12 +48,12 @@ pnpm dev # Docs site at localhost:3000
47
48
48
49
| Source (edit these) | Generated (do not edit by hand) |
-**Policy:**Keep docs metadata authoring centralized in `registry/docs.json`unless a [documented migration](docs/adr/0001-registry-docs-metadata-storage.md)has happened. The ADR lists quantitative **migration triggers** (file size, conflict rate, ownership needs) and qualitative **friction signals** — open a discussion if friction grows, but do not split metadata files until triggers are met.
54
-
-**When the model changes:** If an ADR supersedes 0001 (for example per-component `registry/<slug>/docs.json`), update this section, `BUILD.md`, and any `scripts/build-registry.ts` / CI drift checks in the same change series so contributors have a single coherent story.
55
-
- After any edit to`registry/docs.json` or `registry/demos.tsx`, run `pnpm build:registry` and commit generated files under `apps/www/config/`, `apps/www/components/ui/`, `apps/www/public/registry/`, **`apps/www/public/r/`**, and root `registry.json` as required by CI.
54
+
-**Model:**Registry metadata is authored as one manifest per component under `registry/components/<slug>.json`, aggregated by `scripts/build-registry.ts`. This supersedes the centralized `registry/docs.json`model — see [ADR 0002](docs/adr/0002-per-slug-registry-manifests.md)(which supersedes [ADR 0001](docs/adr/0001-registry-docs-metadata-storage.md)).
55
+
-**When the model changes:** If a future ADR supersedes 0002, update this section, `BUILD.md`, and any `scripts/build-registry.ts` / CI drift checks in the same change series so contributors have a single coherent story.
56
+
- After any edit under`registry/components/`, `registry/manifest.json`, or `registry/demos.tsx`, run `pnpm build:registry` and commit generated files under `apps/www/config/`, `apps/www/components/ui/`, `apps/www/public/registry/`, **`apps/www/public/r/`**, and root `registry.json` as required by CI.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -522,7 +522,7 @@ Registry (GitHub)
522
522
Your project (shadcn components.json, @/lib/utils)
523
523
```
524
524
525
-
1.**Registry** — Each component is defined in `registry/config.ts`and points at files like `registry/<slug>/component.tsx`. `build-registry.ts` outputs `registry.json`, split files under `apps/www/public/registry/`, **shadcn-format items under `apps/www/public/r/`**, and synced docs UI copies.
525
+
1.**Registry** — Each component is defined in `registry/components/<slug>.json` (build config + docs metadata) and points at files like `registry/<slug>/component.tsx`. `build-registry.ts` aggregates these (ordered by `registry/manifest.json`) and outputs `registry.json`, split files under `apps/www/public/registry/`, **shadcn-format items under `apps/www/public/r/`**, and synced docs UI copies.
526
526
2.**UniqueUI CLI** — Fetches the hosted registry, writes files to your project, and installs npm dependencies (and can add `utils/cn.ts`).
527
527
3.**shadcn CLI** — Consumes the same component source via `public/r/<slug>.json` URLs; expects a standard shadcn project layout and `@/lib/utils` for `cn`.
528
528
4.**Showcase** — The `apps/www` Next.js site serves as marketing landing page and component documentation with live previews and install commands.
@@ -570,8 +570,8 @@ node --version # must be v18 or higher
570
570
571
571
1. Fork the repository
572
572
2. Create your feature branch (`git checkout -b feature/my-component`)
573
-
3. Add your component to `registry/` and update`registry/config.ts`
574
-
4.Update `registry/docs.json` for docs metadata and `apps/www/config/demos.tsx` for the live demo
573
+
3. Add your component to `registry/` and create`registry/components/<slug>.json` (build config + docs metadata), then add the slug to `order` and `docsOrder` in `registry/manifest.json`
574
+
4.Add the live demo mapping in `registry/demos.tsx`
575
575
5. Run `pnpm build:registry` to regenerate `registry.json`, refresh `apps/www/public/registry/*` and **`apps/www/public/r/*`**, sync `apps/www/components/ui/*`, and generate `apps/www/config/components.ts` plus `apps/www/config/docs-scenarios.ts`
0 commit comments