starwind 1.7.1 → 1.7.3
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 +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -680,7 +680,7 @@ ${results.updated.map((r) => ` ${r.name} (${r.oldVersion} \u2192 ${r.newVersion
|
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
// src/index.ts
|
|
683
|
-
var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("1.7.
|
|
683
|
+
var program = new Command().name("starwind").description("Add beautifully designed components to your Astro applications").version("1.7.3");
|
|
684
684
|
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 }));
|
|
685
685
|
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);
|
|
686
686
|
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/commands/add.ts","../src/utils/component.ts","../src/utils/registry.ts","../src/utils/prompts.ts","../src/utils/install.ts","../src/utils/validate.ts","../src/commands/remove.ts","../src/commands/update.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\n\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 .name(\"starwind\")\n .description(\"Add beautifully designed components to your Astro applications\")\n .version(\"1.7.1\");\n\nprogram\n .command(\"init\")\n .description(\"Initialize your project with Starwind\")\n .option(\"-d, --defaults\", \"Use default values for all prompts\")\n .action((options) => init(false, { defaults: options.defaults }));\n\nprogram\n .command(\"add\")\n .description(\"Add Starwind components to your project\")\n .argument(\"[components...]\", \"The components to add (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Add all available components\")\n .action(add);\n\nprogram\n .command(\"update\")\n .description(\"Update Starwind components to their latest versions\")\n .argument(\"[components...]\", \"The components to update (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Update all installed components\")\n .option(\"-y, --yes\", \"Skip confirmation prompts\")\n .action(update);\n\nprogram\n .command(\"remove\")\n .description(\"Remove Starwind components from your project\")\n .argument(\"[components...]\", \"The components to remove (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Remove all installed components\")\n .action(remove);\n\nprogram.parse();\n","import * as p from \"@clack/prompts\";\n\nimport 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\";\nconst { init } = await import(\"./init.js\");\n\nexport async function add(components?: string[], options?: { all?: boolean }) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n const shouldInit = await p.confirm({\n message: `Starwind configuration not found. Would you like to run ${highlighter.info(\"starwind init\")} now?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldInit)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n if (shouldInit) {\n await init(true);\n } else {\n p.log.error(\n `Please initialize starwind with ${highlighter.info(\"starwind init\")} before adding components`,\n );\n process.exit(1);\n }\n }\n\n let componentsToInstall: string[] = [];\n\n // ================================================================\n // Get components to install\n // ================================================================\n if (options?.all) {\n // Get all available components\n const availableComponents = await getAllComponents();\n componentsToInstall = availableComponents.map((c) => c.name);\n p.log.info(`Adding all ${componentsToInstall.length} available components...`);\n } else if (components && components.length > 0) {\n // Get all available components once to avoid multiple registry calls\n const availableComponents = await getAllComponents();\n\n // Filter valid components and collect invalid ones\n const { valid, invalid } = await components.reduce<\n Promise<{ valid: string[]; invalid: string[] }>\n >(\n async (accPromise, component) => {\n const acc = await accPromise;\n const isValid = await isValidComponent(component, availableComponents);\n if (isValid) {\n acc.valid.push(component);\n } else {\n acc.invalid.push(component);\n }\n return acc;\n },\n Promise.resolve({ valid: [], invalid: [] }),\n );\n\n // Warn about invalid components\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Invalid components found:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n // Proceed with valid components\n if (valid.length > 0) {\n componentsToInstall = valid;\n } else {\n p.log.warn(`${highlighter.warn(\"No valid components to install\")}`);\n p.cancel(\"Operation cancelled\");\n return process.exit(0);\n }\n } else {\n // If no components provided, show the interactive prompt\n const selected = await selectComponents();\n if (!selected) {\n p.cancel(\"No components selected\");\n return process.exit(0);\n }\n componentsToInstall = selected;\n }\n\n if (componentsToInstall.length === 0) {\n p.log.warn(`${highlighter.warn(\"No components selected\")}`);\n p.cancel(\"Operation cancelled\");\n return process.exit(0);\n }\n\n // confirm installation\n // const confirmed = await p.confirm({\n // \tmessage: `Install ${componentsToInstall\n // \t\t.map((comp) => highlighter.info(comp))\n // \t\t.join(\", \")} ${componentsToInstall.length > 1 ? \"components\" : \"component\"}?`,\n // });\n\n // if (!confirmed || p.isCancel(confirmed)) {\n // \tp.cancel(\"Operation cancelled\");\n // \treturn process.exit(0);\n // }\n\n const results = {\n installed: [] as InstallResult[],\n skipped: [] as InstallResult[],\n failed: [] as InstallResult[],\n };\n\n // ================================================================\n // Install components\n // ================================================================\n const installedComponents = [];\n for (const comp of componentsToInstall) {\n const result = await installComponent(comp);\n switch (result.status) {\n case \"installed\":\n results.installed.push(result);\n installedComponents.push({ name: result.name, version: result.version! });\n break;\n case \"skipped\":\n results.skipped.push(result);\n break;\n case \"failed\":\n results.failed.push(result);\n break;\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n if (installedComponents.length > 0) {\n try {\n await updateConfig({ components: installedComponents }, { appendComponents: true });\n } catch (error) {\n p.log.error(\n `Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n );\n process.exit(1);\n }\n }\n\n // ================================================================\n // Installation summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Installation Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to install components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.skipped.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Skipped components (already installed):\")}\\n${results.skipped\n .map((r) => ` ${r.name} v${r.version}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.installed.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully installed components:\")}\\n${results.installed\n .map((r) => ` ${r.name} v${r.version}`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n p.outro(\"Enjoy using Starwind UI 🚀\");\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n","import * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport semver from \"semver\";\n\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 status: \"installed\" | \"skipped\" | \"failed\";\n name: string;\n version?: string;\n error?: string;\n};\n\nexport interface RemoveResult {\n name: string;\n status: \"removed\" | \"failed\";\n error?: string;\n}\n\nexport interface UpdateResult {\n name: string;\n status: \"updated\" | \"skipped\" | \"failed\";\n oldVersion?: string;\n newVersion?: string;\n error?: 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 const config = await getConfig();\n\n // Ensure components array exists\n const currentComponents = Array.isArray(config.components) ? config.components : [];\n\n // Check if component already exists\n if (!overwrite && currentComponents.some((component) => component.name === name)) {\n const existingComponent = currentComponents.find((c) => c.name === name);\n return {\n status: \"skipped\",\n name,\n version: existingComponent?.version,\n };\n }\n\n const componentDir = path.join(config.componentDir, \"starwind\", name);\n\n try {\n await fs.ensureDir(componentDir);\n\n // Get the path to the installed @starwind/core package\n const pkgUrl = import.meta.resolve?.(PATHS.STARWIND_CORE);\n if (!pkgUrl) {\n throw new Error(`Could not resolve ${PATHS.STARWIND_CORE} package, is it installed?`);\n }\n\n const coreDir = path.dirname(fileURLToPath(pkgUrl));\n const sourceDir = path.join(coreDir, PATHS.STARWIND_CORE_COMPONENTS, name);\n\n const files = await fs.readdir(sourceDir);\n\n for (const file of files) {\n const sourcePath = path.join(sourceDir, file);\n const destPath = path.join(componentDir, file);\n await fs.copy(sourcePath, destPath, { overwrite: true });\n }\n\n // Get component version from registry\n const registry = await getRegistry();\n const componentInfo = registry.find((c) => c.name === name);\n if (!componentInfo) {\n throw new Error(`Component ${name} not found in registry`);\n }\n\n return {\n status: \"installed\",\n name,\n version: componentInfo.version,\n };\n } catch (error) {\n return {\n status: \"failed\",\n name,\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\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 try {\n const componentPath = path.join(componentDir, \"starwind\", name);\n\n // Check if component directory exists\n if (await fs.pathExists(componentPath)) {\n // Remove the component directory\n await fs.remove(componentPath);\n return { name, status: \"removed\" };\n } else {\n return {\n name,\n status: \"failed\",\n error: \"Component directory not found\",\n };\n }\n } catch (error) {\n return {\n name,\n status: \"failed\",\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\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 name: string,\n currentVersion: string,\n skipConfirm?: boolean,\n): Promise<UpdateResult> {\n try {\n // Get latest version from registry\n const registryComponent = await getComponent(name);\n if (!registryComponent) {\n return {\n name,\n status: \"failed\",\n error: \"Component not found in registry\",\n };\n }\n\n // Compare versions\n if (!semver.gt(registryComponent.version, currentVersion)) {\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version,\n };\n }\n\n // Confirm the component update with warning about overriding, unless skipConfirm is true\n let confirmUpdate = true; // Default to true if skipping confirmation\n if (!skipConfirm) {\n // Only prompt if skipConfirm is false or undefined\n const confirmedResult = await p.confirm({\n message: `Update component ${highlighter.info(\n name,\n )} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(\n `v${registryComponent.version}`,\n )}? This will override the existing implementation.`,\n });\n\n // Check for cancellation immediately\n if (p.isCancel(confirmedResult)) {\n p.cancel(\"Update cancelled.\");\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version, // Still useful to return the target version\n };\n }\n\n // If not cancelled, confirmedResult is boolean. Assign it.\n confirmUpdate = confirmedResult;\n }\n\n // Now confirmUpdate is guaranteed to be boolean, proceed with the check\n if (!confirmUpdate) {\n // Handle non-confirmation ('No' was selected)\n p.log.info(`Skipping update for ${highlighter.info(name)}`);\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version,\n };\n }\n\n // Remove and reinstall component with overwrite enabled\n const result = await copyComponent(name, true);\n\n if (result.status === \"installed\") {\n return {\n name,\n status: \"updated\",\n oldVersion: currentVersion,\n newVersion: result.version,\n };\n } else {\n return {\n name,\n status: \"failed\",\n error: result.error || \"Failed to update component\",\n };\n }\n } catch (error) {\n return {\n name,\n status: \"failed\",\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\n}\n","import { registry as localRegistry } from \"@starwind-ui/core\";\nimport { z } from \"zod\";\n\nimport { PATHS } from \"./constants.js\";\n\n// Configuration to select registry source\nconst REGISTRY_CONFIG = {\n // Set to 'remote' to fetch from remote server or 'local' to use the imported registry\n SOURCE: \"local\" as \"remote\" | \"local\",\n};\n\nconst componentSchema = z.object({\n name: z.string(),\n version: z.string(),\n dependencies: z.array(z.string()).default([]),\n type: 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 $schema: z.string().optional(),\n components: 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 const cacheKey =\n REGISTRY_CONFIG.SOURCE === \"remote\"\n ? PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY\n : \"local-registry\";\n\n // Return cached promise if available and refresh not forced\n if (!forceRefresh && registryCache.has(cacheKey)) {\n return registryCache.get(cacheKey)!;\n }\n\n // Create a new promise for the registry operation based on source\n const registryPromise =\n REGISTRY_CONFIG.SOURCE === \"remote\"\n ? fetchRemoteRegistry()\n : Promise.resolve(getLocalRegistry());\n\n // Cache the promise\n registryCache.set(cacheKey, registryPromise);\n\n return registryPromise;\n}\n\n/**\n * Internal function to fetch the registry from the remote server\n */\nasync function fetchRemoteRegistry(): Promise<Component[]> {\n try {\n const response = await fetch(PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch registry: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n const parsedRegistry = registryRootSchema.parse(data);\n\n return parsedRegistry.components;\n } catch (error) {\n console.error(\"Failed to load remote registry:\", error);\n throw error;\n }\n}\n\n/**\n * Internal function to get the registry from the local import\n */\nfunction getLocalRegistry(): Component[] {\n try {\n // Validate the local registry with the schema\n const components = localRegistry.map((comp) => componentSchema.parse(comp));\n return components;\n } catch (error) {\n console.error(\"Failed to validate local registry:\", error);\n throw error;\n }\n}\n\n/**\n * Clear the registry cache\n */\nexport function clearRegistryCache(): void {\n registryCache.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 name: string,\n forceRefresh = false,\n): Promise<Component | undefined> {\n const registry = await getRegistry(forceRefresh);\n return 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 return 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 if (REGISTRY_CONFIG.SOURCE !== source) {\n REGISTRY_CONFIG.SOURCE = source;\n clearRegistryCache(); // Clear cache when changing sources\n }\n}\n","import { confirm, multiselect } from \"@clack/prompts\";\n\nimport type { Component } from \"./registry.js\";\nimport { getAllComponents } from \"./registry.js\";\n\nexport async function selectComponents(): Promise<string[]> {\n const components = await getAllComponents();\n\n const selected = await multiselect({\n message: \"Select components to add\",\n options: components.map((component) => ({\n label: component.name,\n value: component.name,\n })),\n required: false,\n });\n\n // Return empty array if user cancels selection\n if (typeof selected === \"symbol\") {\n return [];\n }\n\n return selected;\n}\n\nexport async function confirmInstall(component: Component): Promise<boolean> {\n if (component.dependencies.length === 0) return true;\n\n const confirmed = await confirm({\n message: `This component requires the following dependencies: ${component.dependencies.join(\", \")}. Install them?`,\n });\n\n if (typeof confirmed === \"symbol\") {\n return false;\n }\n\n return confirmed;\n}\n","import { copyComponent, type InstallResult } 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 const component = await getComponent(name);\n\n if (!component) {\n return {\n status: \"failed\",\n name,\n error: \"Component not found in registry\",\n };\n }\n\n // Handle dependencies installation\n if (component.dependencies.length > 0) {\n const confirmed = await confirmInstall(component);\n if (!confirmed) {\n return {\n status: \"failed\",\n name,\n error: \"Installation cancelled by user\",\n };\n }\n\n try {\n const pm = await requestPackageManager();\n await installDependencies(component.dependencies, pm);\n } catch (error) {\n return {\n status: \"failed\",\n name,\n error: `Failed to install dependencies: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n // Copy the component files\n return 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 component: string,\n availableComponents?: Component[],\n): Promise<boolean> {\n const components = availableComponents || (await getAllComponents());\n return 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 const components = await getAllComponents();\n if (!(await isValidComponent(component, components))) {\n const availableComponents = components.map((c) => highlighter.info(c.name));\n throw new Error(\n `Invalid component: ${highlighter.error(component)}.\\nAvailable components:\\n ${availableComponents.join(\"\\n \")}`,\n );\n }\n}\n","import * as p from \"@clack/prompts\";\n\nimport { removeComponent, type RemoveResult } 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\";\n\nexport async function remove(components?: string[], options?: { all?: boolean }) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n p.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n process.exit(1);\n }\n\n // Get current config and installed components\n const config = await getConfig();\n const installedComponents = config.components;\n\n if (installedComponents.length === 0) {\n p.log.warn(\"No components are currently installed.\");\n process.exit(0);\n }\n\n let componentsToRemove: string[] = [];\n\n // ================================================================\n // Get components to remove\n // ================================================================\n if (options?.all) {\n // Remove all installed components\n componentsToRemove = installedComponents.map((comp) => comp.name);\n p.log.info(`Removing all ${componentsToRemove.length} installed components...`);\n } else if (components && components.length > 0) {\n // Validate that all specified components are installed\n const invalid = components.filter(\n (comp) => !installedComponents.some((ic) => ic.name === comp),\n );\n\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Components not found:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n componentsToRemove = components.filter((comp) =>\n installedComponents.some((ic) => ic.name === comp),\n );\n\n if (componentsToRemove.length === 0) {\n p.log.warn(\"No valid components to remove\");\n process.exit(0);\n }\n } else {\n // Show interactive prompt with installed components\n const choices = installedComponents.map((comp) => ({\n value: comp.name,\n label: comp.name,\n }));\n\n const selected = await p.multiselect({\n message: \"Select components to remove\",\n options: choices,\n });\n\n if (p.isCancel(selected)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n componentsToRemove = selected as string[];\n }\n\n if (componentsToRemove.length === 0) {\n p.log.warn(\"No components selected for removal\");\n process.exit(0);\n }\n\n // Confirm removal\n const confirmed = await p.confirm({\n message: `Remove ${componentsToRemove\n .map((comp) => highlighter.info(comp))\n .join(\", \")} ${componentsToRemove.length > 1 ? \"components\" : \"component\"}?`,\n });\n\n if (!confirmed || p.isCancel(confirmed)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n const results = {\n removed: [] as RemoveResult[],\n failed: [] as RemoveResult[],\n };\n\n // ================================================================\n // Remove Components\n // ================================================================\n for (const comp of componentsToRemove) {\n const result = await removeComponent(comp, config.componentDir);\n if (result.status === \"removed\") {\n results.removed.push(result);\n } else {\n results.failed.push(result);\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n // Update config file by writing the filtered components directly\n const updatedComponents = config.components.filter(\n (comp) => !componentsToRemove.includes(comp.name),\n );\n await updateConfig(\n {\n ...config,\n components: updatedComponents,\n },\n { appendComponents: false },\n );\n\n // ================================================================\n // Removal summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Removal Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to remove components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.removed.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully removed components:\")}\\n${results.removed\n .map((r) => ` ${r.name}`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n if (results.removed.length > 0) {\n p.outro(\"Components removed successfully 🗑️\");\n } else {\n p.cancel(\"Errors occurred while removing components\");\n process.exit(1);\n }\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to remove components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n","import * as p from \"@clack/prompts\";\n\nimport { updateComponent, type UpdateResult } 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\";\n\n// Define the type for options more explicitly\ninterface UpdateOptions {\n all?: boolean;\n yes?: boolean;\n}\n\nexport async function update(components?: string[], options?: UpdateOptions) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n p.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n process.exit(1);\n }\n\n // Get current config and installed components\n const config = await getConfig();\n const installedComponents = config.components;\n\n if (installedComponents.length === 0) {\n p.log.warn(\"No components are currently installed.\");\n process.exit(0);\n }\n\n let componentsToUpdate: string[] = [];\n\n // ================================================================\n // Get components to update\n // ================================================================\n if (options?.all) {\n // Update all installed components\n componentsToUpdate = installedComponents.map((comp) => comp.name);\n p.log.info(`Checking updates for all ${componentsToUpdate.length} installed components...`);\n } else if (components && components.length > 0) {\n // Validate that all specified components are installed\n const invalid = components.filter(\n (comp) => !installedComponents.some((ic) => ic.name === comp),\n );\n\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Components not found in project:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n componentsToUpdate = components.filter((comp) =>\n installedComponents.some((ic) => ic.name === comp),\n );\n\n if (componentsToUpdate.length === 0) {\n p.log.warn(\"No valid components to update\");\n process.exit(0);\n }\n } else {\n // Show interactive prompt with installed components\n const choices = installedComponents.map((comp) => ({\n value: comp.name,\n label: comp.name,\n }));\n\n const selected = await p.multiselect({\n message: \"Select components to update\",\n options: choices,\n });\n\n if (p.isCancel(selected)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n componentsToUpdate = selected as string[];\n }\n\n if (componentsToUpdate.length === 0) {\n p.log.warn(\"No components selected for update\");\n process.exit(0);\n }\n\n const results = {\n updated: [] as UpdateResult[],\n skipped: [] as UpdateResult[],\n failed: [] as UpdateResult[],\n };\n\n // ================================================================\n // Update Components\n // ================================================================\n for (const comp of componentsToUpdate) {\n const currentVersion = installedComponents.find((ic) => ic.name === comp)?.version;\n if (!currentVersion) {\n results.failed.push({\n name: comp,\n status: \"failed\",\n error: \"Could not determine current version\",\n });\n continue;\n }\n\n // Pass the 'yes' option down to updateComponent\n const result = await updateComponent(comp, currentVersion, options?.yes);\n switch (result.status) {\n case \"updated\":\n results.updated.push(result);\n break;\n case \"skipped\":\n results.skipped.push(result);\n break;\n case \"failed\":\n results.failed.push(result);\n break;\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n if (results.updated.length > 0) {\n try {\n // Create a map of current components, excluding updated ones\n const updatedComponentNames = new Set(results.updated.map((r) => r.name));\n const currentComponents = config.components.filter(\n (comp) => !updatedComponentNames.has(comp.name),\n );\n\n // Add the updated components with their new versions\n const updatedComponents = [\n ...currentComponents,\n ...results.updated.map((r) => ({\n name: r.name,\n version: r.newVersion!,\n })),\n ];\n\n await updateConfig(\n {\n components: updatedComponents,\n },\n { appendComponents: false },\n );\n } catch (error) {\n p.log.error(\n `Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n );\n process.exit(1);\n }\n }\n\n // ================================================================\n // Update summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Update Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to update components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.skipped.length > 0) {\n p.log.info(\n `${highlighter.info(\"Components already up to date or skipped:\")}\\n${results.skipped\n .map((r) => ` ${r.name} (${r.oldVersion})`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.updated.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully updated components:\")}\\n${results.updated\n .map((r) => ` ${r.name} (${r.oldVersion} → ${r.newVersion})`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n if (results.updated.length > 0) {\n p.outro(\"Components updated successfully 🚀\");\n } else if (results.skipped.length > 0 && results.failed.length === 0) {\n p.outro(\"Components already up to date or skipped ✨\");\n } else {\n p.cancel(\"No components were updated\");\n process.exit(1);\n }\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to update components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,SAAS,eAAe;;;ACDxB,YAAYA,QAAO;;;ACAnB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAE9B,YAAY,OAAO;AACnB,OAAO,QAAQ;AACf,OAAO,YAAY;;;ACLnB,SAAS,YAAY,qBAAqB;AAC1C,SAAS,SAAS;AAKlB,IAAM,kBAAkB;AAAA;AAAA,EAEtB,QAAQ;AACV;AAEA,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,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;AAC5B,CAAC;AAKD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,YAAY,EAAE,MAAM,eAAe;AACrC,CAAC;AAGD,IAAM,gBAAgB,oBAAI,IAAkC;AAO5D,eAAsB,YAAY,eAAe,OAA6B;AAC5E,QAAM,WACJ,gBAAgB,WAAW,WACvB,MAAM,qCACN;AAGN,MAAI,CAAC,gBAAgB,cAAc,IAAI,QAAQ,GAAG;AAChD,WAAO,cAAc,IAAI,QAAQ;AAAA,EACnC;AAGA,QAAM,kBACJ,gBAAgB,WAAW,WACvB,oBAAoB,IACpB,QAAQ,QAAQ,iBAAiB,CAAC;AAGxC,gBAAc,IAAI,UAAU,eAAe;AAE3C,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Q,QAAQ,SAAS,KAAK,QAAQ,OAAO,WAAW,GAAG;AACpE,MAAE,SAAM,iDAA4C;AAAA,IACtD,OAAO;AACL,MAAE,UAAO,4BAA4B;AACrC,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,SAAS,OAAO;AACd,IAAE,OAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,6BAA6B;AAClF,IAAE,UAAO,qBAAqB;AAC9B,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;;;ARtMA,IAAM,UAAU,IAAI,QAAQ,EACzB,KAAK,UAAU,EACf,YAAY,gEAAgE,EAC5E,QAAQ,OAAO;AAElB,QACG,QAAQ,MAAM,EACd,YAAY,uCAAuC,EACnD,OAAO,kBAAkB,oCAAoC,EAC7D,OAAO,CAAC,YAAY,KAAK,OAAO,EAAE,UAAU,QAAQ,SAAS,CAAC,CAAC;AAElE,QACG,QAAQ,KAAK,EACb,YAAY,yCAAyC,EACrD,SAAS,mBAAmB,yCAAyC,EACrE,qBAAqB,EACrB,OAAO,aAAa,8BAA8B,EAClD,OAAO,GAAG;AAEb,QACG,QAAQ,QAAQ,EAChB,YAAY,qDAAqD,EACjE,SAAS,mBAAmB,4CAA4C,EACxE,qBAAqB,EACrB,OAAO,aAAa,iCAAiC,EACrD,OAAO,aAAa,2BAA2B,EAC/C,OAAO,MAAM;AAEhB,QACG,QAAQ,QAAQ,EAChB,YAAY,8CAA8C,EAC1D,SAAS,mBAAmB,4CAA4C,EACxE,qBAAqB,EACrB,OAAO,aAAa,iCAAiC,EACrD,OAAO,MAAM;AAEhB,QAAQ,MAAM;","names":["p","confirm","confirm","init","p","p"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/add.ts","../src/utils/component.ts","../src/utils/registry.ts","../src/utils/prompts.ts","../src/utils/install.ts","../src/utils/validate.ts","../src/commands/remove.ts","../src/commands/update.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\n\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 .name(\"starwind\")\n .description(\"Add beautifully designed components to your Astro applications\")\n .version(\"1.7.3\");\n\nprogram\n .command(\"init\")\n .description(\"Initialize your project with Starwind\")\n .option(\"-d, --defaults\", \"Use default values for all prompts\")\n .action((options) => init(false, { defaults: options.defaults }));\n\nprogram\n .command(\"add\")\n .description(\"Add Starwind components to your project\")\n .argument(\"[components...]\", \"The components to add (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Add all available components\")\n .action(add);\n\nprogram\n .command(\"update\")\n .description(\"Update Starwind components to their latest versions\")\n .argument(\"[components...]\", \"The components to update (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Update all installed components\")\n .option(\"-y, --yes\", \"Skip confirmation prompts\")\n .action(update);\n\nprogram\n .command(\"remove\")\n .description(\"Remove Starwind components from your project\")\n .argument(\"[components...]\", \"The components to remove (space separated)\")\n .allowExcessArguments()\n .option(\"-a, --all\", \"Remove all installed components\")\n .action(remove);\n\nprogram.parse();\n","import * as p from \"@clack/prompts\";\n\nimport 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\";\nconst { init } = await import(\"./init.js\");\n\nexport async function add(components?: string[], options?: { all?: boolean }) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n const shouldInit = await p.confirm({\n message: `Starwind configuration not found. Would you like to run ${highlighter.info(\"starwind init\")} now?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldInit)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n if (shouldInit) {\n await init(true);\n } else {\n p.log.error(\n `Please initialize starwind with ${highlighter.info(\"starwind init\")} before adding components`,\n );\n process.exit(1);\n }\n }\n\n let componentsToInstall: string[] = [];\n\n // ================================================================\n // Get components to install\n // ================================================================\n if (options?.all) {\n // Get all available components\n const availableComponents = await getAllComponents();\n componentsToInstall = availableComponents.map((c) => c.name);\n p.log.info(`Adding all ${componentsToInstall.length} available components...`);\n } else if (components && components.length > 0) {\n // Get all available components once to avoid multiple registry calls\n const availableComponents = await getAllComponents();\n\n // Filter valid components and collect invalid ones\n const { valid, invalid } = await components.reduce<\n Promise<{ valid: string[]; invalid: string[] }>\n >(\n async (accPromise, component) => {\n const acc = await accPromise;\n const isValid = await isValidComponent(component, availableComponents);\n if (isValid) {\n acc.valid.push(component);\n } else {\n acc.invalid.push(component);\n }\n return acc;\n },\n Promise.resolve({ valid: [], invalid: [] }),\n );\n\n // Warn about invalid components\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Invalid components found:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n // Proceed with valid components\n if (valid.length > 0) {\n componentsToInstall = valid;\n } else {\n p.log.warn(`${highlighter.warn(\"No valid components to install\")}`);\n p.cancel(\"Operation cancelled\");\n return process.exit(0);\n }\n } else {\n // If no components provided, show the interactive prompt\n const selected = await selectComponents();\n if (!selected) {\n p.cancel(\"No components selected\");\n return process.exit(0);\n }\n componentsToInstall = selected;\n }\n\n if (componentsToInstall.length === 0) {\n p.log.warn(`${highlighter.warn(\"No components selected\")}`);\n p.cancel(\"Operation cancelled\");\n return process.exit(0);\n }\n\n // confirm installation\n // const confirmed = await p.confirm({\n // \tmessage: `Install ${componentsToInstall\n // \t\t.map((comp) => highlighter.info(comp))\n // \t\t.join(\", \")} ${componentsToInstall.length > 1 ? \"components\" : \"component\"}?`,\n // });\n\n // if (!confirmed || p.isCancel(confirmed)) {\n // \tp.cancel(\"Operation cancelled\");\n // \treturn process.exit(0);\n // }\n\n const results = {\n installed: [] as InstallResult[],\n skipped: [] as InstallResult[],\n failed: [] as InstallResult[],\n };\n\n // ================================================================\n // Install components\n // ================================================================\n const installedComponents = [];\n for (const comp of componentsToInstall) {\n const result = await installComponent(comp);\n switch (result.status) {\n case \"installed\":\n results.installed.push(result);\n installedComponents.push({ name: result.name, version: result.version! });\n break;\n case \"skipped\":\n results.skipped.push(result);\n break;\n case \"failed\":\n results.failed.push(result);\n break;\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n if (installedComponents.length > 0) {\n try {\n await updateConfig({ components: installedComponents }, { appendComponents: true });\n } catch (error) {\n p.log.error(\n `Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n );\n process.exit(1);\n }\n }\n\n // ================================================================\n // Installation summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Installation Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to install components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.skipped.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Skipped components (already installed):\")}\\n${results.skipped\n .map((r) => ` ${r.name} v${r.version}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.installed.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully installed components:\")}\\n${results.installed\n .map((r) => ` ${r.name} v${r.version}`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n p.outro(\"Enjoy using Starwind UI 🚀\");\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to add components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n","import * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport semver from \"semver\";\n\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 status: \"installed\" | \"skipped\" | \"failed\";\n name: string;\n version?: string;\n error?: string;\n};\n\nexport interface RemoveResult {\n name: string;\n status: \"removed\" | \"failed\";\n error?: string;\n}\n\nexport interface UpdateResult {\n name: string;\n status: \"updated\" | \"skipped\" | \"failed\";\n oldVersion?: string;\n newVersion?: string;\n error?: 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 const config = await getConfig();\n\n // Ensure components array exists\n const currentComponents = Array.isArray(config.components) ? config.components : [];\n\n // Check if component already exists\n if (!overwrite && currentComponents.some((component) => component.name === name)) {\n const existingComponent = currentComponents.find((c) => c.name === name);\n return {\n status: \"skipped\",\n name,\n version: existingComponent?.version,\n };\n }\n\n const componentDir = path.join(config.componentDir, \"starwind\", name);\n\n try {\n await fs.ensureDir(componentDir);\n\n // Get the path to the installed @starwind/core package\n const pkgUrl = import.meta.resolve?.(PATHS.STARWIND_CORE);\n if (!pkgUrl) {\n throw new Error(`Could not resolve ${PATHS.STARWIND_CORE} package, is it installed?`);\n }\n\n const coreDir = path.dirname(fileURLToPath(pkgUrl));\n const sourceDir = path.join(coreDir, PATHS.STARWIND_CORE_COMPONENTS, name);\n\n const files = await fs.readdir(sourceDir);\n\n for (const file of files) {\n const sourcePath = path.join(sourceDir, file);\n const destPath = path.join(componentDir, file);\n await fs.copy(sourcePath, destPath, { overwrite: true });\n }\n\n // Get component version from registry\n const registry = await getRegistry();\n const componentInfo = registry.find((c) => c.name === name);\n if (!componentInfo) {\n throw new Error(`Component ${name} not found in registry`);\n }\n\n return {\n status: \"installed\",\n name,\n version: componentInfo.version,\n };\n } catch (error) {\n return {\n status: \"failed\",\n name,\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\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 try {\n const componentPath = path.join(componentDir, \"starwind\", name);\n\n // Check if component directory exists\n if (await fs.pathExists(componentPath)) {\n // Remove the component directory\n await fs.remove(componentPath);\n return { name, status: \"removed\" };\n } else {\n return {\n name,\n status: \"failed\",\n error: \"Component directory not found\",\n };\n }\n } catch (error) {\n return {\n name,\n status: \"failed\",\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\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 name: string,\n currentVersion: string,\n skipConfirm?: boolean,\n): Promise<UpdateResult> {\n try {\n // Get latest version from registry\n const registryComponent = await getComponent(name);\n if (!registryComponent) {\n return {\n name,\n status: \"failed\",\n error: \"Component not found in registry\",\n };\n }\n\n // Compare versions\n if (!semver.gt(registryComponent.version, currentVersion)) {\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version,\n };\n }\n\n // Confirm the component update with warning about overriding, unless skipConfirm is true\n let confirmUpdate = true; // Default to true if skipping confirmation\n if (!skipConfirm) {\n // Only prompt if skipConfirm is false or undefined\n const confirmedResult = await p.confirm({\n message: `Update component ${highlighter.info(\n name,\n )} from ${highlighter.warn(`v${currentVersion}`)} to ${highlighter.success(\n `v${registryComponent.version}`,\n )}? This will override the existing implementation.`,\n });\n\n // Check for cancellation immediately\n if (p.isCancel(confirmedResult)) {\n p.cancel(\"Update cancelled.\");\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version, // Still useful to return the target version\n };\n }\n\n // If not cancelled, confirmedResult is boolean. Assign it.\n confirmUpdate = confirmedResult;\n }\n\n // Now confirmUpdate is guaranteed to be boolean, proceed with the check\n if (!confirmUpdate) {\n // Handle non-confirmation ('No' was selected)\n p.log.info(`Skipping update for ${highlighter.info(name)}`);\n return {\n name,\n status: \"skipped\",\n oldVersion: currentVersion,\n newVersion: registryComponent.version,\n };\n }\n\n // Remove and reinstall component with overwrite enabled\n const result = await copyComponent(name, true);\n\n if (result.status === \"installed\") {\n return {\n name,\n status: \"updated\",\n oldVersion: currentVersion,\n newVersion: result.version,\n };\n } else {\n return {\n name,\n status: \"failed\",\n error: result.error || \"Failed to update component\",\n };\n }\n } catch (error) {\n return {\n name,\n status: \"failed\",\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\n}\n","import { registry as localRegistry } from \"@starwind-ui/core\";\nimport { z } from \"zod\";\n\nimport { PATHS } from \"./constants.js\";\n\n// Configuration to select registry source\nconst REGISTRY_CONFIG = {\n // Set to 'remote' to fetch from remote server or 'local' to use the imported registry\n SOURCE: \"local\" as \"remote\" | \"local\",\n};\n\nconst componentSchema = z.object({\n name: z.string(),\n version: z.string(),\n dependencies: z.array(z.string()).default([]),\n type: 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 $schema: z.string().optional(),\n components: 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 const cacheKey =\n REGISTRY_CONFIG.SOURCE === \"remote\"\n ? PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY\n : \"local-registry\";\n\n // Return cached promise if available and refresh not forced\n if (!forceRefresh && registryCache.has(cacheKey)) {\n return registryCache.get(cacheKey)!;\n }\n\n // Create a new promise for the registry operation based on source\n const registryPromise =\n REGISTRY_CONFIG.SOURCE === \"remote\"\n ? fetchRemoteRegistry()\n : Promise.resolve(getLocalRegistry());\n\n // Cache the promise\n registryCache.set(cacheKey, registryPromise);\n\n return registryPromise;\n}\n\n/**\n * Internal function to fetch the registry from the remote server\n */\nasync function fetchRemoteRegistry(): Promise<Component[]> {\n try {\n const response = await fetch(PATHS.STARWIND_REMOTE_COMPONENT_REGISTRY);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch registry: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n const parsedRegistry = registryRootSchema.parse(data);\n\n return parsedRegistry.components;\n } catch (error) {\n console.error(\"Failed to load remote registry:\", error);\n throw error;\n }\n}\n\n/**\n * Internal function to get the registry from the local import\n */\nfunction getLocalRegistry(): Component[] {\n try {\n // Validate the local registry with the schema\n const components = localRegistry.map((comp) => componentSchema.parse(comp));\n return components;\n } catch (error) {\n console.error(\"Failed to validate local registry:\", error);\n throw error;\n }\n}\n\n/**\n * Clear the registry cache\n */\nexport function clearRegistryCache(): void {\n registryCache.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 name: string,\n forceRefresh = false,\n): Promise<Component | undefined> {\n const registry = await getRegistry(forceRefresh);\n return 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 return 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 if (REGISTRY_CONFIG.SOURCE !== source) {\n REGISTRY_CONFIG.SOURCE = source;\n clearRegistryCache(); // Clear cache when changing sources\n }\n}\n","import { confirm, multiselect } from \"@clack/prompts\";\n\nimport type { Component } from \"./registry.js\";\nimport { getAllComponents } from \"./registry.js\";\n\nexport async function selectComponents(): Promise<string[]> {\n const components = await getAllComponents();\n\n const selected = await multiselect({\n message: \"Select components to add\",\n options: components.map((component) => ({\n label: component.name,\n value: component.name,\n })),\n required: false,\n });\n\n // Return empty array if user cancels selection\n if (typeof selected === \"symbol\") {\n return [];\n }\n\n return selected;\n}\n\nexport async function confirmInstall(component: Component): Promise<boolean> {\n if (component.dependencies.length === 0) return true;\n\n const confirmed = await confirm({\n message: `This component requires the following dependencies: ${component.dependencies.join(\", \")}. Install them?`,\n });\n\n if (typeof confirmed === \"symbol\") {\n return false;\n }\n\n return confirmed;\n}\n","import { copyComponent, type InstallResult } 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 const component = await getComponent(name);\n\n if (!component) {\n return {\n status: \"failed\",\n name,\n error: \"Component not found in registry\",\n };\n }\n\n // Handle dependencies installation\n if (component.dependencies.length > 0) {\n const confirmed = await confirmInstall(component);\n if (!confirmed) {\n return {\n status: \"failed\",\n name,\n error: \"Installation cancelled by user\",\n };\n }\n\n try {\n const pm = await requestPackageManager();\n await installDependencies(component.dependencies, pm);\n } catch (error) {\n return {\n status: \"failed\",\n name,\n error: `Failed to install dependencies: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n // Copy the component files\n return 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 component: string,\n availableComponents?: Component[],\n): Promise<boolean> {\n const components = availableComponents || (await getAllComponents());\n return 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 const components = await getAllComponents();\n if (!(await isValidComponent(component, components))) {\n const availableComponents = components.map((c) => highlighter.info(c.name));\n throw new Error(\n `Invalid component: ${highlighter.error(component)}.\\nAvailable components:\\n ${availableComponents.join(\"\\n \")}`,\n );\n }\n}\n","import * as p from \"@clack/prompts\";\n\nimport { removeComponent, type RemoveResult } 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\";\n\nexport async function remove(components?: string[], options?: { all?: boolean }) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n p.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n process.exit(1);\n }\n\n // Get current config and installed components\n const config = await getConfig();\n const installedComponents = config.components;\n\n if (installedComponents.length === 0) {\n p.log.warn(\"No components are currently installed.\");\n process.exit(0);\n }\n\n let componentsToRemove: string[] = [];\n\n // ================================================================\n // Get components to remove\n // ================================================================\n if (options?.all) {\n // Remove all installed components\n componentsToRemove = installedComponents.map((comp) => comp.name);\n p.log.info(`Removing all ${componentsToRemove.length} installed components...`);\n } else if (components && components.length > 0) {\n // Validate that all specified components are installed\n const invalid = components.filter(\n (comp) => !installedComponents.some((ic) => ic.name === comp),\n );\n\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Components not found:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n componentsToRemove = components.filter((comp) =>\n installedComponents.some((ic) => ic.name === comp),\n );\n\n if (componentsToRemove.length === 0) {\n p.log.warn(\"No valid components to remove\");\n process.exit(0);\n }\n } else {\n // Show interactive prompt with installed components\n const choices = installedComponents.map((comp) => ({\n value: comp.name,\n label: comp.name,\n }));\n\n const selected = await p.multiselect({\n message: \"Select components to remove\",\n options: choices,\n });\n\n if (p.isCancel(selected)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n componentsToRemove = selected as string[];\n }\n\n if (componentsToRemove.length === 0) {\n p.log.warn(\"No components selected for removal\");\n process.exit(0);\n }\n\n // Confirm removal\n const confirmed = await p.confirm({\n message: `Remove ${componentsToRemove\n .map((comp) => highlighter.info(comp))\n .join(\", \")} ${componentsToRemove.length > 1 ? \"components\" : \"component\"}?`,\n });\n\n if (!confirmed || p.isCancel(confirmed)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n const results = {\n removed: [] as RemoveResult[],\n failed: [] as RemoveResult[],\n };\n\n // ================================================================\n // Remove Components\n // ================================================================\n for (const comp of componentsToRemove) {\n const result = await removeComponent(comp, config.componentDir);\n if (result.status === \"removed\") {\n results.removed.push(result);\n } else {\n results.failed.push(result);\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n // Update config file by writing the filtered components directly\n const updatedComponents = config.components.filter(\n (comp) => !componentsToRemove.includes(comp.name),\n );\n await updateConfig(\n {\n ...config,\n components: updatedComponents,\n },\n { appendComponents: false },\n );\n\n // ================================================================\n // Removal summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Removal Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to remove components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.removed.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully removed components:\")}\\n${results.removed\n .map((r) => ` ${r.name}`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n if (results.removed.length > 0) {\n p.outro(\"Components removed successfully 🗑️\");\n } else {\n p.cancel(\"Errors occurred while removing components\");\n process.exit(1);\n }\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to remove components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n","import * as p from \"@clack/prompts\";\n\nimport { updateComponent, type UpdateResult } 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\";\n\n// Define the type for options more explicitly\ninterface UpdateOptions {\n all?: boolean;\n yes?: boolean;\n}\n\nexport async function update(components?: string[], options?: UpdateOptions) {\n try {\n p.intro(highlighter.title(\" Welcome to the Starwind CLI \"));\n\n // Check if starwind.config.json exists\n const configExists = await fileExists(PATHS.LOCAL_CONFIG_FILE);\n\n if (!configExists) {\n p.log.error(\"No Starwind configuration found. Please run starwind init first.\");\n process.exit(1);\n }\n\n // Get current config and installed components\n const config = await getConfig();\n const installedComponents = config.components;\n\n if (installedComponents.length === 0) {\n p.log.warn(\"No components are currently installed.\");\n process.exit(0);\n }\n\n let componentsToUpdate: string[] = [];\n\n // ================================================================\n // Get components to update\n // ================================================================\n if (options?.all) {\n // Update all installed components\n componentsToUpdate = installedComponents.map((comp) => comp.name);\n p.log.info(`Checking updates for all ${componentsToUpdate.length} installed components...`);\n } else if (components && components.length > 0) {\n // Validate that all specified components are installed\n const invalid = components.filter(\n (comp) => !installedComponents.some((ic) => ic.name === comp),\n );\n\n if (invalid.length > 0) {\n p.log.warn(\n `${highlighter.warn(\"Components not found in project:\")}\\n${invalid\n .map((name) => ` ${name}`)\n .join(\"\\n\")}`,\n );\n }\n\n componentsToUpdate = components.filter((comp) =>\n installedComponents.some((ic) => ic.name === comp),\n );\n\n if (componentsToUpdate.length === 0) {\n p.log.warn(\"No valid components to update\");\n process.exit(0);\n }\n } else {\n // Show interactive prompt with installed components\n const choices = installedComponents.map((comp) => ({\n value: comp.name,\n label: comp.name,\n }));\n\n const selected = await p.multiselect({\n message: \"Select components to update\",\n options: choices,\n });\n\n if (p.isCancel(selected)) {\n p.cancel(\"Operation cancelled\");\n process.exit(0);\n }\n\n componentsToUpdate = selected as string[];\n }\n\n if (componentsToUpdate.length === 0) {\n p.log.warn(\"No components selected for update\");\n process.exit(0);\n }\n\n const results = {\n updated: [] as UpdateResult[],\n skipped: [] as UpdateResult[],\n failed: [] as UpdateResult[],\n };\n\n // ================================================================\n // Update Components\n // ================================================================\n for (const comp of componentsToUpdate) {\n const currentVersion = installedComponents.find((ic) => ic.name === comp)?.version;\n if (!currentVersion) {\n results.failed.push({\n name: comp,\n status: \"failed\",\n error: \"Could not determine current version\",\n });\n continue;\n }\n\n // Pass the 'yes' option down to updateComponent\n const result = await updateComponent(comp, currentVersion, options?.yes);\n switch (result.status) {\n case \"updated\":\n results.updated.push(result);\n break;\n case \"skipped\":\n results.skipped.push(result);\n break;\n case \"failed\":\n results.failed.push(result);\n break;\n }\n }\n\n // ================================================================\n // Update Config File\n // ================================================================\n if (results.updated.length > 0) {\n try {\n // Create a map of current components, excluding updated ones\n const updatedComponentNames = new Set(results.updated.map((r) => r.name));\n const currentComponents = config.components.filter(\n (comp) => !updatedComponentNames.has(comp.name),\n );\n\n // Add the updated components with their new versions\n const updatedComponents = [\n ...currentComponents,\n ...results.updated.map((r) => ({\n name: r.name,\n version: r.newVersion!,\n })),\n ];\n\n await updateConfig(\n {\n components: updatedComponents,\n },\n { appendComponents: false },\n );\n } catch (error) {\n p.log.error(\n `Failed to update config: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n );\n process.exit(1);\n }\n }\n\n // ================================================================\n // Update summary\n // ================================================================\n p.log.message(`\\n\\n${highlighter.underline(\"Update Summary\")}`);\n\n if (results.failed.length > 0) {\n p.log.error(\n `${highlighter.error(\"Failed to update components:\")}\\n${results.failed\n .map((r) => ` ${r.name} - ${r.error}`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.skipped.length > 0) {\n p.log.info(\n `${highlighter.info(\"Components already up to date or skipped:\")}\\n${results.skipped\n .map((r) => ` ${r.name} (${r.oldVersion})`)\n .join(\"\\n\")}`,\n );\n }\n\n if (results.updated.length > 0) {\n p.log.success(\n `${highlighter.success(\"Successfully updated components:\")}\\n${results.updated\n .map((r) => ` ${r.name} (${r.oldVersion} → ${r.newVersion})`)\n .join(\"\\n\")}`,\n );\n }\n\n await sleep(1000);\n\n if (results.updated.length > 0) {\n p.outro(\"Components updated successfully 🚀\");\n } else if (results.skipped.length > 0 && results.failed.length === 0) {\n p.outro(\"Components already up to date or skipped ✨\");\n } else {\n p.cancel(\"No components were updated\");\n process.exit(1);\n }\n } catch (error) {\n p.log.error(error instanceof Error ? error.message : \"Failed to update components\");\n p.cancel(\"Operation cancelled\");\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,SAAS,eAAe;;;ACDxB,YAAYA,QAAO;;;ACAnB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAE9B,YAAY,OAAO;AACnB,OAAO,QAAQ;AACf,OAAO,YAAY;;;ACLnB,SAAS,YAAY,qBAAqB;AAC1C,SAAS,SAAS;AAKlB,IAAM,kBAAkB;AAAA;AAAA,EAEtB,QAAQ;AACV;AAEA,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,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;AAC5B,CAAC;AAKD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,YAAY,EAAE,MAAM,eAAe;AACrC,CAAC;AAGD,IAAM,gBAAgB,oBAAI,IAAkC;AAO5D,eAAsB,YAAY,eAAe,OAA6B;AAC5E,QAAM,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AEhB,QAAQ,MAAM;","names":["p","confirm","confirm","init","p","p"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starwind",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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.11.0",
|
|
36
|
-
"@starwind-ui/core": "1.7.
|
|
36
|
+
"@starwind-ui/core": "1.7.3",
|
|
37
37
|
"chalk": "5.4.1",
|
|
38
38
|
"commander": "14.0.0",
|
|
39
39
|
"execa": "9.6.0",
|