starwind 1.2.0 → 1.3.1

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.
@@ -263,7 +263,7 @@ var MIN_ASTRO_VERSION = "5.0.0";
263
263
  var PATHS = {
264
264
  STARWIND_CORE: "@starwind-ui/core",
265
265
  STARWIND_CORE_COMPONENTS: "src/components",
266
- STARWIND_COMPONENT_REGISTRY: "https://starwind.dev/registry.json",
266
+ STARWIND_REMOTE_COMPONENT_REGISTRY: "https://starwind.dev/registry.json",
267
267
  LOCAL_CSS_FILE: "src/styles/starwind.css",
268
268
  LOCAL_CONFIG_FILE: "starwind.config.json",
269
269
  LOCAL_STYLES_DIR: "src/styles",
@@ -353,6 +353,15 @@ async function requestPackageManager() {
353
353
  }
354
354
  return pm;
355
355
  }
356
+ async function getDefaultPackageManager() {
357
+ if (await fileExists("yarn.lock")) {
358
+ return "yarn";
359
+ } else if (await fileExists("pnpm-lock.yaml")) {
360
+ return "pnpm";
361
+ } else {
362
+ return "npm";
363
+ }
364
+ }
356
365
  async function installDependencies(packages, pm, dev = false, force = false) {
357
366
  const args = [
358
367
  pm === "npm" ? "install" : "add",
@@ -371,7 +380,7 @@ var sleep = async (ms) => {
371
380
  // src/commands/init.ts
372
381
  import * as p3 from "@clack/prompts";
373
382
  import semver from "semver";
374
- async function init(withinAdd = false) {
383
+ async function init(withinAdd = false, options) {
375
384
  if (!withinAdd) {
376
385
  p3.intro(highlighter.title(" Welcome to the Starwind CLI "));
377
386
  }
@@ -384,68 +393,80 @@ async function init(withinAdd = false) {
384
393
  const pkg = await readJsonFile("package.json");
385
394
  const installTasks = [];
386
395
  const configTasks = [];
387
- const configChoices = await p3.group(
388
- {
389
- // ask where to install components
390
- installLocation: () => p3.text({
391
- message: "What is your components directory?",
392
- placeholder: PATHS.LOCAL_COMPONENTS_DIR,
393
- initialValue: PATHS.LOCAL_COMPONENTS_DIR,
394
- validate(value) {
395
- if (value.length === 0) return `Value is required!`;
396
- if (path.isAbsolute(value)) return `Please use a relative path`;
397
- if (value.includes("..")) return `Path traversal is not allowed`;
398
- const invalidChars = /[<>:"|?*]/;
399
- if (invalidChars.test(value)) return `Path contains invalid characters`;
400
- const systemDirs = ["windows", "program files", "system32"];
401
- if (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {
402
- return `Cannot install in system directories`;
403
- }
404
- }
405
- }),
406
- // ask where to add the css file
407
- cssFile: () => p3.text({
408
- message: `Where would you like to add the Tailwind ${highlighter.info(".css")} file?`,
409
- placeholder: PATHS.LOCAL_CSS_FILE,
410
- initialValue: PATHS.LOCAL_CSS_FILE,
411
- validate(value) {
412
- if (value.length === 0) return `Value is required!`;
413
- if (!value.endsWith(".css")) return `File must end with .css extension`;
414
- if (path.isAbsolute(value)) return `Please use a relative path`;
415
- if (value.includes("..")) return `Path traversal is not allowed`;
416
- const invalidChars = /[<>:"|?*]/;
417
- if (invalidChars.test(value)) return `Path contains invalid characters`;
418
- const systemDirs = ["windows", "program files", "system32"];
419
- if (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {
420
- return `Cannot use system directories`;
396
+ let configChoices;
397
+ if (options?.defaults) {
398
+ configChoices = {
399
+ installLocation: PATHS.LOCAL_COMPONENTS_DIR,
400
+ cssFile: PATHS.LOCAL_CSS_FILE,
401
+ twBaseColor: "neutral"
402
+ };
403
+ if (!withinAdd) {
404
+ p3.log.info("Using default configuration values");
405
+ }
406
+ } else {
407
+ configChoices = await p3.group(
408
+ {
409
+ // ask where to install components
410
+ installLocation: () => p3.text({
411
+ message: "What is your components directory?",
412
+ placeholder: PATHS.LOCAL_COMPONENTS_DIR,
413
+ initialValue: PATHS.LOCAL_COMPONENTS_DIR,
414
+ validate(value) {
415
+ if (value.length === 0) return `Value is required!`;
416
+ if (path.isAbsolute(value)) return `Please use a relative path`;
417
+ if (value.includes("..")) return `Path traversal is not allowed`;
418
+ const invalidChars = /[<>:"|?*]/;
419
+ if (invalidChars.test(value)) return `Path contains invalid characters`;
420
+ const systemDirs = ["windows", "program files", "system32"];
421
+ if (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {
422
+ return `Cannot install in system directories`;
423
+ }
421
424
  }
422
- const basename = path.basename(value, ".css");
423
- if (!basename || basename.trim().length === 0) {
424
- return `Invalid filename`;
425
+ }),
426
+ // ask where to add the css file
427
+ cssFile: () => p3.text({
428
+ message: `Where would you like to add the Tailwind ${highlighter.info(".css")} file?`,
429
+ placeholder: PATHS.LOCAL_CSS_FILE,
430
+ initialValue: PATHS.LOCAL_CSS_FILE,
431
+ validate(value) {
432
+ if (value.length === 0) return `Value is required!`;
433
+ if (!value.endsWith(".css")) return `File must end with .css extension`;
434
+ if (path.isAbsolute(value)) return `Please use a relative path`;
435
+ if (value.includes("..")) return `Path traversal is not allowed`;
436
+ const invalidChars = /[<>:"|?*]/;
437
+ if (invalidChars.test(value)) return `Path contains invalid characters`;
438
+ const systemDirs = ["windows", "program files", "system32"];
439
+ if (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {
440
+ return `Cannot use system directories`;
441
+ }
442
+ const basename = path.basename(value, ".css");
443
+ if (!basename || basename.trim().length === 0) {
444
+ return `Invalid filename`;
445
+ }
425
446
  }
447
+ }),
448
+ twBaseColor: () => p3.select({
449
+ message: "What Tailwind base color would you like to use?",
450
+ initialValue: "neutral",
451
+ options: [
452
+ { label: "Neutral (default)", value: "neutral" },
453
+ { label: "Stone", value: "stone" },
454
+ { label: "Zinc", value: "zinc" },
455
+ { label: "Gray", value: "gray" },
456
+ { label: "Slate", value: "slate" }
457
+ ]
458
+ })
459
+ },
460
+ {
461
+ // On Cancel callback that wraps the group
462
+ // So if the user cancels one of the prompts in the group this function will be called
463
+ onCancel: () => {
464
+ p3.cancel("Operation cancelled.");
465
+ process.exit(0);
426
466
  }
427
- }),
428
- twBaseColor: () => p3.select({
429
- message: "What Tailwind base color would you like to use?",
430
- initialValue: "neutral",
431
- options: [
432
- { label: "Neutral (default)", value: "neutral" },
433
- { label: "Stone", value: "stone" },
434
- { label: "Zinc", value: "zinc" },
435
- { label: "Gray", value: "gray" },
436
- { label: "Slate", value: "slate" }
437
- ]
438
- })
439
- },
440
- {
441
- // On Cancel callback that wraps the group
442
- // So if the user cancels one of the prompts in the group this function will be called
443
- onCancel: () => {
444
- p3.cancel("Operation cancelled.");
445
- process.exit(0);
446
467
  }
447
- }
448
- );
468
+ );
469
+ }
449
470
  const cssFileDir = path.dirname(configChoices.cssFile);
450
471
  const componentInstallDir = path.join(configChoices.installLocation, "starwind");
451
472
  configTasks.push({
@@ -477,9 +498,13 @@ async function init(withinAdd = false) {
477
498
  );
478
499
  }
479
500
  if (cssFileExists) {
480
- const shouldOverride = await p3.confirm({
501
+ let shouldOverride = options?.defaults ? true : await p3.confirm({
481
502
  message: `${highlighter.info(configChoices.cssFile)} already exists. Do you want to override it?`
482
503
  });
504
+ if (p3.isCancel(shouldOverride)) {
505
+ p3.cancel("Operation cancelled");
506
+ return process.exit(0);
507
+ }
483
508
  if (!shouldOverride) {
484
509
  p3.log.info("Skipping Tailwind CSS configuration");
485
510
  } else {
@@ -521,11 +546,11 @@ async function init(withinAdd = false) {
521
546
  return "Updated project starwind configuration";
522
547
  }
523
548
  });
524
- const pm = await requestPackageManager();
549
+ const pm = options?.defaults ? await getDefaultPackageManager() : await requestPackageManager();
525
550
  if (pkg.dependencies?.astro) {
526
551
  const astroVersion = pkg.dependencies.astro.replace(/^\^|~/, "");
527
552
  if (!semver.gte(astroVersion, MIN_ASTRO_VERSION)) {
528
- const shouldUpgrade = await p3.confirm({
553
+ let shouldUpgrade = options?.defaults ? true : await p3.confirm({
529
554
  message: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to upgrade from v${astroVersion}?`,
530
555
  initialValue: true
531
556
  });
@@ -546,7 +571,7 @@ async function init(withinAdd = false) {
546
571
  });
547
572
  }
548
573
  } else {
549
- const shouldInstall2 = await p3.confirm({
574
+ let shouldInstall2 = options?.defaults ? true : await p3.confirm({
550
575
  message: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to install it?`,
551
576
  initialValue: true
552
577
  });
@@ -567,7 +592,7 @@ async function init(withinAdd = false) {
567
592
  });
568
593
  }
569
594
  const otherPackages = getOtherPackages();
570
- const shouldInstall = await p3.confirm({
595
+ let shouldInstall = options?.defaults ? true : await p3.confirm({
571
596
  message: `Install ${highlighter.info(otherPackages.join(", "))} using ${highlighter.info(pm)}?`
572
597
  });
573
598
  if (p3.isCancel(shouldInstall)) {
@@ -612,12 +637,12 @@ async function init(withinAdd = false) {
612
637
  export {
613
638
  PATHS,
614
639
  fileExists,
615
- highlighter,
616
640
  getConfig,
617
641
  updateConfig,
642
+ highlighter,
618
643
  requestPackageManager,
619
644
  installDependencies,
620
645
  sleep,
621
646
  init
622
647
  };
623
- //# sourceMappingURL=chunk-DQZF533G.js.map
648
+ //# sourceMappingURL=chunk-GJFQ24ZT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/init.ts","../src/templates/starwind.css.ts","../src/utils/highlighter.ts","../src/utils/astro-config.ts","../src/utils/fs.ts","../src/utils/constants.ts","../src/utils/config.ts","../src/utils/package-manager.ts","../src/utils/sleep.ts"],"sourcesContent":["import path from \"node:path\";\nimport { tailwindConfig } from \"@/templates/starwind.css.js\";\nimport { setupAstroConfig } from \"@/utils/astro-config.js\";\nimport { updateConfig } from \"@/utils/config.js\";\nimport { ASTRO_PACKAGES, MIN_ASTRO_VERSION, PATHS, getOtherPackages } from \"@/utils/constants.js\";\nimport { ensureDirectory, fileExists, readJsonFile, writeCssFile } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { installDependencies, requestPackageManager, getDefaultPackageManager, PackageManager } from \"@/utils/package-manager.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\nimport semver from \"semver\";\n\nexport async function init(withinAdd: boolean = false, options?: { defaults?: boolean }) {\n\tif (!withinAdd) {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\t}\n\n\ttry {\n\t\t// Validate project structure\n\t\tif (!(await fileExists(\"package.json\"))) {\n\t\t\tthrow new Error(\n\t\t\t\t\"No package.json found. Please run this command in the root of your project.\",\n\t\t\t);\n\t\t}\n\n\t\tconst pkg = await readJsonFile(\"package.json\");\n\n\t\t// Check Astro version compatibility\n\t\tconst installTasks = [];\n\t\tconst configTasks = [];\n\n\t\t// ================================================================\n\t\t// Prepare project structure and configuration tasks\n\t\t// ================================================================\n\t\tlet configChoices;\n\t\t\n\t\t// Use defaults if specified, otherwise prompt user for choices\n\t\tif (options?.defaults) {\n\t\t\tconfigChoices = {\n\t\t\t\tinstallLocation: PATHS.LOCAL_COMPONENTS_DIR,\n\t\t\t\tcssFile: PATHS.LOCAL_CSS_FILE,\n\t\t\t\ttwBaseColor: \"neutral\",\n\t\t\t};\n\t\t\t\n\t\t\tif (!withinAdd) {\n\t\t\t\tp.log.info(\"Using default configuration values\");\n\t\t\t}\n\t\t} else {\n\t\t\tconfigChoices = await p.group(\n\t\t\t\t{\n\t\t\t\t\t// ask where to install components\n\t\t\t\t\tinstallLocation: () =>\n\t\t\t\t\t\tp.text({\n\t\t\t\t\t\t\tmessage: \"What is your components directory?\",\n\t\t\t\t\t\t\tplaceholder: PATHS.LOCAL_COMPONENTS_DIR,\n\t\t\t\t\t\t\tinitialValue: PATHS.LOCAL_COMPONENTS_DIR,\n\t\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t\t// Check for empty value\n\t\t\t\t\t\t\t\tif (value.length === 0) return `Value is required!`;\n\n\t\t\t\t\t\t\t\t// Check for absolute paths\n\t\t\t\t\t\t\t\tif (path.isAbsolute(value)) return `Please use a relative path`;\n\n\t\t\t\t\t\t\t\t// Check for path traversal attempts\n\t\t\t\t\t\t\t\tif (value.includes(\"..\")) return `Path traversal is not allowed`;\n\n\t\t\t\t\t\t\t\t// Check for invalid characters in path\n\t\t\t\t\t\t\t\tconst invalidChars = /[<>:\"|?*]/;\n\t\t\t\t\t\t\t\tif (invalidChars.test(value)) return `Path contains invalid characters`;\n\n\t\t\t\t\t\t\t\t// Check if path starts with system directories\n\t\t\t\t\t\t\t\tconst systemDirs = [\"windows\", \"program files\", \"system32\"];\n\t\t\t\t\t\t\t\tif (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {\n\t\t\t\t\t\t\t\t\treturn `Cannot install in system directories`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t// ask where to add the css file\n\t\t\t\t\tcssFile: () =>\n\t\t\t\t\t\tp.text({\n\t\t\t\t\t\t\tmessage: `Where would you like to add the Tailwind ${highlighter.info(\".css\")} file?`,\n\t\t\t\t\t\t\tplaceholder: PATHS.LOCAL_CSS_FILE,\n\t\t\t\t\t\t\tinitialValue: PATHS.LOCAL_CSS_FILE,\n\t\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t\t// Check for empty value\n\t\t\t\t\t\t\t\tif (value.length === 0) return `Value is required!`;\n\n\t\t\t\t\t\t\t\t// Must end with .css\n\t\t\t\t\t\t\t\tif (!value.endsWith(\".css\")) return `File must end with .css extension`;\n\n\t\t\t\t\t\t\t\t// Check for absolute paths\n\t\t\t\t\t\t\t\tif (path.isAbsolute(value)) return `Please use a relative path`;\n\n\t\t\t\t\t\t\t\t// Check for path traversal attempts\n\t\t\t\t\t\t\t\tif (value.includes(\"..\")) return `Path traversal is not allowed`;\n\n\t\t\t\t\t\t\t\t// Check for invalid characters in path\n\t\t\t\t\t\t\t\tconst invalidChars = /[<>:\"|?*]/;\n\t\t\t\t\t\t\t\tif (invalidChars.test(value)) return `Path contains invalid characters`;\n\n\t\t\t\t\t\t\t\t// Check if path starts with system directories\n\t\t\t\t\t\t\t\tconst systemDirs = [\"windows\", \"program files\", \"system32\"];\n\t\t\t\t\t\t\t\tif (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {\n\t\t\t\t\t\t\t\t\treturn `Cannot use system directories`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Ensure the path has a valid filename\n\t\t\t\t\t\t\t\tconst basename = path.basename(value, \".css\");\n\t\t\t\t\t\t\t\tif (!basename || basename.trim().length === 0) {\n\t\t\t\t\t\t\t\t\treturn `Invalid filename`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\n\t\t\t\t\ttwBaseColor: () =>\n\t\t\t\t\t\tp.select({\n\t\t\t\t\t\t\tmessage: \"What Tailwind base color would you like to use?\",\n\t\t\t\t\t\t\tinitialValue: \"neutral\",\n\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t{ label: \"Neutral (default)\", value: \"neutral\" },\n\t\t\t\t\t\t\t\t{ label: \"Stone\", value: \"stone\" },\n\t\t\t\t\t\t\t\t{ label: \"Zinc\", value: \"zinc\" },\n\t\t\t\t\t\t\t\t{ label: \"Gray\", value: \"gray\" },\n\t\t\t\t\t\t\t\t{ label: \"Slate\", value: \"slate\" },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// On Cancel callback that wraps the group\n\t\t\t\t\t// So if the user cancels one of the prompts in the group this function will be called\n\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\tp.cancel(\"Operation cancelled.\");\n\t\t\t\t\t\tprocess.exit(0);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\t// ================================================================\n\t\t// Make sure appropriate directories exist\n\t\t// ================================================================\n\t\tconst cssFileDir = path.dirname(configChoices.cssFile);\n\t\tconst componentInstallDir = path.join(configChoices.installLocation, \"starwind\");\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Creating project structure\",\n\t\t\ttask: async () => {\n\t\t\t\tawait ensureDirectory(componentInstallDir);\n\t\t\t\tawait ensureDirectory(cssFileDir);\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Created project structure\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare Astro config file setup\n\t\t// ================================================================\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Setup Astro config file\",\n\t\t\ttask: async () => {\n\t\t\t\tconst success = await setupAstroConfig();\n\t\t\t\tif (!success) {\n\t\t\t\t\tthrow new Error(\"Failed to setup Astro config\");\n\t\t\t\t}\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Astro config setup completed\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare CSS file\n\t\t// ================================================================\n\t\t// Check if CSS file already exists\n\t\tconst cssFileExists = await fileExists(configChoices.cssFile);\n\t\tlet updatedTailwindConfig = tailwindConfig;\n\n\t\tif (configChoices.twBaseColor !== \"neutral\") {\n\t\t\t// replace all \"--color-neutral\" with \"--color-twBaseColor\"\n\t\t\tupdatedTailwindConfig = updatedTailwindConfig.replace(\n\t\t\t\t/--color-neutral-/g,\n\t\t\t\t`--color-${configChoices.twBaseColor}-`,\n\t\t\t);\n\t\t}\n\n\t\tif (cssFileExists) {\n\t\t\tlet shouldOverride = options?.defaults ? true : await p.confirm({\n\t\t\t\tmessage: `${highlighter.info(configChoices.cssFile)} already exists. Do you want to override it?`,\n\t\t\t});\n\n\t\t\tif (p.isCancel(shouldOverride)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\n\t\t\tif (!shouldOverride) {\n\t\t\t\tp.log.info(\"Skipping Tailwind CSS configuration\");\n\t\t\t} else {\n\t\t\t\tconfigTasks.push({\n\t\t\t\t\ttitle: \"Creating Tailwind CSS configuration\",\n\t\t\t\t\ttask: async () => {\n\t\t\t\t\t\tawait writeCssFile(configChoices.cssFile, updatedTailwindConfig);\n\t\t\t\t\t\tawait sleep(250);\n\t\t\t\t\t\treturn \"Created Tailwind configuration\";\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconfigTasks.push({\n\t\t\t\ttitle: \"Creating Tailwind CSS configuration\",\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait writeCssFile(configChoices.cssFile, updatedTailwindConfig);\n\t\t\t\t\tawait sleep(250);\n\t\t\t\t\treturn \"Created Tailwind configuration\";\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// ================================================================\n\t\t// Prepare project starwind configuration\n\t\t// ================================================================\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Updating project configuration\",\n\t\t\ttask: async () => {\n\t\t\t\tawait updateConfig({\n\t\t\t\t\ttailwind: {\n\t\t\t\t\t\tcss: configChoices.cssFile,\n\t\t\t\t\t\tbaseColor: configChoices.twBaseColor as \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\",\n\t\t\t\t\t\tcssVariables: true,\n\t\t\t\t\t},\n\t\t\t\t\t// aliases: {\n\t\t\t\t\t// \tcomponents: \"@/components\",\n\t\t\t\t\t// },\n\t\t\t\t\tcomponentDir: configChoices.installLocation,\n\t\t\t\t\tcomponents: [],\n\t\t\t\t});\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Updated project starwind configuration\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare astro installation\n\t\t// ================================================================\n\t\t// Request package manager\n\t\tconst pm = options?.defaults \n\t\t\t? await getDefaultPackageManager() \n\t\t\t: await requestPackageManager();\n\n\t\tif (pkg.dependencies?.astro) {\n\t\t\tconst astroVersion = pkg.dependencies.astro.replace(/^\\^|~/, \"\");\n\t\t\tif (!semver.gte(astroVersion, MIN_ASTRO_VERSION)) {\n\t\t\t\tlet shouldUpgrade = options?.defaults ? true : await p.confirm({\n\t\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to upgrade from v${astroVersion}?`,\n\t\t\t\t\tinitialValue: true,\n\t\t\t\t});\n\n\t\t\t\tif (p.isCancel(shouldUpgrade)) {\n\t\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\t\treturn process.exit(0);\n\t\t\t\t}\n\n\t\t\t\tif (!shouldUpgrade) {\n\t\t\t\t\tp.cancel(\"Astro v5 or higher is required to use Starwind\");\n\t\t\t\t\treturn process.exit(1);\n\t\t\t\t}\n\n\t\t\t\tinstallTasks.push({\n\t\t\t\t\ttitle: \"Upgrading Astro\",\n\t\t\t\t\ttask: async () => {\n\t\t\t\t\t\tawait installDependencies([ASTRO_PACKAGES.core], pm);\n\t\t\t\t\t\treturn \"Upgraded Astro successfully\";\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tlet shouldInstall = options?.defaults ? true : await p.confirm({\n\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to install it?`,\n\t\t\t\tinitialValue: true,\n\t\t\t});\n\n\t\t\tif (p.isCancel(shouldInstall)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\n\t\t\tif (!shouldInstall) {\n\t\t\t\tp.cancel(\"Astro is required to use Starwind\");\n\t\t\t\treturn process.exit(1);\n\t\t\t}\n\n\t\t\tinstallTasks.push({\n\t\t\t\ttitle: `Installing ${ASTRO_PACKAGES.core}`,\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait installDependencies([ASTRO_PACKAGES.core], pm);\n\t\t\t\t\treturn `Installed ${highlighter.info(ASTRO_PACKAGES.core)} successfully`;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// ================================================================\n\t\t// Prepare tailwind and other package installation\n\t\t// ================================================================\n\t\tconst otherPackages = getOtherPackages();\n\n\t\tlet shouldInstall = options?.defaults ? true : await p.confirm({\n\t\t\tmessage: `Install ${highlighter.info(otherPackages.join(\", \"))} using ${highlighter.info(pm)}?`,\n\t\t});\n\n\t\tif (p.isCancel(shouldInstall)) {\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\treturn process.exit(0);\n\t\t}\n\n\t\tif (shouldInstall) {\n\t\t\tinstallTasks.push({\n\t\t\t\ttitle: `Installing packages`,\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait installDependencies(getOtherPackages(), pm, false, false);\n\t\t\t\t\treturn `${highlighter.info(\"Packages installed successfully\")}`;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tp.log.warn(\n\t\t\t\thighlighter.warn(`Skipped installation of packages. Make sure to install them manually`),\n\t\t\t);\n\t\t}\n\n\t\t// ================================================================\n\t\t// Execute all tasks\n\t\t// ================================================================\n\t\tif (installTasks.length > 0) {\n\t\t\tawait p.tasks(installTasks);\n\t\t}\n\n\t\tif (configTasks.length > 0) {\n\t\t\tawait p.tasks(configTasks);\n\t\t}\n\n\t\tawait sleep(250);\n\n\t\tp.note(\n\t\t\t`Make sure your layout imports the ${highlighter.infoBright(configChoices.cssFile)} file`,\n\t\t\t\"Next steps\",\n\t\t);\n\n\t\tif (!withinAdd) {\n\t\t\tsleep(1000);\n\t\t\tp.outro(\"Enjoy using Starwind UI 🚀\");\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","export const tailwindConfig = `@import \"tailwindcss\";\n@plugin \"tailwindcss-animate\";\n@plugin \"@tailwindcss/forms\";\n@variant dark (&:where(.dark, .dark *));\n\n@theme {\n\t--animate-accordion-down: accordion-down 0.2s ease-out;\n\t--animate-accordion-up: accordion-up 0.2s ease-out;\n\n\t@keyframes accordion-down {\n\t\tfrom {\n\t\t\theight: 0;\n\t\t}\n\t\tto {\n\t\t\theight: var(--starwind-accordion-content-height);\n\t\t}\n\t}\n\n\t@keyframes accordion-up {\n\t\tfrom {\n\t\t\theight: var(--starwind-accordion-content-height);\n\t\t}\n\t\tto {\n\t\t\theight: 0;\n\t\t}\n\t}\n}\n\n@theme inline {\n\t--color-background: var(--background);\n\t--color-foreground: var(--foreground);\n\t--color-card: var(--card);\n\t--color-card-foreground: var(--card-foreground);\n\t--color-popover: var(--popover);\n\t--color-popover-foreground: var(--popover-foreground);\n\t--color-primary: var(--primary);\n\t--color-primary-foreground: var(--primary-foreground);\n\t--color-secondary: var(--secondary);\n\t--color-secondary-foreground: var(--secondary-foreground);\n\t--color-muted: var(--muted);\n\t--color-muted-foreground: var(--muted-foreground);\n\t--color-accent: var(--accent);\n\t--color-accent-foreground: var(--accent-foreground);\n\t--color-info: var(--info);\n\t--color-info-foreground: var(--info-foreground);\n\t--color-success: var(--success);\n\t--color-success-foreground: var(--success-foreground);\n\t--color-warning: var(--warning);\n\t--color-warning-foreground: var(--warning-foreground);\n\t--color-error: var(--error);\n\t--color-error-foreground: var(--error-foreground);\n\t--color-border: var(--border);\n\t--color-input: var(--input);\n\t--color-outline: var(--outline);\n\n\t--radius-xs: calc(var(--radius) - 0.375rem);\n\t--radius-sm: calc(var(--radius) - 0.25rem);\n\t--radius-md: calc(var(--radius) - 0.125rem);\n\t--radius-lg: var(--radius);\n\t--radius-xl: calc(var(--radius) + 0.25rem);\n\t--radius-2xl: calc(var(--radius) + 0.5rem);\n\t--radius-3xl: calc(var(--radius) + 1rem);\n}\n\n@layer base {\n\t:root {\n\t\t--background: var(--color-neutral-50);\n\t\t--foreground: var(--color-neutral-950);\n\t\t--card: var(--color-neutral-50);\n\t\t--card-foreground: var(--color-neutral-950);\n\t\t--popover: var(--color-neutral-50);\n\t\t--popover-foreground: var(--color-neutral-950);\n\t\t--primary: var(--color-blue-700);\n\t\t--primary-foreground: var(--color-neutral-50);\n\t\t--secondary: var(--color-fuchsia-700);\n\t\t--secondary-foreground: var(--color-neutral-50);\n\t\t--muted: var(--color-neutral-100);\n\t\t--muted-foreground: var(--color-neutral-600);\n\t\t--accent: var(--color-neutral-200);\n\t\t--accent-foreground: var(--color-neutral-900);\n\t\t--info: var(--color-sky-300);\n\t\t--info-foreground: var(--color-sky-950);\n\t\t--success: var(--color-green-300);\n\t\t--success-foreground: var(--color-green-950);\n\t\t--warning: var(--color-amber-300);\n\t\t--warning-foreground: var(--color-amber-950);\n\t\t--error: var(--color-red-700);\n\t\t--error-foreground: var(--color-neutral-50);\n\t\t--border: var(--color-neutral-200);\n\t\t--input: var(--color-neutral-200);\n\t\t--outline: var(--color-blue-600);\n\t\t--radius: 0.5rem;\n\t}\n\n\t.dark {\n\t\t--background: var(--color-neutral-950);\n\t\t--foreground: var(--color-neutral-50);\n\t\t--card: var(--color-neutral-950);\n\t\t--card-foreground: var(--color-neutral-50);\n\t\t--popover: var(--color-neutral-950);\n\t\t--popover-foreground: var(--color-neutral-50);\n\t\t--primary: var(--color-blue-700);\n\t\t--primary-foreground: var(--color-neutral-50);\n\t\t--secondary: var(--color-fuchsia-300);\n\t\t--secondary-foreground: var(--color-neutral-950);\n\t\t--muted: var(--color-neutral-900);\n\t\t--muted-foreground: var(--color-neutral-400);\n\t\t--accent: var(--color-neutral-900);\n\t\t--accent-foreground: var(--color-neutral-100);\n\t\t--info: var(--color-sky-300);\n\t\t--info-foreground: var(--color-sky-950);\n\t\t--success: var(--color-green-300);\n\t\t--success-foreground: var(--color-green-950);\n\t\t--warning: var(--color-amber-300);\n\t\t--warning-foreground: var(--color-amber-950);\n\t\t--error: var(--color-red-800);\n\t\t--error-foreground: var(--color-neutral-50);\n\t\t--border: var(--color-neutral-800);\n\t\t--input: var(--color-neutral-800);\n\t\t--outline: var(--color-blue-600);\n\t\t--radius: 0.5rem;\n\t}\n\n\t* {\n\t\t@apply border-border;\n\t}\n\t*:focus-visible {\n\t\t@apply outline-outline;\n\t}\n\thtml {\n\t\t@apply bg-background text-foreground scheme-light dark:scheme-dark;\n\t}\n\tbutton {\n\t\t@apply cursor-pointer;\n\t}\n}\n\n@layer utilities {\n\t/* transition-colors but without outline-color transition property */\n\t.starwind-transition-colors {\n\t\ttransition-property: color, background-color, border-color, text-decoration-color, fill, stroke,\n\t\t\t--tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n\t\ttransition-timing-function: var(--default-transition-timing-function);\n\t\ttransition-duration: var(--default-transition-duration);\n\t}\n}\n`;\n","import chalk from \"chalk\";\n\nexport const highlighter = {\n\terror: chalk.red,\n\twarn: chalk.yellow,\n\tinfo: chalk.cyan,\n\tinfoBright: chalk.cyanBright,\n\tsuccess: chalk.greenBright,\n\tunderline: chalk.underline,\n\ttitle: chalk.bgBlue,\n};\n","import { highlighter } from \"@/utils/highlighter.js\";\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport { fileExists } from \"./fs.js\";\n\nconst CONFIG_EXTENSIONS = [\"ts\", \"js\", \"mjs\", \"cjs\"] as const;\n// type ConfigExtension = (typeof CONFIG_EXTENSIONS)[number];\n\n/**\n * Finds the Astro config file in the current directory\n * @returns The path to the config file if found, null otherwise\n */\nasync function findAstroConfig(): Promise<string | null> {\n\tfor (const ext of CONFIG_EXTENSIONS) {\n\t\tconst configPath = `astro.config.${ext}`;\n\t\tif (await fileExists(configPath)) {\n\t\t\treturn configPath;\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Updates or creates the Astro configuration file\n * @returns true if successful, false otherwise\n */\nexport async function setupAstroConfig(): Promise<boolean> {\n\ttry {\n\t\tlet configPath = await findAstroConfig();\n\t\tlet content = \"\";\n\n\t\tif (configPath) {\n\t\t\tcontent = await fs.readFile(configPath, \"utf-8\");\n\t\t} else {\n\t\t\tconfigPath = \"astro.config.ts\";\n\t\t\tcontent = `import { defineConfig } from \"astro/config\";\\n\\nexport default defineConfig({});\\n`;\n\t\t}\n\n\t\t// Add tailwindcss import if not present\n\t\tif (!content.includes('import tailwindcss from \"@tailwindcss/vite\"')) {\n\t\t\tcontent = `import tailwindcss from \"@tailwindcss/vite\";\\n${content}`;\n\t\t}\n\n\t\t// Parse the configuration object\n\t\tconst configStart = content.indexOf(\"defineConfig(\") + \"defineConfig(\".length;\n\t\tconst configEnd = content.lastIndexOf(\");\");\n\t\tlet config = content.slice(configStart, configEnd);\n\n\t\t// Remove outer braces and trim\n\t\tconfig = config.trim().replace(/^{|}$/g, \"\").trim();\n\n\t\t// Add experimental configuration\n\t\tif (!config.includes(\"experimental\")) {\n\t\t\tconfig += `\\n\\texperimental: {\n\t\tsvg: {\n\t\t\tmode: \"sprite\",\n\t\t},\n\t},`;\n\t\t} else if (!config.includes(\"svg: {\")) {\n\t\t\t// Insert svg config into existing experimental block\n\t\t\tconst expEnd = config.indexOf(\"experimental:\") + \"experimental:\".length;\n\t\t\tconst blockStart = config.indexOf(\"{\", expEnd) + 1;\n\t\t\tconfig =\n\t\t\t\tconfig.slice(0, blockStart) +\n\t\t\t\t`\\n\\t\\tsvg: {\\n\\t\\t\\tmode: \"sprite\",\\n\\t\\t},` +\n\t\t\t\tconfig.slice(blockStart);\n\t\t}\n\n\t\t// Add vite configuration\n\t\tif (!config.includes(\"vite:\")) {\n\t\t\tconfig += `\\n\\tvite: {\n\t\tplugins: [tailwindcss()],\n\t},`;\n\t\t} else if (!config.includes(\"plugins: [\")) {\n\t\t\t// Insert plugins into existing vite block\n\t\t\tconst viteEnd = config.indexOf(\"vite:\") + \"vite:\".length;\n\t\t\tconst blockStart = config.indexOf(\"{\", viteEnd) + 1;\n\t\t\tconfig =\n\t\t\t\tconfig.slice(0, blockStart) + `\\n\\t\\tplugins: [tailwindcss()],` + config.slice(blockStart);\n\t\t} else if (!config.includes(\"tailwindcss()\")) {\n\t\t\t// Add tailwindcss to existing plugins array\n\t\t\tconst pluginsStart = config.indexOf(\"plugins:\") + \"plugins:\".length;\n\t\t\tconst arrayStart = config.indexOf(\"[\", pluginsStart) + 1;\n\t\t\tconfig = config.slice(0, arrayStart) + `tailwindcss(), ` + config.slice(arrayStart);\n\t\t}\n\n\t\t// Reconstruct the file content\n\t\tconst newContent = `${content.slice(0, configStart)}{\\n\\t${config}\\n}${content.slice(configEnd)}`;\n\n\t\tawait fs.writeFile(configPath, newContent, \"utf-8\");\n\t\treturn true;\n\t} catch (error) {\n\t\tconst errorMessage = error instanceof Error ? error.message : \"An unknown error occurred\";\n\t\tp.log.error(highlighter.error(`Failed to setup Astro config: ${errorMessage}`));\n\t\treturn false;\n\t}\n}\n","import fs from \"fs-extra\";\n\n/**\n * Ensures a directory exists, creating it and its parents if necessary\n * @param dir - Directory path to ensure exists\n */\nexport async function ensureDirectory(dir: string) {\n\tawait fs.ensureDir(dir);\n}\n\n/**\n * Copies a file from source to destination\n * @param src - Source file path\n * @param dest - Destination file path\n */\nexport async function copyFile(src: string, dest: string) {\n\tawait fs.copy(src, dest);\n}\n\n/**\n * Reads and parses a JSON file\n * @param filePath - Path to the JSON file\n * @returns Parsed JSON content\n */\nexport async function readJsonFile(filePath: string) {\n\treturn fs.readJson(filePath);\n}\n\n/**\n * Writes data to a JSON file\n * @param filePath - Path to write the JSON file\n * @param data - Data to write to the file\n */\nexport async function writeJsonFile(filePath: string, data: unknown) {\n\tawait fs.writeJson(filePath, data, { spaces: 2 });\n}\n\n/**\n * Checks if a file exists\n * @param filePath - Path to check\n * @returns True if the file exists, false otherwise\n */\nexport async function fileExists(filePath: string) {\n\treturn fs.pathExists(filePath);\n}\n\n/**\n * Creates a CSS file with the provided content\n * @param filePath - Path to write the CSS file\n * @param content - CSS content to write\n */\nexport async function writeCssFile(filePath: string, content: string) {\n\tawait fs.writeFile(filePath, content, \"utf-8\");\n}\n","export const MIN_ASTRO_VERSION = \"5.0.0\";\n\n/**\n * File system paths used throughout the application\n */\nexport const PATHS = {\n\tSTARWIND_CORE: \"@starwind-ui/core\",\n\tSTARWIND_CORE_COMPONENTS: \"src/components\",\n\tSTARWIND_REMOTE_COMPONENT_REGISTRY: \"https://starwind.dev/registry.json\",\n\tLOCAL_CSS_FILE: \"src/styles/starwind.css\",\n\tLOCAL_CONFIG_FILE: \"starwind.config.json\",\n\tLOCAL_STYLES_DIR: \"src/styles\",\n\tLOCAL_COMPONENTS_DIR: \"src/components\",\n} as const;\n\n/**\n * Core framework dependencies\n */\nexport const ASTRO_PACKAGES = {\n\tcore: \"astro@latest\",\n} as const;\n\n/**\n * Tailwind CSS related dependencies\n */\nexport const OTHER_PACKAGES = {\n\ttailwindCore: \"tailwindcss@latest\",\n\ttailwindVite: \"@tailwindcss/vite@latest\",\n\ttailwindForms: \"@tailwindcss/forms@latest\",\n\ttailwindAnimate: \"tailwindcss-animate@latest\",\n\ttailwindVariants: \"tailwind-variants@latest\",\n\ttablerIcons: \"@tabler/icons@latest\",\n} as const;\n\n/**\n * Get all Tailwind CSS related packages as an array\n */\nexport function getOtherPackages(): string[] {\n\treturn Object.values(OTHER_PACKAGES);\n}\n\n/**\n * Get all Astro related packages as an array\n */\nexport function getAstroPackages(): string[] {\n\treturn Object.values(ASTRO_PACKAGES);\n}\n","import { PATHS } from \"./constants.js\";\nimport { fileExists, readJsonFile, writeJsonFile } from \"./fs.js\";\n\ninterface ComponentConfig {\n\tname: string;\n\tversion: string;\n}\n\ninterface TailwindConfig {\n\tcss: string;\n\tbaseColor: \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\";\n\tcssVariables: boolean;\n}\n\ninterface AliasConfig {\n\tcomponents: string;\n}\n\nexport interface StarwindConfig {\n\t$schema: string;\n\ttailwind: TailwindConfig;\n\t// aliases: AliasConfig;\n\tcomponentDir: string;\n\tcomponents: ComponentConfig[];\n}\n\nconst defaultConfig: StarwindConfig = {\n\t$schema: \"https://starwind.dev/config-schema.json\",\n\ttailwind: {\n\t\tcss: \"src/styles/starwind.css\",\n\t\tbaseColor: \"neutral\",\n\t\tcssVariables: true,\n\t},\n\t// aliases: {\n\t// \tcomponents: \"@/components\",\n\t// },\n\tcomponentDir: \"src/components/starwind\",\n\tcomponents: [],\n};\n\n/**\n * Get the current config, ensuring the file is fully read\n */\nexport async function getConfig(): Promise<StarwindConfig> {\n\ttry {\n\t\tif (await fileExists(PATHS.LOCAL_CONFIG_FILE)) {\n\t\t\tconst config = await readJsonFile(PATHS.LOCAL_CONFIG_FILE);\n\t\t\treturn {\n\t\t\t\t...defaultConfig,\n\t\t\t\t...config,\n\t\t\t\tcomponents: Array.isArray(config.components) ? config.components : [],\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"Error reading config:\", error);\n\t}\n\n\treturn defaultConfig;\n}\n\n/**\n * Options for updating the config file\n */\nexport interface UpdateConfigOptions {\n\t/** If true, append new components to existing array. If false, replace the components array. */\n\tappendComponents?: boolean;\n}\n\n/**\n * Update the config file, ensuring the write operation is completed\n * @param updates - Partial config object to update\n * @param options - Options for updating the config\n */\nexport async function updateConfig(\n\tupdates: Partial<StarwindConfig>,\n\toptions: UpdateConfigOptions = { appendComponents: true },\n): Promise<void> {\n\tconst currentConfig = await getConfig();\n\n\t// Ensure components array exists\n\tconst currentComponents = Array.isArray(currentConfig.components) ? currentConfig.components : [];\n\n\tconst newConfig = {\n\t\t...currentConfig,\n\t\ttailwind: {\n\t\t\t...currentConfig.tailwind,\n\t\t\t...(updates.tailwind || {}),\n\t\t},\n\t\tcomponentDir: updates.componentDir ? updates.componentDir : currentConfig.componentDir,\n\t\tcomponents: updates.components\n\t\t\t? options.appendComponents\n\t\t\t\t? [...currentComponents, ...updates.components]\n\t\t\t\t: updates.components\n\t\t\t: currentComponents,\n\t};\n\n\ttry {\n\t\tawait writeJsonFile(PATHS.LOCAL_CONFIG_FILE, newConfig);\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t);\n\t}\n}\n","import * as p from \"@clack/prompts\";\nimport { execa } from \"execa\";\nimport { fileExists } from \"./fs.js\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n\n/**\n * Prompts the user to select their preferred package manager\n * @returns The selected package manager, defaults to npm if cancelled\n */\nexport async function requestPackageManager(): Promise<PackageManager> {\n\tconst pm = await p.select({\n\t\tmessage: \"Select your preferred package manager\",\n\t\toptions: [\n\t\t\t{ value: \"pnpm\", label: \"pnpm\", hint: \"Default\" },\n\t\t\t{ value: \"npm\", label: \"npm\" },\n\t\t\t{ value: \"yarn\", label: \"yarn\" },\n\t\t\t{ value: \"bun\", label: \"bun\" },\n\t\t],\n\t});\n\n\tif (p.isCancel(pm)) {\n\t\tp.log.warn(\"No package manager selected, defaulting to npm\");\n\t\treturn \"npm\";\n\t}\n\n\treturn pm as PackageManager;\n}\n\n/**\n * Detects and returns the default package manager based on lock files\n * @returns The detected package manager, defaults to npm if no lock file is found\n */\nexport async function getDefaultPackageManager(): Promise<PackageManager> {\n\t// Check for yarn.lock, pnpm-lock.yaml, package-lock.json in order\n\tif (await fileExists(\"yarn.lock\")) {\n\t\treturn \"yarn\";\n\t} else if (await fileExists(\"pnpm-lock.yaml\")) {\n\t\treturn \"pnpm\";\n\t} else {\n\t\treturn \"npm\";\n\t}\n}\n\n/**\n * Installs the specified packages using the detected package manager\n * @param packages - Array of package names to install\n * @param pm - The package manager to use\n * @param dev - Whether to install as dev dependencies\n * @param force - Whether to force install packages\n */\nexport async function installDependencies(\n\tpackages: string[],\n\tpm: PackageManager,\n\tdev = false,\n\tforce = false,\n): Promise<void> {\n\tconst args = [\n\t\tpm === \"npm\" ? \"install\" : \"add\",\n\t\t...packages,\n\t\tdev ? (pm === \"npm\" || pm === \"pnpm\" ? \"-D\" : \"--dev\") : \"\",\n\t\tforce ? \"--force\" : \"\",\n\t].filter(Boolean);\n\n\tawait execa(pm, args);\n}\n","/**\n * Pauses execution for the specified number of milliseconds.\n * @param ms - The number of milliseconds to sleep\n */\nexport const sleep = async (ms: number): Promise<void> => {\n\tawait new Promise((resolve) => setTimeout(resolve, ms));\n};\n"],"mappings":";AAAA,OAAO,UAAU;;;ACAV,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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M,gBAAgB,iBAAiB;AAEvC,QAAI,gBAAgB,SAAS,WAAW,OAAO,MAAQ,WAAQ;AAAA,MAC9D,SAAS,WAAW,YAAY,KAAK,cAAc,KAAK,IAAI,CAAC,CAAC,UAAU,YAAY,KAAK,EAAE,CAAC;AAAA,IAC7F,CAAC;AAED,QAAM,YAAS,aAAa,GAAG;AAC9B,MAAE,UAAO,qBAAqB;AAC9B,aAAO,QAAQ,KAAK,CAAC;AAAA,IACtB;AAEA,QAAI,eAAe;AAClB,mBAAa,KAAK;AAAA,QACjB,OAAO;AAAA,QACP,MAAM,YAAY;AACjB,gBAAM,oBAAoB,iBAAiB,GAAG,IAAI,OAAO,KAAK;AAC9D,iBAAO,GAAG,YAAY,KAAK,iCAAiC,CAAC;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACF,OAAO;AACN,MAAE,OAAI;AAAA,QACL,YAAY,KAAK,sEAAsE;AAAA,MACxF;AAAA,IACD;AAKA,QAAI,aAAa,SAAS,GAAG;AAC5B,YAAQ,SAAM,YAAY;AAAA,IAC3B;AAEA,QAAI,YAAY,SAAS,GAAG;AAC3B,YAAQ,SAAM,WAAW;AAAA,IAC1B;AAEA,UAAM,MAAM,GAAG;AAEf,IAAE;AAAA,MACD,qCAAqC,YAAY,WAAW,cAAc,OAAO,CAAC;AAAA,MAClF;AAAA,IACD;AAEA,QAAI,CAAC,WAAW;AACf,YAAM,GAAI;AACV,MAAE,SAAM,mCAA4B;AAAA,IACrC;AAAA,EACD,SAAS,OAAO;AACf,IAAE,OAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,0BAA0B;AAC/E,IAAE,UAAO,qBAAqB;AAC9B,YAAQ,KAAK,CAAC;AAAA,EACf;AACD;","names":["fs","fs","p","p","shouldInstall"]}
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  requestPackageManager,
10
10
  sleep,
11
11
  updateConfig
12
- } from "./chunk-DQZF533G.js";
12
+ } from "./chunk-GJFQ24ZT.js";
13
13
 
14
14
  // src/index.ts
15
15
  import { Command } from "commander";
@@ -17,10 +17,17 @@ import { Command } from "commander";
17
17
  // src/utils/component.ts
18
18
  import * as path from "node:path";
19
19
  import { fileURLToPath } from "node:url";
20
+ import * as p from "@clack/prompts";
20
21
  import fs from "fs-extra";
22
+ import semver from "semver";
21
23
 
22
24
  // src/utils/registry.ts
23
25
  import { z } from "zod";
26
+ import { registry as localRegistry } from "@starwind-ui/core";
27
+ var REGISTRY_CONFIG = {
28
+ // Set to 'remote' to fetch from remote server or 'local' to use the imported registry
29
+ SOURCE: "local"
30
+ };
24
31
  var componentSchema = z.object({
25
32
  name: z.string(),
26
33
  version: z.string(),
@@ -33,17 +40,17 @@ var registryRootSchema = z.object({
33
40
  });
34
41
  var registryCache = /* @__PURE__ */ new Map();
35
42
  async function getRegistry(forceRefresh = false) {
36
- const cacheKey = PATHS.STARWIND_COMPONENT_REGISTRY;
43
+ const cacheKey = REGISTRY_CONFIG.SOURCE === "remote" ? PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY : "local-registry";
37
44
  if (!forceRefresh && registryCache.has(cacheKey)) {
38
45
  return registryCache.get(cacheKey);
39
46
  }
40
- const fetchPromise = fetchRegistry();
41
- registryCache.set(cacheKey, fetchPromise);
42
- return fetchPromise;
47
+ const registryPromise = REGISTRY_CONFIG.SOURCE === "remote" ? fetchRemoteRegistry() : Promise.resolve(getLocalRegistry());
48
+ registryCache.set(cacheKey, registryPromise);
49
+ return registryPromise;
43
50
  }
44
- async function fetchRegistry() {
51
+ async function fetchRemoteRegistry() {
45
52
  try {
46
- const response = await fetch(PATHS.STARWIND_COMPONENT_REGISTRY);
53
+ const response = await fetch(PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY);
47
54
  if (!response.ok) {
48
55
  throw new Error(`Failed to fetch registry: ${response.status} ${response.statusText}`);
49
56
  }
@@ -51,7 +58,16 @@ async function fetchRegistry() {
51
58
  const parsedRegistry = registryRootSchema.parse(data);
52
59
  return parsedRegistry.components;
53
60
  } catch (error) {
54
- console.error("Failed to load registry:", error);
61
+ console.error("Failed to load remote registry:", error);
62
+ throw error;
63
+ }
64
+ }
65
+ function getLocalRegistry() {
66
+ try {
67
+ const components = localRegistry.map((comp) => componentSchema.parse(comp));
68
+ return components;
69
+ } catch (error) {
70
+ console.error("Failed to validate local registry:", error);
55
71
  throw error;
56
72
  }
57
73
  }
@@ -64,8 +80,6 @@ async function getAllComponents(forceRefresh = false) {
64
80
  }
65
81
 
66
82
  // src/utils/component.ts
67
- import semver from "semver";
68
- import * as p from "@clack/prompts";
69
83
  async function copyComponent(name, overwrite = false) {
70
84
  const config = await getConfig();
71
85
  const currentComponents = Array.isArray(config.components) ? config.components : [];
@@ -254,7 +268,7 @@ async function isValidComponent(component, availableComponents) {
254
268
 
255
269
  // src/commands/add.ts
256
270
  import * as p2 from "@clack/prompts";
257
- var { init: init2 } = await import("./init-URNYHGHO.js");
271
+ var { init: init2 } = await import("./init-EVZCNCIT.js");
258
272
  async function add(components, options) {
259
273
  try {
260
274
  p2.intro(highlighter.title(" Welcome to the Starwind CLI "));
@@ -646,8 +660,8 @@ ${results.failed.map((r) => ` ${r.name} - ${r.error}`).join("\n")}`
646
660
  }
647
661
 
648
662
  // src/index.ts
649
- var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("0.0.1");
650
- program.command("init").description("Initialize your project with Starwind").option("--no-install", "Skip dependency installation").action(() => init(false));
663
+ var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("1.3.0");
664
+ program.command("init").description("Initialize your project with Starwind").option("-d, --defaults", "Use default values for all prompts").action((options) => init(false, { defaults: options.defaults }));
651
665
  program.command("add").description("Add Starwind components to your project").argument("[components...]", "The components to add (space separated)").allowExcessArguments().option("-a, --all", "Add all available components").action(add);
652
666
  program.command("update").description("Update Starwind components to their latest versions").argument("[components...]", "The components to update (space separated)").allowExcessArguments().option("-a, --all", "Update all installed components").action(update);
653
667
  program.command("remove").description("Remove Starwind components from your project").argument("[components...]", "The components to remove (space separated)").allowExcessArguments().option("-a, --all", "Remove all installed components").action(remove);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils/component.ts","../src/utils/registry.ts","../src/utils/prompts.ts","../src/utils/install.ts","../src/utils/validate.ts","../src/commands/add.ts","../src/commands/remove.ts","../src/commands/update.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\nimport { add } from \"./commands/add.js\";\nimport { init } from \"./commands/init.js\";\nimport { remove } from \"./commands/remove.js\";\nimport { update } from \"./commands/update.js\";\n\nconst program = new Command()\n\t.name(\"starwind\")\n\t.description(\"Add beautifully designed components to your Astro applications\")\n\t.version(\"0.0.1\");\n\nprogram\n\t.command(\"init\")\n\t.description(\"Initialize your project with Starwind\")\n\t.option(\"--no-install\", \"Skip dependency installation\")\n\t.action(() => init(false));\n\nprogram\n\t.command(\"add\")\n\t.description(\"Add Starwind components to your project\")\n\t.argument(\"[components...]\", \"The components to add (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Add all available components\")\n\t.action(add);\n\nprogram\n\t.command(\"update\")\n\t.description(\"Update Starwind components to their latest versions\")\n\t.argument(\"[components...]\", \"The components to update (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Update all installed components\")\n\t.action(update);\n\nprogram\n\t.command(\"remove\")\n\t.description(\"Remove Starwind components from your project\")\n\t.argument(\"[components...]\", \"The components to remove (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Remove all installed components\")\n\t.action(remove);\n\nprogram.parse();\n","import * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport fs from \"fs-extra\";\nimport { getConfig, updateConfig } from \"./config.js\";\nimport { PATHS } from \"./constants.js\";\nimport { getRegistry, getComponent } from \"./registry.js\";\nimport semver from \"semver\";\nimport * as p from \"@clack/prompts\";\nimport { highlighter } from \"./highlighter.js\";\n\nexport type InstallResult = {\n\tstatus: \"installed\" | \"skipped\" | \"failed\";\n\tname: string;\n\tversion?: string;\n\terror?: string;\n};\n\nexport interface RemoveResult {\n\tname: string;\n\tstatus: \"removed\" | \"failed\";\n\terror?: string;\n}\n\nexport interface UpdateResult {\n\tname: string;\n\tstatus: \"updated\" | \"skipped\" | \"failed\";\n\toldVersion?: string;\n\tnewVersion?: string;\n\terror?: string;\n}\n\n/**\n * Copies a component from the core package to the local components directory\n * @param name - The name of the component to copy\n * @param overwrite - If true, will overwrite existing component instead of skipping\n * @returns A result object indicating the installation status\n */\nexport async function copyComponent(name: string, overwrite = false): Promise<InstallResult> {\n\tconst config = await getConfig();\n\n\t// Ensure components array exists\n\tconst currentComponents = Array.isArray(config.components) ? config.components : [];\n\n\t// Check if component already exists\n\tif (!overwrite && currentComponents.some((component) => component.name === name)) {\n\t\tconst existingComponent = currentComponents.find((c) => c.name === name);\n\t\treturn {\n\t\t\tstatus: \"skipped\",\n\t\t\tname,\n\t\t\tversion: existingComponent?.version,\n\t\t};\n\t}\n\n\tconst componentDir = path.join(config.componentDir, \"starwind\", name);\n\n\ttry {\n\t\tawait fs.ensureDir(componentDir);\n\n\t\t// Get the path to the installed @starwind/core package\n\t\tconst pkgUrl = import.meta.resolve?.(PATHS.STARWIND_CORE);\n\t\tif (!pkgUrl) {\n\t\t\tthrow new Error(`Could not resolve ${PATHS.STARWIND_CORE} package, is it installed?`);\n\t\t}\n\n\t\tconst coreDir = path.dirname(fileURLToPath(pkgUrl));\n\t\tconst sourceDir = path.join(coreDir, PATHS.STARWIND_CORE_COMPONENTS, name);\n\n\t\tconst files = await fs.readdir(sourceDir);\n\n\t\tfor (const file of files) {\n\t\t\tconst sourcePath = path.join(sourceDir, file);\n\t\t\tconst destPath = path.join(componentDir, file);\n\t\t\tawait fs.copy(sourcePath, destPath, { overwrite: true });\n\t\t}\n\n\t\t// Get component version from registry\n\t\tconst registry = await getRegistry();\n\t\tconst componentInfo = registry.find((c) => c.name === name);\n\t\tif (!componentInfo) {\n\t\t\tthrow new Error(`Component ${name} not found in registry`);\n\t\t}\n\n\t\treturn {\n\t\t\tstatus: \"installed\",\n\t\t\tname,\n\t\t\tversion: componentInfo.version,\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tstatus: \"failed\",\n\t\t\tname,\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n\n/**\n * Removes a component from the project's component directory\n * @param name - The name of the component to remove\n * @param componentDir - The base directory where components are installed\n * @returns A result object indicating the removal status and any errors\n */\nexport async function removeComponent(name: string, componentDir: string): Promise<RemoveResult> {\n\ttry {\n\t\tconst componentPath = path.join(componentDir, \"starwind\", name);\n\n\t\t// Check if component directory exists\n\t\tif (await fs.pathExists(componentPath)) {\n\t\t\t// Remove the component directory\n\t\t\tawait fs.remove(componentPath);\n\t\t\treturn { name, status: \"removed\" };\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"Component directory not found\",\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\treturn {\n\t\t\tname,\n\t\t\tstatus: \"failed\",\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n\n/**\n * Updates a component to its latest version from the registry\n * @param name - The name of the component to update\n * @param currentVersion - The currently installed version\n * @returns A result object indicating the update status\n */\nexport async function updateComponent(name: string, currentVersion: string): Promise<UpdateResult> {\n\ttry {\n\t\t// Get latest version from registry\n\t\tconst registryComponent = await getComponent(name);\n\t\tif (!registryComponent) {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"Component not found in registry\",\n\t\t\t};\n\t\t}\n\n\t\t// Compare versions\n\t\tif (!semver.gt(registryComponent.version, currentVersion)) {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"skipped\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: registryComponent.version,\n\t\t\t};\n\t\t}\n\n\t\t// Confirm the component update with warning about overriding\n\t\tconst confirmUpdate = await p.confirm({\n\t\t\tmessage: `Update component ${highlighter.info(name)} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(`v${registryComponent.version}`)}? This will override the existing implementation.`,\n\t\t});\n\n\t\tif (!confirmUpdate || p.isCancel(confirmUpdate)) {\n\t\t\tp.log.info(`Skipping update for ${highlighter.info(name)}`);\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"skipped\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: registryComponent.version,\n\t\t\t};\n\t\t}\n\n\t\t// Remove and reinstall component with overwrite enabled\n\t\tconst result = await copyComponent(name, true);\n\n\t\tif (result.status === \"installed\") {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"updated\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: result.version,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: result.error || \"Failed to update component\",\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\treturn {\n\t\t\tname,\n\t\t\tstatus: \"failed\",\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n","import { z } from \"zod\";\nimport { PATHS } from \"./constants.js\";\n\nconst componentSchema = z.object({\n\tname: z.string(),\n\tversion: z.string(),\n\tdependencies: z.array(z.string()).default([]),\n\ttype: z.enum([\"component\"]),\n});\n\nexport type Component = z.infer<typeof componentSchema>;\n\n// Schema for the root registry object\nconst registryRootSchema = z.object({\n\t$schema: z.string().optional(),\n\tcomponents: z.array(componentSchema),\n});\n\n// Cache for registry data - stores the promise of fetching to avoid multiple simultaneous requests\nconst registryCache = new Map<string, Promise<any>>();\n\n/**\n * Fetches the component registry from the remote server\n * @param forceRefresh Whether to force a refresh of the cache\n * @returns A promise that resolves to an array of Components\n */\nexport async function getRegistry(forceRefresh = false): Promise<Component[]> {\n\tconst cacheKey = PATHS.STARWIND_COMPONENT_REGISTRY;\n\n\t// Return cached promise if available and refresh not forced\n\tif (!forceRefresh && registryCache.has(cacheKey)) {\n\t\treturn registryCache.get(cacheKey)!;\n\t}\n\n\t// Create a new promise for the fetch operation\n\tconst fetchPromise = fetchRegistry();\n\n\t// Cache the promise\n\tregistryCache.set(cacheKey, fetchPromise);\n\n\treturn fetchPromise;\n}\n\n/**\n * Internal function to fetch the registry from the remote server\n */\nasync function fetchRegistry(): Promise<Component[]> {\n\ttry {\n\t\tconst response = await fetch(PATHS.STARWIND_COMPONENT_REGISTRY);\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Failed to fetch registry: ${response.status} ${response.statusText}`);\n\t\t}\n\n\t\tconst data = await response.json();\n\t\tconst parsedRegistry = registryRootSchema.parse(data);\n\n\t\treturn parsedRegistry.components;\n\t} catch (error) {\n\t\tconsole.error(\"Failed to load registry:\", error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Clear the registry cache\n */\nexport function clearRegistryCache(): void {\n\tregistryCache.clear();\n}\n\n/**\n * Get a component by name from the registry\n * @param name The name of the component to find\n * @param forceRefresh Whether to force a refresh of the registry cache\n * @returns The component or undefined if not found\n */\nexport async function getComponent(\n\tname: string,\n\tforceRefresh = false,\n): Promise<Component | undefined> {\n\tconst registry = await getRegistry(forceRefresh);\n\treturn registry.find((component) => component.name === name);\n}\n\n/**\n * Get all components from the registry\n * @param forceRefresh Whether to force a refresh of the registry cache\n * @returns All components in the registry\n */\nexport async function getAllComponents(forceRefresh = false): Promise<Component[]> {\n\treturn getRegistry(forceRefresh);\n}\n","import { confirm, multiselect } from \"@clack/prompts\";\nimport { getAllComponents } from \"./registry.js\";\nimport type { Component } from \"./registry.js\";\n\nexport async function selectComponents(): Promise<string[]> {\n\tconst components = await getAllComponents();\n\n\tconst selected = await multiselect({\n\t\tmessage: \"Select components to add\",\n\t\toptions: components.map((component) => ({\n\t\t\tlabel: component.name,\n\t\t\tvalue: component.name,\n\t\t})),\n\t\trequired: false,\n\t});\n\n\t// Return empty array if user cancels selection\n\tif (typeof selected === \"symbol\") {\n\t\treturn [];\n\t}\n\n\treturn selected;\n}\n\nexport async function confirmInstall(component: Component): Promise<boolean> {\n\tif (component.dependencies.length === 0) return true;\n\n\tconst confirmed = await confirm({\n\t\tmessage: `This component requires the following dependencies: ${component.dependencies.join(\", \")}. Install them?`,\n\t});\n\n\tif (typeof confirmed === \"symbol\") {\n\t\treturn false;\n\t}\n\n\treturn confirmed;\n}\n","import { type InstallResult, copyComponent } from \"./component.js\";\nimport { installDependencies, requestPackageManager } from \"./package-manager.js\";\nimport { confirmInstall } from \"./prompts.js\";\nimport { getComponent } from \"./registry.js\";\n\nexport async function installComponent(name: string): Promise<InstallResult> {\n\tconst component = await getComponent(name);\n\n\tif (!component) {\n\t\treturn {\n\t\t\tstatus: \"failed\",\n\t\t\tname,\n\t\t\terror: \"Component not found in registry\",\n\t\t};\n\t}\n\n\t// Handle dependencies installation\n\tif (component.dependencies.length > 0) {\n\t\tconst confirmed = await confirmInstall(component);\n\t\tif (!confirmed) {\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tname,\n\t\t\t\terror: \"Installation cancelled by user\",\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tconst pm = await requestPackageManager();\n\t\t\tawait installDependencies(component.dependencies, pm);\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tname,\n\t\t\t\terror: `Failed to install dependencies: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t};\n\t\t}\n\t}\n\n\t// Copy the component files\n\treturn await copyComponent(name);\n}\n","import { highlighter } from \"../utils/highlighter.js\";\nimport { type Component, getAllComponents } from \"./registry.js\";\n\n/**\n * Checks if a component name exists in the registry\n * @param component - The component name to validate\n * @param availableComponents - Optional array of available components from registry\n */\nexport async function isValidComponent(\n\tcomponent: string,\n\tavailableComponents?: Component[],\n): Promise<boolean> {\n\tconst components = availableComponents || (await getAllComponents());\n\treturn components.some((c) => c.name === component);\n}\n\n/**\n * Validates that a component exists in the registry\n * @param component - The component name to validate\n * @throws {Error} If the component is not found in the registry\n */\nexport async function validateComponent(component: string): Promise<void> {\n\tconst components = await getAllComponents();\n\tif (!(await isValidComponent(component, components))) {\n\t\tconst availableComponents = components.map((c) => highlighter.info(c.name));\n\t\tthrow new Error(\n\t\t\t`Invalid component: ${highlighter.error(component)}.\\nAvailable components:\\n ${availableComponents.join(\"\\n \")}`,\n\t\t);\n\t}\n}\n","import type { InstallResult } from \"@/utils/component.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { installComponent } from \"@/utils/install.js\";\nimport { selectComponents } from \"@/utils/prompts.js\";\nimport { getAllComponents } from \"@/utils/registry.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport { isValidComponent } from \"@/utils/validate.js\";\nimport { updateConfig } from \"@/utils/config.js\";\nimport * as p from \"@clack/prompts\";\nconst { init } = await import(\"./init.js\");\n\nexport async function add(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tconst shouldInit = await p.confirm({\n\t\t\t\tmessage: `Starwind configuration not found. Would you like to run ${highlighter.info(\"starwind init\")} now?`,\n\t\t\t\tinitialValue: true,\n\t\t\t});\n\n\t\t\tif (p.isCancel(shouldInit)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tif (shouldInit) {\n\t\t\t\tawait init(true);\n\t\t\t} else {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Please initialize starwind with ${highlighter.info(\"starwind init\")} before adding components`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\tlet componentsToInstall: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to install\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Get all available components\n\t\t\tconst availableComponents = await getAllComponents();\n\t\t\tcomponentsToInstall = availableComponents.map((c) => c.name);\n\t\t\tp.log.info(`Adding all ${componentsToInstall.length} available components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Get all available components once to avoid multiple registry calls\n\t\t\tconst availableComponents = await getAllComponents();\n\n\t\t\t// Filter valid components and collect invalid ones\n\t\t\tconst { valid, invalid } = await components.reduce<\n\t\t\t\tPromise<{ valid: string[]; invalid: string[] }>\n\t\t\t>(\n\t\t\t\tasync (accPromise, component) => {\n\t\t\t\t\tconst acc = await accPromise;\n\t\t\t\t\tconst isValid = await isValidComponent(component, availableComponents);\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tacc.valid.push(component);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacc.invalid.push(component);\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\tPromise.resolve({ valid: [], invalid: [] }),\n\t\t\t);\n\n\t\t\t// Warn about invalid components\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Invalid components found:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Proceed with valid components\n\t\t\tif (valid.length > 0) {\n\t\t\t\tcomponentsToInstall = valid;\n\t\t\t} else {\n\t\t\t\tp.log.warn(`${highlighter.warn(\"No valid components to install\")}`);\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// If no components provided, show the interactive prompt\n\t\t\tconst selected = await selectComponents();\n\t\t\tif (!selected) {\n\t\t\t\tp.cancel(\"No components selected\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\t\t\tcomponentsToInstall = selected;\n\t\t}\n\n\t\tif (componentsToInstall.length === 0) {\n\t\t\tp.log.warn(`${highlighter.warn(\"No components selected\")}`);\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\treturn process.exit(0);\n\t\t}\n\n\t\t// confirm installation\n\t\t// const confirmed = await p.confirm({\n\t\t// \tmessage: `Install ${componentsToInstall\n\t\t// \t\t.map((comp) => highlighter.info(comp))\n\t\t// \t\t.join(\", \")} ${componentsToInstall.length > 1 ? \"components\" : \"component\"}?`,\n\t\t// });\n\n\t\t// if (!confirmed || p.isCancel(confirmed)) {\n\t\t// \tp.cancel(\"Operation cancelled\");\n\t\t// \treturn process.exit(0);\n\t\t// }\n\n\t\tconst results = {\n\t\t\tinstalled: [] as InstallResult[],\n\t\t\tskipped: [] as InstallResult[],\n\t\t\tfailed: [] as InstallResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Install components\n\t\t// ================================================================\n\t\tconst installedComponents = [];\n\t\tfor (const comp of componentsToInstall) {\n\t\t\tconst result = await installComponent(comp);\n\t\t\tswitch (result.status) {\n\t\t\t\tcase \"installed\":\n\t\t\t\t\tresults.installed.push(result);\n\t\t\t\t\tinstalledComponents.push({ name: result.name, version: result.version! });\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skipped\":\n\t\t\t\t\tresults.skipped.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"failed\":\n\t\t\t\t\tresults.failed.push(result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\tif (installedComponents.length > 0) {\n\t\t\ttry {\n\t\t\t\tawait updateConfig({ components: installedComponents }, { appendComponents: true });\n\t\t\t} catch (error) {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Installation summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Installation Summary\")}`);\n\n\t\tif (results.installed.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully installed components:\")}\\n${results.installed\n\t\t\t\t\t.map((r) => ` ${r.name} v${r.version}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.skipped.length > 0) {\n\t\t\tp.log.warn(\n\t\t\t\t`${highlighter.warn(\"Skipped components (already installed):\")}\\n${results.skipped\n\t\t\t\t\t.map((r) => ` ${r.name} v${r.version}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to install components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tp.outro(\"Enjoy using Starwind UI 🚀\");\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","import { getConfig, updateConfig } from \"@/utils/config.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\nimport { type RemoveResult, removeComponent } from \"@/utils/component.js\";\n\nexport async function remove(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tp.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Get current config and installed components\n\t\tconst config = await getConfig();\n\t\tconst installedComponents = config.components;\n\n\t\tif (installedComponents.length === 0) {\n\t\t\tp.log.warn(\"No components are currently installed.\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tlet componentsToRemove: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to remove\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Remove all installed components\n\t\t\tcomponentsToRemove = installedComponents.map((comp) => comp.name);\n\t\t\tp.log.info(`Removing all ${componentsToRemove.length} installed components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Validate that all specified components are installed\n\t\t\tconst invalid = components.filter(\n\t\t\t\t(comp) => !installedComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Components not found:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcomponentsToRemove = components.filter((comp) =>\n\t\t\t\tinstalledComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (componentsToRemove.length === 0) {\n\t\t\t\tp.log.warn(\"No valid components to remove\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// Show interactive prompt with installed components\n\t\t\tconst choices = installedComponents.map((comp) => ({\n\t\t\t\tvalue: comp.name,\n\t\t\t\tlabel: comp.name,\n\t\t\t}));\n\n\t\t\tconst selected = await p.multiselect({\n\t\t\t\tmessage: \"Select components to remove\",\n\t\t\t\toptions: choices,\n\t\t\t});\n\n\t\t\tif (p.isCancel(selected)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tcomponentsToRemove = selected as string[];\n\t\t}\n\n\t\tif (componentsToRemove.length === 0) {\n\t\t\tp.log.warn(\"No components selected for removal\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\t// Confirm removal\n\t\tconst confirmed = await p.confirm({\n\t\t\tmessage: `Remove ${componentsToRemove\n\t\t\t\t.map((comp) => highlighter.info(comp))\n\t\t\t\t.join(\", \")} ${componentsToRemove.length > 1 ? \"components\" : \"component\"}?`,\n\t\t});\n\n\t\tif (!confirmed || p.isCancel(confirmed)) {\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tconst results = {\n\t\t\tremoved: [] as RemoveResult[],\n\t\t\tfailed: [] as RemoveResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Remove Components\n\t\t// ================================================================\n\t\tfor (const comp of componentsToRemove) {\n\t\t\tconst result = await removeComponent(comp, config.componentDir);\n\t\t\tif (result.status === \"removed\") {\n\t\t\t\tresults.removed.push(result);\n\t\t\t} else {\n\t\t\t\tresults.failed.push(result);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\t// Update config file by writing the filtered components directly\n\t\tconst updatedComponents = config.components.filter(\n\t\t\t(comp) => !componentsToRemove.includes(comp.name),\n\t\t);\n\t\tawait updateConfig(\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\tcomponents: updatedComponents,\n\t\t\t},\n\t\t\t{ appendComponents: false },\n\t\t);\n\n\t\t// ================================================================\n\t\t// Removal summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Removal Summary\")}`);\n\n\t\tif (results.removed.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully removed components:\")}\\n${results.removed\n\t\t\t\t\t.map((r) => ` ${r.name}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to remove components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tif (results.removed.length > 0) {\n\t\t\tp.outro(\"Components removed successfully 🗑️\");\n\t\t} else {\n\t\t\tp.cancel(\"Errors occurred while removing components\");\n\t\t\tprocess.exit(1);\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to remove components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","import path from \"node:path\";\nimport { getConfig } from \"@/utils/config.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists, writeJsonFile } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\nimport { type UpdateResult, updateComponent } from \"@/utils/component.js\";\nimport { updateConfig } from \"@/utils/config.js\";\n\nexport async function update(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tp.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Get current config and installed components\n\t\tconst config = await getConfig();\n\t\tconst installedComponents = config.components;\n\n\t\tif (installedComponents.length === 0) {\n\t\t\tp.log.warn(\"No components are currently installed.\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tlet componentsToUpdate: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to update\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Update all installed components\n\t\t\tcomponentsToUpdate = installedComponents.map((comp) => comp.name);\n\t\t\tp.log.info(`Checking updates for all ${componentsToUpdate.length} installed components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Validate that all specified components are installed\n\t\t\tconst invalid = components.filter(\n\t\t\t\t(comp) => !installedComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Components not found in project:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcomponentsToUpdate = components.filter((comp) =>\n\t\t\t\tinstalledComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (componentsToUpdate.length === 0) {\n\t\t\t\tp.log.warn(\"No valid components to update\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// Show interactive prompt with installed components\n\t\t\tconst choices = installedComponents.map((comp) => ({\n\t\t\t\tvalue: comp.name,\n\t\t\t\tlabel: comp.name,\n\t\t\t}));\n\n\t\t\tconst selected = await p.multiselect({\n\t\t\t\tmessage: \"Select components to update\",\n\t\t\t\toptions: choices,\n\t\t\t});\n\n\t\t\tif (p.isCancel(selected)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tcomponentsToUpdate = selected as string[];\n\t\t}\n\n\t\tif (componentsToUpdate.length === 0) {\n\t\t\tp.log.warn(\"No components selected for update\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\t// Confirm update\n\t\t// const confirmed = await p.confirm({\n\t\t// \tmessage: `Check for updates to ${componentsToUpdate\n\t\t// \t\t.map((comp) => highlighter.info(comp))\n\t\t// \t\t.join(\", \")} ${componentsToUpdate.length > 1 ? \"components\" : \"component\"}?`,\n\t\t// });\n\n\t\t// if (!confirmed || p.isCancel(confirmed)) {\n\t\t// \tp.cancel(\"Operation cancelled\");\n\t\t// \tprocess.exit(0);\n\t\t// }\n\n\t\tconst results = {\n\t\t\tupdated: [] as UpdateResult[],\n\t\t\tskipped: [] as UpdateResult[],\n\t\t\tfailed: [] as UpdateResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Update Components\n\t\t// ================================================================\n\t\tfor (const comp of componentsToUpdate) {\n\t\t\tconst currentVersion = installedComponents.find((ic) => ic.name === comp)?.version;\n\t\t\tif (!currentVersion) {\n\t\t\t\tresults.failed.push({\n\t\t\t\t\tname: comp,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: \"Could not determine current version\",\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = await updateComponent(comp, currentVersion);\n\t\t\tswitch (result.status) {\n\t\t\t\tcase \"updated\":\n\t\t\t\t\tresults.updated.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skipped\":\n\t\t\t\t\tresults.skipped.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"failed\":\n\t\t\t\t\tresults.failed.push(result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\tif (results.updated.length > 0) {\n\t\t\ttry {\n\t\t\t\t// Create a map of current components, excluding updated ones\n\t\t\t\tconst updatedComponentNames = new Set(results.updated.map((r) => r.name));\n\t\t\t\tconst currentComponents = config.components.filter(\n\t\t\t\t\t(comp) => !updatedComponentNames.has(comp.name),\n\t\t\t\t);\n\n\t\t\t\t// Add the updated components with their new versions\n\t\t\t\tconst updatedComponents = [\n\t\t\t\t\t...currentComponents,\n\t\t\t\t\t...results.updated.map((r) => ({\n\t\t\t\t\t\tname: r.name,\n\t\t\t\t\t\tversion: r.newVersion!,\n\t\t\t\t\t})),\n\t\t\t\t];\n\n\t\t\t\tawait updateConfig(\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: updatedComponents,\n\t\t\t\t\t},\n\t\t\t\t\t{ appendComponents: false },\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Update Summary\")}`);\n\n\t\tif (results.skipped.length > 0) {\n\t\t\tp.log.info(\n\t\t\t\t`${highlighter.info(\"Components already up to date or skipped:\")}\\n${results.skipped\n\t\t\t\t\t.map((r) => ` ${r.name} (${r.oldVersion})`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.updated.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully updated components:\")}\\n${results.updated\n\t\t\t\t\t.map((r) => ` ${r.name} (${r.oldVersion} → ${r.newVersion})`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to update components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tif (results.updated.length > 0) {\n\t\t\tp.outro(\"Components updated successfully 🚀\");\n\t\t} else if (results.skipped.length > 0 && results.failed.length === 0) {\n\t\t\tp.outro(\"Components already up to date or skipped ✨\");\n\t\t} else {\n\t\t\tp.cancel(\"No components were updated\");\n\t\t\tprocess.exit(1);\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to update components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t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;","names":["confirm","confirm","p","init","p","p"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/component.ts","../src/utils/registry.ts","../src/utils/prompts.ts","../src/utils/install.ts","../src/utils/validate.ts","../src/commands/add.ts","../src/commands/remove.ts","../src/commands/update.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\nimport { add } from \"./commands/add.js\";\nimport { init } from \"./commands/init.js\";\nimport { remove } from \"./commands/remove.js\";\nimport { update } from \"./commands/update.js\";\n\nconst program = new Command()\n\t.name(\"starwind\")\n\t.description(\"Add beautifully designed components to your Astro applications\")\n\t.version(\"1.3.0\");\n\nprogram\n\t.command(\"init\")\n\t.description(\"Initialize your project with Starwind\")\n\t.option(\"-d, --defaults\", \"Use default values for all prompts\")\n\t.action((options) => init(false, { defaults: options.defaults }));\n\nprogram\n\t.command(\"add\")\n\t.description(\"Add Starwind components to your project\")\n\t.argument(\"[components...]\", \"The components to add (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Add all available components\")\n\t.action(add);\n\nprogram\n\t.command(\"update\")\n\t.description(\"Update Starwind components to their latest versions\")\n\t.argument(\"[components...]\", \"The components to update (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Update all installed components\")\n\t.action(update);\n\nprogram\n\t.command(\"remove\")\n\t.description(\"Remove Starwind components from your project\")\n\t.argument(\"[components...]\", \"The components to remove (space separated)\")\n\t.allowExcessArguments()\n\t.option(\"-a, --all\", \"Remove all installed components\")\n\t.action(remove);\n\nprogram.parse();\n","import * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport semver from \"semver\";\nimport { getConfig, } from \"./config.js\";\nimport { PATHS } from \"./constants.js\";\nimport { highlighter } from \"./highlighter.js\";\nimport { getComponent, getRegistry } from \"./registry.js\";\n\nexport type InstallResult = {\n\tstatus: \"installed\" | \"skipped\" | \"failed\";\n\tname: string;\n\tversion?: string;\n\terror?: string;\n};\n\nexport interface RemoveResult {\n\tname: string;\n\tstatus: \"removed\" | \"failed\";\n\terror?: string;\n}\n\nexport interface UpdateResult {\n\tname: string;\n\tstatus: \"updated\" | \"skipped\" | \"failed\";\n\toldVersion?: string;\n\tnewVersion?: string;\n\terror?: string;\n}\n\n/**\n * Copies a component from the core package to the local components directory\n * @param name - The name of the component to copy\n * @param overwrite - If true, will overwrite existing component instead of skipping\n * @returns A result object indicating the installation status\n */\nexport async function copyComponent(name: string, overwrite = false): Promise<InstallResult> {\n\tconst config = await getConfig();\n\n\t// Ensure components array exists\n\tconst currentComponents = Array.isArray(config.components) ? config.components : [];\n\n\t// Check if component already exists\n\tif (!overwrite && currentComponents.some((component) => component.name === name)) {\n\t\tconst existingComponent = currentComponents.find((c) => c.name === name);\n\t\treturn {\n\t\t\tstatus: \"skipped\",\n\t\t\tname,\n\t\t\tversion: existingComponent?.version,\n\t\t};\n\t}\n\n\tconst componentDir = path.join(config.componentDir, \"starwind\", name);\n\n\ttry {\n\t\tawait fs.ensureDir(componentDir);\n\n\t\t// Get the path to the installed @starwind/core package\n\t\tconst pkgUrl = import.meta.resolve?.(PATHS.STARWIND_CORE);\n\t\tif (!pkgUrl) {\n\t\t\tthrow new Error(`Could not resolve ${PATHS.STARWIND_CORE} package, is it installed?`);\n\t\t}\n\n\t\tconst coreDir = path.dirname(fileURLToPath(pkgUrl));\n\t\tconst sourceDir = path.join(coreDir, PATHS.STARWIND_CORE_COMPONENTS, name);\n\n\t\tconst files = await fs.readdir(sourceDir);\n\n\t\tfor (const file of files) {\n\t\t\tconst sourcePath = path.join(sourceDir, file);\n\t\t\tconst destPath = path.join(componentDir, file);\n\t\t\tawait fs.copy(sourcePath, destPath, { overwrite: true });\n\t\t}\n\n\t\t// Get component version from registry\n\t\tconst registry = await getRegistry();\n\t\tconst componentInfo = registry.find((c) => c.name === name);\n\t\tif (!componentInfo) {\n\t\t\tthrow new Error(`Component ${name} not found in registry`);\n\t\t}\n\n\t\treturn {\n\t\t\tstatus: \"installed\",\n\t\t\tname,\n\t\t\tversion: componentInfo.version,\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tstatus: \"failed\",\n\t\t\tname,\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n\n/**\n * Removes a component from the project's component directory\n * @param name - The name of the component to remove\n * @param componentDir - The base directory where components are installed\n * @returns A result object indicating the removal status and any errors\n */\nexport async function removeComponent(name: string, componentDir: string): Promise<RemoveResult> {\n\ttry {\n\t\tconst componentPath = path.join(componentDir, \"starwind\", name);\n\n\t\t// Check if component directory exists\n\t\tif (await fs.pathExists(componentPath)) {\n\t\t\t// Remove the component directory\n\t\t\tawait fs.remove(componentPath);\n\t\t\treturn { name, status: \"removed\" };\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"Component directory not found\",\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\treturn {\n\t\t\tname,\n\t\t\tstatus: \"failed\",\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n\n/**\n * Updates a component to its latest version from the registry\n * @param name - The name of the component to update\n * @param currentVersion - The currently installed version\n * @returns A result object indicating the update status\n */\nexport async function updateComponent(name: string, currentVersion: string): Promise<UpdateResult> {\n\ttry {\n\t\t// Get latest version from registry\n\t\tconst registryComponent = await getComponent(name);\n\t\tif (!registryComponent) {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"Component not found in registry\",\n\t\t\t};\n\t\t}\n\n\t\t// Compare versions\n\t\tif (!semver.gt(registryComponent.version, currentVersion)) {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"skipped\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: registryComponent.version,\n\t\t\t};\n\t\t}\n\n\t\t// Confirm the component update with warning about overriding\n\t\tconst confirmUpdate = await p.confirm({\n\t\t\tmessage: `Update component ${highlighter.info(name)} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(`v${registryComponent.version}`)}? This will override the existing implementation.`,\n\t\t});\n\n\t\tif (!confirmUpdate || p.isCancel(confirmUpdate)) {\n\t\t\tp.log.info(`Skipping update for ${highlighter.info(name)}`);\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"skipped\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: registryComponent.version,\n\t\t\t};\n\t\t}\n\n\t\t// Remove and reinstall component with overwrite enabled\n\t\tconst result = await copyComponent(name, true);\n\n\t\tif (result.status === \"installed\") {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"updated\",\n\t\t\t\toldVersion: currentVersion,\n\t\t\t\tnewVersion: result.version,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: result.error || \"Failed to update component\",\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\treturn {\n\t\t\tname,\n\t\t\tstatus: \"failed\",\n\t\t\terror: error instanceof Error ? error.message : \"Unknown error\",\n\t\t};\n\t}\n}\n","import { z } from \"zod\";\nimport { PATHS } from \"./constants.js\";\nimport { registry as localRegistry } from \"@starwind-ui/core\";\n\n// Configuration to select registry source\nconst REGISTRY_CONFIG = {\n\t// Set to 'remote' to fetch from remote server or 'local' to use the imported registry\n\tSOURCE: \"local\" as \"remote\" | \"local\",\n};\n\nconst componentSchema = z.object({\n\tname: z.string(),\n\tversion: z.string(),\n\tdependencies: z.array(z.string()).default([]),\n\ttype: z.enum([\"component\"]),\n});\n\nexport type Component = z.infer<typeof componentSchema>;\n\n// Schema for the root registry object\nconst registryRootSchema = z.object({\n\t$schema: z.string().optional(),\n\tcomponents: z.array(componentSchema),\n});\n\n// Cache for registry data - stores the promise of fetching to avoid multiple simultaneous requests\nconst registryCache = new Map<string, Promise<Component[]>>();\n\n/**\n * Fetches the component registry from either the remote server or the local import\n * @param forceRefresh Whether to force a refresh of the cache\n * @returns A promise that resolves to an array of Components\n */\nexport async function getRegistry(forceRefresh = false): Promise<Component[]> {\n\tconst cacheKey =\n\t\tREGISTRY_CONFIG.SOURCE === \"remote\"\n\t\t\t? PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY\n\t\t\t: \"local-registry\";\n\n\t// Return cached promise if available and refresh not forced\n\tif (!forceRefresh && registryCache.has(cacheKey)) {\n\t\treturn registryCache.get(cacheKey)!;\n\t}\n\n\t// Create a new promise for the registry operation based on source\n\tconst registryPromise =\n\t\tREGISTRY_CONFIG.SOURCE === \"remote\"\n\t\t\t? fetchRemoteRegistry()\n\t\t\t: Promise.resolve(getLocalRegistry());\n\n\t// Cache the promise\n\tregistryCache.set(cacheKey, registryPromise);\n\n\treturn registryPromise;\n}\n\n/**\n * Internal function to fetch the registry from the remote server\n */\nasync function fetchRemoteRegistry(): Promise<Component[]> {\n\ttry {\n\t\tconst response = await fetch(PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY);\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Failed to fetch registry: ${response.status} ${response.statusText}`);\n\t\t}\n\n\t\tconst data = await response.json();\n\t\tconst parsedRegistry = registryRootSchema.parse(data);\n\n\t\treturn parsedRegistry.components;\n\t} catch (error) {\n\t\tconsole.error(\"Failed to load remote registry:\", error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Internal function to get the registry from the local import\n */\nfunction getLocalRegistry(): Component[] {\n\ttry {\n\t\t// Validate the local registry with the schema\n\t\tconst components = localRegistry.map((comp) => componentSchema.parse(comp));\n\t\treturn components;\n\t} catch (error) {\n\t\tconsole.error(\"Failed to validate local registry:\", error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Clear the registry cache\n */\nexport function clearRegistryCache(): void {\n\tregistryCache.clear();\n}\n\n/**\n * Get a component by name from the registry\n * @param name The name of the component to find\n * @param forceRefresh Whether to force a refresh of the registry cache\n * @returns The component or undefined if not found\n */\nexport async function getComponent(\n\tname: string,\n\tforceRefresh = false,\n): Promise<Component | undefined> {\n\tconst registry = await getRegistry(forceRefresh);\n\treturn registry.find((component) => component.name === name);\n}\n\n/**\n * Get all components from the registry\n * @param forceRefresh Whether to force a refresh of the registry cache\n * @returns All components in the registry\n */\nexport async function getAllComponents(forceRefresh = false): Promise<Component[]> {\n\treturn getRegistry(forceRefresh);\n}\n\n/**\n * Set the registry source\n * @param source The source to use: 'remote' or 'local'\n */\nexport function setRegistrySource(source: \"remote\" | \"local\"): void {\n\tif (REGISTRY_CONFIG.SOURCE !== source) {\n\t\tREGISTRY_CONFIG.SOURCE = source;\n\t\tclearRegistryCache(); // Clear cache when changing sources\n\t}\n}\n","import { confirm, multiselect } from \"@clack/prompts\";\nimport { getAllComponents } from \"./registry.js\";\nimport type { Component } from \"./registry.js\";\n\nexport async function selectComponents(): Promise<string[]> {\n\tconst components = await getAllComponents();\n\n\tconst selected = await multiselect({\n\t\tmessage: \"Select components to add\",\n\t\toptions: components.map((component) => ({\n\t\t\tlabel: component.name,\n\t\t\tvalue: component.name,\n\t\t})),\n\t\trequired: false,\n\t});\n\n\t// Return empty array if user cancels selection\n\tif (typeof selected === \"symbol\") {\n\t\treturn [];\n\t}\n\n\treturn selected;\n}\n\nexport async function confirmInstall(component: Component): Promise<boolean> {\n\tif (component.dependencies.length === 0) return true;\n\n\tconst confirmed = await confirm({\n\t\tmessage: `This component requires the following dependencies: ${component.dependencies.join(\", \")}. Install them?`,\n\t});\n\n\tif (typeof confirmed === \"symbol\") {\n\t\treturn false;\n\t}\n\n\treturn confirmed;\n}\n","import { type InstallResult, copyComponent } from \"./component.js\";\nimport { installDependencies, requestPackageManager } from \"./package-manager.js\";\nimport { confirmInstall } from \"./prompts.js\";\nimport { getComponent } from \"./registry.js\";\n\nexport async function installComponent(name: string): Promise<InstallResult> {\n\tconst component = await getComponent(name);\n\n\tif (!component) {\n\t\treturn {\n\t\t\tstatus: \"failed\",\n\t\t\tname,\n\t\t\terror: \"Component not found in registry\",\n\t\t};\n\t}\n\n\t// Handle dependencies installation\n\tif (component.dependencies.length > 0) {\n\t\tconst confirmed = await confirmInstall(component);\n\t\tif (!confirmed) {\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tname,\n\t\t\t\terror: \"Installation cancelled by user\",\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tconst pm = await requestPackageManager();\n\t\t\tawait installDependencies(component.dependencies, pm);\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tname,\n\t\t\t\terror: `Failed to install dependencies: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t};\n\t\t}\n\t}\n\n\t// Copy the component files\n\treturn await copyComponent(name);\n}\n","import { highlighter } from \"../utils/highlighter.js\";\nimport { type Component, getAllComponents } from \"./registry.js\";\n\n/**\n * Checks if a component name exists in the registry\n * @param component - The component name to validate\n * @param availableComponents - Optional array of available components from registry\n */\nexport async function isValidComponent(\n\tcomponent: string,\n\tavailableComponents?: Component[],\n): Promise<boolean> {\n\tconst components = availableComponents || (await getAllComponents());\n\treturn components.some((c) => c.name === component);\n}\n\n/**\n * Validates that a component exists in the registry\n * @param component - The component name to validate\n * @throws {Error} If the component is not found in the registry\n */\nexport async function validateComponent(component: string): Promise<void> {\n\tconst components = await getAllComponents();\n\tif (!(await isValidComponent(component, components))) {\n\t\tconst availableComponents = components.map((c) => highlighter.info(c.name));\n\t\tthrow new Error(\n\t\t\t`Invalid component: ${highlighter.error(component)}.\\nAvailable components:\\n ${availableComponents.join(\"\\n \")}`,\n\t\t);\n\t}\n}\n","import type { InstallResult } from \"@/utils/component.js\";\nimport { updateConfig } from \"@/utils/config.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { installComponent } from \"@/utils/install.js\";\nimport { selectComponents } from \"@/utils/prompts.js\";\nimport { getAllComponents } from \"@/utils/registry.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport { isValidComponent } from \"@/utils/validate.js\";\nimport * as p from \"@clack/prompts\";\nconst { init } = await import(\"./init.js\");\n\nexport async function add(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tconst shouldInit = await p.confirm({\n\t\t\t\tmessage: `Starwind configuration not found. Would you like to run ${highlighter.info(\"starwind init\")} now?`,\n\t\t\t\tinitialValue: true,\n\t\t\t});\n\n\t\t\tif (p.isCancel(shouldInit)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tif (shouldInit) {\n\t\t\t\tawait init(true);\n\t\t\t} else {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Please initialize starwind with ${highlighter.info(\"starwind init\")} before adding components`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\tlet componentsToInstall: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to install\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Get all available components\n\t\t\tconst availableComponents = await getAllComponents();\n\t\t\tcomponentsToInstall = availableComponents.map((c) => c.name);\n\t\t\tp.log.info(`Adding all ${componentsToInstall.length} available components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Get all available components once to avoid multiple registry calls\n\t\t\tconst availableComponents = await getAllComponents();\n\n\t\t\t// Filter valid components and collect invalid ones\n\t\t\tconst { valid, invalid } = await components.reduce<\n\t\t\t\tPromise<{ valid: string[]; invalid: string[] }>\n\t\t\t>(\n\t\t\t\tasync (accPromise, component) => {\n\t\t\t\t\tconst acc = await accPromise;\n\t\t\t\t\tconst isValid = await isValidComponent(component, availableComponents);\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tacc.valid.push(component);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacc.invalid.push(component);\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\tPromise.resolve({ valid: [], invalid: [] }),\n\t\t\t);\n\n\t\t\t// Warn about invalid components\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Invalid components found:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Proceed with valid components\n\t\t\tif (valid.length > 0) {\n\t\t\t\tcomponentsToInstall = valid;\n\t\t\t} else {\n\t\t\t\tp.log.warn(`${highlighter.warn(\"No valid components to install\")}`);\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// If no components provided, show the interactive prompt\n\t\t\tconst selected = await selectComponents();\n\t\t\tif (!selected) {\n\t\t\t\tp.cancel(\"No components selected\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\t\t\tcomponentsToInstall = selected;\n\t\t}\n\n\t\tif (componentsToInstall.length === 0) {\n\t\t\tp.log.warn(`${highlighter.warn(\"No components selected\")}`);\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\treturn process.exit(0);\n\t\t}\n\n\t\t// confirm installation\n\t\t// const confirmed = await p.confirm({\n\t\t// \tmessage: `Install ${componentsToInstall\n\t\t// \t\t.map((comp) => highlighter.info(comp))\n\t\t// \t\t.join(\", \")} ${componentsToInstall.length > 1 ? \"components\" : \"component\"}?`,\n\t\t// });\n\n\t\t// if (!confirmed || p.isCancel(confirmed)) {\n\t\t// \tp.cancel(\"Operation cancelled\");\n\t\t// \treturn process.exit(0);\n\t\t// }\n\n\t\tconst results = {\n\t\t\tinstalled: [] as InstallResult[],\n\t\t\tskipped: [] as InstallResult[],\n\t\t\tfailed: [] as InstallResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Install components\n\t\t// ================================================================\n\t\tconst installedComponents = [];\n\t\tfor (const comp of componentsToInstall) {\n\t\t\tconst result = await installComponent(comp);\n\t\t\tswitch (result.status) {\n\t\t\t\tcase \"installed\":\n\t\t\t\t\tresults.installed.push(result);\n\t\t\t\t\tinstalledComponents.push({ name: result.name, version: result.version! });\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skipped\":\n\t\t\t\t\tresults.skipped.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"failed\":\n\t\t\t\t\tresults.failed.push(result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\tif (installedComponents.length > 0) {\n\t\t\ttry {\n\t\t\t\tawait updateConfig({ components: installedComponents }, { appendComponents: true });\n\t\t\t} catch (error) {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Installation summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Installation Summary\")}`);\n\n\t\tif (results.installed.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully installed components:\")}\\n${results.installed\n\t\t\t\t\t.map((r) => ` ${r.name} v${r.version}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.skipped.length > 0) {\n\t\t\tp.log.warn(\n\t\t\t\t`${highlighter.warn(\"Skipped components (already installed):\")}\\n${results.skipped\n\t\t\t\t\t.map((r) => ` ${r.name} v${r.version}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to install components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tp.outro(\"Enjoy using Starwind UI 🚀\");\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","import { type RemoveResult, removeComponent } from \"@/utils/component.js\";\nimport { getConfig, updateConfig } from \"@/utils/config.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\n\nexport async function remove(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tp.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Get current config and installed components\n\t\tconst config = await getConfig();\n\t\tconst installedComponents = config.components;\n\n\t\tif (installedComponents.length === 0) {\n\t\t\tp.log.warn(\"No components are currently installed.\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tlet componentsToRemove: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to remove\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Remove all installed components\n\t\t\tcomponentsToRemove = installedComponents.map((comp) => comp.name);\n\t\t\tp.log.info(`Removing all ${componentsToRemove.length} installed components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Validate that all specified components are installed\n\t\t\tconst invalid = components.filter(\n\t\t\t\t(comp) => !installedComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Components not found:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcomponentsToRemove = components.filter((comp) =>\n\t\t\t\tinstalledComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (componentsToRemove.length === 0) {\n\t\t\t\tp.log.warn(\"No valid components to remove\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// Show interactive prompt with installed components\n\t\t\tconst choices = installedComponents.map((comp) => ({\n\t\t\t\tvalue: comp.name,\n\t\t\t\tlabel: comp.name,\n\t\t\t}));\n\n\t\t\tconst selected = await p.multiselect({\n\t\t\t\tmessage: \"Select components to remove\",\n\t\t\t\toptions: choices,\n\t\t\t});\n\n\t\t\tif (p.isCancel(selected)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tcomponentsToRemove = selected as string[];\n\t\t}\n\n\t\tif (componentsToRemove.length === 0) {\n\t\t\tp.log.warn(\"No components selected for removal\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\t// Confirm removal\n\t\tconst confirmed = await p.confirm({\n\t\t\tmessage: `Remove ${componentsToRemove\n\t\t\t\t.map((comp) => highlighter.info(comp))\n\t\t\t\t.join(\", \")} ${componentsToRemove.length > 1 ? \"components\" : \"component\"}?`,\n\t\t});\n\n\t\tif (!confirmed || p.isCancel(confirmed)) {\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tconst results = {\n\t\t\tremoved: [] as RemoveResult[],\n\t\t\tfailed: [] as RemoveResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Remove Components\n\t\t// ================================================================\n\t\tfor (const comp of componentsToRemove) {\n\t\t\tconst result = await removeComponent(comp, config.componentDir);\n\t\t\tif (result.status === \"removed\") {\n\t\t\t\tresults.removed.push(result);\n\t\t\t} else {\n\t\t\t\tresults.failed.push(result);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\t// Update config file by writing the filtered components directly\n\t\tconst updatedComponents = config.components.filter(\n\t\t\t(comp) => !componentsToRemove.includes(comp.name),\n\t\t);\n\t\tawait updateConfig(\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\tcomponents: updatedComponents,\n\t\t\t},\n\t\t\t{ appendComponents: false },\n\t\t);\n\n\t\t// ================================================================\n\t\t// Removal summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Removal Summary\")}`);\n\n\t\tif (results.removed.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully removed components:\")}\\n${results.removed\n\t\t\t\t\t.map((r) => ` ${r.name}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to remove components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tif (results.removed.length > 0) {\n\t\t\tp.outro(\"Components removed successfully 🗑️\");\n\t\t} else {\n\t\t\tp.cancel(\"Errors occurred while removing components\");\n\t\t\tprocess.exit(1);\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to remove components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","\nimport { type UpdateResult, updateComponent } from \"@/utils/component.js\";\nimport { getConfig } from \"@/utils/config.js\";\nimport { updateConfig } from \"@/utils/config.js\";\nimport { PATHS } from \"@/utils/constants.js\";\nimport { fileExists, } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\n\nexport async function update(components?: string[], options?: { all?: boolean }) {\n\ttry {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n\t\t// Check if starwind.config.json exists\n\t\tconst configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n\t\tif (!configExists) {\n\t\t\tp.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Get current config and installed components\n\t\tconst config = await getConfig();\n\t\tconst installedComponents = config.components;\n\n\t\tif (installedComponents.length === 0) {\n\t\t\tp.log.warn(\"No components are currently installed.\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tlet componentsToUpdate: string[] = [];\n\n\t\t// ================================================================\n\t\t// Get components to update\n\t\t// ================================================================\n\t\tif (options?.all) {\n\t\t\t// Update all installed components\n\t\t\tcomponentsToUpdate = installedComponents.map((comp) => comp.name);\n\t\t\tp.log.info(`Checking updates for all ${componentsToUpdate.length} installed components...`);\n\t\t} else if (components && components.length > 0) {\n\t\t\t// Validate that all specified components are installed\n\t\t\tconst invalid = components.filter(\n\t\t\t\t(comp) => !installedComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (invalid.length > 0) {\n\t\t\t\tp.log.warn(\n\t\t\t\t\t`${highlighter.warn(\"Components not found in project:\")}\\n${invalid\n\t\t\t\t\t\t.map((name) => ` ${name}`)\n\t\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcomponentsToUpdate = components.filter((comp) =>\n\t\t\t\tinstalledComponents.some((ic) => ic.name === comp),\n\t\t\t);\n\n\t\t\tif (componentsToUpdate.length === 0) {\n\t\t\t\tp.log.warn(\"No valid components to update\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t} else {\n\t\t\t// Show interactive prompt with installed components\n\t\t\tconst choices = installedComponents.map((comp) => ({\n\t\t\t\tvalue: comp.name,\n\t\t\t\tlabel: comp.name,\n\t\t\t}));\n\n\t\t\tconst selected = await p.multiselect({\n\t\t\t\tmessage: \"Select components to update\",\n\t\t\t\toptions: choices,\n\t\t\t});\n\n\t\t\tif (p.isCancel(selected)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\n\t\t\tcomponentsToUpdate = selected as string[];\n\t\t}\n\n\t\tif (componentsToUpdate.length === 0) {\n\t\t\tp.log.warn(\"No components selected for update\");\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\t// Confirm update\n\t\t// const confirmed = await p.confirm({\n\t\t// \tmessage: `Check for updates to ${componentsToUpdate\n\t\t// \t\t.map((comp) => highlighter.info(comp))\n\t\t// \t\t.join(\", \")} ${componentsToUpdate.length > 1 ? \"components\" : \"component\"}?`,\n\t\t// });\n\n\t\t// if (!confirmed || p.isCancel(confirmed)) {\n\t\t// \tp.cancel(\"Operation cancelled\");\n\t\t// \tprocess.exit(0);\n\t\t// }\n\n\t\tconst results = {\n\t\t\tupdated: [] as UpdateResult[],\n\t\t\tskipped: [] as UpdateResult[],\n\t\t\tfailed: [] as UpdateResult[],\n\t\t};\n\n\t\t// ================================================================\n\t\t// Update Components\n\t\t// ================================================================\n\t\tfor (const comp of componentsToUpdate) {\n\t\t\tconst currentVersion = installedComponents.find((ic) => ic.name === comp)?.version;\n\t\t\tif (!currentVersion) {\n\t\t\t\tresults.failed.push({\n\t\t\t\t\tname: comp,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: \"Could not determine current version\",\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = await updateComponent(comp, currentVersion);\n\t\t\tswitch (result.status) {\n\t\t\t\tcase \"updated\":\n\t\t\t\t\tresults.updated.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"skipped\":\n\t\t\t\t\tresults.skipped.push(result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"failed\":\n\t\t\t\t\tresults.failed.push(result);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update Config File\n\t\t// ================================================================\n\t\tif (results.updated.length > 0) {\n\t\t\ttry {\n\t\t\t\t// Create a map of current components, excluding updated ones\n\t\t\t\tconst updatedComponentNames = new Set(results.updated.map((r) => r.name));\n\t\t\t\tconst currentComponents = config.components.filter(\n\t\t\t\t\t(comp) => !updatedComponentNames.has(comp.name),\n\t\t\t\t);\n\n\t\t\t\t// Add the updated components with their new versions\n\t\t\t\tconst updatedComponents = [\n\t\t\t\t\t...currentComponents,\n\t\t\t\t\t...results.updated.map((r) => ({\n\t\t\t\t\t\tname: r.name,\n\t\t\t\t\t\tversion: r.newVersion!,\n\t\t\t\t\t})),\n\t\t\t\t];\n\n\t\t\t\tawait updateConfig(\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: updatedComponents,\n\t\t\t\t\t},\n\t\t\t\t\t{ appendComponents: false },\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tp.log.error(\n\t\t\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t\t\t);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\t// ================================================================\n\t\t// Update summary\n\t\t// ================================================================\n\t\tp.log.message(`\\n\\n${highlighter.underline(\"Update Summary\")}`);\n\n\t\tif (results.skipped.length > 0) {\n\t\t\tp.log.info(\n\t\t\t\t`${highlighter.info(\"Components already up to date or skipped:\")}\\n${results.skipped\n\t\t\t\t\t.map((r) => ` ${r.name} (${r.oldVersion})`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.updated.length > 0) {\n\t\t\tp.log.success(\n\t\t\t\t`${highlighter.success(\"Successfully updated components:\")}\\n${results.updated\n\t\t\t\t\t.map((r) => ` ${r.name} (${r.oldVersion} → ${r.newVersion})`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (results.failed.length > 0) {\n\t\t\tp.log.error(\n\t\t\t\t`${highlighter.error(\"Failed to update components:\")}\\n${results.failed\n\t\t\t\t\t.map((r) => ` ${r.name} - ${r.error}`)\n\t\t\t\t\t.join(\"\\n\")}`,\n\t\t\t);\n\t\t}\n\n\t\tawait sleep(1000);\n\n\t\tif (results.updated.length > 0) {\n\t\t\tp.outro(\"Components updated successfully 🚀\");\n\t\t} else if (results.skipped.length > 0 && results.failed.length === 0) {\n\t\t\tp.outro(\"Components already up to date or skipped ✨\");\n\t\t} else {\n\t\t\tp.cancel(\"No components were updated\");\n\t\t\tprocess.exit(1);\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to update components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,SAAS,eAAe;;;ACDxB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAC9B,YAAY,OAAO;AACnB,OAAO,QAAQ;AACf,OAAO,YAAY;;;ACJnB,SAAS,SAAS;AAElB,SAAS,YAAY,qBAAqB;AAG1C,IAAM,kBAAkB;AAAA;AAAA,EAEvB,QAAQ;AACT;AAEA,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAChC,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC5C,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC;AAC3B,CAAC;AAKD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,YAAY,E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;AAEhB,QAAI,QAAQ,QAAQ,SAAS,GAAG;AAC/B,MAAE,SAAM,2CAAoC;AAAA,IAC7C,WAAW,QAAQ,QAAQ,SAAS,KAAK,QAAQ,OAAO,WAAW,GAAG;AACrE,MAAE,SAAM,iDAA4C;AAAA,IACrD,OAAO;AACN,MAAE,UAAO,4BAA4B;AACrC,cAAQ,KAAK,CAAC;AAAA,IACf;AAAA,EACD,SAAS,OAAO;AACf,IAAE,OAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,6BAA6B;AAClF,IAAE,UAAO,qBAAqB;AAC9B,YAAQ,KAAK,CAAC;AAAA,EACf;AACD;;;AR5MA,IAAM,UAAU,IAAI,QAAQ,EAC1B,KAAK,UAAU,EACf,YAAY,gEAAgE,EAC5E,QAAQ,OAAO;AAEjB,QACE,QAAQ,MAAM,EACd,YAAY,uCAAuC,EACnD,OAAO,kBAAkB,oCAAoC,EAC7D,OAAO,CAAC,YAAY,KAAK,OAAO,EAAE,UAAU,QAAQ,SAAS,CAAC,CAAC;AAEjE,QACE,QAAQ,KAAK,EACb,YAAY,yCAAyC,EACrD,SAAS,mBAAmB,yCAAyC,EACrE,qBAAqB,EACrB,OAAO,aAAa,8BAA8B,EAClD,OAAO,GAAG;AAEZ,QACE,QAAQ,QAAQ,EAChB,YAAY,qDAAqD,EACjE,SAAS,mBAAmB,4CAA4C,EACxE,qBAAqB,EACrB,OAAO,aAAa,iCAAiC,EACrD,OAAO,MAAM;AAEf,QACE,QAAQ,QAAQ,EAChB,YAAY,8CAA8C,EAC1D,SAAS,mBAAmB,4CAA4C,EACxE,qBAAqB,EACrB,OAAO,aAAa,iCAAiC,EACrD,OAAO,MAAM;AAEf,QAAQ,MAAM;","names":["confirm","confirm","p","init","p","p"]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ init
3
+ } from "./chunk-GJFQ24ZT.js";
4
+ export {
5
+ init
6
+ };
7
+ //# sourceMappingURL=init-EVZCNCIT.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starwind",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Add beautifully designed components to your Astro applications",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.9.1",
36
- "@starwind-ui/core": "1.1.0",
36
+ "@starwind-ui/core": "1.3.1",
37
37
  "chalk": "^5.4.1",
38
38
  "commander": "^13.0.0",
39
39
  "execa": "^9.5.1",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/init.ts","../src/templates/starwind.css.ts","../src/utils/highlighter.ts","../src/utils/astro-config.ts","../src/utils/fs.ts","../src/utils/constants.ts","../src/utils/config.ts","../src/utils/package-manager.ts","../src/utils/sleep.ts"],"sourcesContent":["import path from \"node:path\";\nimport { tailwindConfig } from \"@/templates/starwind.css.js\";\nimport { setupAstroConfig } from \"@/utils/astro-config.js\";\nimport { updateConfig } from \"@/utils/config.js\";\nimport { ASTRO_PACKAGES, MIN_ASTRO_VERSION, PATHS, getOtherPackages } from \"@/utils/constants.js\";\nimport { ensureDirectory, fileExists, readJsonFile, writeCssFile } from \"@/utils/fs.js\";\nimport { highlighter } from \"@/utils/highlighter.js\";\nimport { installDependencies, requestPackageManager } from \"@/utils/package-manager.js\";\nimport { sleep } from \"@/utils/sleep.js\";\nimport * as p from \"@clack/prompts\";\nimport semver from \"semver\";\n\nexport async function init(withinAdd: boolean = false) {\n\tif (!withinAdd) {\n\t\tp.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\t}\n\n\ttry {\n\t\t// Validate project structure\n\t\tif (!(await fileExists(\"package.json\"))) {\n\t\t\tthrow new Error(\n\t\t\t\t\"No package.json found. Please run this command in the root of your project.\",\n\t\t\t);\n\t\t}\n\n\t\tconst pkg = await readJsonFile(\"package.json\");\n\n\t\t// Check Astro version compatibility\n\t\tconst installTasks = [];\n\t\tconst configTasks = [];\n\n\t\t// ================================================================\n\t\t// Prepare project structure and configuration tasks\n\t\t// ================================================================\n\t\tconst configChoices = await p.group(\n\t\t\t{\n\t\t\t\t// ask where to install components\n\t\t\t\tinstallLocation: () =>\n\t\t\t\t\tp.text({\n\t\t\t\t\t\tmessage: \"What is your components directory?\",\n\t\t\t\t\t\tplaceholder: PATHS.LOCAL_COMPONENTS_DIR,\n\t\t\t\t\t\tinitialValue: PATHS.LOCAL_COMPONENTS_DIR,\n\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t// Check for empty value\n\t\t\t\t\t\t\tif (value.length === 0) return `Value is required!`;\n\n\t\t\t\t\t\t\t// Check for absolute paths\n\t\t\t\t\t\t\tif (path.isAbsolute(value)) return `Please use a relative path`;\n\n\t\t\t\t\t\t\t// Check for path traversal attempts\n\t\t\t\t\t\t\tif (value.includes(\"..\")) return `Path traversal is not allowed`;\n\n\t\t\t\t\t\t\t// Check for invalid characters in path\n\t\t\t\t\t\t\tconst invalidChars = /[<>:\"|?*]/;\n\t\t\t\t\t\t\tif (invalidChars.test(value)) return `Path contains invalid characters`;\n\n\t\t\t\t\t\t\t// Check if path starts with system directories\n\t\t\t\t\t\t\tconst systemDirs = [\"windows\", \"program files\", \"system32\"];\n\t\t\t\t\t\t\tif (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {\n\t\t\t\t\t\t\t\treturn `Cannot install in system directories`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t// ask where to add the css file\n\t\t\t\tcssFile: () =>\n\t\t\t\t\tp.text({\n\t\t\t\t\t\tmessage: `Where would you like to add the Tailwind ${highlighter.info(\".css\")} file?`,\n\t\t\t\t\t\tplaceholder: PATHS.LOCAL_CSS_FILE,\n\t\t\t\t\t\tinitialValue: PATHS.LOCAL_CSS_FILE,\n\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t// Check for empty value\n\t\t\t\t\t\t\tif (value.length === 0) return `Value is required!`;\n\n\t\t\t\t\t\t\t// Must end with .css\n\t\t\t\t\t\t\tif (!value.endsWith(\".css\")) return `File must end with .css extension`;\n\n\t\t\t\t\t\t\t// Check for absolute paths\n\t\t\t\t\t\t\tif (path.isAbsolute(value)) return `Please use a relative path`;\n\n\t\t\t\t\t\t\t// Check for path traversal attempts\n\t\t\t\t\t\t\tif (value.includes(\"..\")) return `Path traversal is not allowed`;\n\n\t\t\t\t\t\t\t// Check for invalid characters in path\n\t\t\t\t\t\t\tconst invalidChars = /[<>:\"|?*]/;\n\t\t\t\t\t\t\tif (invalidChars.test(value)) return `Path contains invalid characters`;\n\n\t\t\t\t\t\t\t// Check if path starts with system directories\n\t\t\t\t\t\t\tconst systemDirs = [\"windows\", \"program files\", \"system32\"];\n\t\t\t\t\t\t\tif (systemDirs.some((dir) => value.toLowerCase().startsWith(dir))) {\n\t\t\t\t\t\t\t\treturn `Cannot use system directories`;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Ensure the path has a valid filename\n\t\t\t\t\t\t\tconst basename = path.basename(value, \".css\");\n\t\t\t\t\t\t\tif (!basename || basename.trim().length === 0) {\n\t\t\t\t\t\t\t\treturn `Invalid filename`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\n\t\t\t\ttwBaseColor: () =>\n\t\t\t\t\tp.select({\n\t\t\t\t\t\tmessage: \"What Tailwind base color would you like to use?\",\n\t\t\t\t\t\tinitialValue: \"neutral\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Neutral (default)\", value: \"neutral\" },\n\t\t\t\t\t\t\t{ label: \"Stone\", value: \"stone\" },\n\t\t\t\t\t\t\t{ label: \"Zinc\", value: \"zinc\" },\n\t\t\t\t\t\t\t{ label: \"Gray\", value: \"gray\" },\n\t\t\t\t\t\t\t{ label: \"Slate\", value: \"slate\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t// On Cancel callback that wraps the group\n\t\t\t\t// So if the user cancels one of the prompts in the group this function will be called\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tp.cancel(\"Operation cancelled.\");\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\t// ================================================================\n\t\t// Make sure appropriate directories exist\n\t\t// ================================================================\n\t\tconst cssFileDir = path.dirname(configChoices.cssFile);\n\t\tconst componentInstallDir = path.join(configChoices.installLocation, \"starwind\");\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Creating project structure\",\n\t\t\ttask: async () => {\n\t\t\t\tawait ensureDirectory(componentInstallDir);\n\t\t\t\tawait ensureDirectory(cssFileDir);\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Created project structure\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare Astro config file setup\n\t\t// ================================================================\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Setup Astro config file\",\n\t\t\ttask: async () => {\n\t\t\t\tconst success = await setupAstroConfig();\n\t\t\t\tif (!success) {\n\t\t\t\t\tthrow new Error(\"Failed to setup Astro config\");\n\t\t\t\t}\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Astro config setup completed\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare CSS file\n\t\t// ================================================================\n\t\t// Check if CSS file already exists\n\t\tconst cssFileExists = await fileExists(configChoices.cssFile);\n\t\tlet updatedTailwindConfig = tailwindConfig;\n\n\t\tif (configChoices.twBaseColor !== \"neutral\") {\n\t\t\t// replace all \"--color-neutral\" with \"--color-twBaseColor\"\n\t\t\tupdatedTailwindConfig = updatedTailwindConfig.replace(\n\t\t\t\t/--color-neutral-/g,\n\t\t\t\t`--color-${configChoices.twBaseColor}-`,\n\t\t\t);\n\t\t}\n\n\t\tif (cssFileExists) {\n\t\t\tconst shouldOverride = await p.confirm({\n\t\t\t\tmessage: `${highlighter.info(configChoices.cssFile)} already exists. Do you want to override it?`,\n\t\t\t});\n\n\t\t\tif (!shouldOverride) {\n\t\t\t\tp.log.info(\"Skipping Tailwind CSS configuration\");\n\t\t\t} else {\n\t\t\t\tconfigTasks.push({\n\t\t\t\t\ttitle: \"Creating Tailwind CSS configuration\",\n\t\t\t\t\ttask: async () => {\n\t\t\t\t\t\tawait writeCssFile(configChoices.cssFile, updatedTailwindConfig);\n\t\t\t\t\t\tawait sleep(250);\n\t\t\t\t\t\treturn \"Created Tailwind configuration\";\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconfigTasks.push({\n\t\t\t\ttitle: \"Creating Tailwind CSS configuration\",\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait writeCssFile(configChoices.cssFile, updatedTailwindConfig);\n\t\t\t\t\tawait sleep(250);\n\t\t\t\t\treturn \"Created Tailwind configuration\";\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// ================================================================\n\t\t// Prepare project starwind configuration\n\t\t// ================================================================\n\t\tconfigTasks.push({\n\t\t\ttitle: \"Updating project configuration\",\n\t\t\ttask: async () => {\n\t\t\t\tawait updateConfig({\n\t\t\t\t\ttailwind: {\n\t\t\t\t\t\tcss: configChoices.cssFile,\n\t\t\t\t\t\tbaseColor: configChoices.twBaseColor as \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\",\n\t\t\t\t\t\tcssVariables: true,\n\t\t\t\t\t},\n\t\t\t\t\t// aliases: {\n\t\t\t\t\t// \tcomponents: \"@/components\",\n\t\t\t\t\t// },\n\t\t\t\t\tcomponentDir: configChoices.installLocation,\n\t\t\t\t\tcomponents: [],\n\t\t\t\t});\n\t\t\t\tawait sleep(250);\n\t\t\t\treturn \"Updated project starwind configuration\";\n\t\t\t},\n\t\t});\n\n\t\t// ================================================================\n\t\t// Prepare astro installation\n\t\t// ================================================================\n\t\t// Request package manager\n\t\tconst pm = await requestPackageManager();\n\n\t\tif (pkg.dependencies?.astro) {\n\t\t\tconst astroVersion = pkg.dependencies.astro.replace(/^\\^|~/, \"\");\n\t\t\tif (!semver.gte(astroVersion, MIN_ASTRO_VERSION)) {\n\t\t\t\tconst shouldUpgrade = await p.confirm({\n\t\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to upgrade from v${astroVersion}?`,\n\t\t\t\t\tinitialValue: true,\n\t\t\t\t});\n\n\t\t\t\tif (p.isCancel(shouldUpgrade)) {\n\t\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\t\treturn process.exit(0);\n\t\t\t\t}\n\n\t\t\t\tif (!shouldUpgrade) {\n\t\t\t\t\tp.cancel(\"Astro v5 or higher is required to use Starwind\");\n\t\t\t\t\treturn process.exit(1);\n\t\t\t\t}\n\n\t\t\t\tinstallTasks.push({\n\t\t\t\t\ttitle: \"Upgrading Astro\",\n\t\t\t\t\ttask: async () => {\n\t\t\t\t\t\tawait installDependencies([ASTRO_PACKAGES.core], pm);\n\t\t\t\t\t\treturn \"Upgraded Astro successfully\";\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst shouldInstall = await p.confirm({\n\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to install it?`,\n\t\t\t\tinitialValue: true,\n\t\t\t});\n\n\t\t\tif (p.isCancel(shouldInstall)) {\n\t\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\t\treturn process.exit(0);\n\t\t\t}\n\n\t\t\tif (!shouldInstall) {\n\t\t\t\tp.cancel(\"Astro is required to use Starwind\");\n\t\t\t\treturn process.exit(1);\n\t\t\t}\n\n\t\t\tinstallTasks.push({\n\t\t\t\ttitle: `Installing ${ASTRO_PACKAGES.core}`,\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait installDependencies([ASTRO_PACKAGES.core], pm);\n\t\t\t\t\treturn `Installed ${highlighter.info(ASTRO_PACKAGES.core)} successfully`;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// ================================================================\n\t\t// Prepare tailwind and other package installation\n\t\t// ================================================================\n\t\tconst otherPackages = getOtherPackages();\n\n\t\tconst shouldInstall = await p.confirm({\n\t\t\tmessage: `Install ${highlighter.info(otherPackages.join(\", \"))} using ${highlighter.info(pm)}?`,\n\t\t});\n\n\t\tif (p.isCancel(shouldInstall)) {\n\t\t\tp.cancel(\"Operation cancelled\");\n\t\t\treturn process.exit(0);\n\t\t}\n\n\t\tif (shouldInstall) {\n\t\t\tinstallTasks.push({\n\t\t\t\ttitle: `Installing packages`,\n\t\t\t\ttask: async () => {\n\t\t\t\t\tawait installDependencies(getOtherPackages(), pm, false, false);\n\t\t\t\t\treturn `${highlighter.info(\"Packages installed successfully\")}`;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tp.log.warn(\n\t\t\t\thighlighter.warn(`Skipped installation of packages. Make sure to install them manually`),\n\t\t\t);\n\t\t}\n\n\t\t// ================================================================\n\t\t// Execute all tasks\n\t\t// ================================================================\n\t\tif (installTasks.length > 0) {\n\t\t\tawait p.tasks(installTasks);\n\t\t}\n\n\t\tif (configTasks.length > 0) {\n\t\t\tawait p.tasks(configTasks);\n\t\t}\n\n\t\tawait sleep(250);\n\n\t\tp.note(\n\t\t\t`Make sure your layout imports the ${highlighter.infoBright(configChoices.cssFile)} file`,\n\t\t\t\"Next steps\",\n\t\t);\n\n\t\tif (!withinAdd) {\n\t\t\tsleep(1000);\n\t\t\tp.outro(\"Enjoy using Starwind UI 🚀\");\n\t\t}\n\t} catch (error) {\n\t\tp.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n\t\tp.cancel(\"Operation cancelled\");\n\t\tprocess.exit(1);\n\t}\n}\n","export const tailwindConfig = `@import \"tailwindcss\";\n@plugin \"tailwindcss-animate\";\n@plugin \"@tailwindcss/forms\";\n@variant dark (&:where(.dark, .dark *));\n\n@theme {\n\t--animate-accordion-down: accordion-down 0.2s ease-out;\n\t--animate-accordion-up: accordion-up 0.2s ease-out;\n\n\t@keyframes accordion-down {\n\t\tfrom {\n\t\t\theight: 0;\n\t\t}\n\t\tto {\n\t\t\theight: var(--starwind-accordion-content-height);\n\t\t}\n\t}\n\n\t@keyframes accordion-up {\n\t\tfrom {\n\t\t\theight: var(--starwind-accordion-content-height);\n\t\t}\n\t\tto {\n\t\t\theight: 0;\n\t\t}\n\t}\n}\n\n@theme inline {\n\t--color-background: var(--background);\n\t--color-foreground: var(--foreground);\n\t--color-card: var(--card);\n\t--color-card-foreground: var(--card-foreground);\n\t--color-popover: var(--popover);\n\t--color-popover-foreground: var(--popover-foreground);\n\t--color-primary: var(--primary);\n\t--color-primary-foreground: var(--primary-foreground);\n\t--color-secondary: var(--secondary);\n\t--color-secondary-foreground: var(--secondary-foreground);\n\t--color-muted: var(--muted);\n\t--color-muted-foreground: var(--muted-foreground);\n\t--color-accent: var(--accent);\n\t--color-accent-foreground: var(--accent-foreground);\n\t--color-info: var(--info);\n\t--color-info-foreground: var(--info-foreground);\n\t--color-success: var(--success);\n\t--color-success-foreground: var(--success-foreground);\n\t--color-warning: var(--warning);\n\t--color-warning-foreground: var(--warning-foreground);\n\t--color-error: var(--error);\n\t--color-error-foreground: var(--error-foreground);\n\t--color-border: var(--border);\n\t--color-input: var(--input);\n\t--color-outline: var(--outline);\n\n\t--radius-xs: calc(var(--radius) - 0.375rem);\n\t--radius-sm: calc(var(--radius) - 0.25rem);\n\t--radius-md: calc(var(--radius) - 0.125rem);\n\t--radius-lg: var(--radius);\n\t--radius-xl: calc(var(--radius) + 0.25rem);\n\t--radius-2xl: calc(var(--radius) + 0.5rem);\n\t--radius-3xl: calc(var(--radius) + 1rem);\n}\n\n@layer base {\n\t:root {\n\t\t--background: var(--color-neutral-50);\n\t\t--foreground: var(--color-neutral-950);\n\t\t--card: var(--color-neutral-50);\n\t\t--card-foreground: var(--color-neutral-950);\n\t\t--popover: var(--color-neutral-50);\n\t\t--popover-foreground: var(--color-neutral-950);\n\t\t--primary: var(--color-blue-700);\n\t\t--primary-foreground: var(--color-neutral-50);\n\t\t--secondary: var(--color-fuchsia-700);\n\t\t--secondary-foreground: var(--color-neutral-50);\n\t\t--muted: var(--color-neutral-100);\n\t\t--muted-foreground: var(--color-neutral-600);\n\t\t--accent: var(--color-neutral-200);\n\t\t--accent-foreground: var(--color-neutral-900);\n\t\t--info: var(--color-sky-300);\n\t\t--info-foreground: var(--color-sky-950);\n\t\t--success: var(--color-green-300);\n\t\t--success-foreground: var(--color-green-950);\n\t\t--warning: var(--color-amber-300);\n\t\t--warning-foreground: var(--color-amber-950);\n\t\t--error: var(--color-red-700);\n\t\t--error-foreground: var(--color-neutral-50);\n\t\t--border: var(--color-neutral-200);\n\t\t--input: var(--color-neutral-200);\n\t\t--outline: var(--color-blue-600);\n\t\t--radius: 0.5rem;\n\t}\n\n\t.dark {\n\t\t--background: var(--color-neutral-950);\n\t\t--foreground: var(--color-neutral-50);\n\t\t--card: var(--color-neutral-950);\n\t\t--card-foreground: var(--color-neutral-50);\n\t\t--popover: var(--color-neutral-950);\n\t\t--popover-foreground: var(--color-neutral-50);\n\t\t--primary: var(--color-blue-700);\n\t\t--primary-foreground: var(--color-neutral-50);\n\t\t--secondary: var(--color-fuchsia-300);\n\t\t--secondary-foreground: var(--color-neutral-950);\n\t\t--muted: var(--color-neutral-900);\n\t\t--muted-foreground: var(--color-neutral-400);\n\t\t--accent: var(--color-neutral-900);\n\t\t--accent-foreground: var(--color-neutral-100);\n\t\t--info: var(--color-sky-300);\n\t\t--info-foreground: var(--color-sky-950);\n\t\t--success: var(--color-green-300);\n\t\t--success-foreground: var(--color-green-950);\n\t\t--warning: var(--color-amber-300);\n\t\t--warning-foreground: var(--color-amber-950);\n\t\t--error: var(--color-red-800);\n\t\t--error-foreground: var(--color-neutral-50);\n\t\t--border: var(--color-neutral-800);\n\t\t--input: var(--color-neutral-800);\n\t\t--outline: var(--color-blue-600);\n\t\t--radius: 0.5rem;\n\t}\n\n\t* {\n\t\t@apply border-border;\n\t}\n\t*:focus-visible {\n\t\t@apply outline-outline;\n\t}\n\thtml {\n\t\t@apply bg-background text-foreground scheme-light dark:scheme-dark;\n\t}\n\tbutton {\n\t\t@apply cursor-pointer;\n\t}\n}\n\n@layer utilities {\n\t/* transition-colors but without outline-color transition property */\n\t.starwind-transition-colors {\n\t\ttransition-property: color, background-color, border-color, text-decoration-color, fill, stroke,\n\t\t\t--tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n\t\ttransition-timing-function: var(--default-transition-timing-function);\n\t\ttransition-duration: var(--default-transition-duration);\n\t}\n}\n`;\n","import chalk from \"chalk\";\n\nexport const highlighter = {\n\terror: chalk.red,\n\twarn: chalk.yellow,\n\tinfo: chalk.cyan,\n\tinfoBright: chalk.cyanBright,\n\tsuccess: chalk.greenBright,\n\tunderline: chalk.underline,\n\ttitle: chalk.bgBlue,\n};\n","import { highlighter } from \"@/utils/highlighter.js\";\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport { fileExists } from \"./fs.js\";\n\nconst CONFIG_EXTENSIONS = [\"ts\", \"js\", \"mjs\", \"cjs\"] as const;\n// type ConfigExtension = (typeof CONFIG_EXTENSIONS)[number];\n\n/**\n * Finds the Astro config file in the current directory\n * @returns The path to the config file if found, null otherwise\n */\nasync function findAstroConfig(): Promise<string | null> {\n\tfor (const ext of CONFIG_EXTENSIONS) {\n\t\tconst configPath = `astro.config.${ext}`;\n\t\tif (await fileExists(configPath)) {\n\t\t\treturn configPath;\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Updates or creates the Astro configuration file\n * @returns true if successful, false otherwise\n */\nexport async function setupAstroConfig(): Promise<boolean> {\n\ttry {\n\t\tlet configPath = await findAstroConfig();\n\t\tlet content = \"\";\n\n\t\tif (configPath) {\n\t\t\tcontent = await fs.readFile(configPath, \"utf-8\");\n\t\t} else {\n\t\t\tconfigPath = \"astro.config.ts\";\n\t\t\tcontent = `import { defineConfig } from \"astro/config\";\\n\\nexport default defineConfig({});\\n`;\n\t\t}\n\n\t\t// Add tailwindcss import if not present\n\t\tif (!content.includes('import tailwindcss from \"@tailwindcss/vite\"')) {\n\t\t\tcontent = `import tailwindcss from \"@tailwindcss/vite\";\\n${content}`;\n\t\t}\n\n\t\t// Parse the configuration object\n\t\tconst configStart = content.indexOf(\"defineConfig(\") + \"defineConfig(\".length;\n\t\tconst configEnd = content.lastIndexOf(\");\");\n\t\tlet config = content.slice(configStart, configEnd);\n\n\t\t// Remove outer braces and trim\n\t\tconfig = config.trim().replace(/^{|}$/g, \"\").trim();\n\n\t\t// Add experimental configuration\n\t\tif (!config.includes(\"experimental\")) {\n\t\t\tconfig += `\\n\\texperimental: {\n\t\tsvg: {\n\t\t\tmode: \"sprite\",\n\t\t},\n\t},`;\n\t\t} else if (!config.includes(\"svg: {\")) {\n\t\t\t// Insert svg config into existing experimental block\n\t\t\tconst expEnd = config.indexOf(\"experimental:\") + \"experimental:\".length;\n\t\t\tconst blockStart = config.indexOf(\"{\", expEnd) + 1;\n\t\t\tconfig =\n\t\t\t\tconfig.slice(0, blockStart) +\n\t\t\t\t`\\n\\t\\tsvg: {\\n\\t\\t\\tmode: \"sprite\",\\n\\t\\t},` +\n\t\t\t\tconfig.slice(blockStart);\n\t\t}\n\n\t\t// Add vite configuration\n\t\tif (!config.includes(\"vite:\")) {\n\t\t\tconfig += `\\n\\tvite: {\n\t\tplugins: [tailwindcss()],\n\t},`;\n\t\t} else if (!config.includes(\"plugins: [\")) {\n\t\t\t// Insert plugins into existing vite block\n\t\t\tconst viteEnd = config.indexOf(\"vite:\") + \"vite:\".length;\n\t\t\tconst blockStart = config.indexOf(\"{\", viteEnd) + 1;\n\t\t\tconfig =\n\t\t\t\tconfig.slice(0, blockStart) + `\\n\\t\\tplugins: [tailwindcss()],` + config.slice(blockStart);\n\t\t} else if (!config.includes(\"tailwindcss()\")) {\n\t\t\t// Add tailwindcss to existing plugins array\n\t\t\tconst pluginsStart = config.indexOf(\"plugins:\") + \"plugins:\".length;\n\t\t\tconst arrayStart = config.indexOf(\"[\", pluginsStart) + 1;\n\t\t\tconfig = config.slice(0, arrayStart) + `tailwindcss(), ` + config.slice(arrayStart);\n\t\t}\n\n\t\t// Reconstruct the file content\n\t\tconst newContent = `${content.slice(0, configStart)}{\\n\\t${config}\\n}${content.slice(configEnd)}`;\n\n\t\tawait fs.writeFile(configPath, newContent, \"utf-8\");\n\t\treturn true;\n\t} catch (error) {\n\t\tconst errorMessage = error instanceof Error ? error.message : \"An unknown error occurred\";\n\t\tp.log.error(highlighter.error(`Failed to setup Astro config: ${errorMessage}`));\n\t\treturn false;\n\t}\n}\n","import fs from \"fs-extra\";\n\n/**\n * Ensures a directory exists, creating it and its parents if necessary\n * @param dir - Directory path to ensure exists\n */\nexport async function ensureDirectory(dir: string) {\n\tawait fs.ensureDir(dir);\n}\n\n/**\n * Copies a file from source to destination\n * @param src - Source file path\n * @param dest - Destination file path\n */\nexport async function copyFile(src: string, dest: string) {\n\tawait fs.copy(src, dest);\n}\n\n/**\n * Reads and parses a JSON file\n * @param filePath - Path to the JSON file\n * @returns Parsed JSON content\n */\nexport async function readJsonFile(filePath: string) {\n\treturn fs.readJson(filePath);\n}\n\n/**\n * Writes data to a JSON file\n * @param filePath - Path to write the JSON file\n * @param data - Data to write to the file\n */\nexport async function writeJsonFile(filePath: string, data: unknown) {\n\tawait fs.writeJson(filePath, data, { spaces: 2 });\n}\n\n/**\n * Checks if a file exists\n * @param filePath - Path to check\n * @returns True if the file exists, false otherwise\n */\nexport async function fileExists(filePath: string) {\n\treturn fs.pathExists(filePath);\n}\n\n/**\n * Creates a CSS file with the provided content\n * @param filePath - Path to write the CSS file\n * @param content - CSS content to write\n */\nexport async function writeCssFile(filePath: string, content: string) {\n\tawait fs.writeFile(filePath, content, \"utf-8\");\n}\n","export const MIN_ASTRO_VERSION = \"5.0.0\";\n\n/**\n * File system paths used throughout the application\n */\nexport const PATHS = {\n\tSTARWIND_CORE: \"@starwind-ui/core\",\n\tSTARWIND_CORE_COMPONENTS: \"src/components\",\n\tSTARWIND_COMPONENT_REGISTRY: \"https://starwind.dev/registry.json\",\n\tLOCAL_CSS_FILE: \"src/styles/starwind.css\",\n\tLOCAL_CONFIG_FILE: \"starwind.config.json\",\n\tLOCAL_STYLES_DIR: \"src/styles\",\n\tLOCAL_COMPONENTS_DIR: \"src/components\",\n} as const;\n\n/**\n * Core framework dependencies\n */\nexport const ASTRO_PACKAGES = {\n\tcore: \"astro@latest\",\n} as const;\n\n/**\n * Tailwind CSS related dependencies\n */\nexport const OTHER_PACKAGES = {\n\ttailwindCore: \"tailwindcss@latest\",\n\ttailwindVite: \"@tailwindcss/vite@latest\",\n\ttailwindForms: \"@tailwindcss/forms@latest\",\n\ttailwindAnimate: \"tailwindcss-animate@latest\",\n\ttailwindVariants: \"tailwind-variants@latest\",\n\ttablerIcons: \"@tabler/icons@latest\",\n} as const;\n\n/**\n * Get all Tailwind CSS related packages as an array\n */\nexport function getOtherPackages(): string[] {\n\treturn Object.values(OTHER_PACKAGES);\n}\n\n/**\n * Get all Astro related packages as an array\n */\nexport function getAstroPackages(): string[] {\n\treturn Object.values(ASTRO_PACKAGES);\n}\n","import { PATHS } from \"./constants.js\";\nimport { fileExists, readJsonFile, writeJsonFile } from \"./fs.js\";\n\ninterface ComponentConfig {\n\tname: string;\n\tversion: string;\n}\n\ninterface TailwindConfig {\n\tcss: string;\n\tbaseColor: \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\";\n\tcssVariables: boolean;\n}\n\ninterface AliasConfig {\n\tcomponents: string;\n}\n\nexport interface StarwindConfig {\n\t$schema: string;\n\ttailwind: TailwindConfig;\n\t// aliases: AliasConfig;\n\tcomponentDir: string;\n\tcomponents: ComponentConfig[];\n}\n\nconst defaultConfig: StarwindConfig = {\n\t$schema: \"https://starwind.dev/config-schema.json\",\n\ttailwind: {\n\t\tcss: \"src/styles/starwind.css\",\n\t\tbaseColor: \"neutral\",\n\t\tcssVariables: true,\n\t},\n\t// aliases: {\n\t// \tcomponents: \"@/components\",\n\t// },\n\tcomponentDir: \"src/components/starwind\",\n\tcomponents: [],\n};\n\n/**\n * Get the current config, ensuring the file is fully read\n */\nexport async function getConfig(): Promise<StarwindConfig> {\n\ttry {\n\t\tif (await fileExists(PATHS.LOCAL_CONFIG_FILE)) {\n\t\t\tconst config = await readJsonFile(PATHS.LOCAL_CONFIG_FILE);\n\t\t\treturn {\n\t\t\t\t...defaultConfig,\n\t\t\t\t...config,\n\t\t\t\tcomponents: Array.isArray(config.components) ? config.components : [],\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"Error reading config:\", error);\n\t}\n\n\treturn defaultConfig;\n}\n\n/**\n * Options for updating the config file\n */\nexport interface UpdateConfigOptions {\n\t/** If true, append new components to existing array. If false, replace the components array. */\n\tappendComponents?: boolean;\n}\n\n/**\n * Update the config file, ensuring the write operation is completed\n * @param updates - Partial config object to update\n * @param options - Options for updating the config\n */\nexport async function updateConfig(\n\tupdates: Partial<StarwindConfig>,\n\toptions: UpdateConfigOptions = { appendComponents: true },\n): Promise<void> {\n\tconst currentConfig = await getConfig();\n\n\t// Ensure components array exists\n\tconst currentComponents = Array.isArray(currentConfig.components) ? currentConfig.components : [];\n\n\tconst newConfig = {\n\t\t...currentConfig,\n\t\ttailwind: {\n\t\t\t...currentConfig.tailwind,\n\t\t\t...(updates.tailwind || {}),\n\t\t},\n\t\tcomponentDir: updates.componentDir ? updates.componentDir : currentConfig.componentDir,\n\t\tcomponents: updates.components\n\t\t\t? options.appendComponents\n\t\t\t\t? [...currentComponents, ...updates.components]\n\t\t\t\t: updates.components\n\t\t\t: currentComponents,\n\t};\n\n\ttry {\n\t\tawait writeJsonFile(PATHS.LOCAL_CONFIG_FILE, newConfig);\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t);\n\t}\n}\n","import * as p from \"@clack/prompts\";\nimport { execa } from \"execa\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n\n/**\n * Prompts the user to select their preferred package manager\n * @returns The selected package manager, defaults to npm if cancelled\n */\nexport async function requestPackageManager(): Promise<PackageManager> {\n\tconst pm = await p.select({\n\t\tmessage: \"Select your preferred package manager\",\n\t\toptions: [\n\t\t\t{ value: \"pnpm\", label: \"pnpm\", hint: \"Default\" },\n\t\t\t{ value: \"npm\", label: \"npm\" },\n\t\t\t{ value: \"yarn\", label: \"yarn\" },\n\t\t\t{ value: \"bun\", label: \"bun\" },\n\t\t],\n\t});\n\n\tif (p.isCancel(pm)) {\n\t\tp.log.warn(\"No package manager selected, defaulting to npm\");\n\t\treturn \"npm\";\n\t}\n\n\treturn pm as PackageManager;\n}\n\n/**\n * Installs the specified packages using the detected package manager\n * @param packages - Array of package names to install\n * @param pm - The package manager to use\n * @param dev - Whether to install as dev dependencies\n * @param force - Whether to force install packages\n */\nexport async function installDependencies(\n\tpackages: string[],\n\tpm: PackageManager,\n\tdev = false,\n\tforce = false,\n): Promise<void> {\n\tconst args = [\n\t\tpm === \"npm\" ? \"install\" : \"add\",\n\t\t...packages,\n\t\tdev ? (pm === \"npm\" || pm === \"pnpm\" ? \"-D\" : \"--dev\") : \"\",\n\t\tforce ? \"--force\" : \"\",\n\t].filter(Boolean);\n\n\tawait execa(pm, args);\n}\n","/**\n * Pauses execution for the specified number of milliseconds.\n * @param ms - The number of milliseconds to sleep\n */\nexport const sleep = async (ms: number): Promise<void> => {\n\tawait new Promise((resolve) => setTimeout(resolve, ms));\n};\n"],"mappings":";AAAA,OAAO,UAAU;;;ACAV,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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