From 8da4592308472f31f4e622309214f51fc272cbf0 Mon Sep 17 00:00:00 2001 From: shadcn Date: Sat, 6 Jun 2026 23:19:46 +0400 Subject: [PATCH] feat: update registry build commands (#10880) * feat: update registry build commands * fix --- CONTRIBUTING.md | 5 + apps/v4/registry/README.md | 100 +++++++++ apps/v4/scripts/build-registry.mts | 318 ++++++++++++++++++++++++++--- 3 files changed, 399 insertions(+), 24 deletions(-) create mode 100644 apps/v4/registry/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 590563ccdb..b72afd9807 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -141,6 +141,11 @@ When adding or modifying components, please ensure that: 2. You update the documentation. 3. You run `pnpm registry:build` to update the registry. +See [`apps/v4/registry/README.md`](apps/v4/registry/README.md) for how the +registry pipeline is structured and for the faster targeted build modes +(`--style`, `--registry`, `--examples`, `--indexes`) you can use while +iterating locally. Always run the full `pnpm registry:build` before committing. + ## Commit Convention Before you create a Pull Request, please check whether your commits comply with diff --git a/apps/v4/registry/README.md b/apps/v4/registry/README.md new file mode 100644 index 0000000000..aad5ee4901 --- /dev/null +++ b/apps/v4/registry/README.md @@ -0,0 +1,100 @@ +# Registry + +This directory is the source of truth for the v4 component registry. The build +pipeline (`../scripts/build-registry.mts`) reads the authored source here and +generates the runtime indexes, the local `styles/` consumed by the docs app, and +the installable output under `public/r/`. + +## Source of truth (authored by hand) + +- **`bases/base/`, `bases/radix/`** — the two authored base registries (Base UI + and Radix). Each holds a `registry.ts` plus `ui/`, `lib/`, `hooks/`, `blocks/`, + `examples/`, and `internal/`. Shared surfaces should stay in sync across both + bases — see [`bases/README.md`](./bases/README.md). +- **`styles/style-*.css`** — the style token files (`nova`, `sera`, `vega`, …). + Each defines the design tokens for one style. +- **`new-york-v4/`** — the legacy source registry. Unlike the generated + combinations below, its `registry.ts` and component files are authored + directly and committed. +- **`../examples/base`, `../examples/radix`** — authored component demos. See + [`../examples/README.md`](../examples/README.md). + +## Generated output (do not edit by hand) + +Persistent (committed): + +- `bases/__index__.tsx` — runtime lookup for the authored bases. +- `__index__.tsx` — runtime lookup across legacy styles and every base/style + combination. +- `__blocks__.json` — block metadata index. +- `../examples/__index__.tsx` — runtime lookup for demos. +- `../styles/