ui8kit 1.0.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +211 -194
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +2930 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +70 -28
  6. package/css/dist/styles.css +0 -3325
  7. package/css/src/semantic/alert.css +0 -11
  8. package/css/src/semantic/article.css +0 -59
  9. package/css/src/semantic/avatar.css +0 -11
  10. package/css/src/semantic/badge.css +0 -19
  11. package/css/src/semantic/breadcrumb.css +0 -23
  12. package/css/src/semantic/button.css +0 -39
  13. package/css/src/semantic/card.css +0 -43
  14. package/css/src/semantic/index.css +0 -19
  15. package/css/src/semantic/input.css +0 -3
  16. package/css/src/semantic/label.css +0 -3
  17. package/css/src/semantic/link.css +0 -39
  18. package/css/src/semantic/main.css +0 -3
  19. package/css/src/semantic/markup.css +0 -23
  20. package/css/src/semantic/nav.css +0 -63
  21. package/css/src/semantic/pagination.css +0 -11
  22. package/css/src/semantic/section.css +0 -43
  23. package/css/src/semantic/sheet.css +0 -35
  24. package/css/src/semantic/skeleton.css +0 -3
  25. package/css/src/semantic/table.css +0 -31
  26. package/css/src/semantic/textarea.css +0 -3
  27. package/r/schema/registry-item.json +0 -68
  28. package/r/schema/registry.json +0 -93
  29. package/r/schema.json +0 -60
  30. package/r/semantic/components/article.json +0 -17
  31. package/r/semantic/components/aside.json +0 -17
  32. package/r/semantic/components/footer.json +0 -17
  33. package/r/semantic/components/header.json +0 -17
  34. package/r/semantic/components/main.json +0 -17
  35. package/r/semantic/components/markup.json +0 -17
  36. package/r/semantic/components/media.json +0 -17
  37. package/r/semantic/components/nav.json +0 -18
  38. package/r/semantic/components/section.json +0 -17
  39. package/r/semantic/components/sheet.json +0 -18
  40. package/r/semantic/index.json +0 -130
  41. package/r/semantic/lib/utils.json +0 -18
  42. package/r/semantic/ui/alert.json +0 -18
  43. package/r/semantic/ui/avatar.json +0 -17
  44. package/r/semantic/ui/badge.json +0 -18
  45. package/r/semantic/ui/breadcrumb.json +0 -19
  46. package/r/semantic/ui/button.json +0 -18
  47. package/r/semantic/ui/card.json +0 -17
  48. package/r/semantic/ui/input.json +0 -17
  49. package/r/semantic/ui/label.json +0 -17
  50. package/r/semantic/ui/link.json +0 -18
  51. package/r/semantic/ui/skeleton.json +0 -15
  52. package/r/semantic/ui/table.json +0 -17
  53. package/r/semantic/ui/textarea.json +0 -17
  54. package/r/utility/components/article.json +0 -17
  55. package/r/utility/components/aside.json +0 -17
  56. package/r/utility/components/footer.json +0 -17
  57. package/r/utility/components/header.json +0 -17
  58. package/r/utility/components/main.json +0 -17
  59. package/r/utility/components/markup.json +0 -17
  60. package/r/utility/components/media.json +0 -17
  61. package/r/utility/components/nav.json +0 -18
  62. package/r/utility/components/navbar.json +0 -15
  63. package/r/utility/components/section.json +0 -17
  64. package/r/utility/components/sheet.json +0 -18
  65. package/r/utility/index.json +0 -135
  66. package/r/utility/lib/utils.json +0 -18
  67. package/r/utility/ui/alert.json +0 -18
  68. package/r/utility/ui/avatar.json +0 -17
  69. package/r/utility/ui/badge.json +0 -19
  70. package/r/utility/ui/breadcrumb.json +0 -19
  71. package/r/utility/ui/button.json +0 -19
  72. package/r/utility/ui/card.json +0 -17
  73. package/r/utility/ui/input.json +0 -17
  74. package/r/utility/ui/label.json +0 -17
  75. package/r/utility/ui/link.json +0 -18
  76. package/r/utility/ui/skeleton.json +0 -15
  77. package/r/utility/ui/table.json +0 -17
  78. package/r/utility/ui/textarea.json +0 -17
package/README.md CHANGED
@@ -1,194 +1,211 @@
1
- ## Semantic Components Integration Guide
2
-
3
- ### CLI Installation (Recommended)
4
-
5
- The semantic registry extends utility components with enhanced styling and behavior. Follow these steps:
6
-
7
- #### 1. Initialize Base Registry (Required)
8
- ```bash
9
- # Initialize utility registry first (foundation requirement)
10
- npx buildy-ui@latest init
11
- ```
12
-
13
- #### 2. Initialize Semantic Registry
14
- ```bash
15
- # Initialize semantic registry
16
- npx buildy-ui@latest init --registry semantic
17
-
18
- # Skip prompts and use defaults
19
- npx buildy-ui@latest init --yes --registry semantic
20
- ```
21
-
22
- #### 3. Add Semantic Components
23
- ```bash
24
- # Add specific semantic components
25
- npx buildy-ui@latest add button card --registry semantic
26
- npx buildy-ui@latest add input --registry semantic
27
-
28
- # Install ALL semantic components at once
29
- npx buildy-ui@latest add --all --registry semantic
30
-
31
- # Preview what would be installed
32
- npx buildy-ui@latest add --all --dry-run --registry semantic
33
-
34
- # Force overwrite existing files
35
- npx buildy-ui@latest add button --force --registry semantic
36
- ```
37
-
38
- #### Project Structure After Installation
39
- ```
40
- semantic/
41
- ├── ui/ # Semantic UI components
42
- ├── blocks/ # Semantic blocks
43
- ├── components/ # Semantic components
44
- ├── templates/ # Semantic templates
45
- └── buildy.config.json
46
-
47
- utility/ # Base registry (required)
48
- ├── ui/
49
- ├── blocks/
50
- └── buildy.config.json
51
-
52
- lib/ # Shared utilities
53
- └── utils.ts
54
- ```
55
-
56
- ## CSS Integration with Tailwind (PROD Mode)
57
-
58
- ### Package Installation (Recommended for Tailwind projects)
59
-
60
- Since semantic CSS files contain Tailwind directives (`@apply`), they must be processed during build time:
61
-
62
- ```bash
63
- # Install the CSS package
64
- npm install ui8kit@latest
65
- # or
66
- yarn add ui8kit@latest
67
- # or
68
- pnpm add ui8kit@latest
69
- # or
70
- bun add ui8kit@latest
71
- ```
72
-
73
- ### Import in your CSS/SCSS files
74
-
75
- ```css
76
- /* Import all semantic styles */
77
- @import "ui8kit/css/dist/semantic/index.css";
78
-
79
- /* Or import individual components */
80
- @import "ui8kit/css/dist/semantic/button.css";
81
- @import "ui8kit/css/dist/semantic/card.css";
82
- @import "ui8kit/css/dist/semantic/input.css";
83
- ```
84
-
85
- ### Why Package Installation is Required
86
-
87
- Semantic CSS files contain Tailwind directives that need compilation:
88
-
89
- ```css
90
- /* Example from button.css */
91
- .button-default {
92
- @apply bg-primary text-primary-foreground shadow-xs hover:bg-primary/90;
93
- }
94
-
95
- .button-secondary {
96
- @apply bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90;
97
- }
98
- ```
99
-
100
- ### CDN vs Package Comparison
101
-
102
- | Method | Use Case | Tailwind Directives | Build Required |
103
- |--------|----------|-------------------|----------------|
104
- | **Package** | Production projects | ✅ Supported | ✅ Required |
105
- | **CDN** | Quick prototyping | ❌ Pre-compiled only | ❌ Not required |
106
-
107
- ### Integration with Tailwind Config
108
-
109
- Add the package path to your `tailwind.config.js` for proper purging:
110
-
111
- ```js
112
- /** @type {import('tailwindcss').Config} */
113
- module.exports = {
114
- content: [
115
- "./src/**/*.{js,ts,jsx,tsx}",
116
- "./node_modules/ui8kit/**/*.{js,ts,jsx,tsx}", // Add this line
117
- ],
118
- // ... rest of your config
119
- }
120
- ```
121
-
122
- **Note**: CDN links with `@import` URLs will remain as external references and won't be processed by Tailwind's build system.
123
-
124
- ### CDN Integration
125
-
126
- For projects that prefer CDN over CLI installation:
127
-
128
- #### Compiled Semantic Stylesheet
129
- ```html
130
- <!-- Load compiled semantic components -->
131
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/styles.css">
132
- <!-- OR -->
133
- <link rel="stylesheet" href="https://unpkg.com/ui8kit@latest/css/dist/styles.css">
134
- ```
135
-
136
- ### Usage Examples
137
-
138
- #### With CLI Installation
139
- ```jsx
140
- // After CLI installation, components are available via aliases
141
- import { Button } from '@/semantic/ui/button'
142
- import { Card } from '@/semantic/ui/card'
143
-
144
- function App() {
145
- return (
146
- <Card>
147
- <Button variant="secondary">Semantic Button</Button>
148
- </Card>
149
- )
150
- }
151
- ```
152
-
153
- #### With CDN Integration
154
- ```html
155
- <!DOCTYPE html>
156
- <html>
157
- <head>
158
- <!-- Load compiled semantic styles -->
159
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/styles.css">
160
- </head>
161
- <body>
162
- <!-- Use semantic classes directly -->
163
- <div class="card">
164
- <button class="button button-secondary button-lg">
165
- Semantic Button
166
- </button>
167
- </div>
168
- </body>
169
- </html>
170
- ```
171
-
172
- ### Registry Dependencies
173
-
174
- **Important**: Semantic registry requires utility registry as foundation:
175
- - Utility registry must be initialized first
176
- - Components must exist in utility before installing in semantic
177
- - Cannot use semantic registry without utility base
178
-
179
- ### Performance Considerations
180
-
181
- **CLI Method**:
182
- - Tree-shaking friendly
183
- - Only includes used components
184
- - ✅ TypeScript support
185
- - Local development workflow
186
-
187
- **CDN Method**:
188
- - No build step required
189
- - Instant integration
190
- - ✅ Cacheable across projects
191
- - ⚠️ Individual files = multiple HTTP requests
192
- - ⚠️ Full bundle may include unused styles
193
-
194
- Choose CLI for development projects, CDN for quick prototyping or static sites.
1
+ # ui8kit CLI
2
+
3
+ Official CLI for bootstrapping and managing UI8Kit component workflows in Vite React projects.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js `>=18`
8
+ - A Vite React project (for `init` and `add`)
9
+
10
+ ## Quick Start
11
+
12
+ ```bash
13
+ bunx ui8kit@latest init
14
+ ```
15
+
16
+ Initialize with defaults (non-interactive):
17
+
18
+ ```bash
19
+ bunx ui8kit@latest init --yes
20
+ ```
21
+
22
+ ## Commands
23
+
24
+ ### `init`
25
+
26
+ Initialize UI8Kit structure and config in the current project.
27
+
28
+ ```bash
29
+ bunx ui8kit@latest init
30
+ bunx ui8kit@latest init --yes
31
+ bunx ui8kit@latest init --registry ui
32
+ ```
33
+
34
+ Options:
35
+
36
+ - `-y, --yes` Skip prompts and use defaults
37
+ - `-r, --registry <type>` Registry type (default: `ui`)
38
+
39
+ When running without `--yes`, `init` now asks for:
40
+
41
+ - Global CSS file path (default: `src/index.css`)
42
+ - Import alias for components (default: `@/components`)
43
+
44
+ `typescript` is always set to `true` and `framework` is fixed to `vite-react`.
45
+
46
+ ### `add`
47
+
48
+ Install one or more components from the registry.
49
+
50
+ ```bash
51
+ bunx ui8kit@latest add button
52
+ bunx ui8kit@latest add button card
53
+ bunx ui8kit@latest add --all
54
+ bunx ui8kit@latest add badge --force
55
+ bunx ui8kit@latest add button --dry-run
56
+ bunx ui8kit@latest add --all --retry
57
+ bunx ui8kit@latest --no-cache add button --dry-run
58
+ ```
59
+
60
+ Calling `add` without component arguments opens an interactive multiselect list grouped by component type.
61
+ Resolved registry dependencies are installed in dependency order automatically.
62
+ `add` now prints progress counters for multi-component installs in the format `[n/total]`.
63
+ `--dry-run` now also shows:
64
+ - full target file paths
65
+ - overwrite/create status for each file
66
+ - registry dependency tree
67
+ - compact diff preview for files that already exist locally
68
+
69
+ Options:
70
+
71
+ - `-a, --all` Install all available components
72
+ - `-f, --force` Overwrite existing files
73
+ - `-r, --registry <type>` Registry type (default: `ui`)
74
+ - `--dry-run` Show planned actions without writing files
75
+ - `--retry` Enable retry logic for unstable connections
76
+ - `--no-cache` (root option) bypasses cache for this run.
77
+
78
+ ### `list`
79
+
80
+ List available components from the registry.
81
+ Grouped by component type and sorted alphabetically.
82
+
83
+ ```bash
84
+ bunx ui8kit@latest list
85
+ bunx ui8kit@latest list --registry ui
86
+ bunx ui8kit@latest list --json
87
+ ```
88
+
89
+ Options:
90
+
91
+ - `-r, --registry <type>` Registry type (default: `ui`)
92
+ - `--json` Print JSON output instead of table
93
+
94
+ ### `diff`
95
+
96
+ Show differences between local components and registry versions using unified diff output.
97
+ Useful to check which installed components are outdated.
98
+
99
+ ```bash
100
+ bunx ui8kit@latest diff
101
+ bunx ui8kit@latest diff button
102
+ bunx ui8kit@latest diff --json
103
+ ```
104
+
105
+ Options:
106
+
107
+ - `[component]` Optional component name
108
+ - `-r, --registry <type>` Registry type (default: `ui`)
109
+ - `--json` Print diff summary as JSON
110
+
111
+ Examples:
112
+
113
+ ```bash
114
+ bunx ui8kit@latest diff button
115
+ ```
116
+
117
+ ### `cache`
118
+
119
+ Manage local registry cache.
120
+
121
+ ```bash
122
+ bunx ui8kit@latest cache clear
123
+ ```
124
+
125
+ ### `info`
126
+
127
+ Show local environment and configuration diagnostics.
128
+
129
+ ```bash
130
+ bunx ui8kit@latest info
131
+ bunx ui8kit@latest --no-cache info
132
+ ```
133
+
134
+ Use `--no-cache` in any command to skip reading cached registry data.
135
+
136
+ ```bash
137
+ bunx ui8kit@latest --no-cache diff
138
+ bunx ui8kit@latest --no-cache list --json
139
+ ```
140
+
141
+ ### `scan`
142
+
143
+ Scan source files and generate a registry manifest.
144
+
145
+ ```bash
146
+ bunx ui8kit@latest scan
147
+ bunx ui8kit@latest scan --source ./src --output ./src/registry.json
148
+ ```
149
+
150
+ Options:
151
+
152
+ - `-r, --registry <type|path>` Registry type/path (default: `ui`)
153
+ - `-o, --output <file>` Output registry file
154
+ - `-s, --source <dir>` Source directory to scan
155
+
156
+ ### `build`
157
+
158
+ Build a publishable registry from a registry JSON file.
159
+
160
+ ```bash
161
+ bunx ui8kit@latest build
162
+ bunx ui8kit@latest build ./src/registry.json
163
+ bunx ui8kit@latest build ./src/registry.json --output ./packages/registry/r
164
+ ```
165
+
166
+ Options:
167
+
168
+ - `[registry]` Path to registry JSON (default: `./src/registry.json`)
169
+ - `-o, --output <path>` Output directory (default: `./packages/registry/r`)
170
+
171
+ ### Global options
172
+
173
+ These options work for all commands and are defined at the CLI root:
174
+
175
+ - `-c, --cwd <dir>` Working directory for command execution (default: current directory)
176
+ - `-v, --verbose` Enable verbose output including debug logs from registry/CDN operations
177
+ - `--no-cache` Bypass local filesystem cache for registry lookups
178
+
179
+ ## Typical Flow
180
+
181
+ ```bash
182
+ # 1) Initialize project
183
+ bunx ui8kit@latest init --yes
184
+
185
+ # 2) Add a component
186
+ bunx ui8kit@latest add button
187
+
188
+ # 3) Add everything from registry (optional)
189
+ bunx ui8kit@latest add --all
190
+ ```
191
+
192
+ ## Local Development (this package)
193
+
194
+ From `packages/cli`:
195
+
196
+ ```bash
197
+ npm install
198
+ npm run dev
199
+ ```
200
+
201
+ Build once:
202
+
203
+ ```bash
204
+ npm run build
205
+ ```
206
+
207
+ Run compiled CLI locally:
208
+
209
+ ```bash
210
+ node dist/index.js --help
211
+ ```
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node