@gilav21/shadcn-angular 0.0.25 → 0.0.26

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/dist/index.js CHANGED
@@ -1,19 +1,25 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs';
2
3
  import { Command } from 'commander';
3
4
  import { init } from './commands/init.js';
4
5
  import { add } from './commands/add.js';
6
+ import { diff } from './commands/diff.js';
7
+ import { list } from './commands/list.js';
5
8
  import { help } from './commands/help.js';
9
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
6
10
  const program = new Command();
7
11
  program
8
12
  .name('shadcn-angular')
9
13
  .description('CLI for adding shadcn-angular components to your Angular project')
10
- .version('0.0.10');
14
+ .version(pkg.version);
11
15
  program
12
16
  .command('init')
13
17
  .description('Initialize shadcn-angular in your project')
14
18
  .option('-y, --yes', 'Skip confirmation prompt')
15
19
  .option('-d, --defaults', 'Use default configuration')
20
+ .option('--remote', 'Force remote fetch from GitHub registry')
16
21
  .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
22
+ .option('-r, --registry <url>', 'Custom registry base URL (e.g., https://gitlab.com/org/repo/-/raw/main/packages/components)')
17
23
  .action(init);
18
24
  program
19
25
  .command('add')
@@ -24,8 +30,22 @@ program
24
30
  .option('-a, --all', 'Add all available components')
25
31
  .option('-p, --path <path>', 'The path to add the component to')
26
32
  .option('--remote', 'Force remote fetch from GitHub registry')
33
+ .option('--dry-run', 'Show what would be installed without making changes')
27
34
  .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
35
+ .option('-r, --registry <url>', 'Custom registry base URL (overrides components.json)')
28
36
  .action(add);
37
+ program
38
+ .command('diff')
39
+ .description('Show differences between local and remote component versions')
40
+ .argument('[components...]', 'Components to diff (all installed if omitted)')
41
+ .option('--remote', 'Force remote fetch from GitHub registry')
42
+ .option('-b, --branch <branch>', 'GitHub branch to fetch from', 'master')
43
+ .option('-r, --registry <url>', 'Custom registry base URL')
44
+ .action(diff);
45
+ program
46
+ .command('list')
47
+ .description('List all components and their install status')
48
+ .action(list);
29
49
  program
30
50
  .command('help')
31
51
  .description('Show detailed usage information')
@@ -3,18 +3,128 @@ export interface OptionalDependency {
3
3
  readonly description: string;
4
4
  }
5
5
  export interface ComponentDefinition {
6
- name: string;
7
- files: string[];
8
- peerFiles?: string[];
9
- dependencies?: string[];
10
- optionalDependencies?: readonly OptionalDependency[];
11
- npmDependencies?: string[];
12
- libFiles?: string[];
13
- shortcutDefinitions?: {
14
- exportName: string;
15
- componentName: string;
16
- sourceFile: string;
6
+ readonly name: string;
7
+ readonly files: readonly string[];
8
+ readonly peerFiles?: readonly string[];
9
+ readonly dependencies?: readonly string[];
10
+ readonly optionalDependencies?: readonly OptionalDependency[];
11
+ readonly npmDependencies?: readonly string[];
12
+ readonly libFiles?: readonly string[];
13
+ readonly shortcutDefinitions?: readonly {
14
+ readonly exportName: string;
15
+ readonly componentName: string;
16
+ readonly sourceFile: string;
17
17
  }[];
18
18
  }
19
+ export declare const registry: {
20
+ readonly accordion: ComponentDefinition;
21
+ readonly autocomplete: ComponentDefinition;
22
+ readonly alert: ComponentDefinition;
23
+ readonly 'alert-dialog': ComponentDefinition;
24
+ readonly 'aspect-ratio': ComponentDefinition;
25
+ readonly avatar: ComponentDefinition;
26
+ readonly badge: ComponentDefinition;
27
+ readonly breadcrumb: ComponentDefinition;
28
+ readonly button: ComponentDefinition;
29
+ readonly 'button-group': ComponentDefinition;
30
+ readonly calendar: ComponentDefinition;
31
+ readonly card: ComponentDefinition;
32
+ readonly carousel: ComponentDefinition;
33
+ readonly checkbox: ComponentDefinition;
34
+ readonly collapsible: ComponentDefinition;
35
+ readonly 'color-picker': ComponentDefinition;
36
+ readonly confetti: ComponentDefinition;
37
+ readonly command: ComponentDefinition;
38
+ readonly 'context-menu': ComponentDefinition;
39
+ readonly 'date-picker': ComponentDefinition;
40
+ readonly chat: ComponentDefinition;
41
+ readonly 'streaming-text': ComponentDefinition;
42
+ readonly sparkles: ComponentDefinition;
43
+ readonly 'code-block': ComponentDefinition;
44
+ readonly 'text-reveal': ComponentDefinition;
45
+ readonly 'data-table': ComponentDefinition;
46
+ readonly dialog: ComponentDefinition;
47
+ readonly dock: ComponentDefinition;
48
+ readonly 'tree-select': ComponentDefinition;
49
+ readonly 'virtual-scroll': ComponentDefinition;
50
+ readonly 'input-mask': ComponentDefinition;
51
+ readonly drawer: ComponentDefinition;
52
+ readonly 'dropdown-menu': ComponentDefinition;
53
+ readonly empty: ComponentDefinition;
54
+ readonly field: ComponentDefinition;
55
+ readonly icon: ComponentDefinition;
56
+ readonly 'file-upload': ComponentDefinition;
57
+ readonly 'file-viewer': ComponentDefinition;
58
+ readonly 'hover-card': ComponentDefinition;
59
+ readonly input: ComponentDefinition;
60
+ readonly 'input-group': ComponentDefinition;
61
+ readonly 'input-otp': ComponentDefinition;
62
+ readonly kbd: ComponentDefinition;
63
+ readonly label: ComponentDefinition;
64
+ readonly menubar: ComponentDefinition;
65
+ readonly 'native-select': ComponentDefinition;
66
+ readonly 'navigation-menu': ComponentDefinition;
67
+ readonly 'number-ticker': ComponentDefinition;
68
+ readonly pagination: ComponentDefinition;
69
+ readonly popover: ComponentDefinition;
70
+ readonly progress: ComponentDefinition;
71
+ readonly 'radio-group': ComponentDefinition;
72
+ readonly rating: ComponentDefinition;
73
+ readonly resizable: ComponentDefinition;
74
+ readonly 'scroll-area': ComponentDefinition;
75
+ readonly select: ComponentDefinition;
76
+ readonly separator: ComponentDefinition;
77
+ readonly sheet: ComponentDefinition;
78
+ readonly sidebar: ComponentDefinition;
79
+ readonly skeleton: ComponentDefinition;
80
+ readonly slider: ComponentDefinition;
81
+ readonly spinner: ComponentDefinition;
82
+ readonly stepper: ComponentDefinition;
83
+ readonly switch: ComponentDefinition;
84
+ readonly table: ComponentDefinition;
85
+ readonly tabs: ComponentDefinition;
86
+ readonly textarea: ComponentDefinition;
87
+ readonly timeline: ComponentDefinition;
88
+ readonly toast: ComponentDefinition;
89
+ readonly toggle: ComponentDefinition;
90
+ readonly 'toggle-group': ComponentDefinition;
91
+ readonly tooltip: ComponentDefinition;
92
+ readonly tree: ComponentDefinition;
93
+ readonly 'speed-dial': ComponentDefinition;
94
+ readonly 'chip-list': ComponentDefinition;
95
+ readonly 'emoji-picker': ComponentDefinition;
96
+ readonly 'rich-text-editor': ComponentDefinition;
97
+ readonly 'pie-chart': ComponentDefinition;
98
+ readonly 'pie-chart-drilldown': ComponentDefinition;
99
+ readonly 'bar-chart': ComponentDefinition;
100
+ readonly 'bar-chart-drilldown': ComponentDefinition;
101
+ readonly 'stacked-bar-chart': ComponentDefinition;
102
+ readonly 'column-range-chart': ComponentDefinition;
103
+ readonly 'bar-race-chart': ComponentDefinition;
104
+ readonly 'org-chart': ComponentDefinition;
105
+ readonly 'bento-grid': ComponentDefinition;
106
+ readonly 'page-builder': ComponentDefinition;
107
+ readonly 'component-outlet': ComponentDefinition;
108
+ readonly 'split-button': ComponentDefinition;
109
+ readonly 'gradient-text': ComponentDefinition;
110
+ readonly 'flip-text': ComponentDefinition;
111
+ readonly meteors: ComponentDefinition;
112
+ readonly 'shine-border': ComponentDefinition;
113
+ readonly 'scroll-progress': ComponentDefinition;
114
+ readonly 'blur-fade': ComponentDefinition;
115
+ readonly ripple: ComponentDefinition;
116
+ readonly marquee: ComponentDefinition;
117
+ readonly 'word-rotate': ComponentDefinition;
118
+ readonly 'morphing-text': ComponentDefinition;
119
+ readonly 'typing-animation': ComponentDefinition;
120
+ readonly 'wobble-card': ComponentDefinition;
121
+ readonly magnetic: ComponentDefinition;
122
+ readonly orbit: ComponentDefinition;
123
+ readonly 'stagger-children': ComponentDefinition;
124
+ readonly particles: ComponentDefinition;
125
+ readonly kanban: ComponentDefinition;
126
+ readonly 'shortcut-bindings-dialog': ComponentDefinition;
127
+ };
19
128
  export type ComponentName = keyof typeof registry;
20
- export declare const registry: Record<string, ComponentDefinition>;
129
+ export declare function isComponentName(name: string): name is ComponentName;
130
+ export declare function getComponentNames(): ComponentName[];
@@ -1,8 +1,9 @@
1
1
  // Component Registry - Defines available components and their file mappings
2
2
  // Actual component files are stored in packages/components/ui/
3
- // Registry maps component names to their file definitions
4
- // Files are relative to the components/ui directory
5
- export const registry = {
3
+ function defineRegistry(reg) {
4
+ return reg;
5
+ }
6
+ export const registry = defineRegistry({
6
7
  accordion: {
7
8
  name: 'accordion',
8
9
  files: ['accordion.component.ts'],
@@ -10,7 +11,7 @@ export const registry = {
10
11
  autocomplete: {
11
12
  name: 'autocomplete',
12
13
  files: ['autocomplete.component.ts', 'highlight.pipe.ts'],
13
- dependencies: ['popover', 'command', 'badge'],
14
+ dependencies: ['badge', 'command', 'popover'],
14
15
  },
15
16
  alert: {
16
17
  name: 'alert',
@@ -43,12 +44,11 @@ export const registry = {
43
44
  },
44
45
  'button-group': {
45
46
  name: 'button-group',
46
- files: ['button-group.component.ts'],
47
- dependencies: ['button']
47
+ files: ['button-group.component.ts']
48
48
  },
49
49
  calendar: {
50
50
  name: 'calendar',
51
- files: ['calendar.component.ts', 'calendar-locales.ts'],
51
+ files: ['calendar-locales.ts', 'calendar.component.ts'],
52
52
  dependencies: ['button', 'select'],
53
53
  },
54
54
  card: {
@@ -70,7 +70,7 @@ export const registry = {
70
70
  'color-picker': {
71
71
  name: 'color-picker',
72
72
  files: ['color-picker.component.ts'],
73
- dependencies: ['popover', 'input', 'tabs'],
73
+ dependencies: ['input', 'popover', 'tabs'],
74
74
  },
75
75
  confetti: {
76
76
  name: 'confetti',
@@ -91,7 +91,7 @@ export const registry = {
91
91
  },
92
92
  'context-menu': {
93
93
  name: 'context-menu',
94
- files: ['context-menu.component.ts', 'context-menu-integrations.ts'],
94
+ files: ['context-menu.component.ts'],
95
95
  },
96
96
  'date-picker': {
97
97
  name: 'date-picker',
@@ -101,7 +101,7 @@ export const registry = {
101
101
  chat: {
102
102
  name: 'chat',
103
103
  files: ['chat.component.ts'],
104
- dependencies: ['avatar', 'button', 'textarea', 'scroll-area'],
104
+ dependencies: ['avatar', 'button', 'scroll-area', 'textarea'],
105
105
  },
106
106
  'streaming-text': {
107
107
  name: 'streaming-text',
@@ -115,7 +115,7 @@ export const registry = {
115
115
  'code-block': {
116
116
  name: 'code-block',
117
117
  files: ['code-block.component.ts'],
118
- dependencies: ['button', 'scroll-area'],
118
+ dependencies: ['button'],
119
119
  },
120
120
  'text-reveal': {
121
121
  name: 'text-reveal',
@@ -123,31 +123,11 @@ export const registry = {
123
123
  },
124
124
  'data-table': {
125
125
  name: 'data-table',
126
- files: [
127
- 'data-table/data-table.component.ts',
128
- 'data-table/data-table-column-header.component.ts',
129
- 'data-table/data-table-pagination.component.ts',
130
- 'data-table/data-table-multiselect-filter.component.ts',
131
- 'data-table/data-table.types.ts',
132
- 'data-table/data-table.utils.ts',
133
- 'data-table/index.ts',
134
- ],
126
+ files: ['calendar-locales.ts', 'data-table/component-pool.service.ts', 'data-table/data-table-column-header.component.ts', 'data-table/data-table-date-filter.component.ts', 'data-table/data-table-multiselect-filter.component.ts', 'data-table/data-table-pagination.component.ts', 'data-table/data-table.component.ts', 'data-table/data-table.types.ts', 'data-table/data-table.utils.ts', 'data-table/index.ts'],
135
127
  peerFiles: [
136
128
  'context-menu-integrations.ts',
137
129
  ],
138
- dependencies: [
139
- 'table',
140
- 'input',
141
- 'button',
142
- 'checkbox',
143
- 'select',
144
- 'pagination',
145
- 'popover',
146
- 'component-outlet',
147
- 'icon',
148
- 'command',
149
- 'badge',
150
- ],
130
+ dependencies: ['badge', 'button', 'calendar', 'checkbox', 'command', 'component-outlet', 'context-menu', 'icon', 'input', 'pagination', 'popover', 'select', 'table'],
151
131
  libFiles: ['xlsx.ts'],
152
132
  optionalDependencies: [
153
133
  { name: 'context-menu', description: 'Enables right-click context menus on rows and headers' },
@@ -159,18 +139,12 @@ export const registry = {
159
139
  },
160
140
  dock: {
161
141
  name: 'dock',
162
- files: [
163
- 'dock.component.ts',
164
- 'dock-item.component.ts',
165
- 'dock-icon.component.ts',
166
- 'dock-label.component.ts',
167
- ],
168
- dependencies: ['icon'],
142
+ files: ['dock-icon.component.ts', 'dock-item.component.ts', 'dock-label.component.ts', 'dock.component.ts'],
169
143
  },
170
144
  'tree-select': {
171
145
  name: 'tree-select',
172
146
  files: ['tree-select.component.ts'],
173
- dependencies: ['popover', 'tree', 'icon'],
147
+ dependencies: ['popover', 'tree'],
174
148
  },
175
149
  'virtual-scroll': {
176
150
  name: 'virtual-scroll',
@@ -199,7 +173,7 @@ export const registry = {
199
173
  },
200
174
  icon: {
201
175
  name: 'icon',
202
- files: ['icon.component.ts'],
176
+ files: ['icon.component.ts', 'icon.token.ts'],
203
177
  },
204
178
  'file-upload': {
205
179
  name: 'file-upload',
@@ -210,19 +184,7 @@ export const registry = {
210
184
  name: 'file-viewer',
211
185
  files: ['file-viewer.component.ts'],
212
186
  dependencies: ['spinner'],
213
- libFiles: [
214
- 'file-type-detector.ts',
215
- 'inflate.ts',
216
- 'zip-reader.ts',
217
- 'image-validator.ts',
218
- 'ole2-reader.ts',
219
- 'pptx-parser.ts',
220
- 'xlsx-reader.ts',
221
- 'docx-parser.ts',
222
- 'doc-enhanced-parser.ts',
223
- 'ppt-parser.ts',
224
- 'svg-sanitizer.ts',
225
- ],
187
+ libFiles: ['doc-enhanced-parser.ts', 'docx-parser.ts', 'file-type-detector.ts', 'image-validator.ts', 'inflate.ts', 'ole2-reader.ts', 'ppt-parser.ts', 'pptx-parser.ts', 'svg-sanitizer.ts', 'xlsx-reader.ts', 'zip-reader.ts'],
226
188
  },
227
189
  'hover-card': {
228
190
  name: 'hover-card',
@@ -230,12 +192,11 @@ export const registry = {
230
192
  },
231
193
  input: {
232
194
  name: 'input',
233
- files: ['input.component.ts', 'input-group.token.ts'],
195
+ files: ['input-group.token.ts', 'input.component.ts'],
234
196
  },
235
197
  'input-group': {
236
198
  name: 'input-group',
237
199
  files: ['input-group.component.ts', 'input-group.token.ts'],
238
- dependencies: ['input'],
239
200
  },
240
201
  'input-otp': {
241
202
  name: 'input-otp',
@@ -308,7 +269,7 @@ export const registry = {
308
269
  sidebar: {
309
270
  name: 'sidebar',
310
271
  files: ['sidebar.component.ts'],
311
- dependencies: ['scroll-area', 'tooltip', 'icon'],
272
+ dependencies: ['scroll-area', 'tooltip'],
312
273
  },
313
274
  skeleton: {
314
275
  name: 'skeleton',
@@ -340,7 +301,7 @@ export const registry = {
340
301
  },
341
302
  textarea: {
342
303
  name: 'textarea',
343
- files: ['textarea.component.ts', 'input-group.token.ts'],
304
+ files: ['input-group.token.ts', 'textarea.component.ts'],
344
305
  },
345
306
  timeline: {
346
307
  name: 'timeline',
@@ -365,60 +326,29 @@ export const registry = {
365
326
  tree: {
366
327
  name: 'tree',
367
328
  files: ['tree.component.ts'],
368
- dependencies: ['icon'],
369
329
  optionalDependencies: [
370
330
  { name: 'context-menu', description: 'Enables right-click context menus on tree nodes' },
371
331
  ],
372
332
  },
373
333
  'speed-dial': {
374
334
  name: 'speed-dial',
375
- files: ['speed-dial.component.ts'],
376
- dependencies: ['button']
335
+ files: ['speed-dial.component.ts']
377
336
  },
378
337
  'chip-list': {
379
338
  name: 'chip-list',
380
- files: ['chip-list.component.ts'],
381
- dependencies: ['badge', 'button', 'input', 'input-group'],
339
+ files: ['chip-list.component.ts', 'input-group.token.ts'],
340
+ dependencies: ['badge', 'button', 'input'],
382
341
  },
383
342
  'emoji-picker': {
384
343
  name: 'emoji-picker',
385
- files: ['emoji-picker.component.ts', 'emoji-data.ts'],
344
+ files: ['emoji-data.ts', 'emoji-picker.component.ts'],
386
345
  dependencies: ['input', 'scroll-area', 'tooltip'],
387
346
  },
388
347
  'rich-text-editor': {
389
348
  name: 'rich-text-editor',
390
- files: [
391
- 'rich-text-editor.component.ts',
392
- 'rich-text-toolbar.component.ts',
393
- 'rich-text-sanitizer.service.ts',
394
- 'rich-text-markdown.service.ts',
395
- 'rich-text-paste-normalizer.service.ts',
396
- 'rich-text-command-registry.service.ts',
397
- 'rich-text-mention.component.ts',
398
- 'rich-text-image-resizer.component.ts',
399
- 'rich-text-locales.ts',
400
- ],
401
- dependencies: [
402
- 'button',
403
- 'separator',
404
- 'popover',
405
- 'emoji-picker',
406
- 'autocomplete',
407
- 'select',
408
- 'input',
409
- 'dialog',
410
- 'scroll-area',
411
- ],
412
- libFiles: [
413
- 'pdf-parser.ts',
414
- 'image-validator.ts',
415
- 'svg-sanitizer.ts',
416
- 'shortcut-binding.service.ts',
417
- 'docx-parser.ts',
418
- 'docx-to-editor-html.ts',
419
- 'zip-reader.ts',
420
- 'inflate.ts',
421
- ],
349
+ files: ['rich-text-command-registry.service.ts', 'rich-text-editor.component.ts', 'rich-text-image-resizer.component.ts', 'rich-text-locales.ts', 'rich-text-markdown.service.ts', 'rich-text-mention.component.ts', 'rich-text-paste-normalizer.service.ts', 'rich-text-sanitizer.service.ts', 'rich-text-toolbar.component.ts'],
350
+ dependencies: ['autocomplete', 'button', 'dialog', 'emoji-picker', 'popover', 'scroll-area', 'separator'],
351
+ libFiles: ['docx-parser.ts', 'docx-to-editor-html.ts', 'image-validator.ts', 'inflate.ts', 'pdf-parser.ts', 'shortcut-binding.service.ts', 'svg-sanitizer.ts', 'zip-reader.ts'],
422
352
  shortcutDefinitions: [
423
353
  {
424
354
  exportName: 'RICH_TEXT_SHORTCUT_DEFINITIONS',
@@ -430,102 +360,54 @@ export const registry = {
430
360
  // Chart Components
431
361
  'pie-chart': {
432
362
  name: 'pie-chart',
433
- files: [
434
- 'charts/pie-chart.component.ts',
435
- 'charts/chart.types.ts',
436
- 'charts/chart.utils.ts',
437
- ],
363
+ files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/pie-chart.component.ts'],
438
364
  },
439
365
  'pie-chart-drilldown': {
440
366
  name: 'pie-chart-drilldown',
441
- files: [
442
- 'charts/pie-chart-drilldown.component.ts',
443
- 'charts/chart.types.ts',
444
- 'charts/chart.utils.ts',
445
- ],
367
+ files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/pie-chart-drilldown.component.ts'],
446
368
  },
447
369
  'bar-chart': {
448
370
  name: 'bar-chart',
449
- files: [
450
- 'charts/bar-chart.component.ts',
451
- 'charts/chart.types.ts',
452
- 'charts/chart.utils.ts',
453
- ],
371
+ files: ['charts/bar-chart.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
454
372
  },
455
373
  'bar-chart-drilldown': {
456
374
  name: 'bar-chart-drilldown',
457
- files: [
458
- 'charts/bar-chart-drilldown.component.ts',
459
- 'charts/chart.types.ts',
460
- 'charts/chart.utils.ts',
461
- ],
375
+ files: ['charts/bar-chart-drilldown.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
462
376
  },
463
377
  'stacked-bar-chart': {
464
378
  name: 'stacked-bar-chart',
465
- files: [
466
- 'charts/stacked-bar-chart.component.ts',
467
- 'charts/chart.types.ts',
468
- 'charts/chart.utils.ts',
469
- ],
379
+ files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/stacked-bar-chart.component.ts'],
470
380
  },
471
381
  'column-range-chart': {
472
382
  name: 'column-range-chart',
473
- files: [
474
- 'charts/column-range-chart.component.ts',
475
- 'charts/chart.types.ts',
476
- 'charts/chart.utils.ts',
477
- ],
383
+ files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/column-range-chart.component.ts'],
478
384
  },
479
385
  'bar-race-chart': {
480
386
  name: 'bar-race-chart',
481
- files: [
482
- 'charts/bar-race-chart.component.ts',
483
- 'charts/chart.types.ts',
484
- 'charts/chart.utils.ts',
485
- ],
387
+ files: ['charts/bar-race-chart.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
486
388
  },
487
389
  'org-chart': {
488
390
  name: 'org-chart',
489
- files: [
490
- 'charts/org-chart.component.ts',
491
- 'charts/chart.types.ts',
492
- 'charts/chart.utils.ts',
493
- ],
391
+ files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/org-chart.component.ts'],
494
392
  },
495
393
  'bento-grid': {
496
394
  name: 'bento-grid',
497
- dependencies: ['context-menu', 'component-outlet', 'icon'],
498
- files: [
499
- 'bento-grid.component.ts',
500
- ],
395
+ dependencies: ['component-outlet', 'context-menu'],
396
+ files: ['bento-grid.component.ts'],
501
397
  },
502
398
  'page-builder': {
503
399
  name: 'page-builder',
504
- dependencies: [
505
- 'bento-grid',
506
- 'button',
507
- 'input',
508
- 'label',
509
- 'select',
510
- 'switch',
511
- 'slider',
512
- 'icon'
513
- ],
514
- files: [
515
- 'page-builder/page-builder.component.ts',
516
- 'page-builder/page-builder.types.ts',
517
- 'page-builder/property-editor.component.ts',
518
- 'page-builder/page-renderer.component.ts'
519
- ],
400
+ dependencies: ['bento-grid', 'icon', 'select', 'switch'],
401
+ files: ['page-builder/page-builder.component.ts', 'page-builder/page-builder.types.ts', 'page-builder/property-editor.component.ts'],
520
402
  },
521
403
  'component-outlet': {
522
404
  name: 'component-outlet',
523
- files: ['component-outlet.directive.ts'],
405
+ files: ['component-outlet.directive.ts', 'data-table/component-pool.service.ts'],
524
406
  },
525
407
  'split-button': {
526
408
  name: 'split-button',
527
409
  files: ['split-button.component.ts'],
528
- dependencies: ['button', 'dropdown-menu'],
410
+ dependencies: ['button'],
529
411
  },
530
412
  // Animations
531
413
  'gradient-text': {
@@ -592,16 +474,22 @@ export const registry = {
592
474
  name: 'particles',
593
475
  files: ['particles.component.ts'],
594
476
  },
595
- // Kanban
596
477
  kanban: {
597
478
  name: 'kanban',
598
- files: ['kanban.component.ts', 'kanban-locales.ts'],
479
+ files: ['kanban-locales.ts', 'kanban.component.ts'],
599
480
  libFiles: ['shortcut-binding.service.ts'],
600
- dependencies: [
601
- 'badge', 'avatar', 'scroll-area', 'separator',
602
- 'button', 'input', 'textarea', 'label',
603
- 'chip-list', 'autocomplete',
604
- 'dialog', 'alert-dialog', 'context-menu',
605
- ],
481
+ dependencies: ['alert-dialog', 'autocomplete', 'avatar', 'badge', 'button', 'chip-list', 'context-menu', 'dialog', 'input', 'label', 'scroll-area', 'separator', 'textarea'],
606
482
  },
607
- };
483
+ 'shortcut-bindings-dialog': {
484
+ name: 'shortcut-bindings-dialog',
485
+ files: ['shortcut-bindings-dialog.component.ts'],
486
+ libFiles: ['shortcut-binding.service.ts'],
487
+ dependencies: ['accordion', 'badge', 'button', 'dialog', 'scroll-area'],
488
+ },
489
+ });
490
+ export function isComponentName(name) {
491
+ return name in registry;
492
+ }
493
+ export function getComponentNames() {
494
+ return Object.keys(registry);
495
+ }
@@ -1,6 +1,6 @@
1
1
  export interface Config {
2
- $schema: string;
3
2
  style: 'default';
3
+ registry?: string;
4
4
  tailwind: {
5
5
  css: string;
6
6
  baseColor: 'neutral' | 'slate' | 'stone' | 'gray' | 'zinc';
@@ -2,7 +2,6 @@ import fs from 'fs-extra';
2
2
  import path from 'node:path';
3
3
  export function getDefaultConfig() {
4
4
  return {
5
- $schema: 'https://shadcn-angular.dev/schema.json',
6
5
  style: 'default',
7
6
  tailwind: {
8
7
  css: 'src/styles.scss',
@@ -17,13 +16,34 @@ export function getDefaultConfig() {
17
16
  },
18
17
  };
19
18
  }
19
+ function validateConfig(data) {
20
+ if (!data || typeof data !== 'object')
21
+ return false;
22
+ const obj = data;
23
+ if (!obj['tailwind'] || typeof obj['tailwind'] !== 'object')
24
+ return false;
25
+ const tw = obj['tailwind'];
26
+ if (typeof tw['css'] !== 'string' || typeof tw['baseColor'] !== 'string')
27
+ return false;
28
+ if (!obj['aliases'] || typeof obj['aliases'] !== 'object')
29
+ return false;
30
+ const aliases = obj['aliases'];
31
+ if (typeof aliases['components'] !== 'string' || typeof aliases['utils'] !== 'string' || typeof aliases['ui'] !== 'string')
32
+ return false;
33
+ return true;
34
+ }
20
35
  export async function getConfig(cwd) {
21
36
  const configPath = path.join(cwd, 'components.json');
22
37
  if (!await fs.pathExists(configPath)) {
23
38
  return null;
24
39
  }
25
40
  try {
26
- return await fs.readJson(configPath);
41
+ const data = await fs.readJson(configPath);
42
+ if (!validateConfig(data)) {
43
+ console.error('Error: components.json is missing required fields (tailwind.css, tailwind.baseColor, aliases.components, aliases.utils, aliases.ui).');
44
+ return null;
45
+ }
46
+ return data;
27
47
  }
28
48
  catch {
29
49
  return null;
@@ -0,0 +1,7 @@
1
+ export declare function validateBranch(branch: string): void;
2
+ export declare function getRegistryBaseUrl(branch: string, customRegistry?: string): string;
3
+ export declare function getLibRegistryBaseUrl(branch: string, customRegistry?: string): string;
4
+ export declare function getLocalComponentsDir(): string | null;
5
+ export declare function getLocalLibDir(): string | null;
6
+ export declare function resolveProjectPath(cwd: string, inputPath: string): string;
7
+ export declare function aliasToProjectPath(aliasOrPath: string): string;