galaxy-design 0.2.16 → 0.2.17
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/init.js +337 -5
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -162,7 +162,7 @@ export async function initCommand(options) {
|
|
|
162
162
|
case 'vue':
|
|
163
163
|
case 'nuxtjs':
|
|
164
164
|
dependencies.push('radix-vue');
|
|
165
|
-
devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');
|
|
165
|
+
devDependencies.push('tailwindcss@3.4.0', 'autoprefixer', 'postcss');
|
|
166
166
|
if (config.iconLibrary === 'lucide') {
|
|
167
167
|
dependencies.push('lucide-vue-next');
|
|
168
168
|
}
|
|
@@ -170,7 +170,7 @@ export async function initCommand(options) {
|
|
|
170
170
|
case 'react':
|
|
171
171
|
case 'nextjs':
|
|
172
172
|
dependencies.push('@radix-ui/react-slot');
|
|
173
|
-
devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');
|
|
173
|
+
devDependencies.push('tailwindcss@3.4.0', 'autoprefixer', 'postcss');
|
|
174
174
|
if (config.iconLibrary === 'lucide') {
|
|
175
175
|
dependencies.push('lucide-react');
|
|
176
176
|
}
|
|
@@ -246,12 +246,42 @@ export async function initCommand(options) {
|
|
|
246
246
|
console.error(chalk.red(error));
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
|
+
// Create Tailwind CSS configuration files (only for frameworks that use Tailwind)
|
|
250
|
+
if (framework !== 'flutter' && framework !== 'angular') {
|
|
251
|
+
const tailwindSpinner = ora('Creating Tailwind CSS configuration...').start();
|
|
252
|
+
try {
|
|
253
|
+
// Create tailwind.config.js
|
|
254
|
+
const tailwindConfigPath = resolve(cwd, config.tailwind.config);
|
|
255
|
+
const tailwindConfigContent = getTailwindConfigContent(framework);
|
|
256
|
+
writeFile(tailwindConfigPath, tailwindConfigContent);
|
|
257
|
+
// Create postcss.config.js
|
|
258
|
+
const postcssConfigPath = resolve(cwd, 'postcss.config.js');
|
|
259
|
+
const postcssConfigContent = getPostCSSConfigContent();
|
|
260
|
+
writeFile(postcssConfigPath, postcssConfigContent);
|
|
261
|
+
tailwindSpinner.succeed('Tailwind CSS configuration created');
|
|
262
|
+
} catch (error) {
|
|
263
|
+
tailwindSpinner.fail('Failed to create Tailwind CSS configuration');
|
|
264
|
+
console.error(chalk.red(error));
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
// Create or update CSS file with Tailwind directives
|
|
268
|
+
const cssSpinner = ora('Setting up CSS file...').start();
|
|
269
|
+
try {
|
|
270
|
+
const baseDir = usesSrcDir ? 'src/' : '';
|
|
271
|
+
const cssPath = resolve(cwd, baseDir + config.tailwind.css.replace('src/', ''));
|
|
272
|
+
const cssContent = getCSSContent(config.tailwind.baseColor);
|
|
273
|
+
writeFile(cssPath, cssContent);
|
|
274
|
+
cssSpinner.succeed('CSS file configured');
|
|
275
|
+
} catch (error) {
|
|
276
|
+
cssSpinner.fail('Failed to configure CSS file');
|
|
277
|
+
console.error(chalk.red(error));
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
249
281
|
// Success message
|
|
250
282
|
console.log(chalk.green('\n✨ Success! Galaxy UI has been initialized.\n'));
|
|
251
283
|
console.log(chalk.cyan('Next steps:\n'));
|
|
252
|
-
console.log(chalk.white(` 1.
|
|
253
|
-
console.log(chalk.white(` 2. Import utilities in ${config.tailwind.css}`));
|
|
254
|
-
console.log(chalk.white(` 3. Add components:`));
|
|
284
|
+
console.log(chalk.white(` 1. Add components:`));
|
|
255
285
|
console.log(chalk.gray(` galaxy-design add button`));
|
|
256
286
|
console.log(chalk.gray(` galaxy-design add input card`));
|
|
257
287
|
console.log(chalk.gray(` galaxy-design add --all\n`));
|
|
@@ -273,5 +303,307 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
273
303
|
}
|
|
274
304
|
`;
|
|
275
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Get tailwind.config.js content
|
|
308
|
+
*/ function getTailwindConfigContent(framework) {
|
|
309
|
+
const contentPaths = framework === 'react' || framework === 'nextjs' ? `[
|
|
310
|
+
"./index.html",
|
|
311
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
312
|
+
]` : framework === 'vue' || framework === 'nuxtjs' ? `[
|
|
313
|
+
"./index.html",
|
|
314
|
+
"./src/**/*.{vue,js,ts,jsx,tsx}",
|
|
315
|
+
]` : `[
|
|
316
|
+
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
|
317
|
+
]`;
|
|
318
|
+
return `/** @type {import('tailwindcss').Config} */
|
|
319
|
+
export default {
|
|
320
|
+
darkMode: ["class"],
|
|
321
|
+
content: ${contentPaths},
|
|
322
|
+
theme: {
|
|
323
|
+
extend: {
|
|
324
|
+
colors: {
|
|
325
|
+
border: "hsl(var(--border))",
|
|
326
|
+
input: "hsl(var(--input))",
|
|
327
|
+
ring: "hsl(var(--ring))",
|
|
328
|
+
background: "hsl(var(--background))",
|
|
329
|
+
foreground: "hsl(var(--foreground))",
|
|
330
|
+
primary: {
|
|
331
|
+
DEFAULT: "hsl(var(--primary))",
|
|
332
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
333
|
+
},
|
|
334
|
+
secondary: {
|
|
335
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
336
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
337
|
+
},
|
|
338
|
+
destructive: {
|
|
339
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
340
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
341
|
+
},
|
|
342
|
+
muted: {
|
|
343
|
+
DEFAULT: "hsl(var(--muted))",
|
|
344
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
345
|
+
},
|
|
346
|
+
accent: {
|
|
347
|
+
DEFAULT: "hsl(var(--accent))",
|
|
348
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
349
|
+
},
|
|
350
|
+
popover: {
|
|
351
|
+
DEFAULT: "hsl(var(--popover))",
|
|
352
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
353
|
+
},
|
|
354
|
+
card: {
|
|
355
|
+
DEFAULT: "hsl(var(--card))",
|
|
356
|
+
foreground: "hsl(var(--card-foreground))",
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
borderRadius: {
|
|
360
|
+
lg: "var(--radius)",
|
|
361
|
+
md: "calc(var(--radius) - 2px)",
|
|
362
|
+
sm: "calc(var(--radius) - 4px)",
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
plugins: [],
|
|
367
|
+
}
|
|
368
|
+
`;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get postcss.config.js content
|
|
372
|
+
*/ function getPostCSSConfigContent() {
|
|
373
|
+
return `export default {
|
|
374
|
+
plugins: {
|
|
375
|
+
tailwindcss: {},
|
|
376
|
+
autoprefixer: {},
|
|
377
|
+
},
|
|
378
|
+
}
|
|
379
|
+
`;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Get CSS file content with Tailwind directives and CSS variables
|
|
383
|
+
*/ function getCSSContent(baseColor) {
|
|
384
|
+
// CSS variables based on base color
|
|
385
|
+
const colorVariables = {
|
|
386
|
+
slate: {
|
|
387
|
+
light: `--background: 0 0% 100%;
|
|
388
|
+
--foreground: 222.2 84% 4.9%;
|
|
389
|
+
--card: 0 0% 100%;
|
|
390
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
391
|
+
--popover: 0 0% 100%;
|
|
392
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
393
|
+
--primary: 222.2 47.4% 11.2%;
|
|
394
|
+
--primary-foreground: 210 40% 98%;
|
|
395
|
+
--secondary: 210 40% 96.1%;
|
|
396
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
397
|
+
--muted: 210 40% 96.1%;
|
|
398
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
399
|
+
--accent: 210 40% 96.1%;
|
|
400
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
401
|
+
--destructive: 0 84.2% 60.2%;
|
|
402
|
+
--destructive-foreground: 210 40% 98%;
|
|
403
|
+
--border: 214.3 31.8% 91.4%;
|
|
404
|
+
--input: 214.3 31.8% 91.4%;
|
|
405
|
+
--ring: 222.2 84% 4.9%;
|
|
406
|
+
--radius: 0.5rem;`,
|
|
407
|
+
dark: `--background: 222.2 84% 4.9%;
|
|
408
|
+
--foreground: 210 40% 98%;
|
|
409
|
+
--card: 222.2 84% 4.9%;
|
|
410
|
+
--card-foreground: 210 40% 98%;
|
|
411
|
+
--popover: 222.2 84% 4.9%;
|
|
412
|
+
--popover-foreground: 210 40% 98%;
|
|
413
|
+
--primary: 210 40% 98%;
|
|
414
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
415
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
416
|
+
--secondary-foreground: 210 40% 98%;
|
|
417
|
+
--muted: 217.2 32.6% 17.5%;
|
|
418
|
+
--muted-foreground: 215 20.2% 65.1%;
|
|
419
|
+
--accent: 217.2 32.6% 17.5%;
|
|
420
|
+
--accent-foreground: 210 40% 98%;
|
|
421
|
+
--destructive: 0 62.8% 30.6%;
|
|
422
|
+
--destructive-foreground: 210 40% 98%;
|
|
423
|
+
--border: 217.2 32.6% 17.5%;
|
|
424
|
+
--input: 217.2 32.6% 17.5%;
|
|
425
|
+
--ring: 212.7 26.8% 83.9%;`
|
|
426
|
+
},
|
|
427
|
+
gray: {
|
|
428
|
+
light: `--background: 0 0% 100%;
|
|
429
|
+
--foreground: 224 71.4% 4.1%;
|
|
430
|
+
--card: 0 0% 100%;
|
|
431
|
+
--card-foreground: 224 71.4% 4.1%;
|
|
432
|
+
--popover: 0 0% 100%;
|
|
433
|
+
--popover-foreground: 224 71.4% 4.1%;
|
|
434
|
+
--primary: 220.9 39.3% 11%;
|
|
435
|
+
--primary-foreground: 210 20% 98%;
|
|
436
|
+
--secondary: 220 14.3% 95.9%;
|
|
437
|
+
--secondary-foreground: 220.9 39.3% 11%;
|
|
438
|
+
--muted: 220 14.3% 95.9%;
|
|
439
|
+
--muted-foreground: 220 8.9% 46.1%;
|
|
440
|
+
--accent: 220 14.3% 95.9%;
|
|
441
|
+
--accent-foreground: 220.9 39.3% 11%;
|
|
442
|
+
--destructive: 0 84.2% 60.2%;
|
|
443
|
+
--destructive-foreground: 210 20% 98%;
|
|
444
|
+
--border: 220 13% 91%;
|
|
445
|
+
--input: 220 13% 91%;
|
|
446
|
+
--ring: 224 71.4% 4.1%;
|
|
447
|
+
--radius: 0.5rem;`,
|
|
448
|
+
dark: `--background: 224 71.4% 4.1%;
|
|
449
|
+
--foreground: 210 20% 98%;
|
|
450
|
+
--card: 224 71.4% 4.1%;
|
|
451
|
+
--card-foreground: 210 20% 98%;
|
|
452
|
+
--popover: 224 71.4% 4.1%;
|
|
453
|
+
--popover-foreground: 210 20% 98%;
|
|
454
|
+
--primary: 210 20% 98%;
|
|
455
|
+
--primary-foreground: 220.9 39.3% 11%;
|
|
456
|
+
--secondary: 215 27.9% 16.9%;
|
|
457
|
+
--secondary-foreground: 210 20% 98%;
|
|
458
|
+
--muted: 215 27.9% 16.9%;
|
|
459
|
+
--muted-foreground: 217.9 10.6% 64.9%;
|
|
460
|
+
--accent: 215 27.9% 16.9%;
|
|
461
|
+
--accent-foreground: 210 20% 98%;
|
|
462
|
+
--destructive: 0 62.8% 30.6%;
|
|
463
|
+
--destructive-foreground: 210 20% 98%;
|
|
464
|
+
--border: 215 27.9% 16.9%;
|
|
465
|
+
--input: 215 27.9% 16.9%;
|
|
466
|
+
--ring: 216 12.2% 83.9%;`
|
|
467
|
+
},
|
|
468
|
+
zinc: {
|
|
469
|
+
light: `--background: 0 0% 100%;
|
|
470
|
+
--foreground: 240 10% 3.9%;
|
|
471
|
+
--card: 0 0% 100%;
|
|
472
|
+
--card-foreground: 240 10% 3.9%;
|
|
473
|
+
--popover: 0 0% 100%;
|
|
474
|
+
--popover-foreground: 240 10% 3.9%;
|
|
475
|
+
--primary: 240 5.9% 10%;
|
|
476
|
+
--primary-foreground: 0 0% 98%;
|
|
477
|
+
--secondary: 240 4.8% 95.9%;
|
|
478
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
479
|
+
--muted: 240 4.8% 95.9%;
|
|
480
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
481
|
+
--accent: 240 4.8% 95.9%;
|
|
482
|
+
--accent-foreground: 240 5.9% 10%;
|
|
483
|
+
--destructive: 0 84.2% 60.2%;
|
|
484
|
+
--destructive-foreground: 0 0% 98%;
|
|
485
|
+
--border: 240 5.9% 90%;
|
|
486
|
+
--input: 240 5.9% 90%;
|
|
487
|
+
--ring: 240 10% 3.9%;
|
|
488
|
+
--radius: 0.5rem;`,
|
|
489
|
+
dark: `--background: 240 10% 3.9%;
|
|
490
|
+
--foreground: 0 0% 98%;
|
|
491
|
+
--card: 240 10% 3.9%;
|
|
492
|
+
--card-foreground: 0 0% 98%;
|
|
493
|
+
--popover: 240 10% 3.9%;
|
|
494
|
+
--popover-foreground: 0 0% 98%;
|
|
495
|
+
--primary: 0 0% 98%;
|
|
496
|
+
--primary-foreground: 240 5.9% 10%;
|
|
497
|
+
--secondary: 240 3.7% 15.9%;
|
|
498
|
+
--secondary-foreground: 0 0% 98%;
|
|
499
|
+
--muted: 240 3.7% 15.9%;
|
|
500
|
+
--muted-foreground: 240 5% 64.9%;
|
|
501
|
+
--accent: 240 3.7% 15.9%;
|
|
502
|
+
--accent-foreground: 0 0% 98%;
|
|
503
|
+
--destructive: 0 62.8% 30.6%;
|
|
504
|
+
--destructive-foreground: 0 0% 98%;
|
|
505
|
+
--border: 240 3.7% 15.9%;
|
|
506
|
+
--input: 240 3.7% 15.9%;
|
|
507
|
+
--ring: 240 4.9% 83.9%;`
|
|
508
|
+
},
|
|
509
|
+
neutral: {
|
|
510
|
+
light: `--background: 0 0% 100%;
|
|
511
|
+
--foreground: 0 0% 3.9%;
|
|
512
|
+
--card: 0 0% 100%;
|
|
513
|
+
--card-foreground: 0 0% 3.9%;
|
|
514
|
+
--popover: 0 0% 100%;
|
|
515
|
+
--popover-foreground: 0 0% 3.9%;
|
|
516
|
+
--primary: 0 0% 9%;
|
|
517
|
+
--primary-foreground: 0 0% 98%;
|
|
518
|
+
--secondary: 0 0% 96.1%;
|
|
519
|
+
--secondary-foreground: 0 0% 9%;
|
|
520
|
+
--muted: 0 0% 96.1%;
|
|
521
|
+
--muted-foreground: 0 0% 45.1%;
|
|
522
|
+
--accent: 0 0% 96.1%;
|
|
523
|
+
--accent-foreground: 0 0% 9%;
|
|
524
|
+
--destructive: 0 84.2% 60.2%;
|
|
525
|
+
--destructive-foreground: 0 0% 98%;
|
|
526
|
+
--border: 0 0% 89.8%;
|
|
527
|
+
--input: 0 0% 89.8%;
|
|
528
|
+
--ring: 0 0% 3.9%;
|
|
529
|
+
--radius: 0.5rem;`,
|
|
530
|
+
dark: `--background: 0 0% 3.9%;
|
|
531
|
+
--foreground: 0 0% 98%;
|
|
532
|
+
--card: 0 0% 3.9%;
|
|
533
|
+
--card-foreground: 0 0% 98%;
|
|
534
|
+
--popover: 0 0% 3.9%;
|
|
535
|
+
--popover-foreground: 0 0% 98%;
|
|
536
|
+
--primary: 0 0% 98%;
|
|
537
|
+
--primary-foreground: 0 0% 9%;
|
|
538
|
+
--secondary: 0 0% 14.9%;
|
|
539
|
+
--secondary-foreground: 0 0% 98%;
|
|
540
|
+
--muted: 0 0% 14.9%;
|
|
541
|
+
--muted-foreground: 0 0% 63.9%;
|
|
542
|
+
--accent: 0 0% 14.9%;
|
|
543
|
+
--accent-foreground: 0 0% 98%;
|
|
544
|
+
--destructive: 0 62.8% 30.6%;
|
|
545
|
+
--destructive-foreground: 0 0% 98%;
|
|
546
|
+
--border: 0 0% 14.9%;
|
|
547
|
+
--input: 0 0% 14.9%;
|
|
548
|
+
--ring: 0 0% 83.1%;`
|
|
549
|
+
},
|
|
550
|
+
stone: {
|
|
551
|
+
light: `--background: 0 0% 100%;
|
|
552
|
+
--foreground: 20 14.3% 4.1%;
|
|
553
|
+
--card: 0 0% 100%;
|
|
554
|
+
--card-foreground: 20 14.3% 4.1%;
|
|
555
|
+
--popover: 0 0% 100%;
|
|
556
|
+
--popover-foreground: 20 14.3% 4.1%;
|
|
557
|
+
--primary: 24 9.8% 10%;
|
|
558
|
+
--primary-foreground: 60 9.1% 97.8%;
|
|
559
|
+
--secondary: 60 4.8% 95.9%;
|
|
560
|
+
--secondary-foreground: 24 9.8% 10%;
|
|
561
|
+
--muted: 60 4.8% 95.9%;
|
|
562
|
+
--muted-foreground: 25 5.3% 44.7%;
|
|
563
|
+
--accent: 60 4.8% 95.9%;
|
|
564
|
+
--accent-foreground: 24 9.8% 10%;
|
|
565
|
+
--destructive: 0 84.2% 60.2%;
|
|
566
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
|
567
|
+
--border: 20 5.9% 90%;
|
|
568
|
+
--input: 20 5.9% 90%;
|
|
569
|
+
--ring: 20 14.3% 4.1%;
|
|
570
|
+
--radius: 0.5rem;`,
|
|
571
|
+
dark: `--background: 20 14.3% 4.1%;
|
|
572
|
+
--foreground: 60 9.1% 97.8%;
|
|
573
|
+
--card: 20 14.3% 4.1%;
|
|
574
|
+
--card-foreground: 60 9.1% 97.8%;
|
|
575
|
+
--popover: 20 14.3% 4.1%;
|
|
576
|
+
--popover-foreground: 60 9.1% 97.8%;
|
|
577
|
+
--primary: 60 9.1% 97.8%;
|
|
578
|
+
--primary-foreground: 24 9.8% 10%;
|
|
579
|
+
--secondary: 12 6.5% 15.1%;
|
|
580
|
+
--secondary-foreground: 60 9.1% 97.8%;
|
|
581
|
+
--muted: 12 6.5% 15.1%;
|
|
582
|
+
--muted-foreground: 24 5.4% 63.9%;
|
|
583
|
+
--accent: 12 6.5% 15.1%;
|
|
584
|
+
--accent-foreground: 60 9.1% 97.8%;
|
|
585
|
+
--destructive: 0 62.8% 30.6%;
|
|
586
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
|
587
|
+
--border: 12 6.5% 15.1%;
|
|
588
|
+
--input: 12 6.5% 15.1%;
|
|
589
|
+
--ring: 24 5.7% 82.9%;`
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
const colors = colorVariables[baseColor];
|
|
593
|
+
return `@tailwind base;
|
|
594
|
+
@tailwind components;
|
|
595
|
+
@tailwind utilities;
|
|
596
|
+
|
|
597
|
+
@layer base {
|
|
598
|
+
:root {
|
|
599
|
+
${colors.light}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.dark {
|
|
603
|
+
${colors.dark}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
`;
|
|
607
|
+
}
|
|
276
608
|
|
|
277
609
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/init.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n detectFramework,\n detectPackageManager,\n hasSrcDirectory,\n type Framework as DetectedFramework,\n} from '../utils/detect.js';\nimport {\n createComponentsConfig,\n hasComponentsConfig,\n loadComponentsConfig,\n type Framework,\n} from '../utils/components-config.js';\nimport {\n getDefaultConfig,\n type BaseColor,\n type IconLibrary,\n} from '../utils/config-schema.js';\nimport { writeFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport { resolve } from 'path';\n\ninterface InitOptions {\n yes?: boolean;\n cwd: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n console.log(chalk.bold.cyan('\\n🌌 Galaxy UI CLI - Multi-Framework Edition\\n'));\n\n const cwd = options.cwd;\n\n // Check if already initialized\n if (hasComponentsConfig(cwd)) {\n console.log(chalk.yellow('⚠ components.json already exists in this project.'));\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'Do you want to overwrite the existing configuration?',\n initial: false,\n });\n\n if (!overwrite) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n }\n\n // Detect framework\n const detectedFramework = detectFramework(cwd);\n\n if (detectedFramework === 'unknown') {\n console.log(\n chalk.red(\n '❌ Could not detect framework. Please ensure you are in a valid Angular, React, Vue, Next.js, Nuxt.js, React Native, or Flutter project.'\n )\n );\n return;\n }\n\n console.log(chalk.green(`✓ Detected ${chalk.bold(detectedFramework)} framework`));\n\n // Map detected framework to Framework type\n const frameworkMap: Record<DetectedFramework, Framework | null> = {\n angular: 'angular',\n react: 'react',\n vue: 'vue',\n 'react-native': 'react-native',\n flutter: 'flutter',\n nextjs: 'nextjs',\n nuxtjs: 'nuxtjs',\n unknown: null,\n };\n\n const framework = frameworkMap[detectedFramework];\n if (!framework) {\n console.log(chalk.red('❌ Unsupported framework detected.'));\n return;\n }\n\n // Detect package manager\n const packageManager = detectPackageManager(cwd);\n console.log(chalk.green(`✓ Using ${chalk.bold(packageManager)} package manager`));\n\n // Get configuration from user (or use defaults with --yes)\n let config = getDefaultConfig(framework);\n\n // Detect if project uses src/ directory and adjust paths accordingly\n const usesSrcDir = hasSrcDirectory(cwd);\n if (usesSrcDir) {\n console.log(chalk.green(`✓ Detected ${chalk.bold('src/')} directory structure`));\n }\n\n if (!options.yes) {\n console.log(chalk.cyan('\\n📝 Configuration\\n'));\n\n // Build prompts based on framework\n const promptQuestions: any[] = [];\n\n // TypeScript prompt (not for Flutter)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'toggle',\n name: 'typescript',\n message: 'Would you like to use TypeScript?',\n initial: true,\n active: 'yes',\n inactive: 'no',\n });\n }\n\n // Base color prompt (for all frameworks)\n promptQuestions.push({\n type: 'select',\n name: 'baseColor',\n message: 'Which base color would you like to use?',\n choices: [\n { title: 'Slate', value: 'slate' },\n { title: 'Gray', value: 'gray' },\n { title: 'Zinc', value: 'zinc' },\n { title: 'Neutral', value: 'neutral' },\n { title: 'Stone', value: 'stone' },\n ],\n initial: 0,\n });\n\n // Icon library prompt (not for Flutter - uses built-in icons)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'select',\n name: 'iconLibrary',\n message: 'Which icon library would you like to use?',\n choices: [\n { title: 'Lucide (Recommended)', value: 'lucide' },\n { title: 'Heroicons', value: 'heroicons' },\n { title: 'Radix Icons', value: 'radix-icons' },\n ],\n initial: 0,\n });\n }\n\n // CSS file prompt (only for web frameworks and React Native)\n if (framework !== 'flutter' && config.tailwind.css) {\n promptQuestions.push({\n type: 'text',\n name: 'cssFile',\n message: framework === 'react-native'\n ? 'Where is your global CSS file (for NativeWind)?'\n : 'Where is your global CSS file?',\n initial: config.tailwind.css,\n });\n }\n\n const answers = await prompts(promptQuestions);\n\n if (Object.keys(answers).length === 0) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n\n // Update config with user choices\n config = {\n ...config,\n typescript: answers.typescript ?? config.typescript,\n iconLibrary: (answers.iconLibrary as IconLibrary) ?? config.iconLibrary,\n tailwind: {\n ...config.tailwind,\n baseColor: (answers.baseColor as BaseColor) ?? config.tailwind.baseColor,\n css: answers.cssFile ?? config.tailwind.css,\n },\n };\n }\n\n console.log(chalk.cyan('\\n📦 Installing dependencies...\\n'));\n\n // Install dependencies\n const spinner = ora('Installing dependencies...').start();\n\n const dependencies: string[] = [];\n const devDependencies: string[] = [];\n\n // Common dependencies\n dependencies.push('clsx', 'tailwind-merge');\n\n // Framework-specific dependencies\n switch (framework) {\n case 'vue':\n case 'nuxtjs':\n dependencies.push('radix-vue');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-vue-next');\n }\n break;\n\n case 'react':\n case 'nextjs':\n dependencies.push('@radix-ui/react-slot');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-react');\n }\n if (config.typescript) {\n devDependencies.push('@types/react', '@types/react-dom');\n }\n break;\n\n case 'angular':\n // Angular components use Radix NG primitives\n dependencies.push('@radix-ng/primitives');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-angular');\n }\n break;\n }\n\n try {\n // Install dependencies\n if (dependencies.length > 0) {\n await installDependencies(dependencies, {\n cwd,\n silent: true,\n });\n }\n\n // Install devDependencies\n if (devDependencies.length > 0) {\n await installDependencies(devDependencies, {\n cwd,\n dev: true,\n silent: true,\n });\n }\n\n spinner.succeed('Dependencies installed');\n } catch (error) {\n spinner.fail('Failed to install dependencies');\n console.error(chalk.red(error));\n return;\n }\n\n // Create directories\n const dirSpinner = ora('Creating directories...').start();\n\n try {\n const baseDir = usesSrcDir ? 'src/' : '';\n const componentsPath = resolve(cwd, baseDir + config.aliases.components.replace('@/', ''));\n const utilsPath = resolve(cwd, baseDir + config.aliases.utils.replace('@/', ''));\n\n await ensureDir(componentsPath);\n await ensureDir(resolve(componentsPath, 'ui'));\n await ensureDir(utilsPath.replace('/utils', '')); // Create lib dir\n\n dirSpinner.succeed('Directories created');\n } catch (error) {\n dirSpinner.fail('Failed to create directories');\n console.error(chalk.red(error));\n return;\n }\n\n // Create utils file\n const utilsSpinner = ora('Creating utility functions...').start();\n\n try {\n const baseDir = usesSrcDir ? 'src/' : '';\n const utilsPath = resolve(cwd, baseDir + config.aliases.utils.replace('@/', '') + '.ts');\n const utilsContent = getUtilsContent();\n writeFile(utilsPath, utilsContent);\n\n utilsSpinner.succeed('Utility functions created');\n } catch (error) {\n utilsSpinner.fail('Failed to create utility functions');\n console.error(chalk.red(error));\n return;\n }\n\n // Save components.json\n const configSpinner = ora('Creating components.json...').start();\n\n try {\n createComponentsConfig(cwd, framework);\n configSpinner.succeed('components.json created');\n } catch (error) {\n configSpinner.fail('Failed to create components.json');\n console.error(chalk.red(error));\n return;\n }\n\n // Success message\n console.log(chalk.green('\\n✨ Success! Galaxy UI has been initialized.\\n'));\n console.log(chalk.cyan('Next steps:\\n'));\n console.log(chalk.white(` 1. Configure Tailwind CSS in ${config.tailwind.config}`));\n console.log(chalk.white(` 2. Import utilities in ${config.tailwind.css}`));\n console.log(chalk.white(` 3. Add components:`));\n console.log(chalk.gray(` galaxy-design add button`));\n console.log(chalk.gray(` galaxy-design add input card`));\n console.log(chalk.gray(` galaxy-design add --all\\n`));\n\n console.log(chalk.cyan('Learn more:'));\n console.log(chalk.white(' Documentation: https://galaxy-design.vercel.app'));\n console.log(chalk.white(' GitHub: https://github.com/buikevin/galaxy-design\\n'));\n}\n\n/**\n * Get utils.ts content\n */\nfunction getUtilsContent(): string {\n return `import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge Tailwind CSS classes\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n}\n"],"names":["prompts","chalk","ora","detectFramework","detectPackageManager","hasSrcDirectory","createComponentsConfig","hasComponentsConfig","getDefaultConfig","writeFile","ensureDir","installDependencies","resolve","initCommand","options","console","log","bold","cyan","cwd","yellow","overwrite","type","name","message","initial","gray","detectedFramework","red","green","frameworkMap","angular","react","vue","flutter","nextjs","nuxtjs","unknown","framework","packageManager","config","usesSrcDir","yes","promptQuestions","push","active","inactive","choices","title","value","tailwind","css","answers","Object","keys","length","typescript","iconLibrary","baseColor","cssFile","spinner","start","dependencies","devDependencies","silent","dev","succeed","error","fail","dirSpinner","baseDir","componentsPath","aliases","components","replace","utilsPath","utils","utilsSpinner","utilsContent","getUtilsContent","configSpinner","white"],"mappings":";AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SACEC,eAAe,EACfC,oBAAoB,EACpBC,eAAe,QAEV,qBAAqB;AAC5B,SACEC,sBAAsB,EACtBC,mBAAmB,QAGd,gCAAgC;AACvC,SACEC,gBAAgB,QAGX,4BAA4B;AACnC,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,mBAAmB,QAAQ,8BAA8B;AAClE,SAASC,OAAO,QAAQ,OA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;IACxBlE,QAAQC,GAAG,CAACf,MAAMgF,KAAK,CAAC;AAC1B;AAEA;;CAEC,GACD,SAASF;IACP,OAAO,CAAC;;;;;;;;;AASV,CAAC;AACD"}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/init.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n detectFramework,\n detectPackageManager,\n hasSrcDirectory,\n type Framework as DetectedFramework,\n} from '../utils/detect.js';\nimport {\n createComponentsConfig,\n hasComponentsConfig,\n loadComponentsConfig,\n type Framework,\n} from '../utils/components-config.js';\nimport {\n getDefaultConfig,\n type BaseColor,\n type IconLibrary,\n} from '../utils/config-schema.js';\nimport { writeFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport { resolve } from 'path';\n\ninterface InitOptions {\n yes?: boolean;\n cwd: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n console.log(chalk.bold.cyan('\\n🌌 Galaxy UI CLI - Multi-Framework Edition\\n'));\n\n const cwd = options.cwd;\n\n // Check if already initialized\n if (hasComponentsConfig(cwd)) {\n console.log(chalk.yellow('⚠ components.json already exists in this project.'));\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'Do you want to overwrite the existing configuration?',\n initial: false,\n });\n\n if (!overwrite) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n }\n\n // Detect framework\n const detectedFramework = detectFramework(cwd);\n\n if (detectedFramework === 'unknown') {\n console.log(\n chalk.red(\n '❌ Could not detect framework. Please ensure you are in a valid Angular, React, Vue, Next.js, Nuxt.js, React Native, or Flutter project.'\n )\n );\n return;\n }\n\n console.log(chalk.green(`✓ Detected ${chalk.bold(detectedFramework)} framework`));\n\n // Map detected framework to Framework type\n const frameworkMap: Record<DetectedFramework, Framework | null> = {\n angular: 'angular',\n react: 'react',\n vue: 'vue',\n 'react-native': 'react-native',\n flutter: 'flutter',\n nextjs: 'nextjs',\n nuxtjs: 'nuxtjs',\n unknown: null,\n };\n\n const framework = frameworkMap[detectedFramework];\n if (!framework) {\n console.log(chalk.red('❌ Unsupported framework detected.'));\n return;\n }\n\n // Detect package manager\n const packageManager = detectPackageManager(cwd);\n console.log(chalk.green(`✓ Using ${chalk.bold(packageManager)} package manager`));\n\n // Get configuration from user (or use defaults with --yes)\n let config = getDefaultConfig(framework);\n\n // Detect if project uses src/ directory and adjust paths accordingly\n const usesSrcDir = hasSrcDirectory(cwd);\n if (usesSrcDir) {\n console.log(chalk.green(`✓ Detected ${chalk.bold('src/')} directory structure`));\n }\n\n if (!options.yes) {\n console.log(chalk.cyan('\\n📝 Configuration\\n'));\n\n // Build prompts based on framework\n const promptQuestions: any[] = [];\n\n // TypeScript prompt (not for Flutter)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'toggle',\n name: 'typescript',\n message: 'Would you like to use TypeScript?',\n initial: true,\n active: 'yes',\n inactive: 'no',\n });\n }\n\n // Base color prompt (for all frameworks)\n promptQuestions.push({\n type: 'select',\n name: 'baseColor',\n message: 'Which base color would you like to use?',\n choices: [\n { title: 'Slate', value: 'slate' },\n { title: 'Gray', value: 'gray' },\n { title: 'Zinc', value: 'zinc' },\n { title: 'Neutral', value: 'neutral' },\n { title: 'Stone', value: 'stone' },\n ],\n initial: 0,\n });\n\n // Icon library prompt (not for Flutter - uses built-in icons)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'select',\n name: 'iconLibrary',\n message: 'Which icon library would you like to use?',\n choices: [\n { title: 'Lucide (Recommended)', value: 'lucide' },\n { title: 'Heroicons', value: 'heroicons' },\n { title: 'Radix Icons', value: 'radix-icons' },\n ],\n initial: 0,\n });\n }\n\n // CSS file prompt (only for web frameworks and React Native)\n if (framework !== 'flutter' && config.tailwind.css) {\n promptQuestions.push({\n type: 'text',\n name: 'cssFile',\n message: framework === 'react-native'\n ? 'Where is your global CSS file (for NativeWind)?'\n : 'Where is your global CSS file?',\n initial: config.tailwind.css,\n });\n }\n\n const answers = await prompts(promptQuestions);\n\n if (Object.keys(answers).length === 0) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n\n // Update config with user choices\n config = {\n ...config,\n typescript: answers.typescript ?? config.typescript,\n iconLibrary: (answers.iconLibrary as IconLibrary) ?? config.iconLibrary,\n tailwind: {\n ...config.tailwind,\n baseColor: (answers.baseColor as BaseColor) ?? config.tailwind.baseColor,\n css: answers.cssFile ?? config.tailwind.css,\n },\n };\n }\n\n console.log(chalk.cyan('\\n📦 Installing dependencies...\\n'));\n\n // Install dependencies\n const spinner = ora('Installing dependencies...').start();\n\n const dependencies: string[] = [];\n const devDependencies: string[] = [];\n\n // Common dependencies\n dependencies.push('clsx', 'tailwind-merge');\n\n // Framework-specific dependencies\n switch (framework) {\n case 'vue':\n case 'nuxtjs':\n dependencies.push('radix-vue');\n devDependencies.push('tailwindcss@3.4.0', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-vue-next');\n }\n break;\n\n case 'react':\n case 'nextjs':\n dependencies.push('@radix-ui/react-slot');\n devDependencies.push('tailwindcss@3.4.0', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-react');\n }\n if (config.typescript) {\n devDependencies.push('@types/react', '@types/react-dom');\n }\n break;\n\n case 'angular':\n // Angular components use Radix NG primitives\n dependencies.push('@radix-ng/primitives');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-angular');\n }\n break;\n }\n\n try {\n // Install dependencies\n if (dependencies.length > 0) {\n await installDependencies(dependencies, {\n cwd,\n silent: true,\n });\n }\n\n // Install devDependencies\n if (devDependencies.length > 0) {\n await installDependencies(devDependencies, {\n cwd,\n dev: true,\n silent: true,\n });\n }\n\n spinner.succeed('Dependencies installed');\n } catch (error) {\n spinner.fail('Failed to install dependencies');\n console.error(chalk.red(error));\n return;\n }\n\n // Create directories\n const dirSpinner = ora('Creating directories...').start();\n\n try {\n const baseDir = usesSrcDir ? 'src/' : '';\n const componentsPath = resolve(cwd, baseDir + config.aliases.components.replace('@/', ''));\n const utilsPath = resolve(cwd, baseDir + config.aliases.utils.replace('@/', ''));\n\n await ensureDir(componentsPath);\n await ensureDir(resolve(componentsPath, 'ui'));\n await ensureDir(utilsPath.replace('/utils', '')); // Create lib dir\n\n dirSpinner.succeed('Directories created');\n } catch (error) {\n dirSpinner.fail('Failed to create directories');\n console.error(chalk.red(error));\n return;\n }\n\n // Create utils file\n const utilsSpinner = ora('Creating utility functions...').start();\n\n try {\n const baseDir = usesSrcDir ? 'src/' : '';\n const utilsPath = resolve(cwd, baseDir + config.aliases.utils.replace('@/', '') + '.ts');\n const utilsContent = getUtilsContent();\n writeFile(utilsPath, utilsContent);\n\n utilsSpinner.succeed('Utility functions created');\n } catch (error) {\n utilsSpinner.fail('Failed to create utility functions');\n console.error(chalk.red(error));\n return;\n }\n\n // Save components.json\n const configSpinner = ora('Creating components.json...').start();\n\n try {\n createComponentsConfig(cwd, framework);\n configSpinner.succeed('components.json created');\n } catch (error) {\n configSpinner.fail('Failed to create components.json');\n console.error(chalk.red(error));\n return;\n }\n\n // Create Tailwind CSS configuration files (only for frameworks that use Tailwind)\n if (framework !== 'flutter' && framework !== 'angular') {\n const tailwindSpinner = ora('Creating Tailwind CSS configuration...').start();\n\n try {\n // Create tailwind.config.js\n const tailwindConfigPath = resolve(cwd, config.tailwind.config);\n const tailwindConfigContent = getTailwindConfigContent(framework);\n writeFile(tailwindConfigPath, tailwindConfigContent);\n\n // Create postcss.config.js\n const postcssConfigPath = resolve(cwd, 'postcss.config.js');\n const postcssConfigContent = getPostCSSConfigContent();\n writeFile(postcssConfigPath, postcssConfigContent);\n\n tailwindSpinner.succeed('Tailwind CSS configuration created');\n } catch (error) {\n tailwindSpinner.fail('Failed to create Tailwind CSS configuration');\n console.error(chalk.red(error));\n return;\n }\n\n // Create or update CSS file with Tailwind directives\n const cssSpinner = ora('Setting up CSS file...').start();\n\n try {\n const baseDir = usesSrcDir ? 'src/' : '';\n const cssPath = resolve(cwd, baseDir + config.tailwind.css.replace('src/', ''));\n const cssContent = getCSSContent(config.tailwind.baseColor);\n writeFile(cssPath, cssContent);\n\n cssSpinner.succeed('CSS file configured');\n } catch (error) {\n cssSpinner.fail('Failed to configure CSS file');\n console.error(chalk.red(error));\n return;\n }\n }\n\n // Success message\n console.log(chalk.green('\\n✨ Success! Galaxy UI has been initialized.\\n'));\n console.log(chalk.cyan('Next steps:\\n'));\n console.log(chalk.white(` 1. Add components:`));\n console.log(chalk.gray(` galaxy-design add button`));\n console.log(chalk.gray(` galaxy-design add input card`));\n console.log(chalk.gray(` galaxy-design add --all\\n`));\n\n console.log(chalk.cyan('Learn more:'));\n console.log(chalk.white(' Documentation: https://galaxy-design.vercel.app'));\n console.log(chalk.white(' GitHub: https://github.com/buikevin/galaxy-design\\n'));\n}\n\n/**\n * Get utils.ts content\n */\nfunction getUtilsContent(): string {\n return `import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge Tailwind CSS classes\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n}\n\n/**\n * Get tailwind.config.js content\n */\nfunction getTailwindConfigContent(framework: Framework): string {\n const contentPaths =\n framework === 'react' || framework === 'nextjs'\n ? `[\n \"./index.html\",\n \"./src/**/*.{js,ts,jsx,tsx}\",\n ]`\n : framework === 'vue' || framework === 'nuxtjs'\n ? `[\n \"./index.html\",\n \"./src/**/*.{vue,js,ts,jsx,tsx}\",\n ]`\n : `[\n \"./src/**/*.{js,ts,jsx,tsx,mdx}\",\n ]`;\n\n return `/** @type {import('tailwindcss').Config} */\nexport default {\n darkMode: [\"class\"],\n content: ${contentPaths},\n theme: {\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n },\n },\n plugins: [],\n}\n`;\n}\n\n/**\n * Get postcss.config.js content\n */\nfunction getPostCSSConfigContent(): string {\n return `export default {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n}\n`;\n}\n\n/**\n * Get CSS file content with Tailwind directives and CSS variables\n */\nfunction getCSSContent(baseColor: BaseColor): string {\n // CSS variables based on base color\n const colorVariables: Record<BaseColor, { light: string; dark: string }> = {\n slate: {\n light: `--background: 0 0% 100%;\n --foreground: 222.2 84% 4.9%;\n --card: 0 0% 100%;\n --card-foreground: 222.2 84% 4.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 84% 4.9%;\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 40% 98%;\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n --ring: 222.2 84% 4.9%;\n --radius: 0.5rem;`,\n dark: `--background: 222.2 84% 4.9%;\n --foreground: 210 40% 98%;\n --card: 222.2 84% 4.9%;\n --card-foreground: 210 40% 98%;\n --popover: 222.2 84% 4.9%;\n --popover-foreground: 210 40% 98%;\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 11.2%;\n --secondary: 217.2 32.6% 17.5%;\n --secondary-foreground: 210 40% 98%;\n --muted: 217.2 32.6% 17.5%;\n --muted-foreground: 215 20.2% 65.1%;\n --accent: 217.2 32.6% 17.5%;\n --accent-foreground: 210 40% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 40% 98%;\n --border: 217.2 32.6% 17.5%;\n --input: 217.2 32.6% 17.5%;\n --ring: 212.7 26.8% 83.9%;`,\n },\n gray: {\n light: `--background: 0 0% 100%;\n --foreground: 224 71.4% 4.1%;\n --card: 0 0% 100%;\n --card-foreground: 224 71.4% 4.1%;\n --popover: 0 0% 100%;\n --popover-foreground: 224 71.4% 4.1%;\n --primary: 220.9 39.3% 11%;\n --primary-foreground: 210 20% 98%;\n --secondary: 220 14.3% 95.9%;\n --secondary-foreground: 220.9 39.3% 11%;\n --muted: 220 14.3% 95.9%;\n --muted-foreground: 220 8.9% 46.1%;\n --accent: 220 14.3% 95.9%;\n --accent-foreground: 220.9 39.3% 11%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 20% 98%;\n --border: 220 13% 91%;\n --input: 220 13% 91%;\n --ring: 224 71.4% 4.1%;\n --radius: 0.5rem;`,\n dark: `--background: 224 71.4% 4.1%;\n --foreground: 210 20% 98%;\n --card: 224 71.4% 4.1%;\n --card-foreground: 210 20% 98%;\n --popover: 224 71.4% 4.1%;\n --popover-foreground: 210 20% 98%;\n --primary: 210 20% 98%;\n --primary-foreground: 220.9 39.3% 11%;\n --secondary: 215 27.9% 16.9%;\n --secondary-foreground: 210 20% 98%;\n --muted: 215 27.9% 16.9%;\n --muted-foreground: 217.9 10.6% 64.9%;\n --accent: 215 27.9% 16.9%;\n --accent-foreground: 210 20% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 20% 98%;\n --border: 215 27.9% 16.9%;\n --input: 215 27.9% 16.9%;\n --ring: 216 12.2% 83.9%;`,\n },\n zinc: {\n light: `--background: 0 0% 100%;\n --foreground: 240 10% 3.9%;\n --card: 0 0% 100%;\n --card-foreground: 240 10% 3.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 240 10% 3.9%;\n --primary: 240 5.9% 10%;\n --primary-foreground: 0 0% 98%;\n --secondary: 240 4.8% 95.9%;\n --secondary-foreground: 240 5.9% 10%;\n --muted: 240 4.8% 95.9%;\n --muted-foreground: 240 3.8% 46.1%;\n --accent: 240 4.8% 95.9%;\n --accent-foreground: 240 5.9% 10%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 0 0% 98%;\n --border: 240 5.9% 90%;\n --input: 240 5.9% 90%;\n --ring: 240 10% 3.9%;\n --radius: 0.5rem;`,\n dark: `--background: 240 10% 3.9%;\n --foreground: 0 0% 98%;\n --card: 240 10% 3.9%;\n --card-foreground: 0 0% 98%;\n --popover: 240 10% 3.9%;\n --popover-foreground: 0 0% 98%;\n --primary: 0 0% 98%;\n --primary-foreground: 240 5.9% 10%;\n --secondary: 240 3.7% 15.9%;\n --secondary-foreground: 0 0% 98%;\n --muted: 240 3.7% 15.9%;\n --muted-foreground: 240 5% 64.9%;\n --accent: 240 3.7% 15.9%;\n --accent-foreground: 0 0% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 0 0% 98%;\n --border: 240 3.7% 15.9%;\n --input: 240 3.7% 15.9%;\n --ring: 240 4.9% 83.9%;`,\n },\n neutral: {\n light: `--background: 0 0% 100%;\n --foreground: 0 0% 3.9%;\n --card: 0 0% 100%;\n --card-foreground: 0 0% 3.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 0 0% 3.9%;\n --primary: 0 0% 9%;\n --primary-foreground: 0 0% 98%;\n --secondary: 0 0% 96.1%;\n --secondary-foreground: 0 0% 9%;\n --muted: 0 0% 96.1%;\n --muted-foreground: 0 0% 45.1%;\n --accent: 0 0% 96.1%;\n --accent-foreground: 0 0% 9%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 89.8%;\n --input: 0 0% 89.8%;\n --ring: 0 0% 3.9%;\n --radius: 0.5rem;`,\n dark: `--background: 0 0% 3.9%;\n --foreground: 0 0% 98%;\n --card: 0 0% 3.9%;\n --card-foreground: 0 0% 98%;\n --popover: 0 0% 3.9%;\n --popover-foreground: 0 0% 98%;\n --primary: 0 0% 98%;\n --primary-foreground: 0 0% 9%;\n --secondary: 0 0% 14.9%;\n --secondary-foreground: 0 0% 98%;\n --muted: 0 0% 14.9%;\n --muted-foreground: 0 0% 63.9%;\n --accent: 0 0% 14.9%;\n --accent-foreground: 0 0% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 0 0% 98%;\n --border: 0 0% 14.9%;\n --input: 0 0% 14.9%;\n --ring: 0 0% 83.1%;`,\n },\n stone: {\n light: `--background: 0 0% 100%;\n --foreground: 20 14.3% 4.1%;\n --card: 0 0% 100%;\n --card-foreground: 20 14.3% 4.1%;\n --popover: 0 0% 100%;\n --popover-foreground: 20 14.3% 4.1%;\n --primary: 24 9.8% 10%;\n --primary-foreground: 60 9.1% 97.8%;\n --secondary: 60 4.8% 95.9%;\n --secondary-foreground: 24 9.8% 10%;\n --muted: 60 4.8% 95.9%;\n --muted-foreground: 25 5.3% 44.7%;\n --accent: 60 4.8% 95.9%;\n --accent-foreground: 24 9.8% 10%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 60 9.1% 97.8%;\n --border: 20 5.9% 90%;\n --input: 20 5.9% 90%;\n --ring: 20 14.3% 4.1%;\n --radius: 0.5rem;`,\n dark: `--background: 20 14.3% 4.1%;\n --foreground: 60 9.1% 97.8%;\n --card: 20 14.3% 4.1%;\n --card-foreground: 60 9.1% 97.8%;\n --popover: 20 14.3% 4.1%;\n --popover-foreground: 60 9.1% 97.8%;\n --primary: 60 9.1% 97.8%;\n --primary-foreground: 24 9.8% 10%;\n --secondary: 12 6.5% 15.1%;\n --secondary-foreground: 60 9.1% 97.8%;\n --muted: 12 6.5% 15.1%;\n --muted-foreground: 24 5.4% 63.9%;\n --accent: 12 6.5% 15.1%;\n --accent-foreground: 60 9.1% 97.8%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 60 9.1% 97.8%;\n --border: 12 6.5% 15.1%;\n --input: 12 6.5% 15.1%;\n --ring: 24 5.7% 82.9%;`,\n },\n };\n\n const colors = colorVariables[baseColor];\n\n return `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer base {\n :root {\n ${colors.light}\n }\n\n .dark {\n ${colors.dark}\n }\n}\n`;\n}\n"],"names":["prompts","chalk","ora","detectFramework","detectPackageManager","hasSrcDirectory","createComponentsConfig","hasComponentsConfig","getDefaultConfig","writeFile","ensureDir","installDependencies","resolve","initCommand","options","console","log","bold","cyan","cwd","yellow","overwrite","type","name","message","initial","gray","detectedFramework","red","green","frameworkMap","angular","react","vue","flutter","nextjs","nuxtjs","unknown","framework","packageManager","config","usesSrcDir","yes","promptQuestions","push","active","inactive","choices","title","value","tailwind","css","answers","Object","keys","length","typescript","iconLibrary","baseColor","cssFile","spinner","start","dependencies","devDependencies","silent","dev","succeed","error","fail","dirSpinner","baseDir","componentsPath","aliases","components","replace","utilsPath","utils","utilsSpinner","utilsContent","getUtilsContent","configSpinner","tailwindSpinner","tailwindConfigPath","tailwindConfigContent","getTailwindConfigContent","postcssConfigPath","postcssConfigContent","getPostCSSConfigContent","cssSpinner","cssPath","cssContent","getCSSContent","white","contentPaths","colorVariables","slate","light","dark","zinc","neutral","stone","colors"],"mappings":";AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SACEC,eAA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
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "CLI tool for adding Galaxy UI components to your Vue, React, Angular, Next.js, Nuxt.js, React Native, or Flutter project",
|
|
5
5
|
"author": "Bùi Trọng Hiếu (kevinbui) <kevinbui210191@gmail.com>",
|
|
6
6
|
"license": "MIT",
|