trix-ui 0.2.1 → 0.2.3

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 (69) hide show
  1. package/README.md +306 -215
  2. package/dist/commands/add/__tests__/add.test.js +16 -4
  3. package/dist/commands/add/__tests__/add.test.js.map +1 -1
  4. package/dist/commands/add/analysis.js +6 -1
  5. package/dist/commands/add/analysis.js.map +1 -1
  6. package/dist/commands/add/command.js +6 -0
  7. package/dist/commands/add/command.js.map +1 -1
  8. package/dist/commands/add/types.d.ts +1 -0
  9. package/dist/commands/add/ui.js +4 -0
  10. package/dist/commands/add/ui.js.map +1 -1
  11. package/dist/commands/add-composite.d.ts +2 -0
  12. package/dist/commands/add-composite.js +202 -0
  13. package/dist/commands/add-composite.js.map +1 -0
  14. package/dist/commands/add-section.js +6 -0
  15. package/dist/commands/add-section.js.map +1 -1
  16. package/dist/commands/add-wrapper.js +6 -0
  17. package/dist/commands/add-wrapper.js.map +1 -1
  18. package/dist/commands/build.js +104 -104
  19. package/dist/commands/doctor.js +7 -2
  20. package/dist/commands/doctor.js.map +1 -1
  21. package/dist/commands/init/config.js +1 -0
  22. package/dist/commands/init/config.js.map +1 -1
  23. package/dist/commands/list.js +12 -4
  24. package/dist/commands/list.js.map +1 -1
  25. package/dist/commands/remove.js +24 -10
  26. package/dist/commands/remove.js.map +1 -1
  27. package/dist/commands/shared/add-collection.d.ts +2 -1
  28. package/dist/commands/shared/add-collection.js +8 -2
  29. package/dist/commands/shared/add-collection.js.map +1 -1
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/lib/config.d.ts +1 -0
  33. package/dist/lib/config.js +1 -0
  34. package/dist/lib/config.js.map +1 -1
  35. package/dist/lib/lockfile.d.ts +6 -5
  36. package/dist/lib/lockfile.js +3 -0
  37. package/dist/lib/lockfile.js.map +1 -1
  38. package/dist/lib/paths.d.ts +1 -0
  39. package/dist/lib/paths.js +1 -0
  40. package/dist/lib/paths.js.map +1 -1
  41. package/dist/lib/registry.d.ts +2 -0
  42. package/dist/lib/registry.js +11 -0
  43. package/dist/lib/registry.js.map +1 -1
  44. package/package.json +4 -3
  45. package/registry/index.json +204 -242
  46. package/templates/components/ui/avatar.tsx +109 -0
  47. package/templates/components/ui/badge.tsx +182 -182
  48. package/templates/components/ui/button.tsx +48 -44
  49. package/templates/components/ui/label.tsx +24 -0
  50. package/templates/composites/feature-collection-card.tsx +113 -0
  51. package/templates/composites/music-player-card.tsx +571 -0
  52. package/templates/composites/user-profile-card.tsx +145 -0
  53. package/templates/sections/signature-hero.tsx +92 -0
  54. package/templates/wrappers/Interative-wrapper.tsx +555 -0
  55. package/templates/wrappers/progress-wrapper.tsx +248 -0
  56. package/templates/wrappers/reveal-wrap.tsx +136 -0
  57. package/LICENSE.md +0 -21
  58. package/templates/components/ui/checkbox.tsx +0 -33
  59. package/templates/components/ui/dialog.tsx +0 -92
  60. package/templates/components/ui/dropdown.tsx +0 -75
  61. package/templates/components/ui/select.tsx +0 -24
  62. package/templates/components/ui/switch.tsx +0 -27
  63. package/templates/components/ui/toast.tsx +0 -100
  64. package/templates/sections/cta.tsx +0 -22
  65. package/templates/sections/feature-grid.tsx +0 -62
  66. package/templates/sections/hero.tsx +0 -63
  67. package/templates/wrappers/border-wrapper.tsx +0 -34
  68. package/templates/wrappers/glow-wrapper.tsx +0 -31
  69. package/templates/wrappers/lift-wrapper.tsx +0 -27
package/README.md CHANGED
@@ -1,215 +1,306 @@
1
- # trix-ui
2
-
3
- A small, registry-driven CLI that installs minimal, accessible UI components into your app.
4
-
5
- ## Install
6
-
7
- Use it with npx or install as a dev dependency.
8
-
9
- ```bash
10
- npx trix-ui init
11
- ```
12
-
13
- ```bash
14
- npm install -D trix-ui
15
- ui init
16
- ```
17
-
18
- ## Quickstart
19
-
20
- ```bash
21
- npx trix-ui init
22
- npx trix-ui add button card dialog
23
- npx trix-ui add-section hero
24
- npx trix-ui add-wrapper glow-wrapper
25
- npx trix-ui remove button
26
- npx trix-ui remove-section hero
27
- npx trix-ui remove-wrapper glow-wrapper
28
- npx trix-ui list
29
- npx trix-ui list-sections
30
- npx trix-ui list-wrappers
31
- npx trix-ui doctor
32
- ```
33
-
34
- ## Commands
35
-
36
- - `ui init` - Creates `components.json`, `components/ui`, `lib/utils.ts`, `styles/globals.css`, and `.ui/lock.json`.
37
- - `ui add <component...>` - Copies templates into `components/ui` and updates `.ui/lock.json`.
38
- - `ui add-section <section...>` - Copies section templates into `components/sections` and updates `.ui/lock.json`.
39
- - `ui add-wrapper <wrapper...>` - Copies wrapper templates into `components/wrappers` and updates `.ui/lock.json`.
40
- - `ui remove <component...>` - Removes only files tracked in `.ui/lock.json` (safe by default).
41
- - `ui remove-section <section...>` - Removes only section files tracked in `.ui/lock.json` (safe by default).
42
- - `ui remove-wrapper <wrapper...>` - Removes only wrapper files tracked in `.ui/lock.json` (safe by default).
43
- - `ui list` - Lists registry components.
44
- - `ui list-sections` - Lists registry sections.
45
- - `ui list-wrappers` - Lists registry wrappers.
46
- - `ui doctor` - Checks config, registry, and required files.
47
-
48
- ## Config (components.json)
49
-
50
- ```json
51
- {
52
- "schemaVersion": 1,
53
- "registry": {
54
- "type": "bundled"
55
- },
56
- "paths": {
57
- "components": "components/ui",
58
- "sections": "components/sections",
59
- "wrappers": "components/wrappers",
60
- "lib": "lib",
61
- "utils": "lib/utils.ts",
62
- "styles": "styles/globals.css"
63
- },
64
- "barrel": false
65
- }
66
- ```
67
-
68
- Notes:
69
- - `registry.type`:
70
- - `bundled` uses the registry packaged with the CLI (default).
71
- - Set `barrel: true` and run `ui init --barrel` to create `components/ui/index.ts`.
72
-
73
- ## Registry format
74
-
75
- `registry/index.json`:
76
-
77
- ```json
78
- {
79
- "version": 1,
80
- "components": [
81
- {
82
- "name": "button",
83
- "description": "Button with variants and focus ring.",
84
- "files": [
85
- {
86
- "source": "components/ui/button.tsx",
87
- "target": "{{components}}/button.tsx"
88
- }
89
- ],
90
- "dependencies": {
91
- "npm": ["clsx", "tailwind-merge"]
92
- }
93
- }
94
- ],
95
- "sections": [
96
- {
97
- "name": "hero",
98
- "description": "Hero section with headline, bullets, and CTAs.",
99
- "files": [
100
- {
101
- "source": "sections/hero.tsx",
102
- "target": "{{sections}}/hero.tsx"
103
- }
104
- ],
105
- "dependencies": {
106
- "local": ["badge", "button"]
107
- }
108
- }
109
- ],
110
- "wrappers": [
111
- {
112
- "name": "glow-wrapper",
113
- "description": "Glow effect wrapper for highlighting key components.",
114
- "files": [
115
- {
116
- "source": "wrappers/glow-wrapper.tsx",
117
- "target": "{{wrappers}}/glow-wrapper.tsx"
118
- }
119
- ]
120
- }
121
- ]
122
- }
123
- ```
124
-
125
- - `source` is relative to `templates/`.
126
- - `target` supports tokens: `{{components}}`, `{{sections}}`, `{{wrappers}}`, `{{lib}}`, `{{styles}}`.
127
- - `dependencies.local` installs registry components before the section or wrapper.
128
- - `dependencies.npm` are printed after install; you install them manually.
129
-
130
- ## Add a new component
131
-
132
- 1. Create a template in `templates/components/ui/<name>.tsx`.
133
- 2. Add a registry entry in `registry/index.json`.
134
- 3. Run `ui add <name>` in your app.
135
-
136
- ## Add a new section
137
-
138
- 1. Create a template in `templates/sections/<name>.tsx`.
139
- 2. Add a registry entry in `registry/index.json` under `sections`.
140
- 3. Run `ui add-section <name>` in your app.
141
-
142
- ## Add a new wrapper
143
-
144
- 1. Create a template in `templates/wrappers/<name>.tsx`.
145
- 2. Add a registry entry in `registry/index.json` under `wrappers`.
146
- 3. Run `ui add-wrapper <name>` in your app.
147
-
148
- ## Tailwind setup
149
-
150
- Add CSS variables in `styles/globals.css` (installed by `ui init`).
151
- In your Tailwind config, map colors to CSS variables, for example:
152
-
153
- ```ts
154
- export default {
155
- theme: {
156
- extend: {
157
- colors: {
158
- border: "hsl(var(--border))",
159
- input: "hsl(var(--input))",
160
- ring: "hsl(var(--ring))",
161
- background: "hsl(var(--background))",
162
- foreground: "hsl(var(--foreground))",
163
- primary: {
164
- DEFAULT: "hsl(var(--primary))",
165
- foreground: "hsl(var(--primary-foreground))"
166
- },
167
- secondary: {
168
- DEFAULT: "hsl(var(--secondary))",
169
- foreground: "hsl(var(--secondary-foreground))"
170
- },
171
- muted: {
172
- DEFAULT: "hsl(var(--muted))",
173
- foreground: "hsl(var(--muted-foreground))"
174
- },
175
- accent: {
176
- DEFAULT: "hsl(var(--accent))",
177
- foreground: "hsl(var(--accent-foreground))"
178
- },
179
- destructive: {
180
- DEFAULT: "hsl(var(--destructive))",
181
- foreground: "hsl(var(--destructive-foreground))"
182
- },
183
- card: {
184
- DEFAULT: "hsl(var(--card))",
185
- foreground: "hsl(var(--card-foreground))"
186
- },
187
- popover: {
188
- DEFAULT: "hsl(var(--popover))",
189
- foreground: "hsl(var(--popover-foreground))"
190
- }
191
- },
192
- borderRadius: {
193
- lg: "var(--radius)",
194
- md: "calc(var(--radius) - 2px)",
195
- sm: "calc(var(--radius) - 4px)"
196
- }
197
- }
198
- }
199
- }
200
- ```
201
-
202
- ## Troubleshooting
203
-
204
- `ui doctor` reports common issues:
205
- - missing `components.json`
206
- - missing `components/ui` directory
207
- - missing `lib/utils.ts` or `styles/globals.css`
208
- - registry load failures
209
- - missing `.ui/lock.json`
210
-
211
- ## Notes
212
-
213
- - Requires Node 18+ for built-in `fetch`.
214
- - Paths are stored in `.ui/lock.json` relative to the project root for Windows/Mac safety.
215
-
1
+ <!-- # trix-ui
2
+
3
+ A small, registry-driven CLI that installs minimal, accessible UI components into your app.
4
+
5
+ ## Install
6
+
7
+ Use it with npx or install as a dev dependency.
8
+
9
+ ```bash
10
+ npx trix-ui init
11
+ ```
12
+
13
+ ```bash
14
+ npm install -D trix-ui
15
+ ui init
16
+ ```
17
+
18
+ ## Quickstart
19
+
20
+ ```bash
21
+ npx trix-ui init
22
+ npx trix-ui add button card dialog
23
+ npx trix-ui add-section hero
24
+ npx trix-ui add-wrapper glow-wrapper
25
+ npx trix-ui remove button
26
+ npx trix-ui remove --section hero
27
+ npx trix-ui remove --wrapper glow-wrapper
28
+ npx trix-ui list
29
+ npx trix-ui list --type sections
30
+ npx trix-ui list --type wrappers
31
+ npx trix-ui doctor
32
+ ```
33
+
34
+ ## How it works (detailed)
35
+
36
+ ### High-level model
37
+ `trix-ui` is a registry-driven CLI. It installs UI assets into your app by copying
38
+ templates and recording those installs in a lockfile. The registry is a JSON catalog
39
+ of components, sections, wrappers, and composites. Each entry describes:
40
+ - which template files to copy
41
+ - where those files should land in your project
42
+ - any local or npm dependencies
43
+
44
+ ### Core files and directories
45
+ When you run `ui init`, the CLI prepares a project for installs:
46
+ - `trix-ui.json` (config)
47
+ - `components/ui`, `components/sections`, `components/wrappers`, `components/composites`
48
+ - `lib/utils.ts`
49
+ - `styles/globals.css`
50
+ - `.ui/lock.json` (install tracking)
51
+
52
+ The lockfile is the source of truth for what the CLI has installed and is used
53
+ to safely remove files later.
54
+
55
+ ### Data flow (install)
56
+ 1. Resolve working directory (`--cwd` or `process.cwd()`).
57
+ 2. Load config from `trix-ui.json` (merged with defaults).
58
+ 3. Load registry (bundled by default or local if configured).
59
+ 4. Load lockfile (creates empty lockfile if none exists).
60
+ 5. Validate inputs (normalize names and verify registry entries).
61
+ 6. Analyze dependencies:
62
+ - `dependencies.local` installs other registry components first.
63
+ - `dependencies.npm` are collected for optional install.
64
+ 7. Handle conflicts (existing files/lockfile entries) with prompts, or `--force`.
65
+ 8. Copy templates into target paths.
66
+ 9. Update lockfile with installed entries and files.
67
+ 10. Optionally install npm dependencies (`--skip-deps` to skip).
68
+
69
+ ### Dependency resolution
70
+ - **Local dependencies** (`dependencies.local`) are other registry components and
71
+ are installed before sections/wrappers/composites.
72
+ - **NPM dependencies** (`dependencies.npm`) are optional and can be installed
73
+ by the CLI via your package manager.
74
+
75
+ ### Conflict handling
76
+ If a target file already exists or an entry is in the lockfile:
77
+ - Default: skip and warn.
78
+ - `--force`: overwrite files and update lockfile entries.
79
+ - `--yes`: auto-confirm prompts.
80
+
81
+ ### Safe removal
82
+ - `ui remove` and related commands remove only files tracked in `.ui/lock.json`.
83
+ - `--force` removes files based on registry targets even if not tracked.
84
+
85
+ ### Registry resolution
86
+ - **Bundled registry** (default): packaged with the CLI (`registry/index.json`).
87
+ - **Local registry**: configure `registry` in `trix-ui.json` to point to a custom
88
+ registry file (and optional templates path).
89
+
90
+ ### Tokens and path resolution
91
+ Registry `target` fields support tokens:
92
+ `{{components}}`, `{{sections}}`, `{{wrappers}}`, `{{composites}}`, `{{lib}}`, `{{styles}}`.
93
+ Tokens are resolved using `trix-ui.json` paths, then converted to absolute paths.
94
+ Note: `{{lib}}` resolves to the `paths.utils` file path.
95
+
96
+ ### Doctor command
97
+ `ui doctor` checks:
98
+ - config presence and validity
99
+ - required directories/files
100
+ - registry load errors
101
+ - lockfile existence
102
+
103
+ ## Commands
104
+
105
+ - `ui init` - Creates `trix-ui.json`, `components/ui`, `lib/utils.ts`, `styles/globals.css`, and `.ui/lock.json`.
106
+ - `ui add <component...>` - Copies templates into `components/ui` and updates `.ui/lock.json`.
107
+ - `ui add-section <section...>` - Copies section templates into `components/sections` and updates `.ui/lock.json`.
108
+ - `ui add-wrapper <wrapper...>` - Copies wrapper templates into `components/wrappers` and updates `.ui/lock.json`.
109
+ - `ui add-composite <composite...>` - Copies composite templates into `components/composites` and updates `.ui/lock.json`.
110
+ - `ui remove <component...>` - Removes only files tracked in `.ui/lock.json` (safe by default).
111
+ - `ui remove --section <section...>` - Removes only section files tracked in `.ui/lock.json` (safe by default).
112
+ - `ui remove --wrapper <wrapper...>` - Removes only wrapper files tracked in `.ui/lock.json` (safe by default).
113
+ - `ui remove --composite <composite...>` - Removes only composite files tracked in `.ui/lock.json` (safe by default).
114
+ - `ui list` - Lists registry components, sections, wrappers, and composites.
115
+ - `ui list --type sections` - Lists registry sections only.
116
+ - `ui list --type wrappers` - Lists registry wrappers only.
117
+ - `ui list --type composites` - Lists registry composites only.
118
+ - `ui doctor` - Checks config, registry, and required files.
119
+
120
+ ## Config (trix-ui.json)
121
+
122
+ ```json
123
+ {
124
+ "registry": {
125
+ "type": "bundled"
126
+ },
127
+ "paths": {
128
+ "components": "components/ui",
129
+ "sections": "components/sections",
130
+ "wrappers": "components/wrappers",
131
+ "composites": "components/composites",
132
+ "utils": "lib/utils.ts",
133
+ "styles": "styles/globals.css"
134
+ },
135
+ "barrel": false
136
+ }
137
+ ```
138
+
139
+ Notes:
140
+ - `registry.type`:
141
+ - `bundled` uses the registry packaged with the CLI (default).
142
+ - Set `barrel: true` and run `ui init --barrel` to create `components/ui/index.ts`.
143
+
144
+ ## Registry format
145
+
146
+ `registry/index.json`:
147
+
148
+ ```json
149
+ {
150
+ "version": 1,
151
+ "components": [
152
+ {
153
+ "name": "button",
154
+ "description": "Button with variants and focus ring.",
155
+ "files": [
156
+ {
157
+ "source": "components/ui/button.tsx",
158
+ "target": "{{components}}/button.tsx"
159
+ }
160
+ ],
161
+ "dependencies": {
162
+ "npm": ["clsx", "tailwind-merge"]
163
+ }
164
+ }
165
+ ],
166
+ "sections": [
167
+ {
168
+ "name": "hero",
169
+ "description": "Hero section with headline, bullets, and CTAs.",
170
+ "files": [
171
+ {
172
+ "source": "sections/hero.tsx",
173
+ "target": "{{sections}}/hero.tsx"
174
+ }
175
+ ],
176
+ "dependencies": {
177
+ "local": ["badge", "button"]
178
+ }
179
+ }
180
+ ],
181
+ "wrappers": [
182
+ {
183
+ "name": "glow-wrapper",
184
+ "description": "Glow effect wrapper for highlighting key components.",
185
+ "files": [
186
+ {
187
+ "source": "wrappers/glow-wrapper.tsx",
188
+ "target": "{{wrappers}}/glow-wrapper.tsx"
189
+ }
190
+ ]
191
+ }
192
+ ],
193
+ "composites": [
194
+ {
195
+ "name": "marketing-stack",
196
+ "description": "Composite layout for stacked marketing sections.",
197
+ "files": [
198
+ {
199
+ "source": "composites/marketing-stack.tsx",
200
+ "target": "{{composites}}/marketing-stack.tsx"
201
+ }
202
+ ],
203
+ "dependencies": {
204
+ "local": ["button", "card"]
205
+ }
206
+ }
207
+ ]
208
+ }
209
+ ```
210
+
211
+ - `source` is relative to `templates/`.
212
+ - `target` supports tokens: `{{components}}`, `{{sections}}`, `{{wrappers}}`, `{{composites}}`, `{{lib}}`, `{{styles}}`.
213
+ - `dependencies.local` installs registry components before the section, wrapper, or composite.
214
+ - `dependencies.npm` are printed after install; you install them manually.
215
+
216
+ ## Add a new component
217
+
218
+ 1. Create a template in `templates/components/ui/<name>.tsx`.
219
+ 2. Add a registry entry in `registry/index.json`.
220
+ 3. Run `ui add <name>` in your app.
221
+
222
+ ## Add a new section
223
+
224
+ 1. Create a template in `templates/sections/<name>.tsx`.
225
+ 2. Add a registry entry in `registry/index.json` under `sections`.
226
+ 3. Run `ui add-section <name>` in your app.
227
+
228
+ ## Add a new wrapper
229
+
230
+ 1. Create a template in `templates/wrappers/<name>.tsx`.
231
+ 2. Add a registry entry in `registry/index.json` under `wrappers`.
232
+ 3. Run `ui add-wrapper <name>` in your app.
233
+
234
+ ## Add a new composite
235
+
236
+ 1. Create a template in `templates/composites/<name>.tsx`.
237
+ 2. Add a registry entry in `registry/index.json` under `composites`.
238
+ 3. Run `ui add-composite <name>` in your app.
239
+
240
+ ## Tailwind setup
241
+
242
+ Add CSS variables in `styles/globals.css` (installed by `ui init`).
243
+ In your Tailwind config, map colors to CSS variables, for example:
244
+
245
+ ```ts
246
+ export default {
247
+ theme: {
248
+ extend: {
249
+ colors: {
250
+ border: "hsl(var(--border))",
251
+ input: "hsl(var(--input))",
252
+ ring: "hsl(var(--ring))",
253
+ background: "hsl(var(--background))",
254
+ foreground: "hsl(var(--foreground))",
255
+ primary: {
256
+ DEFAULT: "hsl(var(--primary))",
257
+ foreground: "hsl(var(--primary-foreground))"
258
+ },
259
+ secondary: {
260
+ DEFAULT: "hsl(var(--secondary))",
261
+ foreground: "hsl(var(--secondary-foreground))"
262
+ },
263
+ muted: {
264
+ DEFAULT: "hsl(var(--muted))",
265
+ foreground: "hsl(var(--muted-foreground))"
266
+ },
267
+ accent: {
268
+ DEFAULT: "hsl(var(--accent))",
269
+ foreground: "hsl(var(--accent-foreground))"
270
+ },
271
+ destructive: {
272
+ DEFAULT: "hsl(var(--destructive))",
273
+ foreground: "hsl(var(--destructive-foreground))"
274
+ },
275
+ card: {
276
+ DEFAULT: "hsl(var(--card))",
277
+ foreground: "hsl(var(--card-foreground))"
278
+ },
279
+ popover: {
280
+ DEFAULT: "hsl(var(--popover))",
281
+ foreground: "hsl(var(--popover-foreground))"
282
+ }
283
+ },
284
+ borderRadius: {
285
+ lg: "var(--radius)",
286
+ md: "calc(var(--radius) - 2px)",
287
+ sm: "calc(var(--radius) - 4px)"
288
+ }
289
+ }
290
+ }
291
+ }
292
+ ```
293
+
294
+ ## Troubleshooting
295
+
296
+ `ui doctor` reports common issues:
297
+ - missing `trix-ui.json`
298
+ - missing `components/ui` directory
299
+ - missing `lib/utils.ts` or `styles/globals.css`
300
+ - registry load failures
301
+ - missing `.ui/lock.json`
302
+
303
+ ## Notes
304
+
305
+ - Requires Node 18+ for built-in `fetch`.
306
+ - Paths are stored in `.ui/lock.json` relative to the project root for Windows/Mac safety. -->
@@ -37,8 +37,11 @@ describe("add command", () => {
37
37
  });
38
38
  analyzeDependencies.mockReturnValue({
39
39
  components: ["button"],
40
+ dependencies: new Set(),
41
+ npmDependencies: new Set(),
40
42
  conflicts: [],
41
- totalToInstall: 1
43
+ totalToInstall: 1,
44
+ missingDependencies: []
42
45
  });
43
46
  installComponents.mockResolvedValue({
44
47
  installed: ["button"],
@@ -61,8 +64,11 @@ describe("add command", () => {
61
64
  });
62
65
  analyzeDependencies.mockReturnValue({
63
66
  components: ["button", "card"],
67
+ dependencies: new Set(),
68
+ npmDependencies: new Set(),
64
69
  conflicts: [],
65
- totalToInstall: 2
70
+ totalToInstall: 2,
71
+ missingDependencies: []
66
72
  });
67
73
  installComponents.mockResolvedValue({
68
74
  installed: ["button", "card"],
@@ -84,8 +90,11 @@ describe("add command", () => {
84
90
  });
85
91
  analyzeDependencies.mockReturnValue({
86
92
  components: ["button"],
93
+ dependencies: new Set(),
94
+ npmDependencies: new Set(),
87
95
  conflicts: ["button"],
88
- totalToInstall: 0
96
+ totalToInstall: 0,
97
+ missingDependencies: []
89
98
  });
90
99
  installComponents.mockResolvedValue({
91
100
  installed: ["button"],
@@ -114,8 +123,11 @@ describe("add command", () => {
114
123
  });
115
124
  analyzeDependencies.mockReturnValue({
116
125
  components: ["hbutton"],
126
+ dependencies: new Set(),
127
+ npmDependencies: new Set(),
117
128
  conflicts: [],
118
- totalToInstall: 1
129
+ totalToInstall: 1,
130
+ missingDependencies: []
119
131
  });
120
132
  installComponents.mockResolvedValue({
121
133
  installed: [],
@@ -1 +1 @@
1
- {"version":3,"file":"add.test.js","sourceRoot":"","sources":["../../../../src/commands/add/__tests__/add.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAExK,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAEzC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;QAE9D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,oBA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,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -10,6 +10,7 @@ export function analyzeDependencies(components, registry, lockfile) {
10
10
  const allComponents = new Set(components);
11
11
  const dependencies = new Set();
12
12
  const npmDependencies = new Set();
13
+ const missingDependencies = new Set();
13
14
  const visited = new Set();
14
15
  const resolveDependencies = (componentName) => {
15
16
  if (visited.has(componentName)) {
@@ -18,6 +19,9 @@ export function analyzeDependencies(components, registry, lockfile) {
18
19
  visited.add(componentName);
19
20
  const entry = componentMap.get(componentName);
20
21
  if (!entry) {
22
+ missingDependencies.add(componentName);
23
+ allComponents.delete(componentName);
24
+ dependencies.delete(componentName);
21
25
  return;
22
26
  }
23
27
  for (const dep of collectLocalDependencies(entry)) {
@@ -46,7 +50,8 @@ export function analyzeDependencies(components, registry, lockfile) {
46
50
  dependencies,
47
51
  npmDependencies,
48
52
  conflicts,
49
- totalToInstall
53
+ totalToInstall,
54
+ missingDependencies: Array.from(missingDependencies).sort()
50
55
  };
51
56
  }
52
57
  //# sourceMappingURL=analysis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../../src/commands/add/analysis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,SAAS,wBAAwB,CAAC,KAAmB;IACnD,OAAO,KAAK,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAA;AACxC,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAmB;IACjD,OAAO,KAAK,CAAC,YAAY,EAAE,GAAG,IAAI,EAAE,CAAA;AACtC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,UAAoB,EACpB,QAAuB,EACvB,QAAkB;IAElB,MAAM,YAAY,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACjD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS,UAAU,CAAC,CAAA;IACjD,MAAM,YAAY,GAA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C"}
@@ -94,6 +94,12 @@ export const addCommand = new Command("add")
94
94
  spinner?.start("Analyzing dependencies...");
95
95
  const analysis = analyzeDependencies(validation.valid, registry, lockfile);
96
96
  spinner?.stop();
97
+ if (analysis.missingDependencies.length > 0) {
98
+ logger.error("Registry is missing required component dependencies:");
99
+ analysis.missingDependencies.forEach((name) => logger.error(` \u0007 ${name}`));
100
+ process.exit(1);
101
+ return;
102
+ }
97
103
  if (shouldLog) {
98
104
  displayInstallationPlan(analysis, options);
99
105
  }