starwind 1.5.2 → 1.6.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/index.js CHANGED
@@ -678,7 +678,7 @@ ${results.failed.map((r) => ` ${r.name} - ${r.error}`).join("\n")}`
678
678
  }
679
679
 
680
680
  // src/index.ts
681
- var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("1.3.0");
681
+ var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("1.6.0");
682
682
  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 }));
683
683
  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);
684
684
  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").option("-y, --yes", "Skip confirmation prompts").action(update);
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(\"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.option(\"-y, --yes\", \"Skip confirmation prompts\")\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 * @param skipConfirm - If true, skips the confirmation prompt\n * @returns A result object indicating the update status\n */\nexport async function updateComponent(\n\tname: string,\n\tcurrentVersion: string,\n\tskipConfirm?: boolean,\n): 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, unless skipConfirm is true\n\t\tlet confirmUpdate = true; // Default to true if skipping confirmation\n\t\tif (!skipConfirm) {\n\t\t\t// Only prompt if skipConfirm is false or undefined\n\t\t\tconst confirmedResult = await p.confirm({\n\t\t\t\tmessage: `Update component ${highlighter.info(\n\t\t\t\t\tname,\n\t\t\t\t)} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(\n\t\t\t\t\t`v${registryComponent.version}`,\n\t\t\t\t)}? This will override the existing implementation.`,\n\t\t\t});\n\n\t\t\t// Check for cancellation immediately\n\t\t\tif (p.isCancel(confirmedResult)) {\n\t\t\t\tp.cancel(\"Update cancelled.\");\n\t\t\t\treturn {\n\t\t\t\t\tname,\n\t\t\t\t\tstatus: \"skipped\",\n\t\t\t\t\toldVersion: currentVersion,\n\t\t\t\t\tnewVersion: registryComponent.version, // Still useful to return the target version\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// If not cancelled, confirmedResult is boolean. Assign it.\n\t\t\tconfirmUpdate = confirmedResult;\n\t\t}\n\n\t\t// Now confirmUpdate is guaranteed to be boolean, proceed with the check\n\t\tif (!confirmUpdate) {\n\t\t\t// Handle non-confirmation ('No' was selected)\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 { registry as localRegistry } from \"@starwind-ui/core\";\nimport { z } from \"zod\";\nimport { PATHS } from \"./constants.js\";\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","import { 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\n// Define the type for options more explicitly\ninterface UpdateOptions {\n\tall?: boolean;\n\tyes?: boolean;\n}\n\nexport async function update(components?: string[], options?: UpdateOptions) {\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\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\t// Pass the 'yes' option down to updateComponent\n\t\t\tconst result = await updateComponent(comp, currentVersion, options?.yes);\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,YAAY,qBAAqB;AAC1C,SAAS,SAAS;AAIlB,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,EAAE,MAAM,eAAe;AACpC,CAAC;AAGD,IAAM,gBAAgB,oBAAI,IAAkC;AAO5D,eAAsB,YAAY,eAAe,OAA6B;AAC7E,QAAM,WACL,gBAAgB,WAAW,WACxB,MAAM,qCACN;AAGJ,MAAI,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":["../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.6.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.option(\"-y, --yes\", \"Skip confirmation prompts\")\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 * @param skipConfirm - If true, skips the confirmation prompt\n * @returns A result object indicating the update status\n */\nexport async function updateComponent(\n\tname: string,\n\tcurrentVersion: string,\n\tskipConfirm?: boolean,\n): 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, unless skipConfirm is true\n\t\tlet confirmUpdate = true; // Default to true if skipping confirmation\n\t\tif (!skipConfirm) {\n\t\t\t// Only prompt if skipConfirm is false or undefined\n\t\t\tconst confirmedResult = await p.confirm({\n\t\t\t\tmessage: `Update component ${highlighter.info(\n\t\t\t\t\tname,\n\t\t\t\t)} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(\n\t\t\t\t\t`v${registryComponent.version}`,\n\t\t\t\t)}? This will override the existing implementation.`,\n\t\t\t});\n\n\t\t\t// Check for cancellation immediately\n\t\t\tif (p.isCancel(confirmedResult)) {\n\t\t\t\tp.cancel(\"Update cancelled.\");\n\t\t\t\treturn {\n\t\t\t\t\tname,\n\t\t\t\t\tstatus: \"skipped\",\n\t\t\t\t\toldVersion: currentVersion,\n\t\t\t\t\tnewVersion: registryComponent.version, // Still useful to return the target version\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// If not cancelled, confirmedResult is boolean. Assign it.\n\t\t\tconfirmUpdate = confirmedResult;\n\t\t}\n\n\t\t// Now confirmUpdate is guaranteed to be boolean, proceed with the check\n\t\tif (!confirmUpdate) {\n\t\t\t// Handle non-confirmation ('No' was selected)\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 { registry as localRegistry } from \"@starwind-ui/core\";\nimport { z } from \"zod\";\nimport { PATHS } from \"./constants.js\";\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","import { 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\n// Define the type for options more explicitly\ninterface UpdateOptions {\n\tall?: boolean;\n\tyes?: boolean;\n}\n\nexport async function update(components?: string[], options?: UpdateOptions) {\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\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\t// Pass the 'yes' option down to updateComponent\n\t\t\tconst result = await updateComponent(comp, currentVersion, options?.yes);\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,S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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,aAAa,2BAA2B,EAC/C,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starwind",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "Add beautifully designed components to your Astro applications",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -32,18 +32,18 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@clack/prompts": "^0.9.1",
36
- "@starwind-ui/core": "1.5.1",
35
+ "@clack/prompts": "^0.10.1",
36
+ "@starwind-ui/core": "1.6.0",
37
37
  "chalk": "^5.4.1",
38
38
  "commander": "^13.0.0",
39
39
  "execa": "^9.5.1",
40
40
  "fs-extra": "^11.2.0",
41
41
  "semver": "^7.6.3",
42
- "zod": "^3.22.4"
42
+ "zod": "^3.24.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/fs-extra": "^11.0.4",
46
- "@types/node": "^22.10.2",
46
+ "@types/node": "^22.15.2",
47
47
  "@types/prompts": "^2.4.9",
48
48
  "@types/semver": "^7.5.8",
49
49
  "tsup": "^8.0.2"