- Node.js 24 LTS (recommended)
- pnpm 10.33.0 —
npm install -g pnpm@10.33.0 - Git
This repository uses pnpm workspaces as its development workflow.
- Run install and scripts with
pnpm - Treat
pnpm-lock.yamlas the source of truth - Do not commit workspace
package-lock.jsonfiles
git clone https://github.com/pras75299/uniqueui.git
cd uniqueui
pnpm install
pnpm build:registry
pnpm dev # Docs site at localhost:3000| Directory | Purpose |
|---|---|
registry/ |
Component source files — single source of truth |
registry/components/<slug>.json |
Per-component manifest: build config (deps, files, tailwind) + docs metadata. See ADR 0002 |
registry/manifest.json |
Demos sourceFile + order (install order) + docsOrder (docs-site display order) |
packages/cli/ |
uniqueui-cli npm package — handles uniqueui add <component> |
apps/www/ |
Next.js docs/showcase site |
scripts/ |
Build scripts (registry generation, pre-commit hook) |
- Create
registry/<component-name>/component.tsxwith the component source - Create
registry/components/<slug>.json— aregistryblock (dependencies,files, optionaltailwindConfig/tailwindCss; the sharedcnutil is appended automatically, so don't list it) and adocsblock (name, description, icon, props, optionaldocs.overview/docs.scenarios). See ADR 0002 - Add the slug to both
orderanddocsOrderinregistry/manifest.json - Add the live demo mapping to
registry/demos.tsx - Run
pnpm build:registryfrom the root — this regeneratesregistry.json, refreshesapps/www/public/registry/*andapps/www/public/r/*(shadcn registry URLs), syncsapps/www/components/ui/*, and generatesapps/www/config/components.ts,apps/www/config/docs-scenarios.ts, andapps/www/config/demos.tsx - Test in the docs site:
cd apps/www && pnpm dev
| Source (edit these) | Generated (do not edit by hand) |
|---|---|
registry/components/<slug>.json |
apps/www/config/components.ts, apps/www/config/docs-scenarios.ts |
registry/demos.tsx |
apps/www/config/demos.tsx |
- Model: Registry metadata is authored as one manifest per component under
registry/components/<slug>.json, aggregated byscripts/build-registry.ts. This supersedes the centralizedregistry/docs.jsonmodel — see ADR 0002 (which supersedes ADR 0001). - When the model changes: If a future ADR supersedes 0002, update this section,
BUILD.md, and anyscripts/build-registry.ts/ CI drift checks in the same change series so contributors have a single coherent story. - After any edit under
registry/components/,registry/manifest.json, orregistry/demos.tsx, runpnpm build:registryand commit generated files underapps/www/config/,apps/www/components/ui/,apps/www/public/registry/,apps/www/public/r/, and rootregistry.jsonas required by CI.
- Animations: Use
motionfrommotion/react(notframer-motion). Prefertype: "spring"transitions. - Styling: All components must accept a
classNameprop merged viacn(clsx+tailwind-merge). - Self-contained: One file per component. No imports from other registry components.
"use client"directive: Required on all interactive or animated components.- TypeScript: Extend the relevant HTML/motion props interface and omit conflicting event handlers.
- No arbitrary Tailwind values: Use standard tokens where possible.
pnpm test # All workspaces
pnpm --dir packages/cli test # CLI tests only
pnpm --dir apps/www test # Docs site tests only
# Single test file:
pnpm test -- packages/cli/src/commands/add.test.tsFollow Conventional Commits:
feat(scope): add new component
fix(scope): correct animation timing
chore(scope): update dependencies
Common scopes: registry, cli, docs, or the component name (e.g. moving-border).
- Fork the repo and create a branch from
pras75299/initial-feature-setup - Make your changes following the guidelines above
- Run
pnpm build:registryif you touched registry source or docs metadata, and commit the regenerated artifacts - Run
pnpm testand ensure all tests pass - Add a changeset if your changes affect
packages/cli:pnpm changeset - Do not edit
CHANGELOG.mdmanually. Release automation updates it from changesets. - Open a PR — fill in the PR template
- Changesets are the source of truth for versioned CLI releases.
- The release automation opens or updates a PR that runs
pnpm version-packages. pnpm version-packagesupdatespackages/cli/CHANGELOG.mdand syncs rootCHANGELOG.md.- Write changeset summaries for end users (what changed in behavior or usage). See
.changeset/README.mdfor bump types and examples. Root changelog richness depends on good changeset first lines. - Optional quality check: run
pnpm changeset:qualityto catch weak changeset summaries before PR review.
Be respectful and constructive. Feedback on PRs should focus on the code, not the person. We welcome contributions from everyone regardless of experience level.