Component Registry
Relevant source filesPurpose and Scope
The Component Registry is a centralized metadata system that catalogs all components in@ui8kit/core and enables multiple installation and consumption patterns. The registry is defined in src/registry.json1-281 and provides structured metadata including component names, types, dependencies, file paths, and target directories.
This page documents the registry format, component metadata schema, registration process, and how the registry powers different installation methods. For information about the build pipeline that generates registry artifacts, see Build System. For details on package distribution, see Package Structure.
Sources: src/registry.json1-281 README.md251-276
Registry File Structure
The registry is a JSON file conforming to the buildy-ui schema. It contains three top-level properties:| Property | Type | Description |
|---|---|---|
$schema | string | JSON schema URL for validation |
items | array | Array of component metadata objects |
version | string | Registry schema version (currently “1.0.0”) |
lastUpdated | string | ISO 8601 timestamp of last update |
registry | string | Registry identifier (“ui”) |
Registry Schema Diagram
Component Metadata Schema
Each component entry in theitems array contains the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Component name (e.g., “Button”, “Card”) |
type | string | Yes | Component category: “registry:ui” or “registry:layout” |
description | string | Yes | Component description (may be empty string) |
dependencies | string[] | Yes | Runtime dependencies (e.g., “react”, “lucide-react”) |
devDependencies | string[] | Yes | Development dependencies (typically empty) |
files | object[] | Yes | Array of file metadata objects |
files[].path | string | Yes | Source file path relative to repo root |
files[].target | string | Yes | Target directory in consumer project |
Component Types Distribution
The registry contains 18 components across two types:| Type | Count | Components |
|---|---|---|
registry:ui | 15 | Title, Text, Stack, Sheet, Image, Icon, Group, Grid, Container, Card, Button, Box, Block, Badge, Accordion |
registry:layout | 3 | SplitBlock, LayoutBlock, DashLayout |
Example Component Entry
The Button component demonstrates a minimal registry entry:Dependency Classification
The registry tracks two categories of dependencies for each component:Runtime Dependencies
Components declare runtime dependencies that must be installed in the consumer application:| Dependency | Used By | Purpose |
|---|---|---|
react | All components | Core React library |
lucide-react | Sheet, Accordion | Icon components (ChevronRight, X) |
react-resizable-panels | DashLayout | Resizable panel layout system |
class-variance-authority, clsx, and tailwind-merge are package-level dependencies defined in package.json48-53 and not tracked per-component.
Development Dependencies
ThedevDependencies array is present in all entries but typically empty, as development dependencies are managed at the package level in package.json59-66
Sources: src/registry.json8-10 src/registry.json54-56 src/registry.json266-268 package.json48-53
File Path Mapping
Each component entry maps source files to target directories in the consumer project:Target Directory Structure
| Target | Purpose | Components |
|---|---|---|
components/ui | UI components | 15 components (Button, Card, etc.) |
layouts | Layout templates | 3 components (DashLayout, LayoutBlock, SplitBlock) |
File Mapping Diagram
Registry Generation
The registry is generated and maintained through thebuildy-ui CLI tool:
Scan Command
Thescan script in package.json26 executes the buildy-ui scanner:
- Scans component directories (
src/components/ui/,src/layouts/) - Extracts component metadata from source files
- Determines dependencies by analyzing imports
- Updates src/registry.json1-281 with current metadata
- Sets
lastUpdatedtimestamp to current ISO 8601 time
Build Registry Command
Thebuild:r script in package.json27 generates distribution artifacts:
packages/registry/ for programmatic access.
Sources: package.json27-28
Integration with Installation Methods
The registry powers four distinct installation patterns:Installation Methods Comparison
| Method | Command | Registry Usage | Use Case |
|---|---|---|---|
| Full Library | npm install @ui8kit/core | Not used (installs entire package) | Comprehensive projects |
| Per-Component | npx buildy-ui add button | Reads metadata for selective install | Bundle optimization |
| Programmatic | import registry from 'registry.json' | Direct JSON access | Tooling/automation |
| Git Submodule | git submodule add | Not used (clones source) | Monorepo architectures |
Per-Component Installation Flow
Programmatic Registry Access
Applications can import the registry JSON for automation and tooling:Registry Data Structure
Example Usage
Component Coverage
The registry provides complete coverage of the library’s component hierarchy:Component Inventory by Layer
Registry Maintenance
Version Management
The registry uses semantic versioning independently from the package version:- Registry Version: src/registry.json278 - Currently “1.0.0”
- Package Version: package.json3 - Currently “0.1.8”
Last Updated Timestamp
ThelastUpdated field in src/registry.json279 records the last modification time as an ISO 8601 string:
npm run scan.
Sources: src/registry.json278-281 package.json3 package.json26
Registry Distribution
The registry is distributed through two channels:NPM Package Distribution
The registry JSON is included in the NPM package through thefiles field in package.json39-42:
Standalone Registry Package
Thepublish script in package.json28 publishes a standalone registry package:
Integration with Build Pipeline
The registry interacts with other build-time systems:Summary
The Component Registry serves as the single source of truth for component metadata in@ui8kit/core. It enables:
- Per-component installation via
npx buildy-ui add [component] - Programmatic access for tooling and automation
- Dependency tracking for selective installations
- File path mapping from source to target directories
- Component classification by type (UI vs Layout)
buildy-ui scan command and distributed via NPM alongside the compiled package.
Sources: src/registry.json1-281 README.md251-276 package.json26-28