@gilav21/shadcn-angular 0.0.24 → 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/commands/add.d.ts +2 -0
- package/dist/commands/add.js +169 -114
- package/dist/commands/add.spec.js +17 -23
- package/dist/commands/diff.d.ts +8 -0
- package/dist/commands/diff.js +99 -0
- package/dist/commands/help.js +15 -6
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +171 -185
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.js +50 -0
- package/dist/index.js +21 -1
- package/dist/registry/index.d.ts +122 -12
- package/dist/registry/index.js +59 -158
- package/dist/utils/config.d.ts +1 -1
- package/dist/utils/config.js +22 -2
- package/dist/utils/paths.d.ts +7 -0
- package/dist/utils/paths.js +43 -0
- package/dist/utils/shortcut-registry.js +1 -13
- package/package.json +1 -1
- package/scripts/sync-registry.ts +347 -0
- package/src/commands/add.spec.ts +22 -32
- package/src/commands/add.ts +211 -137
- package/src/commands/diff.ts +133 -0
- package/src/commands/help.ts +15 -6
- package/src/commands/init.ts +329 -314
- package/src/commands/list.ts +66 -0
- package/src/index.ts +24 -1
- package/src/registry/index.ts +73 -169
- package/src/utils/config.ts +22 -3
- package/src/utils/paths.ts +52 -0
- package/src/utils/shortcut-registry.ts +1 -15
- package/vitest.config.ts +7 -0
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(
|
|
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')
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -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
|
|
129
|
+
export declare function isComponentName(name: string): name is ComponentName;
|
|
130
|
+
export declare function getComponentNames(): ComponentName[];
|
package/dist/registry/index.js
CHANGED
|
@@ -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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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: ['
|
|
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.
|
|
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: ['
|
|
73
|
+
dependencies: ['input', 'popover', 'tabs'],
|
|
74
74
|
},
|
|
75
75
|
confetti: {
|
|
76
76
|
name: 'confetti',
|
|
@@ -80,6 +80,7 @@ export const registry = {
|
|
|
80
80
|
name: 'command',
|
|
81
81
|
files: ['command.component.ts'],
|
|
82
82
|
dependencies: ['dialog'],
|
|
83
|
+
libFiles: ['shortcut-binding.service.ts'],
|
|
83
84
|
shortcutDefinitions: [
|
|
84
85
|
{
|
|
85
86
|
exportName: 'COMMAND_DIALOG_SHORTCUT_DEFINITIONS',
|
|
@@ -90,7 +91,7 @@ export const registry = {
|
|
|
90
91
|
},
|
|
91
92
|
'context-menu': {
|
|
92
93
|
name: 'context-menu',
|
|
93
|
-
files: ['context-menu.component.ts'
|
|
94
|
+
files: ['context-menu.component.ts'],
|
|
94
95
|
},
|
|
95
96
|
'date-picker': {
|
|
96
97
|
name: 'date-picker',
|
|
@@ -100,7 +101,7 @@ export const registry = {
|
|
|
100
101
|
chat: {
|
|
101
102
|
name: 'chat',
|
|
102
103
|
files: ['chat.component.ts'],
|
|
103
|
-
dependencies: ['avatar', 'button', '
|
|
104
|
+
dependencies: ['avatar', 'button', 'scroll-area', 'textarea'],
|
|
104
105
|
},
|
|
105
106
|
'streaming-text': {
|
|
106
107
|
name: 'streaming-text',
|
|
@@ -114,7 +115,7 @@ export const registry = {
|
|
|
114
115
|
'code-block': {
|
|
115
116
|
name: 'code-block',
|
|
116
117
|
files: ['code-block.component.ts'],
|
|
117
|
-
dependencies: ['button'
|
|
118
|
+
dependencies: ['button'],
|
|
118
119
|
},
|
|
119
120
|
'text-reveal': {
|
|
120
121
|
name: 'text-reveal',
|
|
@@ -122,31 +123,11 @@ export const registry = {
|
|
|
122
123
|
},
|
|
123
124
|
'data-table': {
|
|
124
125
|
name: 'data-table',
|
|
125
|
-
files: [
|
|
126
|
-
'data-table/data-table.component.ts',
|
|
127
|
-
'data-table/data-table-column-header.component.ts',
|
|
128
|
-
'data-table/data-table-pagination.component.ts',
|
|
129
|
-
'data-table/data-table-multiselect-filter.component.ts',
|
|
130
|
-
'data-table/data-table.types.ts',
|
|
131
|
-
'data-table/data-table.utils.ts',
|
|
132
|
-
'data-table/index.ts',
|
|
133
|
-
],
|
|
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'],
|
|
134
127
|
peerFiles: [
|
|
135
128
|
'context-menu-integrations.ts',
|
|
136
129
|
],
|
|
137
|
-
dependencies: [
|
|
138
|
-
'table',
|
|
139
|
-
'input',
|
|
140
|
-
'button',
|
|
141
|
-
'checkbox',
|
|
142
|
-
'select',
|
|
143
|
-
'pagination',
|
|
144
|
-
'popover',
|
|
145
|
-
'component-outlet',
|
|
146
|
-
'icon',
|
|
147
|
-
'command',
|
|
148
|
-
'badge',
|
|
149
|
-
],
|
|
130
|
+
dependencies: ['badge', 'button', 'calendar', 'checkbox', 'command', 'component-outlet', 'context-menu', 'icon', 'input', 'pagination', 'popover', 'select', 'table'],
|
|
150
131
|
libFiles: ['xlsx.ts'],
|
|
151
132
|
optionalDependencies: [
|
|
152
133
|
{ name: 'context-menu', description: 'Enables right-click context menus on rows and headers' },
|
|
@@ -158,18 +139,12 @@ export const registry = {
|
|
|
158
139
|
},
|
|
159
140
|
dock: {
|
|
160
141
|
name: 'dock',
|
|
161
|
-
files: [
|
|
162
|
-
'dock.component.ts',
|
|
163
|
-
'dock-item.component.ts',
|
|
164
|
-
'dock-icon.component.ts',
|
|
165
|
-
'dock-label.component.ts',
|
|
166
|
-
],
|
|
167
|
-
dependencies: ['icon'],
|
|
142
|
+
files: ['dock-icon.component.ts', 'dock-item.component.ts', 'dock-label.component.ts', 'dock.component.ts'],
|
|
168
143
|
},
|
|
169
144
|
'tree-select': {
|
|
170
145
|
name: 'tree-select',
|
|
171
146
|
files: ['tree-select.component.ts'],
|
|
172
|
-
dependencies: ['popover', 'tree'
|
|
147
|
+
dependencies: ['popover', 'tree'],
|
|
173
148
|
},
|
|
174
149
|
'virtual-scroll': {
|
|
175
150
|
name: 'virtual-scroll',
|
|
@@ -198,7 +173,7 @@ export const registry = {
|
|
|
198
173
|
},
|
|
199
174
|
icon: {
|
|
200
175
|
name: 'icon',
|
|
201
|
-
files: ['icon.component.ts'],
|
|
176
|
+
files: ['icon.component.ts', 'icon.token.ts'],
|
|
202
177
|
},
|
|
203
178
|
'file-upload': {
|
|
204
179
|
name: 'file-upload',
|
|
@@ -209,17 +184,7 @@ export const registry = {
|
|
|
209
184
|
name: 'file-viewer',
|
|
210
185
|
files: ['file-viewer.component.ts'],
|
|
211
186
|
dependencies: ['spinner'],
|
|
212
|
-
libFiles: [
|
|
213
|
-
'file-type-detector.ts',
|
|
214
|
-
'inflate.ts',
|
|
215
|
-
'zip-reader.ts',
|
|
216
|
-
'pptx-parser.ts',
|
|
217
|
-
'xlsx-reader.ts',
|
|
218
|
-
'docx-parser.ts',
|
|
219
|
-
'doc-enhanced-parser.ts',
|
|
220
|
-
'ppt-parser.ts',
|
|
221
|
-
'svg-sanitizer.ts',
|
|
222
|
-
],
|
|
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'],
|
|
223
188
|
},
|
|
224
189
|
'hover-card': {
|
|
225
190
|
name: 'hover-card',
|
|
@@ -227,12 +192,11 @@ export const registry = {
|
|
|
227
192
|
},
|
|
228
193
|
input: {
|
|
229
194
|
name: 'input',
|
|
230
|
-
files: ['input.
|
|
195
|
+
files: ['input-group.token.ts', 'input.component.ts'],
|
|
231
196
|
},
|
|
232
197
|
'input-group': {
|
|
233
198
|
name: 'input-group',
|
|
234
199
|
files: ['input-group.component.ts', 'input-group.token.ts'],
|
|
235
|
-
dependencies: ['input'],
|
|
236
200
|
},
|
|
237
201
|
'input-otp': {
|
|
238
202
|
name: 'input-otp',
|
|
@@ -305,7 +269,7 @@ export const registry = {
|
|
|
305
269
|
sidebar: {
|
|
306
270
|
name: 'sidebar',
|
|
307
271
|
files: ['sidebar.component.ts'],
|
|
308
|
-
dependencies: ['scroll-area', 'tooltip'
|
|
272
|
+
dependencies: ['scroll-area', 'tooltip'],
|
|
309
273
|
},
|
|
310
274
|
skeleton: {
|
|
311
275
|
name: 'skeleton',
|
|
@@ -337,7 +301,7 @@ export const registry = {
|
|
|
337
301
|
},
|
|
338
302
|
textarea: {
|
|
339
303
|
name: 'textarea',
|
|
340
|
-
files: ['
|
|
304
|
+
files: ['input-group.token.ts', 'textarea.component.ts'],
|
|
341
305
|
},
|
|
342
306
|
timeline: {
|
|
343
307
|
name: 'timeline',
|
|
@@ -362,51 +326,29 @@ export const registry = {
|
|
|
362
326
|
tree: {
|
|
363
327
|
name: 'tree',
|
|
364
328
|
files: ['tree.component.ts'],
|
|
365
|
-
dependencies: ['icon'],
|
|
366
329
|
optionalDependencies: [
|
|
367
330
|
{ name: 'context-menu', description: 'Enables right-click context menus on tree nodes' },
|
|
368
331
|
],
|
|
369
332
|
},
|
|
370
333
|
'speed-dial': {
|
|
371
334
|
name: 'speed-dial',
|
|
372
|
-
files: ['speed-dial.component.ts']
|
|
373
|
-
dependencies: ['button']
|
|
335
|
+
files: ['speed-dial.component.ts']
|
|
374
336
|
},
|
|
375
337
|
'chip-list': {
|
|
376
338
|
name: 'chip-list',
|
|
377
|
-
files: ['chip-list.component.ts'],
|
|
378
|
-
dependencies: ['badge', 'button', 'input'
|
|
339
|
+
files: ['chip-list.component.ts', 'input-group.token.ts'],
|
|
340
|
+
dependencies: ['badge', 'button', 'input'],
|
|
379
341
|
},
|
|
380
342
|
'emoji-picker': {
|
|
381
343
|
name: 'emoji-picker',
|
|
382
|
-
files: ['emoji-
|
|
344
|
+
files: ['emoji-data.ts', 'emoji-picker.component.ts'],
|
|
383
345
|
dependencies: ['input', 'scroll-area', 'tooltip'],
|
|
384
346
|
},
|
|
385
347
|
'rich-text-editor': {
|
|
386
348
|
name: 'rich-text-editor',
|
|
387
|
-
files: [
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
'rich-text-sanitizer.service.ts',
|
|
391
|
-
'rich-text-markdown.service.ts',
|
|
392
|
-
'rich-text-paste-normalizer.service.ts',
|
|
393
|
-
'rich-text-command-registry.service.ts',
|
|
394
|
-
'rich-text-mention.component.ts',
|
|
395
|
-
'rich-text-image-resizer.component.ts',
|
|
396
|
-
'rich-text-locales.ts',
|
|
397
|
-
],
|
|
398
|
-
dependencies: [
|
|
399
|
-
'button',
|
|
400
|
-
'separator',
|
|
401
|
-
'popover',
|
|
402
|
-
'emoji-picker',
|
|
403
|
-
'autocomplete',
|
|
404
|
-
'select',
|
|
405
|
-
'input',
|
|
406
|
-
'dialog',
|
|
407
|
-
'scroll-area',
|
|
408
|
-
],
|
|
409
|
-
libFiles: ['pdf-parser.ts', 'image-validator.ts', 'svg-sanitizer.ts'],
|
|
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'],
|
|
410
352
|
shortcutDefinitions: [
|
|
411
353
|
{
|
|
412
354
|
exportName: 'RICH_TEXT_SHORTCUT_DEFINITIONS',
|
|
@@ -418,102 +360,54 @@ export const registry = {
|
|
|
418
360
|
// Chart Components
|
|
419
361
|
'pie-chart': {
|
|
420
362
|
name: 'pie-chart',
|
|
421
|
-
files: [
|
|
422
|
-
'charts/pie-chart.component.ts',
|
|
423
|
-
'charts/chart.types.ts',
|
|
424
|
-
'charts/chart.utils.ts',
|
|
425
|
-
],
|
|
363
|
+
files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/pie-chart.component.ts'],
|
|
426
364
|
},
|
|
427
365
|
'pie-chart-drilldown': {
|
|
428
366
|
name: 'pie-chart-drilldown',
|
|
429
|
-
files: [
|
|
430
|
-
'charts/pie-chart-drilldown.component.ts',
|
|
431
|
-
'charts/chart.types.ts',
|
|
432
|
-
'charts/chart.utils.ts',
|
|
433
|
-
],
|
|
367
|
+
files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/pie-chart-drilldown.component.ts'],
|
|
434
368
|
},
|
|
435
369
|
'bar-chart': {
|
|
436
370
|
name: 'bar-chart',
|
|
437
|
-
files: [
|
|
438
|
-
'charts/bar-chart.component.ts',
|
|
439
|
-
'charts/chart.types.ts',
|
|
440
|
-
'charts/chart.utils.ts',
|
|
441
|
-
],
|
|
371
|
+
files: ['charts/bar-chart.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
|
|
442
372
|
},
|
|
443
373
|
'bar-chart-drilldown': {
|
|
444
374
|
name: 'bar-chart-drilldown',
|
|
445
|
-
files: [
|
|
446
|
-
'charts/bar-chart-drilldown.component.ts',
|
|
447
|
-
'charts/chart.types.ts',
|
|
448
|
-
'charts/chart.utils.ts',
|
|
449
|
-
],
|
|
375
|
+
files: ['charts/bar-chart-drilldown.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
|
|
450
376
|
},
|
|
451
377
|
'stacked-bar-chart': {
|
|
452
378
|
name: 'stacked-bar-chart',
|
|
453
|
-
files: [
|
|
454
|
-
'charts/stacked-bar-chart.component.ts',
|
|
455
|
-
'charts/chart.types.ts',
|
|
456
|
-
'charts/chart.utils.ts',
|
|
457
|
-
],
|
|
379
|
+
files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/stacked-bar-chart.component.ts'],
|
|
458
380
|
},
|
|
459
381
|
'column-range-chart': {
|
|
460
382
|
name: 'column-range-chart',
|
|
461
|
-
files: [
|
|
462
|
-
'charts/column-range-chart.component.ts',
|
|
463
|
-
'charts/chart.types.ts',
|
|
464
|
-
'charts/chart.utils.ts',
|
|
465
|
-
],
|
|
383
|
+
files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/column-range-chart.component.ts'],
|
|
466
384
|
},
|
|
467
385
|
'bar-race-chart': {
|
|
468
386
|
name: 'bar-race-chart',
|
|
469
|
-
files: [
|
|
470
|
-
'charts/bar-race-chart.component.ts',
|
|
471
|
-
'charts/chart.types.ts',
|
|
472
|
-
'charts/chart.utils.ts',
|
|
473
|
-
],
|
|
387
|
+
files: ['charts/bar-race-chart.component.ts', 'charts/chart.types.ts', 'charts/chart.utils.ts'],
|
|
474
388
|
},
|
|
475
389
|
'org-chart': {
|
|
476
390
|
name: 'org-chart',
|
|
477
|
-
files: [
|
|
478
|
-
'charts/org-chart.component.ts',
|
|
479
|
-
'charts/chart.types.ts',
|
|
480
|
-
'charts/chart.utils.ts',
|
|
481
|
-
],
|
|
391
|
+
files: ['charts/chart.types.ts', 'charts/chart.utils.ts', 'charts/org-chart.component.ts'],
|
|
482
392
|
},
|
|
483
393
|
'bento-grid': {
|
|
484
394
|
name: 'bento-grid',
|
|
485
|
-
dependencies: ['
|
|
486
|
-
files: [
|
|
487
|
-
'bento-grid.component.ts',
|
|
488
|
-
],
|
|
395
|
+
dependencies: ['component-outlet', 'context-menu'],
|
|
396
|
+
files: ['bento-grid.component.ts'],
|
|
489
397
|
},
|
|
490
398
|
'page-builder': {
|
|
491
399
|
name: 'page-builder',
|
|
492
|
-
dependencies: [
|
|
493
|
-
|
|
494
|
-
'button',
|
|
495
|
-
'input',
|
|
496
|
-
'label',
|
|
497
|
-
'select',
|
|
498
|
-
'switch',
|
|
499
|
-
'slider',
|
|
500
|
-
'icon'
|
|
501
|
-
],
|
|
502
|
-
files: [
|
|
503
|
-
'page-builder/page-builder.component.ts',
|
|
504
|
-
'page-builder/page-builder.types.ts',
|
|
505
|
-
'page-builder/property-editor.component.ts',
|
|
506
|
-
'page-builder/page-renderer.component.ts'
|
|
507
|
-
],
|
|
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'],
|
|
508
402
|
},
|
|
509
403
|
'component-outlet': {
|
|
510
404
|
name: 'component-outlet',
|
|
511
|
-
files: ['component-outlet.directive.ts'],
|
|
405
|
+
files: ['component-outlet.directive.ts', 'data-table/component-pool.service.ts'],
|
|
512
406
|
},
|
|
513
407
|
'split-button': {
|
|
514
408
|
name: 'split-button',
|
|
515
409
|
files: ['split-button.component.ts'],
|
|
516
|
-
dependencies: ['button'
|
|
410
|
+
dependencies: ['button'],
|
|
517
411
|
},
|
|
518
412
|
// Animations
|
|
519
413
|
'gradient-text': {
|
|
@@ -580,15 +474,22 @@ export const registry = {
|
|
|
580
474
|
name: 'particles',
|
|
581
475
|
files: ['particles.component.ts'],
|
|
582
476
|
},
|
|
583
|
-
// Kanban
|
|
584
477
|
kanban: {
|
|
585
478
|
name: 'kanban',
|
|
586
|
-
files: ['kanban.
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
],
|
|
593
|
-
|
|
594
|
-
|
|
479
|
+
files: ['kanban-locales.ts', 'kanban.component.ts'],
|
|
480
|
+
libFiles: ['shortcut-binding.service.ts'],
|
|
481
|
+
dependencies: ['alert-dialog', 'autocomplete', 'avatar', 'badge', 'button', 'chip-list', 'context-menu', 'dialog', 'input', 'label', 'scroll-area', 'separator', 'textarea'],
|
|
482
|
+
},
|
|
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
|
+
}
|
package/dist/utils/config.d.ts
CHANGED
package/dist/utils/config.js
CHANGED
|
@@ -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
|
-
|
|
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;
|