@electroplix/components 0.4.1 → 0.5.0-alpha.2
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/CHANGELOG.md +66 -0
- package/LICENSE +21 -0
- package/README.md +88 -474
- package/SECURITY.md +19 -0
- package/cli.cjs +510 -485
- package/dist/config.d.ts +73 -0
- package/dist/config.esm.js +229 -0
- package/dist/index.esm.js +6531 -6668
- package/dist/package.json +97 -0
- package/dist/src/components/blog/index.d.ts +5 -5
- package/dist/src/components/blog/index.d.ts.map +1 -1
- package/dist/src/components/buttons/index.d.ts +38 -8
- package/dist/src/components/buttons/index.d.ts.map +1 -1
- package/dist/src/components/content/BlockquoteTestimonial.d.ts +1 -1
- package/dist/src/components/content/BlockquoteTestimonial.d.ts.map +1 -1
- package/dist/src/components/content/CalloutBox.d.ts +4 -3
- package/dist/src/components/content/CalloutBox.d.ts.map +1 -1
- package/dist/src/components/content/HeadingSection.d.ts +2 -2
- package/dist/src/components/content/HeadingSection.d.ts.map +1 -1
- package/dist/src/components/content/InlineCodeText.d.ts +4 -3
- package/dist/src/components/content/InlineCodeText.d.ts.map +1 -1
- package/dist/src/components/content/ParagraphBlock.d.ts +5 -4
- package/dist/src/components/content/ParagraphBlock.d.ts.map +1 -1
- package/dist/src/components/content/RichMarkdown.d.ts +4 -3
- package/dist/src/components/content/RichMarkdown.d.ts.map +1 -1
- package/dist/src/components/content/TeamGrid.d.ts.map +1 -1
- package/dist/src/components/content/index.d.ts +7 -7
- package/dist/src/components/content/index.d.ts.map +1 -1
- package/dist/src/components/data-display/Badge.d.ts +5 -4
- package/dist/src/components/data-display/Badge.d.ts.map +1 -1
- package/dist/src/components/data-display/BadgeGroup.d.ts +4 -3
- package/dist/src/components/data-display/BadgeGroup.d.ts.map +1 -1
- package/dist/src/components/data-display/BarChart.d.ts.map +1 -1
- package/dist/src/components/data-display/CalendarGrid.d.ts +1 -1
- package/dist/src/components/data-display/CalendarGrid.d.ts.map +1 -1
- package/dist/src/components/data-display/DataTable.d.ts +3 -3
- package/dist/src/components/data-display/DataTable.d.ts.map +1 -1
- package/dist/src/components/data-display/LineChart.d.ts.map +1 -1
- package/dist/src/components/data-display/PieChart.d.ts +1 -1
- package/dist/src/components/data-display/PieChart.d.ts.map +1 -1
- package/dist/src/components/data-display/ProgressBar.d.ts.map +1 -1
- package/dist/src/components/data-display/RatingStars.d.ts.map +1 -1
- package/dist/src/components/data-display/Sparkline.d.ts.map +1 -1
- package/dist/src/components/data-display/Timeline.d.ts +1 -1
- package/dist/src/components/data-display/Timeline.d.ts.map +1 -1
- package/dist/src/components/data-display/index.d.ts +11 -11
- package/dist/src/components/data-display/index.d.ts.map +1 -1
- package/dist/src/components/ecommerce/index.d.ts +8 -8
- package/dist/src/components/ecommerce/index.d.ts.map +1 -1
- package/dist/src/components/forms/AddressAutocomplete.d.ts +1 -1
- package/dist/src/components/forms/AddressAutocomplete.d.ts.map +1 -1
- package/dist/src/components/forms/Captcha.d.ts +2 -2
- package/dist/src/components/forms/Captcha.d.ts.map +1 -1
- package/dist/src/components/forms/ContactForm.d.ts +1 -1
- package/dist/src/components/forms/ContactForm.d.ts.map +1 -1
- package/dist/src/components/forms/DateTimePicker.d.ts +2 -2
- package/dist/src/components/forms/DateTimePicker.d.ts.map +1 -1
- package/dist/src/components/forms/FileUploader.d.ts +1 -1
- package/dist/src/components/forms/FileUploader.d.ts.map +1 -1
- package/dist/src/components/forms/FormShell.d.ts +1 -1
- package/dist/src/components/forms/FormShell.d.ts.map +1 -1
- package/dist/src/components/forms/InputField.d.ts +1 -1
- package/dist/src/components/forms/InputField.d.ts.map +1 -1
- package/dist/src/components/forms/MultiStepWizard.d.ts +1 -1
- package/dist/src/components/forms/MultiStepWizard.d.ts.map +1 -1
- package/dist/src/components/forms/NewsletterSignup.d.ts +1 -1
- package/dist/src/components/forms/NewsletterSignup.d.ts.map +1 -1
- package/dist/src/components/forms/RadioGroup.d.ts +1 -1
- package/dist/src/components/forms/RadioGroup.d.ts.map +1 -1
- package/dist/src/components/forms/SelectDropdown.d.ts +1 -1
- package/dist/src/components/forms/SelectDropdown.d.ts.map +1 -1
- package/dist/src/components/forms/TextAreaField.d.ts +1 -1
- package/dist/src/components/forms/TextAreaField.d.ts.map +1 -1
- package/dist/src/components/forms/ToggleSwitch.d.ts +1 -1
- package/dist/src/components/forms/ToggleSwitch.d.ts.map +1 -1
- package/dist/src/components/forms/ValidationWrapper.d.ts +1 -1
- package/dist/src/components/forms/ValidationWrapper.d.ts.map +1 -1
- package/dist/src/components/forms/index.d.ts +28 -28
- package/dist/src/components/forms/index.d.ts.map +1 -1
- package/dist/src/components/hero/CTAOverlayHero.d.ts +1 -1
- package/dist/src/components/hero/CTAOverlayHero.d.ts.map +1 -1
- package/dist/src/components/hero/CarouselHero.d.ts +1 -1
- package/dist/src/components/hero/CarouselHero.d.ts.map +1 -1
- package/dist/src/components/hero/HeroShell.d.ts +1 -1
- package/dist/src/components/hero/HeroShell.d.ts.map +1 -1
- package/dist/src/components/hero/PatternedHero.d.ts +2 -2
- package/dist/src/components/hero/PatternedHero.d.ts.map +1 -1
- package/dist/src/components/hero/SplitHero.d.ts +1 -1
- package/dist/src/components/hero/SplitHero.d.ts.map +1 -1
- package/dist/src/components/hero/StaticHero.d.ts +2 -2
- package/dist/src/components/hero/StaticHero.d.ts.map +1 -1
- package/dist/src/components/hero/VideoHeaderHero.d.ts +1 -1
- package/dist/src/components/hero/VideoHeaderHero.d.ts.map +1 -1
- package/dist/src/components/hero/index.d.ts +14 -14
- package/dist/src/components/hero/index.d.ts.map +1 -1
- package/dist/src/components/lists-cards/index.d.ts +7 -7
- package/dist/src/components/lists-cards/index.d.ts.map +1 -1
- package/dist/src/components/marketing/index.d.ts +5 -5
- package/dist/src/components/marketing/index.d.ts.map +1 -1
- package/dist/src/components/media/index.d.ts +7 -7
- package/dist/src/components/media/index.d.ts.map +1 -1
- package/dist/src/components/miscellaneous/index.d.ts +4 -4
- package/dist/src/components/miscellaneous/index.d.ts.map +1 -1
- package/dist/src/components/modals/index.d.ts +5 -5
- package/dist/src/components/modals/index.d.ts.map +1 -1
- package/dist/src/components/navigation/AnchorLinks.d.ts +2 -2
- package/dist/src/components/navigation/AnchorLinks.d.ts.map +1 -1
- package/dist/src/components/navigation/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/navigation/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/components/navigation/Footer.d.ts +1 -1
- package/dist/src/components/navigation/Footer.d.ts.map +1 -1
- package/dist/src/components/navigation/LanguageSelector.d.ts +1 -1
- package/dist/src/components/navigation/LanguageSelector.d.ts.map +1 -1
- package/dist/src/components/navigation/MegaMenu.d.ts +1 -1
- package/dist/src/components/navigation/MegaMenu.d.ts.map +1 -1
- package/dist/src/components/navigation/Pagination.d.ts.map +1 -1
- package/dist/src/components/navigation/PrimaryNav.d.ts.map +1 -1
- package/dist/src/components/navigation/SideDrawerNav.d.ts +2 -2
- package/dist/src/components/navigation/SideDrawerNav.d.ts.map +1 -1
- package/dist/src/components/navigation/SidebarMenu.d.ts +1 -1
- package/dist/src/components/navigation/SidebarMenu.d.ts.map +1 -1
- package/dist/src/components/navigation/Stepper.d.ts +1 -1
- package/dist/src/components/navigation/Stepper.d.ts.map +1 -1
- package/dist/src/components/navigation/Tabs.d.ts +2 -2
- package/dist/src/components/navigation/Tabs.d.ts.map +1 -1
- package/dist/src/components/navigation/index.d.ts +22 -22
- package/dist/src/components/navigation/index.d.ts.map +1 -1
- package/dist/src/components/onboarding/index.d.ts +7 -7
- package/dist/src/components/onboarding/index.d.ts.map +1 -1
- package/dist/src/components/search/index.d.ts +3 -3
- package/dist/src/components/search/index.d.ts.map +1 -1
- package/dist/src/components/site-identity/index.d.ts +5 -5
- package/dist/src/components/site-identity/index.d.ts.map +1 -1
- package/dist/src/components/social/index.d.ts +7 -7
- package/dist/src/components/social/index.d.ts.map +1 -1
- package/dist/src/components/user-accounts/index.d.ts +6 -6
- package/dist/src/components/user-accounts/index.d.ts.map +1 -1
- package/dist/src/core/config.d.ts +1 -1
- package/dist/src/core/config.d.ts.map +1 -1
- package/dist/src/core/icons.d.ts +1 -1
- package/dist/src/core/icons.d.ts.map +1 -1
- package/dist/src/core/index.d.ts +7 -7
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/provider.d.ts +20 -20
- package/dist/src/core/provider.d.ts.map +1 -1
- package/dist/src/core/types.d.ts +4 -4
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/utils.d.ts +1 -1
- package/dist/src/core/utils.d.ts.map +1 -1
- package/dist/src/index.d.ts +19 -19
- package/dist/src/index.d.ts.map +1 -1
- package/metadata/blog.json +807 -0
- package/metadata/buttons.json +2186 -0
- package/metadata/content.json +1152 -0
- package/metadata/data-display.json +822 -0
- package/metadata/ecommerce.json +1059 -0
- package/metadata/forms.json +2637 -0
- package/metadata/hero.json +1401 -0
- package/metadata/lists-cards.json +848 -0
- package/metadata/marketing.json +1235 -0
- package/metadata/media.json +800 -0
- package/metadata/miscellaneous.json +778 -0
- package/metadata/modals.json +954 -0
- package/metadata/navigation.json +1348 -0
- package/metadata/onboarding.json +615 -0
- package/metadata/search.json +559 -0
- package/metadata/site-identity.json +555 -0
- package/metadata/social.json +654 -0
- package/metadata/user-accounts.json +727 -0
- package/package.json +18 -6
- package/dist/README.md +0 -35
- package/dist/src/__tests__/test-utils.d.ts +0 -8
- package/dist/src/__tests__/test-utils.d.ts.map +0 -1
package/cli.cjs
CHANGED
|
@@ -1,485 +1,510 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @electroplix/components CLI
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx @electroplix/components init – scaffold config + providers
|
|
8
|
-
* npx @electroplix/components add <name|category> – show install/import instructions
|
|
9
|
-
* npx @electroplix/components list – list all available components
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const fs = require(
|
|
13
|
-
const path = require(
|
|
14
|
-
|
|
15
|
-
/* ══════════════════════════════════════════════════════════════════ */
|
|
16
|
-
/* ANSI Styling */
|
|
17
|
-
/* ══════════════════════════════════════════════════════════════════ */
|
|
18
|
-
|
|
19
|
-
const ESC =
|
|
20
|
-
const R = `${ESC}0m`;
|
|
21
|
-
|
|
22
|
-
const s = {
|
|
23
|
-
bold:
|
|
24
|
-
dim:
|
|
25
|
-
italic:
|
|
26
|
-
purple:
|
|
27
|
-
violet:
|
|
28
|
-
cyan:
|
|
29
|
-
green:
|
|
30
|
-
yellow:
|
|
31
|
-
red:
|
|
32
|
-
white:
|
|
33
|
-
gray:
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/* ══════════════════════════════════════════════════════════════════ */
|
|
37
|
-
/* Box-drawing helpers */
|
|
38
|
-
/* ══════════════════════════════════════════════════════════════════ */
|
|
39
|
-
|
|
40
|
-
const B = {
|
|
41
|
-
tl:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
/*
|
|
332
|
-
/*
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @electroplix/components CLI
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx @electroplix/components init – scaffold config + providers
|
|
8
|
+
* npx @electroplix/components add <name|category> – show install/import instructions
|
|
9
|
+
* npx @electroplix/components list – list all available components
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require('node:fs');
|
|
13
|
+
const path = require('node:path');
|
|
14
|
+
|
|
15
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
16
|
+
/* ANSI Styling */
|
|
17
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
18
|
+
|
|
19
|
+
const ESC = '\x1b[';
|
|
20
|
+
const R = `${ESC}0m`;
|
|
21
|
+
|
|
22
|
+
const s = {
|
|
23
|
+
bold: (t) => `${ESC}1m${t}${R}`,
|
|
24
|
+
dim: (t) => `${ESC}2m${t}${R}`,
|
|
25
|
+
italic: (t) => `${ESC}3m${t}${R}`,
|
|
26
|
+
purple: (t) => `${ESC}38;2;139;92;246m${t}${R}`,
|
|
27
|
+
violet: (t) => `${ESC}38;2;167;139;250m${t}${R}`,
|
|
28
|
+
cyan: (t) => `${ESC}38;2;34;211;238m${t}${R}`,
|
|
29
|
+
green: (t) => `${ESC}38;2;52;211;153m${t}${R}`,
|
|
30
|
+
yellow: (t) => `${ESC}38;2;251;191;36m${t}${R}`,
|
|
31
|
+
red: (t) => `${ESC}38;2;251;113;133m${t}${R}`,
|
|
32
|
+
white: (t) => `${ESC}38;2;243;244;246m${t}${R}`,
|
|
33
|
+
gray: (t) => `${ESC}38;2;107;114;128m${t}${R}`,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
37
|
+
/* Box-drawing helpers */
|
|
38
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
39
|
+
|
|
40
|
+
const B = {
|
|
41
|
+
tl: '\u256D',
|
|
42
|
+
tr: '\u256E',
|
|
43
|
+
bl: '\u2570',
|
|
44
|
+
br: '\u256F',
|
|
45
|
+
h: '\u2500',
|
|
46
|
+
v: '\u2502',
|
|
47
|
+
tee: '\u251C',
|
|
48
|
+
end: '\u2570',
|
|
49
|
+
branch: '\u251C\u2500\u2500',
|
|
50
|
+
last: '\u2570\u2500\u2500',
|
|
51
|
+
pipe: '\u2502 ',
|
|
52
|
+
dot: '\u25CF',
|
|
53
|
+
arrow: '\u2192',
|
|
54
|
+
check: '\u2713',
|
|
55
|
+
star: '\u2605',
|
|
56
|
+
diamond: '\u25C6',
|
|
57
|
+
spark: '\u26A1',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
function hr(w) {
|
|
61
|
+
return B.h.repeat(w);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function stripAnsi(t) {
|
|
65
|
+
return t.replace(/\x1b\[[0-9;]*m/g, '');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function boxLine(l, content, r, w) {
|
|
69
|
+
const vis = stripAnsi(content);
|
|
70
|
+
const pad = Math.max(0, w - vis.length - 2);
|
|
71
|
+
return ` ${l}${content}${' '.repeat(pad)}${r}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
75
|
+
/* Brand banner */
|
|
76
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
77
|
+
|
|
78
|
+
function printBanner() {
|
|
79
|
+
const W = 58;
|
|
80
|
+
const _lines = [
|
|
81
|
+
'',
|
|
82
|
+
` ${B.tl}${hr(W)}${B.tr}`,
|
|
83
|
+
boxLine(
|
|
84
|
+
B.v,
|
|
85
|
+
` ${s.bold(s.purple(`${B.spark} ELECTROPLIX`))} ${s.dim(s.violet('COMPONENTS'))}`,
|
|
86
|
+
B.v,
|
|
87
|
+
W,
|
|
88
|
+
),
|
|
89
|
+
boxLine(B.v, ` ${s.gray('Parametric \u2022 Config-Driven \u2022 Zero-Dependency')}`, B.v, W),
|
|
90
|
+
` ${B.bl}${hr(W)}${B.br}`,
|
|
91
|
+
'',
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
96
|
+
/* Component registry */
|
|
97
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
98
|
+
|
|
99
|
+
const CATEGORIES = {
|
|
100
|
+
navigation: [
|
|
101
|
+
'AnchorLinks',
|
|
102
|
+
'Breadcrumbs',
|
|
103
|
+
'LanguageSelector',
|
|
104
|
+
'MegaMenu',
|
|
105
|
+
'Pagination',
|
|
106
|
+
'PrimaryNav',
|
|
107
|
+
'SidebarMenu',
|
|
108
|
+
'SideDrawerNav',
|
|
109
|
+
'Stepper',
|
|
110
|
+
'Tabs',
|
|
111
|
+
],
|
|
112
|
+
hero: [
|
|
113
|
+
'HeroShell',
|
|
114
|
+
'StaticHero',
|
|
115
|
+
'CarouselHero',
|
|
116
|
+
'CTAOverlayHero',
|
|
117
|
+
'PatternedHero',
|
|
118
|
+
'SplitHero',
|
|
119
|
+
'VideoHeaderHero',
|
|
120
|
+
],
|
|
121
|
+
buttons: [
|
|
122
|
+
'PrimaryButton',
|
|
123
|
+
'SecondaryButton',
|
|
124
|
+
'TertiaryButton',
|
|
125
|
+
'IconButton',
|
|
126
|
+
'FloatingActionButton',
|
|
127
|
+
'ButtonGroup',
|
|
128
|
+
'LoadingButton',
|
|
129
|
+
'ShareButton',
|
|
130
|
+
'DownloadButton',
|
|
131
|
+
'PrintButton',
|
|
132
|
+
],
|
|
133
|
+
forms: [
|
|
134
|
+
'FormShell',
|
|
135
|
+
'InputField',
|
|
136
|
+
'TextAreaField',
|
|
137
|
+
'SelectDropdown',
|
|
138
|
+
'RadioGroup',
|
|
139
|
+
'ToggleSwitch',
|
|
140
|
+
'DateTimePicker',
|
|
141
|
+
'FileUploader',
|
|
142
|
+
'ContactForm',
|
|
143
|
+
'NewsletterSignup',
|
|
144
|
+
'MultiStepWizard',
|
|
145
|
+
'Captcha',
|
|
146
|
+
'AddressAutocomplete',
|
|
147
|
+
'ValidationWrapper',
|
|
148
|
+
],
|
|
149
|
+
content: [
|
|
150
|
+
'BlockquoteTestimonial',
|
|
151
|
+
'CalloutBox',
|
|
152
|
+
'HeadingSection',
|
|
153
|
+
'InlineCodeText',
|
|
154
|
+
'ParagraphBlock',
|
|
155
|
+
'RichMarkdown',
|
|
156
|
+
],
|
|
157
|
+
'data-display': [
|
|
158
|
+
'Badge',
|
|
159
|
+
'BadgeGroup',
|
|
160
|
+
'BarChart',
|
|
161
|
+
'LineChart',
|
|
162
|
+
'PieChart',
|
|
163
|
+
'Sparkline',
|
|
164
|
+
'ProgressBar',
|
|
165
|
+
'RatingStars',
|
|
166
|
+
'CalendarGrid',
|
|
167
|
+
'DataTable',
|
|
168
|
+
'Timeline',
|
|
169
|
+
],
|
|
170
|
+
ecommerce: [
|
|
171
|
+
'CartDrawer',
|
|
172
|
+
'MiniCartPanel',
|
|
173
|
+
'OrderSummary',
|
|
174
|
+
'ProductCard',
|
|
175
|
+
'ProductGrid',
|
|
176
|
+
'ProductDetail',
|
|
177
|
+
'VariantSelector',
|
|
178
|
+
'QuickAddButton',
|
|
179
|
+
'WishlistButton',
|
|
180
|
+
'PaymentButtons',
|
|
181
|
+
],
|
|
182
|
+
'lists-cards': [
|
|
183
|
+
'BlockShell',
|
|
184
|
+
'Accordion',
|
|
185
|
+
'GenericList',
|
|
186
|
+
'FeatureGrid',
|
|
187
|
+
'ItemCardGrid',
|
|
188
|
+
'PricingTable',
|
|
189
|
+
'SortableTable',
|
|
190
|
+
'LCTimeline',
|
|
191
|
+
],
|
|
192
|
+
marketing: [
|
|
193
|
+
'ComparisonTable',
|
|
194
|
+
'CountdownTimer',
|
|
195
|
+
'FeatureHighlights',
|
|
196
|
+
'LeadMagnetGate',
|
|
197
|
+
'MarketingHeroBlock',
|
|
198
|
+
'PromoPopup',
|
|
199
|
+
'TestimonialsCarousel',
|
|
200
|
+
'TrustBadges',
|
|
201
|
+
],
|
|
202
|
+
media: [
|
|
203
|
+
'MediaShell',
|
|
204
|
+
'ResponsiveVideo',
|
|
205
|
+
'AudioEmbed',
|
|
206
|
+
'AvatarProfile',
|
|
207
|
+
'IconGrid',
|
|
208
|
+
'ImageGallery',
|
|
209
|
+
'LightboxGallery',
|
|
210
|
+
'MasonryGrid',
|
|
211
|
+
'PolaroidImage',
|
|
212
|
+
'LottieOrSVG',
|
|
213
|
+
'ImageCropperUploader',
|
|
214
|
+
],
|
|
215
|
+
miscellaneous: [
|
|
216
|
+
'CookieConsent',
|
|
217
|
+
'ScrollProgressBar',
|
|
218
|
+
'ThemeToggle',
|
|
219
|
+
'EmptyState',
|
|
220
|
+
'AppInstallBanner',
|
|
221
|
+
'DownloadBlock',
|
|
222
|
+
'InlineCode',
|
|
223
|
+
'RSSFeed',
|
|
224
|
+
],
|
|
225
|
+
modals: [
|
|
226
|
+
'OverlayBase',
|
|
227
|
+
'GenericModal',
|
|
228
|
+
'ConfirmDialog',
|
|
229
|
+
'FormDialog',
|
|
230
|
+
'LoadingOverlay',
|
|
231
|
+
'Tooltip',
|
|
232
|
+
'ToastBanners',
|
|
233
|
+
'CookieNotice',
|
|
234
|
+
'WelcomePopup',
|
|
235
|
+
],
|
|
236
|
+
onboarding: [
|
|
237
|
+
'FAQAccordion',
|
|
238
|
+
'OnboardingWizard',
|
|
239
|
+
'ProductTour',
|
|
240
|
+
'TooltipHelp',
|
|
241
|
+
'SupportChat',
|
|
242
|
+
'ContactSupportBlock',
|
|
243
|
+
],
|
|
244
|
+
search: [
|
|
245
|
+
'SiteSearchBar',
|
|
246
|
+
'AutoSuggest',
|
|
247
|
+
'FacetFilters',
|
|
248
|
+
'SearchResultCard',
|
|
249
|
+
'SearchResults',
|
|
250
|
+
'SearchEmptyState',
|
|
251
|
+
],
|
|
252
|
+
'site-identity': [
|
|
253
|
+
'LogoDisplay',
|
|
254
|
+
'AnimatedBrandMark',
|
|
255
|
+
'Taglines',
|
|
256
|
+
'BrandingShell',
|
|
257
|
+
'BrandIconGrid',
|
|
258
|
+
'FaviconUploader',
|
|
259
|
+
],
|
|
260
|
+
social: [
|
|
261
|
+
'SocialShareBar',
|
|
262
|
+
'SocialLoginButtons',
|
|
263
|
+
'SocialEmbed',
|
|
264
|
+
'FollowLike',
|
|
265
|
+
'ReactionsBar',
|
|
266
|
+
'CommentsBox',
|
|
267
|
+
'ReviewsForm',
|
|
268
|
+
],
|
|
269
|
+
'user-accounts': [
|
|
270
|
+
'AuthForm',
|
|
271
|
+
'PasswordReset',
|
|
272
|
+
'MultiFactorAuthInput',
|
|
273
|
+
'ProfileOverview',
|
|
274
|
+
'ProfileSettings',
|
|
275
|
+
'AccountSettings',
|
|
276
|
+
'RoleBadge',
|
|
277
|
+
],
|
|
278
|
+
blog: [
|
|
279
|
+
'BlogCard',
|
|
280
|
+
'AuthorByline',
|
|
281
|
+
'TagList',
|
|
282
|
+
'BlogBadge',
|
|
283
|
+
'ReadingBar',
|
|
284
|
+
'ArticleRenderer',
|
|
285
|
+
'RelatedPosts',
|
|
286
|
+
'ArchiveList',
|
|
287
|
+
'CommentsSection',
|
|
288
|
+
],
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/* build lookup maps */
|
|
292
|
+
const ALL_COMPONENTS = new Map();
|
|
293
|
+
for (const [cat, names] of Object.entries(CATEGORIES)) {
|
|
294
|
+
for (const n of names) ALL_COMPONENTS.set(n.toLowerCase(), { name: n, category: cat });
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const CATEGORY_ALIASES = new Map();
|
|
298
|
+
for (const cat of Object.keys(CATEGORIES)) {
|
|
299
|
+
CATEGORY_ALIASES.set(cat.toLowerCase(), cat);
|
|
300
|
+
CATEGORY_ALIASES.set(cat.replace(/-/g, '').toLowerCase(), cat);
|
|
301
|
+
CATEGORY_ALIASES.set(cat.replace(/-/g, ' ').toLowerCase(), cat);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const _totalCount = Object.values(CATEGORIES).reduce((sum, a) => sum + a.length, 0);
|
|
305
|
+
|
|
306
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
307
|
+
/* Package manager detection */
|
|
308
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
309
|
+
|
|
310
|
+
function detectPackageManager() {
|
|
311
|
+
const cwd = process.cwd();
|
|
312
|
+
|
|
313
|
+
// Check for lockfiles in order of preference
|
|
314
|
+
if (fs.existsSync(path.join(cwd, 'bun.lock'))) {
|
|
315
|
+
return { manager: 'bun', command: 'bun install', displayName: 'Bun' };
|
|
316
|
+
}
|
|
317
|
+
if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))) {
|
|
318
|
+
return { manager: 'pnpm', command: 'pnpm install', displayName: 'pnpm' };
|
|
319
|
+
}
|
|
320
|
+
if (fs.existsSync(path.join(cwd, 'yarn.lock'))) {
|
|
321
|
+
return { manager: 'yarn', command: 'yarn install', displayName: 'Yarn' };
|
|
322
|
+
}
|
|
323
|
+
if (fs.existsSync(path.join(cwd, 'package-lock.json'))) {
|
|
324
|
+
return { manager: 'npm', command: 'npm install', displayName: 'npm' };
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Default to npm if no lockfile found
|
|
328
|
+
return { manager: 'npm', command: 'npm install', displayName: 'npm' };
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
332
|
+
/* INIT command */
|
|
333
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
334
|
+
|
|
335
|
+
function init() {
|
|
336
|
+
printBanner();
|
|
337
|
+
|
|
338
|
+
const configName = 'electroplix.config.ts';
|
|
339
|
+
const providerRel = path.join('components', 'providers.tsx');
|
|
340
|
+
const configPath = path.join(process.cwd(), configName);
|
|
341
|
+
const providerDir = path.join(process.cwd(), 'components');
|
|
342
|
+
const providerPath = path.join(providerDir, 'providers.tsx');
|
|
343
|
+
|
|
344
|
+
const created = [];
|
|
345
|
+
const skipped = [];
|
|
346
|
+
|
|
347
|
+
/* ── config file ─────────────────────────────────────── */
|
|
348
|
+
if (fs.existsSync(configPath)) {
|
|
349
|
+
skipped.push(configName);
|
|
350
|
+
} else {
|
|
351
|
+
const configTemplate = `import { defineConfig } from "@electroplix/components";
|
|
352
|
+
|
|
353
|
+
const config = defineConfig({
|
|
354
|
+
// \u2500\u2500 Global overrides (applied to ALL categories) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
355
|
+
accentColor: "#7C3AED",
|
|
356
|
+
textColor: "#E5E7EB",
|
|
357
|
+
bgColor: "#0b0b0c",
|
|
358
|
+
borderColor: "rgba(255,255,255,0.14)",
|
|
359
|
+
radius: 14,
|
|
360
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
361
|
+
|
|
362
|
+
// \u2500\u2500 Per-category overrides \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
363
|
+
// navigation: { sticky: true, height: 64 },
|
|
364
|
+
// hero: { minH: 600 },
|
|
365
|
+
// buttons: { bgColor: "#e94560", radius: 12 },
|
|
366
|
+
// forms: { inputBg: "rgba(255,255,255,0.05)" },
|
|
367
|
+
// ecommerce: { accentColor: "#10B981" },
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
export default config;
|
|
371
|
+
`;
|
|
372
|
+
fs.writeFileSync(configPath, configTemplate, 'utf-8');
|
|
373
|
+
created.push(configName);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* ── providers wrapper ───────────────────────────────── */
|
|
377
|
+
if (fs.existsSync(providerPath)) {
|
|
378
|
+
skipped.push(providerRel);
|
|
379
|
+
} else {
|
|
380
|
+
if (!fs.existsSync(providerDir)) {
|
|
381
|
+
fs.mkdirSync(providerDir, { recursive: true });
|
|
382
|
+
}
|
|
383
|
+
const providerTemplate = `"use client";
|
|
384
|
+
|
|
385
|
+
import { ElectroplixProvider } from "@electroplix/components";
|
|
386
|
+
import config from "../electroplix.config";
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Client-side providers wrapper.
|
|
390
|
+
* Import this into your root layout (which stays as a Server Component).
|
|
391
|
+
*/
|
|
392
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
393
|
+
return (
|
|
394
|
+
<ElectroplixProvider config={config}>
|
|
395
|
+
{children}
|
|
396
|
+
</ElectroplixProvider>
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
`;
|
|
400
|
+
fs.writeFileSync(providerPath, providerTemplate, 'utf-8');
|
|
401
|
+
created.push(providerRel);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/* ── output ──────────────────────────────────────────── */
|
|
405
|
+
if (created.length) {
|
|
406
|
+
for (const _f of created) {
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (skipped.length) {
|
|
410
|
+
for (const _f of skipped) {
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* ── install package ── */
|
|
415
|
+
const { execSync } = require('node:child_process');
|
|
416
|
+
const pmInfo = detectPackageManager();
|
|
417
|
+
|
|
418
|
+
try {
|
|
419
|
+
execSync(`${pmInfo.command} @electroplix/components`, { stdio: 'inherit' });
|
|
420
|
+
} catch (_err) {
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
425
|
+
/* ADD command */
|
|
426
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
427
|
+
|
|
428
|
+
function add(name) {
|
|
429
|
+
printBanner();
|
|
430
|
+
|
|
431
|
+
if (!name) {
|
|
432
|
+
process.exit(1);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const key = name.toLowerCase().replace(/\s+/g, '-');
|
|
436
|
+
|
|
437
|
+
/* ── try category match first ──────────────────────── */
|
|
438
|
+
const catMatch = CATEGORY_ALIASES.get(key);
|
|
439
|
+
if (catMatch) {
|
|
440
|
+
const comps = CATEGORIES[catMatch];
|
|
441
|
+
for (let i = 0; i < comps.length; i++) {
|
|
442
|
+
const _comma = i < comps.length - 1 ? ',' : '';
|
|
443
|
+
}
|
|
444
|
+
for (let i = 0; i < comps.length; i++) {
|
|
445
|
+
const isLast = i === comps.length - 1;
|
|
446
|
+
const _prefix = isLast ? B.last : B.branch;
|
|
447
|
+
}
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* ── try individual component match ────────────────── */
|
|
452
|
+
const entry = ALL_COMPONENTS.get(key);
|
|
453
|
+
if (!entry) {
|
|
454
|
+
process.exit(1);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const _W = 52;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
461
|
+
/* LIST command */
|
|
462
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
463
|
+
|
|
464
|
+
function list() {
|
|
465
|
+
printBanner();
|
|
466
|
+
|
|
467
|
+
const catEntries = Object.entries(CATEGORIES);
|
|
468
|
+
|
|
469
|
+
for (let ci = 0; ci < catEntries.length; ci++) {
|
|
470
|
+
const [_cat, names] = catEntries[ci];
|
|
471
|
+
const isLastCat = ci === catEntries.length - 1;
|
|
472
|
+
const _catPrefix = isLastCat ? B.end : B.tee;
|
|
473
|
+
const _childPipe = isLastCat ? ' ' : B.pipe;
|
|
474
|
+
|
|
475
|
+
for (let ni = 0; ni < names.length; ni++) {
|
|
476
|
+
const isLastName = ni === names.length - 1;
|
|
477
|
+
const _namePrefix = isLastName ? B.last : B.branch;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (!isLastCat)
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
485
|
+
/* HELP / default */
|
|
486
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
487
|
+
|
|
488
|
+
function help() {
|
|
489
|
+
printBanner();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
493
|
+
/* Main */
|
|
494
|
+
/* ══════════════════════════════════════════════════════════════════ */
|
|
495
|
+
|
|
496
|
+
const [, , cmd, ...args] = process.argv;
|
|
497
|
+
|
|
498
|
+
switch (cmd) {
|
|
499
|
+
case 'init':
|
|
500
|
+
init();
|
|
501
|
+
break;
|
|
502
|
+
case 'add':
|
|
503
|
+
add(args.join(' '));
|
|
504
|
+
break;
|
|
505
|
+
case 'list':
|
|
506
|
+
list();
|
|
507
|
+
break;
|
|
508
|
+
default:
|
|
509
|
+
help();
|
|
510
|
+
}
|