starwind 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Y5GTTJVG.js → chunk-M6T5EAJY.js} +2 -2
- package/dist/{chunk-Y5GTTJVG.js.map → chunk-M6T5EAJY.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/init-U4G2DYBL.js +7 -0
- package/package.json +2 -2
- package/dist/init-3GX3AET6.js +0 -7
- /package/dist/{init-3GX3AET6.js.map → init-U4G2DYBL.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
|
|
4
4
|
// src/templates/starwind.css.ts
|
|
5
5
|
var tailwindConfig = `@import "tailwindcss";
|
|
6
|
-
@
|
|
6
|
+
@import "tw-animate-css";
|
|
7
7
|
@plugin "@tailwindcss/forms";
|
|
8
8
|
@variant dark (&:where(.dark, .dark *));
|
|
9
9
|
|
|
@@ -641,4 +641,4 @@ export {
|
|
|
641
641
|
sleep,
|
|
642
642
|
init
|
|
643
643
|
};
|
|
644
|
-
//# sourceMappingURL=chunk-
|
|
644
|
+
//# sourceMappingURL=chunk-M6T5EAJY.js.map
|
|
@@ -1 +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 {\n\tgetDefaultPackageManager,\n\tinstallDependencies,\n\trequestPackageManager,\n} 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\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\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\tconst shouldOverride = options?.defaults\n\t\t\t\t? true\n\t\t\t\t: await p.confirm({\n\t\t\t\t\t\tmessage: `${highlighter.info(configChoices.cssFile)} already exists. Do you want to override it?`,\n\t\t\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 ? await getDefaultPackageManager() : 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 = options?.defaults\n\t\t\t\t\t? true\n\t\t\t\t\t: await p.confirm({\n\t\t\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\t\t\tinitialValue: true,\n\t\t\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 = options?.defaults\n\t\t\t\t? true\n\t\t\t\t: await p.confirm({\n\t\t\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to install it?`,\n\t\t\t\t\t\tinitialValue: true,\n\t\t\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 = options?.defaults\n\t\t\t? true\n\t\t\t: await p.confirm({\n\t\t\t\t\tmessage: `Install ${highlighter.info(otherPackages.join(\", \"))} using ${highlighter.info(pm)}?`,\n\t\t\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 \"tw-animate-css\";\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: true,\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 = config.slice(0, blockStart) + `\\n\\t\\tsvg: true,` + config.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: \"tw-animate-css@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\n// interface 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;;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ACf;AACD;","names":["fs","fs","p","p","shouldInstall"]}
|
|
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 {\n\tgetDefaultPackageManager,\n\tinstallDependencies,\n\trequestPackageManager,\n} 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\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\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\tconst shouldOverride = options?.defaults\n\t\t\t\t? true\n\t\t\t\t: await p.confirm({\n\t\t\t\t\t\tmessage: `${highlighter.info(configChoices.cssFile)} already exists. Do you want to override it?`,\n\t\t\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 ? await getDefaultPackageManager() : 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 = options?.defaults\n\t\t\t\t\t? true\n\t\t\t\t\t: await p.confirm({\n\t\t\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\t\t\tinitialValue: true,\n\t\t\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 = options?.defaults\n\t\t\t\t? true\n\t\t\t\t: await p.confirm({\n\t\t\t\t\t\tmessage: `Starwind requires Astro v${MIN_ASTRO_VERSION} or higher. Would you like to install it?`,\n\t\t\t\t\t\tinitialValue: true,\n\t\t\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 = options?.defaults\n\t\t\t? true\n\t\t\t: await p.confirm({\n\t\t\t\t\tmessage: `Install ${highlighter.info(otherPackages.join(\", \"))} using ${highlighter.info(pm)}?`,\n\t\t\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@import \"tw-animate-css\";\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: true,\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 = config.slice(0, blockStart) + `\\n\\t\\tsvg: true,` + config.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: \"tw-animate-css@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\n// interface 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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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EAAsE;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-
|
|
12
|
+
} from "./chunk-M6T5EAJY.js";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
import { Command } from "commander";
|
|
@@ -286,7 +286,7 @@ async function isValidComponent(component, availableComponents) {
|
|
|
286
286
|
|
|
287
287
|
// src/commands/add.ts
|
|
288
288
|
import * as p2 from "@clack/prompts";
|
|
289
|
-
var { init: init2 } = await import("./init-
|
|
289
|
+
var { init: init2 } = await import("./init-U4G2DYBL.js");
|
|
290
290
|
async function add(components, options) {
|
|
291
291
|
try {
|
|
292
292
|
p2.intro(highlighter.title(" Welcome to the Starwind CLI "));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starwind",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
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.
|
|
36
|
+
"@starwind-ui/core": "1.5.0",
|
|
37
37
|
"chalk": "^5.4.1",
|
|
38
38
|
"commander": "^13.0.0",
|
|
39
39
|
"execa": "^9.5.1",
|
package/dist/init-3GX3AET6.js
DELETED
|
File without changes
|