ui8kit 1.1.0 → 1.3.5

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.
package/README.md CHANGED
@@ -1,125 +1,211 @@
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
- ### `add`
40
-
41
- Install one or more components from the registry.
42
-
43
- ```bash
44
- bunx ui8kit@latest add button
45
- bunx ui8kit@latest add button card
46
- bunx ui8kit@latest add --all
47
- bunx ui8kit@latest add badge --force
48
- bunx ui8kit@latest add button --dry-run
49
- bunx ui8kit@latest add --all --retry
50
- ```
51
-
52
- Options:
53
-
54
- - `-a, --all` Install all available components
55
- - `-f, --force` Overwrite existing files
56
- - `-r, --registry <type>` Registry type (default: `ui`)
57
- - `--dry-run` Show planned actions without writing files
58
- - `--retry` Enable retry logic for unstable connections
59
-
60
- ### `scan`
61
-
62
- Scan source files and generate a registry manifest.
63
-
64
- ```bash
65
- bunx ui8kit@latest scan
66
- bunx ui8kit@latest scan --cwd ./apps/engine
67
- bunx ui8kit@latest scan --source ./src --output ./src/registry.json
68
- ```
69
-
70
- Options:
71
-
72
- - `-r, --registry <type|path>` Registry type/path (default: `ui`)
73
- - `-o, --output <file>` Output registry file
74
- - `-s, --source <dir>` Source directory to scan
75
- - `--cwd <dir>` Working directory
76
-
77
- ### `build`
78
-
79
- Build a publishable registry from a registry JSON file.
80
-
81
- ```bash
82
- bunx ui8kit@latest build
83
- bunx ui8kit@latest build ./src/registry.json
84
- bunx ui8kit@latest build ./src/registry.json --output ./packages/registry/r
85
- ```
86
-
87
- Options:
88
-
89
- - `[registry]` Path to registry JSON (default: `./src/registry.json`)
90
- - `-o, --output <path>` Output directory (default: `./packages/registry/r`)
91
- - `-c, --cwd <cwd>` Working directory
92
-
93
- ## Typical Flow
94
-
95
- ```bash
96
- # 1) Initialize project
97
- bunx ui8kit@latest init --yes
98
-
99
- # 2) Add a component
100
- bunx ui8kit@latest add button
101
-
102
- # 3) Add everything from registry (optional)
103
- bunx ui8kit@latest add --all
104
- ```
105
-
106
- ## Local Development (this package)
107
-
108
- From `packages/cli`:
109
-
110
- ```bash
111
- npm install
112
- npm run dev
113
- ```
114
-
115
- Build once:
116
-
117
- ```bash
118
- npm run build
119
- ```
120
-
121
- Run compiled CLI locally:
122
-
123
- ```bash
124
- node dist/index.js --help
125
- ```
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
+ ```