Registry
Fragiola UI's registry, in shadcn's format: a static directory of JSON that the shadcn CLI reads, with no server and no compute.
Fragiola publishes a registry in shadcn's format, consumed by their CLI. The registry is a static directory of JSON on a CDN: no server, no compute, edge-cacheable.
Two formats
| lives at | has content? | read by | |
|---|---|---|---|
| source | registry.json | no — only path | the build |
| served | https://fragiola.com/r/<name>.json | yes, inlined | the CLI |
The CLI fetches one JSON per item and has everything it needs. It resolves
registryDependencies recursively, with a visited set that both
deduplicates and prevents cycles.
The dependency chain
theme ← palette-* ← atom ← uiDeclare only direct dependencies. dropdown-menu will not restate cn or
tailwind-variants because menu already pulls them; the graph resolves the
rest, and restating is noise that goes stale.
Dependencies are namespaced
Every registryDependencies entry is written @fragiola/<name>. The CLI
resolves a bare name ("cn") against its own default registry, never ours:
it either fails, or — when shadcn has an item of the same name, like field
— silently installs shadcn's file instead. The build rejects bare names; only
@namespace/name or a full URL is accepted.
target
Each file declares where it lands, using the placeholders the CLI resolves
against the user's components.json aliases:
| placeholder | used for |
|---|---|
@ui/ | registry/ui/ |
@components/ | registry/atoms/, registry/families/ |
@lib/ | registry/lib/ |
@hooks/ | registry/hooks/ |
Stylesheets use a relative target (styles/…), which the CLI places under
src/ when the project has one. ~/ is the project root, not the source
root — in a project with src/ it writes outside it — so the build rejects
it.
The placement must match the import rewrite in scripts/build-registry.ts
(#/atoms/ → @/components/atoms/, …): a file anywhere else installs
"successfully" and breaks every import pointing at it.
CSS is not merged
global.css and each palette are separate files. The CLI does not edit the
project's CSS entry; the user imports them, and adding an item again does not
overwrite a file they have edited.
No versioning, therefore no update
The format has no version field. Whoever installs keeps a frozen copy. That
is inherent to copy-paste distribution, it is accepted deliberately, and
pretending otherwise would be worse than saying it plainly.
Adding a new item
- Add the source file under
packages/registry/registry/at the right path. - Add an entry to
registry.jsonwithtype,files(withpathandtarget),registryDependencies(direct only, as@fragiola/<name>), anddependencies(npm packages). - Run
pnpm registry:buildto emitpackages/registry/dist/r/<name>.json, thenpnpm registry:smoketo install every item with the real CLI. - The guard tests run over
registry/**— adding a family or palette means the tests are the check, not review.