Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

@ui8kit/registry

Published component registry digest for ui8kit CLI (>=2.0.1).

Source primitives come from ui8kit/codegengenerated/ (bricks + utils). This repo packs them into JSON under /r for CDN / npm.

Consumers only need the published r/ tree (npm/CDN). They do not need to clone codegen.

CDN URLs (after npm publish)

https://unpkg.com/@ui8kit/registry@2.0.0/r/index.json
https://cdn.jsdelivr.net/npm/@ui8kit/registry@2.0.0/r/components/ui/button.json
https://unpkg.com/@ui8kit/registry@2.0.0/schema/registry-item.json

CLI defaults already prefer @ui8kit/registry@latest/r.

Consumer install

npx ui8kit@2.0.1 init --yes --framework react --dir src \
--registry-url https://unpkg.com/@ui8kit/registry@2.0.0/r \
--strict-cdn
npx ui8kit@2.0.1 add button --runtime react \
--registry-url https://unpkg.com/@ui8kit/registry@2.0.0/r \
--strict-cdn

button declares registryDependencies (e.g. utils, slot) — CLI installs those first.

Each brick JSON embeds all runtime files. With ui8kit@>=2.0.1, --runtime / config.runtime installs only that stack’s files plus shared (*.shared.ts, *.variants.json).

Layout

r/ # publishable digest (CDN root) — commit / publish this
index.json
components/ui/*.json # registry:ui bricks (all runtimes per brick)
utils/utils.json # registry:utils (cn, expr, variants, …)
schema/ # JSON Schema for items / registry / config
src/ # staged kit (gitignored) — input to ui8kit build
.cache/codegen/ # gitignored — GitHub clone used by pack script
scripts/
pack-from-codegen.mjs
write-schema.mjs
stamp-index.mjs
verify-registry.mjs

Rebuild from codegen

pack-from-codegen resolves the generated tree in this order:

  1. --codegen <path> — explicit local generated/
  2. Sibling ../@ui8kit-codegen/generated (local monorepo convenience)
  3. GitHub clone of ui8kit/codegen into .cache/codegen/ (default)

Digest defaults to this package’s version (2.0.0).

# Fresh clone of this registry only — pulls codegen from GitHub
npm run pack:codegen:github
# Pin a tag / commit
node scripts/pack-from-codegen.mjs --force-github --ref main --digest 2.0.0
# Local codegen override
node scripts/pack-from-codegen.mjs --codegen ../@ui8kit-codegen/generated

Requires git on PATH for the GitHub path. The chosen ref must include committed generated/ui + generated/utils.

Full digest build uses published CLI:

npm run build
# = pack:codegen → npx ui8kit@2.0.1 build → schema → stamp → verify

Publish

npm run build
npm publish --access public

Then consumers pin @2.0.0 (or @latest) via --registry-version / registryVersion in ui8kit.config.json.

Local smoke CDN

npx serve . -l 4173
# registry base: http://127.0.0.1:4173/r

License

MIT

About

Consumers only need the published r/ tree (npm/CDN). They do not need to clone codegen

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages