@foundrykit/cli 0.1.1 → 1.0.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.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/commands/list.ts","../src/commands/add.ts","../src/commands/update.ts","../src/commands/doctor.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { initCommand } from './commands/init.js';\nimport { listCommand } from './commands/list.js';\nimport { addCommand } from './commands/add.js';\nimport { updateCommand } from './commands/update.js';\nimport { doctorCommand } from './commands/doctor.js';\n\nconst program = new Command();\n\nprogram\n .name('foundrykit')\n .description('FoundryKit CLI - Component library management tool')\n .version('0.1.0');\n\n// Add commands\nprogram.addCommand(initCommand());\nprogram.addCommand(listCommand());\nprogram.addCommand(addCommand());\nprogram.addCommand(updateCommand());\nprogram.addCommand(doctorCommand());\n\nprogram.parse();\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport inquirer from 'inquirer';\n\ninterface InitOptions {\n force?: boolean;\n skipInstall?: boolean;\n}\n\nexport function initCommand() {\n return new Command('init')\n .description('Initialize FoundryKit in your Next.js project')\n .option('-f, --force', 'overwrite existing files')\n .option('--skip-install', 'skip installing dependencies')\n .action(async (options: InitOptions) => {\n try {\n console.log(chalk.blue('šŸš€ Initializing FoundryKit...'));\n\n // Check if it's a Next.js project\n await validateNextJsProject();\n\n // Check if already initialized\n if (!options.force && (await isFoundryKitInitialized())) {\n const { shouldContinue } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'shouldContinue',\n message: 'FoundryKit is already initialized. Continue anyway?',\n default: false,\n },\n ]);\n\n if (!shouldContinue) {\n console.log(chalk.yellow('āŒ Initialization cancelled.'));\n return;\n }\n }\n\n // Install dependencies\n if (!options.skipInstall) {\n await installDependencies();\n }\n\n // Setup Tailwind config\n await setupTailwindConfig();\n\n // Create components directory\n await createDirectories();\n\n // Create example files\n await createExampleFiles();\n\n // Update package.json scripts\n await updatePackageScripts();\n\n console.log(chalk.green('\\nāœ… FoundryKit initialized successfully!'));\n console.log(chalk.cyan('\\nšŸ“¦ Next steps:'));\n console.log(\n chalk.gray(\n ' 1. Add a component: npx @foundrykit/cli add hero-minimal'\n )\n );\n console.log(\n chalk.gray(' 2. List available components: npx @foundrykit/cli list')\n );\n console.log(\n chalk.gray(' 3. Check out the docs: https://foundrykit.dev')\n );\n } catch (error) {\n console.error(chalk.red('āŒ Failed to initialize FoundryKit:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n process.exit(1);\n }\n });\n}\n\nasync function validateNextJsProject(): Promise<void> {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n throw new Error(\n 'No package.json found. Please run this command in a Next.js project root.'\n );\n }\n\n const packageJson = await fs.readJson(packageJsonPath);\n const dependencies = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n if (!dependencies.next) {\n throw new Error(\n 'Next.js not detected. This command should be run in a Next.js project.'\n );\n }\n\n console.log(chalk.green('āœ… Next.js project detected'));\n}\n\nasync function isFoundryKitInitialized(): Promise<boolean> {\n const tailwindConfigPath = path.join(process.cwd(), 'tailwind.config.js');\n const tailwindConfigTsPath = path.join(process.cwd(), 'tailwind.config.ts');\n\n if (fs.existsSync(tailwindConfigPath)) {\n const config = await fs.readFile(tailwindConfigPath, 'utf-8');\n return config.includes('@foundrykit/tailwind-config');\n }\n\n if (fs.existsSync(tailwindConfigTsPath)) {\n const config = await fs.readFile(tailwindConfigTsPath, 'utf-8');\n return config.includes('@foundrykit/tailwind-config');\n }\n\n return false;\n}\n\nasync function installDependencies(): Promise<void> {\n console.log(chalk.blue('šŸ“¦ Installing FoundryKit dependencies...'));\n\n const dependencies = [\n '@foundrykit/primitives',\n '@foundrykit/components',\n '@foundrykit/blocks',\n '@foundrykit/hooks',\n '@foundrykit/animation',\n '@foundrykit/tokens',\n '@foundrykit/tailwind-config',\n ];\n\n try {\n // Detect package manager\n const packageManager = detectPackageManager();\n console.log(chalk.gray(`Using ${packageManager}...`));\n\n const installCmd =\n packageManager === 'npm'\n ? `npm install ${dependencies.join(' ')}`\n : packageManager === 'yarn'\n ? `yarn add ${dependencies.join(' ')}`\n : `pnpm add ${dependencies.join(' ')}`;\n\n execSync(installCmd, { stdio: 'inherit' });\n console.log(chalk.green('āœ… Dependencies installed'));\n } catch (error) {\n throw new Error(\n 'Failed to install dependencies. Please install them manually.'\n );\n }\n}\n\nfunction detectPackageManager(): string {\n if (fs.existsSync('pnpm-lock.yaml')) return 'pnpm';\n if (fs.existsSync('yarn.lock')) return 'yarn';\n return 'npm';\n}\n\nasync function setupTailwindConfig(): Promise<void> {\n console.log(chalk.blue('āš™ļø Setting up Tailwind configuration...'));\n\n const configPath = path.join(process.cwd(), 'tailwind.config.ts');\n const configContent = `import type { Config } from 'tailwindcss';\nimport { withFoundryKit } from '@foundrykit/tailwind-config';\n\nconst config: Config = withFoundryKit({\n content: [\n './pages/**/*.{js,ts,jsx,tsx,mdx}',\n './components/**/*.{js,ts,jsx,tsx,mdx}',\n './app/**/*.{js,ts,jsx,tsx,mdx}',\n './src/**/*.{js,ts,jsx,tsx,mdx}',\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n});\n\nexport default config;\n`;\n\n await fs.writeFile(configPath, configContent);\n console.log(chalk.green('āœ… Tailwind config created'));\n}\n\nasync function createDirectories(): Promise<void> {\n console.log(chalk.blue('šŸ“ Creating component directories...'));\n\n const dirs = ['components/ui', 'components/blocks', 'lib', 'hooks'];\n\n for (const dir of dirs) {\n await fs.ensureDir(path.join(process.cwd(), dir));\n }\n\n console.log(chalk.green('āœ… Directories created'));\n}\n\nasync function createExampleFiles(): Promise<void> {\n console.log(chalk.blue('šŸ“ Creating example files...'));\n\n // Create lib/utils.ts\n const utilsPath = path.join(process.cwd(), 'lib/utils.ts');\n const utilsContent = `import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n\n await fs.writeFile(utilsPath, utilsContent);\n\n // Create a basic globals.css if it doesn't exist\n const globalsCssPath = path.join(process.cwd(), 'app/globals.css');\n const srcGlobalsCssPath = path.join(process.cwd(), 'src/app/globals.css');\n\n const globalsCssContent = `@import \"tailwindcss\";\n\n@layer base {\n :root {\n --background: 0 0% 100%;\n --foreground: 222.2 84% 4.9%;\n --card: 0 0% 100%;\n --card-foreground: 222.2 84% 4.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 84% 4.9%;\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n --secondary: 210 40% 96%;\n --secondary-foreground: 222.2 84% 4.9%;\n --muted: 210 40% 96%;\n --muted-foreground: 215.4 16.3% 46.9%;\n --accent: 210 40% 96%;\n --accent-foreground: 222.2 84% 4.9%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 40% 98%;\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n --ring: 222.2 84% 4.9%;\n --radius: 0.5rem;\n }\n\n .dark {\n --background: 222.2 84% 4.9%;\n --foreground: 210 40% 98%;\n --card: 222.2 84% 4.9%;\n --card-foreground: 210 40% 98%;\n --popover: 222.2 84% 4.9%;\n --popover-foreground: 210 40% 98%;\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 11.2%;\n --secondary: 217.2 32.6% 17.5%;\n --secondary-foreground: 210 40% 98%;\n --muted: 217.2 32.6% 17.5%;\n --muted-foreground: 215 20.2% 65.1%;\n --accent: 217.2 32.6% 17.5%;\n --accent-foreground: 210 40% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 40% 98%;\n --border: 217.2 32.6% 17.5%;\n --input: 217.2 32.6% 17.5%;\n --ring: 212.7 26.8% 83.9%;\n }\n}\n\n@layer base {\n body {\n @apply bg-background text-foreground;\n }\n}\n`;\n\n // Try to update existing globals.css or create new one\n if (fs.existsSync(globalsCssPath)) {\n const existing = await fs.readFile(globalsCssPath, 'utf-8');\n if (!existing.includes('--background')) {\n await fs.writeFile(globalsCssPath, globalsCssContent);\n }\n } else if (fs.existsSync(srcGlobalsCssPath)) {\n const existing = await fs.readFile(srcGlobalsCssPath, 'utf-8');\n if (!existing.includes('--background')) {\n await fs.writeFile(srcGlobalsCssPath, globalsCssContent);\n }\n } else {\n // Create in app directory by default\n await fs.ensureDir(path.join(process.cwd(), 'app'));\n await fs.writeFile(globalsCssPath, globalsCssContent);\n }\n\n console.log(chalk.green('āœ… Example files created'));\n}\n\nasync function updatePackageScripts(): Promise<void> {\n console.log(chalk.blue('šŸ“‹ Updating package.json scripts...'));\n\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n const packageJson = await fs.readJson(packageJsonPath);\n\n if (!packageJson.scripts) {\n packageJson.scripts = {};\n }\n\n // Add FoundryKit CLI scripts if they don't exist\n if (!packageJson.scripts['foundrykit']) {\n packageJson.scripts['foundrykit'] = 'foundrykit';\n }\n\n if (!packageJson.scripts['fk']) {\n packageJson.scripts['fk'] = 'foundrykit';\n }\n\n await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });\n console.log(chalk.green('āœ… Package scripts updated'));\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport fetch from 'node-fetch';\n\ninterface Component {\n name: string;\n description: string;\n category: 'primitives' | 'components' | 'blocks';\n dependencies?: string[];\n tags?: string[];\n}\n\ninterface Registry {\n primitives: Component[];\n components: Component[];\n blocks: Component[];\n}\n\nexport function listCommand() {\n return new Command('list')\n .description('List all available FoundryKit components and blocks')\n .option(\n '-c, --category <category>',\n 'filter by category (primitives, components, blocks)'\n )\n .option('-s, --search <term>', 'search components by name or description')\n .action(async (options: { category?: string; search?: string }) => {\n try {\n console.log(chalk.blue('šŸ“¦ Available FoundryKit components:'));\n\n const registry = await getRegistry();\n\n // Filter by category if specified\n let categories: ('primitives' | 'components' | 'blocks')[] = [\n 'primitives',\n 'components',\n 'blocks',\n ];\n if (options.category) {\n if (\n !['primitives', 'components', 'blocks'].includes(options.category)\n ) {\n console.error(chalk.red(`Invalid category: ${options.category}`));\n console.log(\n chalk.gray('Available categories: primitives, components, blocks')\n );\n return;\n }\n categories = [\n options.category as 'primitives' | 'components' | 'blocks',\n ];\n }\n\n // Display components\n for (const category of categories) {\n const items = registry[category];\n const filteredItems = options.search\n ? items.filter(\n item =>\n item.name\n .toLowerCase()\n .includes(options.search!.toLowerCase()) ||\n item.description\n .toLowerCase()\n .includes(options.search!.toLowerCase())\n )\n : items;\n\n if (filteredItems.length === 0) continue;\n\n console.log(`\\n${chalk.cyan.bold(category.toUpperCase())}`);\n console.log(chalk.gray('─'.repeat(40)));\n\n for (const item of filteredItems) {\n console.log(`${chalk.green('ā—')} ${chalk.bold(item.name)}`);\n console.log(` ${chalk.gray(item.description)}`);\n if (item.tags && item.tags.length > 0) {\n console.log(\n ` ${chalk.blue(item.tags.map(tag => `#${tag}`).join(' '))}`\n );\n }\n console.log();\n }\n }\n\n console.log(chalk.cyan('\\nšŸ’” Usage:'));\n console.log(chalk.gray(' foundrykit add <component-name>'));\n console.log(chalk.gray(' foundrykit add button --with-animation'));\n } catch (error) {\n console.error(chalk.red('āŒ Failed to fetch component registry:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n\n // Fallback to local registry\n console.log(chalk.yellow('\\nšŸ“‹ Using local registry:'));\n displayLocalRegistry(options);\n }\n });\n}\n\nasync function getRegistry(): Promise<Registry> {\n try {\n // Try to fetch from registry API\n const response = await fetch('http://localhost:3001/api/components');\n if (response.ok) {\n const data = await response.json();\n return data as Registry;\n }\n } catch (error) {\n // Fall back to local registry\n }\n\n // Return local/fallback registry\n return getLocalRegistry();\n}\n\nfunction getLocalRegistry(): Registry {\n return {\n primitives: [\n {\n name: 'button',\n description:\n 'Displays a button or a component that looks like a button.',\n category: 'primitives',\n tags: ['form', 'interactive'],\n },\n {\n name: 'input',\n description:\n 'Displays a form input field or a component that looks like an input.',\n category: 'primitives',\n tags: ['form'],\n },\n {\n name: 'badge',\n description: 'Displays a badge or a component that looks like a badge.',\n category: 'primitives',\n tags: ['status', 'label'],\n },\n {\n name: 'card',\n description: 'Displays a card with header, content, and footer.',\n category: 'primitives',\n tags: ['layout', 'container'],\n },\n {\n name: 'avatar',\n description:\n 'An image element with a fallback for representing the user.',\n category: 'primitives',\n tags: ['user', 'profile'],\n },\n ],\n components: [\n {\n name: 'search-bar',\n description: 'A search input with suggestions and keyboard navigation.',\n category: 'components',\n dependencies: ['input', 'popover'],\n tags: ['search', 'form'],\n },\n {\n name: 'combobox',\n description:\n 'Combines a text input with a listbox, allowing users to filter a list.',\n category: 'components',\n dependencies: ['input', 'popover', 'command'],\n tags: ['form', 'selection'],\n },\n {\n name: 'date-picker',\n description: 'A date picker component with calendar popup.',\n category: 'components',\n dependencies: ['input', 'popover', 'calendar'],\n tags: ['form', 'date'],\n },\n ],\n blocks: [\n {\n name: 'hero-minimal',\n description:\n 'A minimal hero section with heading, description, and CTA button.',\n category: 'blocks',\n dependencies: ['button'],\n tags: ['landing', 'marketing'],\n },\n {\n name: 'hero-with-image',\n description:\n 'A hero section with background image and content overlay.',\n category: 'blocks',\n dependencies: ['button'],\n tags: ['landing', 'marketing', 'image'],\n },\n {\n name: 'pricing',\n description:\n 'A pricing section with multiple tiers and feature comparison.',\n category: 'blocks',\n dependencies: ['card', 'button', 'badge'],\n tags: ['pricing', 'marketing'],\n },\n {\n name: 'testimonials',\n description: 'A testimonials section with customer quotes and avatars.',\n category: 'blocks',\n dependencies: ['avatar', 'card'],\n tags: ['social-proof', 'marketing'],\n },\n ],\n };\n}\n\nfunction displayLocalRegistry(options: { category?: string; search?: string }) {\n const registry = getLocalRegistry();\n\n let categories: ('primitives' | 'components' | 'blocks')[] = [\n 'primitives',\n 'components',\n 'blocks',\n ];\n if (options.category) {\n categories = [options.category as 'primitives' | 'components' | 'blocks'];\n }\n\n for (const category of categories) {\n const items = registry[category];\n const filteredItems = options.search\n ? items.filter(\n item =>\n item.name.toLowerCase().includes(options.search!.toLowerCase()) ||\n item.description\n .toLowerCase()\n .includes(options.search!.toLowerCase())\n )\n : items;\n\n if (filteredItems.length === 0) continue;\n\n console.log(`\\n${chalk.cyan.bold(category.toUpperCase())}`);\n console.log(chalk.gray('─'.repeat(40)));\n\n for (const item of filteredItems) {\n console.log(`${chalk.green('ā—')} ${chalk.bold(item.name)}`);\n console.log(` ${chalk.gray(item.description)}`);\n if (item.tags && item.tags.length > 0) {\n console.log(\n ` ${chalk.blue(item.tags.map(tag => `#${tag}`).join(' '))}`\n );\n }\n console.log();\n }\n }\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport fetch from 'node-fetch';\nimport inquirer from 'inquirer';\n\ninterface AddOptions {\n withAnimation?: boolean;\n path?: string;\n force?: boolean;\n}\n\ninterface ComponentFile {\n path: string;\n content: string;\n type: 'component' | 'hook' | 'util' | 'style';\n}\n\ninterface ComponentData {\n name: string;\n category: 'primitives' | 'components' | 'blocks';\n description: string;\n dependencies?: string[];\n files: ComponentFile[];\n registryDependencies?: string[];\n}\n\nexport function addCommand() {\n return new Command('add')\n .description('Add a component or block to your project')\n .argument('<id>', 'Component or block ID')\n .option('--with-animation', 'Include animation variants')\n .option('--path <path>', 'Custom installation path')\n .option('--force', 'Force overwrite existing files')\n .action(async (id: string, options: AddOptions) => {\n try {\n console.log(chalk.blue(`šŸ“¦ Adding ${id} to your project...`));\n\n // Validate FoundryKit is initialized\n await validateFoundryKitProject();\n\n // Get component data\n const componentData = await getComponentData(id);\n\n if (!componentData) {\n console.error(chalk.red(`āŒ Component \"${id}\" not found.`));\n console.log(\n chalk.gray('\\nUse \"foundrykit list\" to see available components.')\n );\n return;\n }\n\n // Check for existing files\n if (\n !options.force &&\n (await hasConflictingFiles(componentData, options))\n ) {\n const { shouldContinue } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'shouldContinue',\n message: 'Some files already exist. Continue and overwrite?',\n default: false,\n },\n ]);\n\n if (!shouldContinue) {\n console.log(chalk.yellow('āŒ Installation cancelled.'));\n return;\n }\n }\n\n // Install registry dependencies first\n if (\n componentData.registryDependencies &&\n componentData.registryDependencies.length > 0\n ) {\n console.log(chalk.blue('šŸ“¦ Installing required components...'));\n for (const dep of componentData.registryDependencies) {\n await addComponent(dep, { ...options, force: true });\n }\n }\n\n // Install the component files\n await installComponentFiles(componentData, options);\n\n // Update imports if needed\n await updateImports(componentData);\n\n console.log(\n chalk.green(`\\nāœ… ${componentData.name} added successfully!`)\n );\n\n // Show usage example\n showUsageExample(componentData);\n } catch (error) {\n console.error(chalk.red('āŒ Failed to add component:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n process.exit(1);\n }\n });\n}\n\nasync function validateFoundryKitProject(): Promise<void> {\n const tailwindConfigPath = path.join(process.cwd(), 'tailwind.config.ts');\n const tailwindConfigJsPath = path.join(process.cwd(), 'tailwind.config.js');\n\n if (\n !fs.existsSync(tailwindConfigPath) &&\n !fs.existsSync(tailwindConfigJsPath)\n ) {\n throw new Error('FoundryKit not initialized. Run \"foundrykit init\" first.');\n }\n\n // Check if config includes FoundryKit\n const configPath = fs.existsSync(tailwindConfigPath)\n ? tailwindConfigPath\n : tailwindConfigJsPath;\n const config = await fs.readFile(configPath, 'utf-8');\n\n if (!config.includes('@foundrykit/tailwind-config')) {\n throw new Error(\n 'FoundryKit not properly configured. Run \"foundrykit init\" first.'\n );\n }\n}\n\nasync function getComponentData(id: string): Promise<ComponentData | null> {\n try {\n // Try to fetch from registry API\n const response = await fetch(`http://localhost:3001/api/components/${id}`);\n if (response.ok) {\n const data = await response.json();\n return data as ComponentData;\n }\n } catch (error) {\n // Fall back to local registry\n }\n\n // Return local component data\n return getLocalComponentData(id);\n}\n\nfunction getLocalComponentData(id: string): ComponentData | null {\n const components: Record<string, ComponentData> = {\n button: {\n name: 'Button',\n category: 'primitives',\n description: 'A button component with multiple variants.',\n files: [\n {\n path: 'components/ui/button.tsx',\n type: 'component',\n content: `import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n`,\n },\n ],\n },\n input: {\n name: 'Input',\n category: 'primitives',\n description: 'A form input component.',\n files: [\n {\n path: 'components/ui/input.tsx',\n type: 'component',\n content: `import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n`,\n },\n ],\n },\n 'hero-minimal': {\n name: 'Hero Minimal',\n category: 'blocks',\n description: 'A minimal hero section with heading, description, and CTA.',\n registryDependencies: ['button'],\n files: [\n {\n path: 'components/blocks/hero-minimal.tsx',\n type: 'component',\n content: `import { Button } from \"@/components/ui/button\"\n\nexport function HeroMinimal() {\n return (\n <section className=\"w-full py-12 md:py-24 lg:py-32\">\n <div className=\"container px-4 md:px-6\">\n <div className=\"flex flex-col items-center space-y-4 text-center\">\n <div className=\"space-y-2\">\n <h1 className=\"text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl/none\">\n Welcome to FoundryKit\n </h1>\n <p className=\"mx-auto max-w-[700px] text-gray-500 md:text-xl dark:text-gray-400\">\n Build beautiful, accessible React components with our comprehensive design system.\n Fast, flexible, and ready for production.\n </p>\n </div>\n <div className=\"space-x-4\">\n <Button>Get Started</Button>\n <Button variant=\"outline\">Learn More</Button>\n </div>\n </div>\n </div>\n </section>\n )\n}\n`,\n },\n ],\n },\n };\n\n return components[id] || null;\n}\n\nasync function hasConflictingFiles(\n componentData: ComponentData,\n options: AddOptions\n): Promise<boolean> {\n const basePath = options.path || process.cwd();\n\n for (const file of componentData.files) {\n const filePath = path.join(basePath, file.path);\n if (fs.existsSync(filePath)) {\n return true;\n }\n }\n\n return false;\n}\n\nasync function installComponentFiles(\n componentData: ComponentData,\n options: AddOptions\n): Promise<void> {\n const basePath = options.path || process.cwd();\n\n console.log(chalk.blue('šŸ“ Installing component files...'));\n\n for (const file of componentData.files) {\n const filePath = path.join(basePath, file.path);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(filePath));\n\n // Write file\n await fs.writeFile(filePath, file.content);\n\n console.log(chalk.green(` āœ“ ${file.path}`));\n }\n}\n\nasync function updateImports(componentData: ComponentData): Promise<void> {\n // This would handle updating import maps, index files, etc.\n // For now, we'll skip this step\n}\n\nasync function addComponent(id: string, options: AddOptions): Promise<void> {\n const componentData = await getComponentData(id);\n if (!componentData) {\n throw new Error(`Dependency component \"${id}\" not found.`);\n }\n\n await installComponentFiles(componentData, options);\n}\n\nfunction showUsageExample(componentData: ComponentData): void {\n console.log(chalk.cyan('\\nšŸ’” Usage:'));\n\n if (componentData.category === 'primitives') {\n console.log(\n chalk.gray(\n `import { ${componentData.name} } from \"@/components/ui/${componentData.name.toLowerCase()}\"`\n )\n );\n } else if (componentData.category === 'blocks') {\n console.log(\n chalk.gray(\n `import { ${componentData.name.replace(/\\s+/g, '')} } from \"@/components/blocks/${componentData.name.toLowerCase().replace(/\\s+/g, '-')}\"`\n )\n );\n }\n\n // Show a basic usage example\n if (componentData.name === 'Button') {\n console.log(chalk.gray('\\n<Button>Click me</Button>'));\n console.log(chalk.gray('<Button variant=\"outline\">Outline</Button>'));\n } else if (componentData.name === 'Input') {\n console.log(chalk.gray('\\n<Input placeholder=\"Enter text...\" />'));\n } else if (componentData.name === 'Hero Minimal') {\n console.log(chalk.gray('\\n<HeroMinimal />'));\n }\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\n\nexport function updateCommand() {\n return new Command('update')\n .description('Update an existing component or block')\n .argument('<id>', 'Component or block ID')\n .action(async id => {\n console.log(chalk.blue(`šŸ”„ Updating ${id}...`));\n console.log(chalk.green(`āœ… ${id} updated successfully!`));\n });\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\n\nexport function doctorCommand() {\n return new Command('doctor')\n .description('Check project health and configuration')\n .action(async () => {\n console.log(chalk.blue('šŸ” Checking project health...'));\n console.log(chalk.green('āœ… All checks passed!'));\n });\n}\n"],"mappings":";;;AAEA,SAAS,WAAAA,gBAAe;;;ACFxB,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,gBAAgB;AACzB,OAAO,cAAc;AAOd,SAAS,cAAc;AAC5B,SAAO,IAAI,QAAQ,MAAM,EACtB,YAAY,+CAA+C,EAC3D,OAAO,eAAe,0BAA0B,EAChD,OAAO,kBAAkB,8BAA8B,EACvD,OAAO,OAAO,YAAyB;AACtC,QAAI;AACF,cAAQ,IAAI,MAAM,KAAK,sCAA+B,CAAC;AAGvD,YAAM,sBAAsB;AAG5B,UAAI,CAAC,QAAQ,SAAU,MAAM,wBAAwB,GAAI;AACvD,cAAM,EAAE,eAAe,IAAI,MAAM,SAAS,OAAO;AAAA,UAC/C;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,SAAS;AAAA,YACT,SAAS;AAAA,UACX;AAAA,QACF,CAAC;AAED,YAAI,CAAC,gBAAgB;AACnB,kBAAQ,IAAI,MAAM,OAAO,kCAA6B,CAAC;AACvD;AAAA,QACF;AAAA,MACF;AAGA,UAAI,CAAC,QAAQ,aAAa;AACxB,cAAM,oBAAoB;AAAA,MAC5B;AAGA,YAAM,oBAAoB;AAG1B,YAAM,kBAAkB;AAGxB,YAAM,mBAAmB;AAGzB,YAAM,qBAAqB;AAE3B,cAAQ,IAAI,MAAM,MAAM,+CAA0C,CAAC;AACnE,cAAQ,IAAI,MAAM,KAAK,yBAAkB,CAAC;AAC1C,cAAQ;AAAA,QACN,MAAM;AAAA,UACJ;AAAA,QACF;AAAA,MACF;AACA,cAAQ;AAAA,QACN,MA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wCAAwC,EACpD,OAAO,YAAY;AAClB,YAAQ,IAAIC,OAAM,KAAK,sCAA+B,CAAC;AACvD,YAAQ,IAAIA,OAAM,MAAM,2BAAsB,CAAC;AAAA,EACjD,CAAC;AACL;;;ALDA,IAAM,UAAU,IAAIC,SAAQ;AAE5B,QACG,KAAK,YAAY,EACjB,YAAY,oDAAoD,EAChE,QAAQ,OAAO;AAGlB,QAAQ,WAAW,YAAY,CAAC;AAChC,QAAQ,WAAW,YAAY,CAAC;AAChC,QAAQ,WAAW,WAAW,CAAC;AAC/B,QAAQ,WAAW,cAAc,CAAC;AAClC,QAAQ,WAAW,cAAc,CAAC;AAElC,QAAQ,MAAM;","names":["Command","Command","chalk","Command","chalk","fs","path","fetch","inquirer","Command","chalk","Command","chalk","Command"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/commands/list.ts","../src/lib/registry.ts","../src/commands/add.ts","../src/commands/update.ts","../src/commands/doctor.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { initCommand } from './commands/init.js';\nimport { listCommand } from './commands/list.js';\nimport { addCommand } from './commands/add.js';\nimport { updateCommand } from './commands/update.js';\nimport { doctorCommand } from './commands/doctor.js';\n\n// Get package.json version\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('foundrykit')\n .description('FoundryKit CLI - Component library management tool')\n .version(packageJson.version);\n\n// Add commands\nprogram.addCommand(initCommand());\nprogram.addCommand(listCommand());\nprogram.addCommand(addCommand());\nprogram.addCommand(updateCommand());\nprogram.addCommand(doctorCommand());\n\nprogram.parse();\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport inquirer from 'inquirer';\n\ninterface InitOptions {\n force?: boolean;\n skipInstall?: boolean;\n}\n\nexport function initCommand() {\n return new Command('init')\n .description('Initialize FoundryKit in your Next.js project')\n .option('-f, --force', 'overwrite existing files')\n .option('--skip-install', 'skip installing dependencies')\n .action(async (options: InitOptions) => {\n try {\n console.log(chalk.blue('šŸš€ Initializing FoundryKit...'));\n\n // Check if it's a Next.js project\n await validateNextJsProject();\n\n // Check if already initialized\n if (!options.force && (await isFoundryKitInitialized())) {\n const { shouldContinue } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'shouldContinue',\n message: 'FoundryKit is already initialized. Continue anyway?',\n default: false,\n },\n ]);\n\n if (!shouldContinue) {\n console.log(chalk.yellow('āŒ Initialization cancelled.'));\n return;\n }\n }\n\n // Install dependencies\n if (!options.skipInstall) {\n await installDependencies();\n }\n\n // Setup CSS with Tailwind v4\n await setupTailwindV4();\n\n // Create components directory\n await createDirectories();\n\n // Create example files\n await createExampleFiles();\n\n // Update package.json scripts\n await updatePackageScripts();\n\n console.log(chalk.green('\\nāœ… FoundryKit initialized successfully!'));\n console.log(chalk.cyan('\\nšŸ“¦ Next steps:'));\n console.log(\n chalk.gray(\n ' 1. Add a component: npx @foundrykit/cli add hero-minimal'\n )\n );\n console.log(\n chalk.gray(' 2. List available components: npx @foundrykit/cli list')\n );\n console.log(\n chalk.gray(' 3. Check out the docs: https://foundrykit.dev')\n );\n } catch (error) {\n console.error(chalk.red('āŒ Failed to initialize FoundryKit:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n process.exit(1);\n }\n });\n}\n\nasync function validateNextJsProject(): Promise<void> {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n throw new Error(\n 'No package.json found. Please run this command in a Next.js project root.'\n );\n }\n\n const packageJson = await fs.readJson(packageJsonPath);\n const dependencies = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n if (!dependencies.next) {\n throw new Error(\n 'Next.js not detected. This command should be run in a Next.js project.'\n );\n }\n\n console.log(chalk.green('āœ… Next.js project detected'));\n}\n\nasync function isFoundryKitInitialized(): Promise<boolean> {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n\n if (fs.existsSync(packageJsonPath)) {\n const packageJson = await fs.readJson(packageJsonPath);\n const dependencies = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n // Check if any FoundryKit packages are installed\n return Object.keys(dependencies).some(dep =>\n dep.startsWith('@foundrykit/')\n );\n }\n\n return false;\n}\n\nasync function installDependencies(): Promise<void> {\n console.log(chalk.blue('šŸ“¦ Installing FoundryKit dependencies...'));\n\n // Check if we're in a workspace (local development)\n const isWorkspace = await checkIfWorkspace();\n\n if (isWorkspace) {\n console.log(\n chalk.yellow('āš ļø Workspace detected - skipping dependency installation')\n );\n console.log(chalk.gray('Dependencies are already available via workspace'));\n return;\n }\n\n const dependencies = [\n '@foundrykit/primitives',\n '@foundrykit/components',\n '@foundrykit/blocks',\n '@foundrykit/hooks',\n '@foundrykit/animation',\n '@foundrykit/tailwind',\n ];\n\n try {\n // Detect package manager\n const packageManager = detectPackageManager();\n console.log(chalk.gray(`Using ${packageManager}...`));\n\n const installCmd =\n packageManager === 'npm'\n ? `npm install ${dependencies.join(' ')}`\n : packageManager === 'yarn'\n ? `yarn add ${dependencies.join(' ')}`\n : `pnpm add ${dependencies.join(' ')}`;\n\n execSync(installCmd, { stdio: 'inherit' });\n console.log(chalk.green('āœ… Dependencies installed'));\n } catch (error) {\n throw new Error(\n 'Failed to install dependencies. Please install them manually.'\n );\n }\n}\n\nasync function checkIfWorkspace(): Promise<boolean> {\n try {\n // Check for pnpm workspace\n const pnpmWorkspacePath = path.join(\n process.cwd(),\n '../../pnpm-workspace.yaml'\n );\n if (fs.existsSync(pnpmWorkspacePath)) {\n return true;\n }\n\n // Check package.json for workspace packages\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n if (fs.existsSync(packageJsonPath)) {\n const packageJson = await fs.readJson(packageJsonPath);\n const allDeps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n // Check if any FoundryKit packages use workspace protocol\n const foundryKitPackages = Object.keys(allDeps).filter(key =>\n key.startsWith('@foundrykit/')\n );\n for (const pkg of foundryKitPackages) {\n if (allDeps[pkg]?.includes('workspace:')) {\n return true;\n }\n }\n }\n\n return false;\n } catch {\n return false;\n }\n}\n\nfunction detectPackageManager(): string {\n if (fs.existsSync('pnpm-lock.yaml')) return 'pnpm';\n if (fs.existsSync('yarn.lock')) return 'yarn';\n return 'npm';\n}\n\nasync function setupTailwindV4(): Promise<void> {\n console.log(chalk.blue('āš™ļø Setting up Tailwind CSS v4...'));\n\n // First check if layout already imports FoundryKit styles\n const layoutInfo = await findLayoutFile();\n if (layoutInfo) {\n const layoutContent = await fs.readFile(layoutInfo.path, 'utf-8');\n\n // Check if already importing FoundryKit styles directly\n if (layoutContent.includes('@foundrykit/tailwind/globals.css')) {\n const { importPreference } = await inquirer.prompt([\n {\n type: 'list',\n name: 'importPreference',\n message:\n 'FoundryKit styles are already imported directly. How would you like to proceed?',\n choices: [\n {\n name: 'Keep direct import from @foundrykit/tailwind/globals.css',\n value: 'direct',\n },\n {\n name: 'Switch to local globals.css file (recommended for customization)',\n value: 'local',\n },\n ],\n default: 'direct',\n },\n ]);\n\n if (importPreference === 'direct') {\n console.log(\n chalk.green(\n 'āœ… Keeping direct import from @foundrykit/tailwind/globals.css'\n )\n );\n return;\n }\n\n // User wants to switch to local globals.css\n await createLocalGlobalsAndUpdateLayout(layoutInfo.path, layoutContent);\n return;\n }\n\n // Check if importing a local globals.css\n const globalsCssImportMatch = layoutContent.match(\n /import\\s+['\"]([^'\"]*globals\\.css)['\"]/\n );\n if (globalsCssImportMatch && globalsCssImportMatch[1]) {\n // Local globals.css is imported, check if it needs updating\n const importPath = globalsCssImportMatch[1];\n const resolvedPath = importPath.startsWith('.')\n ? path.join(path.dirname(layoutInfo.path), importPath)\n : path.join(process.cwd(), importPath.replace(/^@\\//, 'app/'));\n\n if (fs.existsSync(resolvedPath)) {\n const globalsCssContent = await fs.readFile(resolvedPath, 'utf-8');\n if (globalsCssContent.includes('@foundrykit/tailwind/globals.css')) {\n console.log(chalk.green('āœ… FoundryKit styles already configured'));\n return;\n }\n\n // Update existing globals.css\n const updatedContent = `/* Import FoundryKit's Tailwind CSS v4 styles */\n@import \"@foundrykit/tailwind/globals.css\";\n\n/* Your custom styles below */\n${globalsCssContent}`;\n\n await fs.writeFile(resolvedPath, updatedContent);\n console.log(\n chalk.green('āœ… Updated existing globals.css with FoundryKit styles')\n );\n return;\n }\n }\n }\n\n // No existing setup found, ask user preference\n const { setupPreference } = await inquirer.prompt([\n {\n type: 'list',\n name: 'setupPreference',\n message: 'How would you like to import FoundryKit styles?',\n choices: [\n {\n name: 'Create a local globals.css file (recommended for customization)',\n value: 'local',\n },\n {\n name: 'Import directly from @foundrykit/tailwind/globals.css',\n value: 'direct',\n },\n ],\n default: 'local',\n },\n ]);\n\n if (setupPreference === 'direct') {\n // Add direct import to layout\n await addDirectImportToLayout();\n } else {\n // Create local globals.css and update layout\n await createLocalGlobalsAndUpdateLayout();\n }\n}\n\nasync function createLocalGlobalsAndUpdateLayout(\n existingLayoutPath?: string,\n existingLayoutContent?: string\n): Promise<void> {\n // Find or create globals.css\n const possiblePaths = [\n 'app/globals.css',\n 'src/app/globals.css',\n 'styles/globals.css',\n 'src/styles/globals.css',\n ];\n\n let globalCssPath: string | null = null;\n for (const p of possiblePaths) {\n const fullPath = path.join(process.cwd(), p);\n if (fs.existsSync(fullPath)) {\n globalCssPath = fullPath;\n break;\n }\n }\n\n if (!globalCssPath) {\n // Create in app directory by default\n globalCssPath = path.join(process.cwd(), 'app/globals.css');\n await fs.ensureDir(path.dirname(globalCssPath));\n }\n\n // Check if the file already imports FoundryKit styles\n const existingContent = fs.existsSync(globalCssPath)\n ? await fs.readFile(globalCssPath, 'utf-8')\n : '';\n\n if (!existingContent.includes('@foundrykit/tailwind/globals.css')) {\n // Add FoundryKit import to globals.css\n const cssContent = `/* Import FoundryKit's Tailwind CSS v4 styles */\n@import \"@foundrykit/tailwind/globals.css\";\n\n/* Your custom styles below */\n${existingContent}`;\n\n await fs.writeFile(globalCssPath, cssContent);\n console.log(\n chalk.green('āœ… Created/updated globals.css with FoundryKit styles')\n );\n }\n\n // Update layout file\n if (existingLayoutPath && existingLayoutContent) {\n // Replace direct import with local globals.css\n const layoutDir = path.dirname(existingLayoutPath);\n const cssRelativePath = path\n .relative(layoutDir, globalCssPath)\n .replace(/\\\\/g, '/');\n const importPath = cssRelativePath.startsWith('.')\n ? cssRelativePath\n : `./${cssRelativePath}`;\n\n const updatedContent = existingLayoutContent.replace(\n /@foundrykit\\/tailwind\\/globals\\.css/g,\n importPath\n );\n\n await fs.writeFile(existingLayoutPath, updatedContent);\n console.log(chalk.green('āœ… Updated layout to use local globals.css'));\n } else {\n // Add import to layout\n await updateLayoutImport(globalCssPath);\n }\n}\n\nasync function addDirectImportToLayout(): Promise<void> {\n const layoutInfo = await findLayoutFile();\n\n if (!layoutInfo) {\n console.log(\n chalk.yellow(\n 'āš ļø No layout file found. Please add this import to your layout manually:'\n )\n );\n console.log(chalk.gray(` import '@foundrykit/tailwind/globals.css';`));\n return;\n }\n\n const layoutContent = await fs.readFile(layoutInfo.path, 'utf-8');\n\n // Check if already importing\n if (layoutContent.includes('@foundrykit/tailwind/globals.css')) {\n console.log(\n chalk.gray('Layout already imports FoundryKit styles directly')\n );\n return;\n }\n\n // Add import statement after existing imports\n const importStatement = `import '@foundrykit/tailwind/globals.css';`;\n\n // Find a good place to insert the import (after other imports)\n const importRegex = /^import\\s+.*$/gm;\n const imports = layoutContent.match(importRegex);\n\n let updatedContent: string;\n if (imports && imports.length > 0) {\n const lastImport = imports[imports.length - 1];\n const lastImportIndex = layoutContent.lastIndexOf(lastImport!);\n const insertPosition = lastImportIndex + lastImport!.length;\n\n updatedContent =\n layoutContent.slice(0, insertPosition) +\n '\\n' +\n importStatement +\n layoutContent.slice(insertPosition);\n } else {\n // No imports found, add at the beginning\n updatedContent = importStatement + '\\n' + layoutContent;\n }\n\n await fs.writeFile(layoutInfo.path, updatedContent);\n console.log(\n chalk.green('āœ… Added direct import of FoundryKit styles to layout')\n );\n}\n\nasync function findLayoutFile(): Promise<{ path: string } | null> {\n const layoutPaths = [\n 'app/layout.tsx',\n 'app/layout.jsx',\n 'app/layout.js',\n 'src/app/layout.tsx',\n 'src/app/layout.jsx',\n 'src/app/layout.js',\n ];\n\n for (const p of layoutPaths) {\n const fullPath = path.join(process.cwd(), p);\n if (fs.existsSync(fullPath)) {\n return { path: fullPath };\n }\n }\n\n return null;\n}\n\nasync function updateLayoutImport(globalCssPath: string): Promise<void> {\n const layoutInfo = await findLayoutFile();\n\n if (!layoutInfo) {\n console.log(\n chalk.yellow(\n 'āš ļø No layout file found. Please import globals.css manually in your layout.'\n )\n );\n return;\n }\n\n const layoutContent = await fs.readFile(layoutInfo.path, 'utf-8');\n\n // Check if already importing any globals.css\n if (layoutContent.match(/import\\s+['\"][^'\"]*globals\\.css['\"]/)) {\n console.log(chalk.gray('Layout already has a globals.css import'));\n return;\n }\n\n // Check if already importing FoundryKit styles directly\n if (layoutContent.includes('@foundrykit/tailwind/globals.css')) {\n // Replace direct FoundryKit import with local globals.css\n const layoutDir = path.dirname(layoutInfo.path);\n const cssRelativePath = path\n .relative(layoutDir, globalCssPath)\n .replace(/\\\\/g, '/');\n const importPath = cssRelativePath.startsWith('.')\n ? cssRelativePath\n : `./${cssRelativePath}`;\n\n const updatedContent = layoutContent.replace(\n /@foundrykit\\/tailwind\\/globals\\.css/g,\n importPath\n );\n\n await fs.writeFile(layoutInfo.path, updatedContent);\n console.log(\n chalk.green('āœ… Updated layout import to use local globals.css')\n );\n return;\n }\n\n // Calculate relative import path\n const layoutDir = path.dirname(layoutInfo.path);\n const cssRelativePath = path\n .relative(layoutDir, globalCssPath)\n .replace(/\\\\/g, '/');\n const importPath = cssRelativePath.startsWith('.')\n ? cssRelativePath\n : `./${cssRelativePath}`;\n\n // Add import statement after existing imports\n const importStatement = `import '${importPath}';`;\n\n // Find a good place to insert the import (after other imports)\n const importRegex = /^import\\s+.*$/gm;\n const imports = layoutContent.match(importRegex);\n\n let updatedContent: string;\n if (imports && imports.length > 0) {\n const lastImport = imports[imports.length - 1];\n const lastImportIndex = layoutContent.lastIndexOf(lastImport!);\n const insertPosition = lastImportIndex + lastImport!.length;\n\n updatedContent =\n layoutContent.slice(0, insertPosition) +\n '\\n' +\n importStatement +\n layoutContent.slice(insertPosition);\n } else {\n // No imports found, add at the beginning\n updatedContent = importStatement + '\\n' + layoutContent;\n }\n\n await fs.writeFile(layoutInfo.path, updatedContent);\n console.log(chalk.green('āœ… Layout file updated with globals.css import'));\n}\n\nasync function createDirectories(): Promise<void> {\n console.log(chalk.blue('šŸ“ Creating component directories...'));\n\n const dirs = ['components/ui', 'components/blocks', 'lib', 'hooks'];\n\n for (const dir of dirs) {\n await fs.ensureDir(path.join(process.cwd(), dir));\n }\n\n console.log(chalk.green('āœ… Directories created'));\n}\n\nasync function createExampleFiles(): Promise<void> {\n console.log(chalk.blue('šŸ“ Creating example files...'));\n\n // Create lib/utils.ts\n const utilsPath = path.join(process.cwd(), 'lib/utils.ts');\n const utilsContent = `import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n\n if (!fs.existsSync(utilsPath)) {\n await fs.writeFile(utilsPath, utilsContent);\n console.log(chalk.gray('Created lib/utils.ts'));\n }\n\n // Create providers.tsx if using theme support\n const providersPath = path.join(process.cwd(), 'components/providers.tsx');\n const providersContent = `'use client';\n\nimport { ThemeProvider } from 'next-themes';\n\nexport function Providers({ children }: { children: React.ReactNode }) {\n return (\n <ThemeProvider attribute=\"class\" defaultTheme=\"system\" enableSystem>\n {children}\n </ThemeProvider>\n );\n}\n`;\n\n if (!fs.existsSync(providersPath)) {\n await fs.writeFile(providersPath, providersContent);\n console.log(chalk.gray('Created components/providers.tsx'));\n }\n\n console.log(chalk.green('āœ… Example files created'));\n}\n\nasync function updatePackageScripts(): Promise<void> {\n console.log(chalk.blue('šŸ“‹ Updating package.json scripts...'));\n\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n const packageJson = await fs.readJson(packageJsonPath);\n\n if (!packageJson.scripts) {\n packageJson.scripts = {};\n }\n\n // Add FoundryKit CLI scripts if they don't exist\n if (!packageJson.scripts['foundrykit']) {\n packageJson.scripts['foundrykit'] = 'foundrykit';\n }\n\n if (!packageJson.scripts['fk']) {\n packageJson.scripts['fk'] = 'foundrykit';\n }\n\n await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });\n console.log(chalk.green('āœ… Package scripts updated'));\n}\n","/**\n * List command for FoundryKit CLI\n * Displays available components from the registry\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport type { ComponentMeta, ComponentCategory } from '@foundrykit/types';\nimport { getRegistry } from '../lib/registry.js';\n\ninterface ListOptions {\n category?: string;\n search?: string;\n}\n\nexport function listCommand() {\n return new Command('list')\n .description('List all available FoundryKit components and blocks')\n .option(\n '-c, --category <category>',\n 'filter by category (primitives, components, blocks, animations)'\n )\n .option('-s, --search <term>', 'search components by name or description')\n .action(async (options: ListOptions) => {\n try {\n console.log(chalk.blue('šŸ“¦ Available FoundryKit components:'));\n\n const registry = getRegistry();\n\n // Validate category if provided\n if (options.category) {\n const validCategories: ComponentCategory[] = [\n 'primitives',\n 'components',\n 'blocks',\n 'animations',\n ];\n if (\n !validCategories.includes(options.category as ComponentCategory)\n ) {\n console.error(chalk.red(`Invalid category: ${options.category}`));\n console.log(\n chalk.gray(`Valid categories: ${validCategories.join(', ')}`)\n );\n process.exit(1);\n }\n }\n\n // Fetch components from registry\n console.log(chalk.gray('Fetching from registry...'));\n const components = await registry.getComponents(\n options.category,\n options.search\n );\n\n if (components.length === 0) {\n console.log(\n chalk.yellow('\\nNo components found matching your criteria.')\n );\n if (options.search) {\n console.log(chalk.gray(`Search term: \"${options.search}\"`));\n }\n if (options.category) {\n console.log(chalk.gray(`Category: ${options.category}`));\n }\n return;\n }\n\n // Group and display components\n displayComponents(components);\n\n // Show usage hints\n console.log(chalk.cyan('\\nšŸ’” Usage:'));\n console.log(\n chalk.gray(' foundrykit add # Interactive mode')\n );\n console.log(\n chalk.gray(' foundrykit add <id> # Add specific component')\n );\n console.log(chalk.gray(' foundrykit add button # Example'));\n } catch (error) {\n console.error(chalk.red('āŒ Failed to fetch component registry:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n process.exit(1);\n }\n });\n}\n\n/**\n * Display components grouped by category\n */\nfunction displayComponents(components: ComponentMeta[]): void {\n // Group components by category\n const grouped = components.reduce(\n (acc, component) => {\n if (!acc[component.category]) {\n acc[component.category] = [];\n }\n acc[component.category].push(component);\n return acc;\n },\n {} as Record<ComponentCategory, ComponentMeta[]>\n );\n\n // Display in category order\n const categoryOrder: ComponentCategory[] = [\n 'primitives',\n 'components',\n 'blocks',\n 'animations',\n ];\n\n for (const category of categoryOrder) {\n const items = grouped[category];\n if (!items || items.length === 0) continue;\n\n console.log(`\\n${chalk.cyan.bold(category.toUpperCase())}`);\n console.log(chalk.gray('─'.repeat(40)));\n\n for (const item of items) {\n // Component name and ID\n console.log(\n `${chalk.green('ā—')} ${chalk.bold(item.name)} ${chalk.gray(\n `(${item.id})`\n )}`\n );\n\n // Description\n console.log(` ${chalk.gray(item.description)}`);\n\n // Tags\n if (item.tags && item.tags.length > 0) {\n console.log(\n ` ${chalk.blue(item.tags.map(tag => `#${tag}`).join(' '))}`\n );\n }\n\n // Dependencies\n if (item.registryDependencies && item.registryDependencies.length > 0) {\n console.log(\n ` ${chalk.yellow('Requires:')} ${item.registryDependencies.join(\n ', '\n )}`\n );\n }\n\n // Package dependencies\n if (item.packageDependencies && item.packageDependencies.length > 0) {\n console.log(\n ` ${chalk.magenta('NPM packages:')} ${item.packageDependencies.join(\n ', '\n )}`\n );\n }\n\n console.log();\n }\n }\n\n // Show summary\n const total = components.length;\n const byCategory = Object.entries(grouped)\n .map(([cat, items]) => `${items.length} ${cat}`)\n .join(', ');\n\n console.log(chalk.gray('─'.repeat(40)));\n console.log(chalk.gray(`Total: ${total} components (${byCategory})`));\n}\n","/**\n * Registry service for fetching and caching component data\n * Handles communication with the FoundryKit registry\n */\n\nimport fs from 'fs-extra';\nimport path from 'path';\nimport os from 'os';\nimport chalk from 'chalk';\nimport type {\n ComponentMeta,\n ComponentData,\n RegistryIndex,\n RegistryComponent,\n RegistryError,\n LocalCache,\n CLIConfig,\n} from '@foundrykit/types';\n\n/**\n * Default configuration\n */\nconst DEFAULT_CONFIG: CLIConfig = {\n registryUrl:\n process.env.FOUNDRYKIT_REGISTRY_URL || 'https://foundry.umiflow.com',\n cacheDir: path.join(os.homedir(), '.foundrykit', 'cache'),\n cacheMaxAge: 1000 * 60 * 60 * 24, // 24 hours\n};\n\n/**\n * Registry service class\n */\nexport class RegistryService {\n private config: CLIConfig;\n private cacheFile: string;\n\n constructor(config?: Partial<CLIConfig>) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.cacheFile = path.join(this.config.cacheDir, 'registry.json');\n }\n\n /**\n * Fetch all components from the registry\n */\n async getComponents(\n category?: string,\n search?: string\n ): Promise<RegistryIndex> {\n try {\n // Build query params\n const params = new URLSearchParams();\n if (category) params.append('category', category);\n if (search) params.append('search', search);\n\n const url = `${this.config.registryUrl}/registry${\n params.toString() ? '?' + params.toString() : ''\n }`;\n\n console.log(chalk.gray(`Fetching from: ${url}`));\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(\n `Registry returned ${response.status}: ${response.statusText}`\n );\n }\n\n const components = (await response.json()) as RegistryIndex;\n\n // Update cache\n await this.updateCache(components);\n\n return components;\n } catch (error) {\n // Try to load from cache\n const cache = await this.loadCache();\n if (cache && this.isCacheValid(cache)) {\n console.log(chalk.yellow('Using cached registry data'));\n return this.filterComponents(cache.components, category, search);\n }\n\n // No valid cache, throw error\n throw new Error(\n `Failed to connect to registry: ${error instanceof Error ? error.message : 'Unknown error'}\\n` +\n `Registry URL: ${this.config.registryUrl}\\n` +\n `Try again later or check your internet connection.`\n );\n }\n }\n\n /**\n * Fetch a specific component by ID\n */\n async getComponent(id: string): Promise<ComponentData> {\n try {\n const url = `${this.config.registryUrl}/registry/${id}`;\n console.log(chalk.gray(`Fetching component: ${url}`));\n\n const response = await fetch(url);\n\n if (!response.ok) {\n if (response.status === 404) {\n throw new Error(`Component \"${id}\" not found in registry`);\n }\n throw new Error(\n `Registry returned ${response.status}: ${response.statusText}`\n );\n }\n\n const component = (await response.json()) as RegistryComponent;\n\n // Cache the component data\n await this.cacheComponent(component);\n\n return component;\n } catch (error) {\n // Try to load from cache\n const cache = await this.loadCache();\n if (cache?.componentData?.[id]) {\n console.log(chalk.yellow(`Using cached data for component: ${id}`));\n return cache.componentData[id];\n }\n\n // No cached data, throw error\n throw new Error(\n `Failed to fetch component \"${id}\": ${error instanceof Error ? error.message : 'Unknown error'}\\n` +\n `Registry URL: ${this.config.registryUrl}\\n` +\n `Try again later or check your internet connection.`\n );\n }\n }\n\n /**\n * Update the local cache with new component list\n */\n private async updateCache(components: RegistryIndex): Promise<void> {\n try {\n const cache = await this.loadCache();\n const newCache: LocalCache = {\n version: '1.0.0',\n lastUpdated: new Date().toISOString(),\n components,\n componentData: cache?.componentData || {},\n };\n\n await fs.ensureDir(this.config.cacheDir);\n await fs.writeJson(this.cacheFile, newCache, { spaces: 2 });\n } catch (error) {\n // Cache update failed, but don't throw - this is not critical\n console.log(chalk.gray('Failed to update cache'));\n }\n }\n\n /**\n * Cache a specific component\n */\n private async cacheComponent(component: ComponentData): Promise<void> {\n try {\n const cache = await this.loadCache();\n if (!cache) return;\n\n cache.componentData[component.id] = component;\n cache.lastUpdated = new Date().toISOString();\n\n await fs.writeJson(this.cacheFile, cache, { spaces: 2 });\n } catch (error) {\n // Cache update failed, but don't throw\n console.log(chalk.gray('Failed to cache component'));\n }\n }\n\n /**\n * Load the local cache\n */\n private async loadCache(): Promise<LocalCache | null> {\n try {\n if (await fs.pathExists(this.cacheFile)) {\n return await fs.readJson(this.cacheFile);\n }\n } catch (error) {\n console.log(chalk.gray('Failed to load cache'));\n }\n return null;\n }\n\n /**\n * Check if cache is still valid\n */\n private isCacheValid(cache: LocalCache): boolean {\n const lastUpdated = new Date(cache.lastUpdated).getTime();\n const now = Date.now();\n return now - lastUpdated < this.config.cacheMaxAge;\n }\n\n /**\n * Filter components by category and search\n */\n private filterComponents(\n components: ComponentMeta[],\n category?: string,\n search?: string\n ): ComponentMeta[] {\n let filtered = components;\n\n if (category) {\n filtered = filtered.filter(c => c.category === category);\n }\n\n if (search) {\n const searchLower = search.toLowerCase();\n filtered = filtered.filter(\n c =>\n c.name.toLowerCase().includes(searchLower) ||\n c.description.toLowerCase().includes(searchLower) ||\n c.id.toLowerCase().includes(searchLower) ||\n c.tags?.some(tag => tag.toLowerCase().includes(searchLower))\n );\n }\n\n return filtered;\n }\n\n /**\n * Clear the local cache\n */\n async clearCache(): Promise<void> {\n try {\n if (await fs.pathExists(this.cacheFile)) {\n await fs.remove(this.cacheFile);\n console.log(chalk.green('Cache cleared successfully'));\n }\n } catch (error) {\n throw new Error(\n `Failed to clear cache: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n }\n\n /**\n * Get cache statistics\n */\n async getCacheStats(): Promise<{\n exists: boolean;\n size: number;\n lastUpdated: string | null;\n componentCount: number;\n }> {\n try {\n if (await fs.pathExists(this.cacheFile)) {\n const cache = await this.loadCache();\n const stats = await fs.stat(this.cacheFile);\n\n return {\n exists: true,\n size: stats.size,\n lastUpdated: cache?.lastUpdated || null,\n componentCount: cache?.components.length || 0,\n };\n }\n } catch (error) {\n // Ignore errors\n }\n\n return {\n exists: false,\n size: 0,\n lastUpdated: null,\n componentCount: 0,\n };\n }\n}\n\n/**\n * Singleton instance\n */\nlet registryInstance: RegistryService | null = null;\n\n/**\n * Get the registry service instance\n */\nexport function getRegistry(config?: Partial<CLIConfig>): RegistryService {\n if (!registryInstance) {\n registryInstance = new RegistryService(config);\n }\n return registryInstance;\n}\n\n/**\n * Reset the registry instance (mainly for testing)\n */\nexport function resetRegistry(): void {\n registryInstance = null;\n}\n","/**\n * Add command for FoundryKit CLI\n * Handles adding components to projects\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport inquirer from 'inquirer';\nimport type {\n ComponentMeta,\n ComponentData,\n ComponentCategory,\n} from '@foundrykit/types';\nimport { getRegistry } from '../lib/registry.js';\n\ninterface AddOptions {\n withAnimation?: boolean;\n path?: string;\n overwrite?: boolean;\n}\n\nexport function addCommand() {\n return new Command('add')\n .description('Add a component or block to your project')\n .argument('[id]', 'Component or block ID (optional for interactive mode)')\n .option('--with-animation', 'Include animation variants')\n .option('-p, --path <path>', 'Custom installation path')\n .option('-o, --overwrite', 'Overwrite existing files')\n .action(async (id: string | undefined, options: AddOptions) => {\n try {\n // If no ID provided, show interactive selector\n if (!id) {\n const selectedIds = await selectComponentsInteractively();\n if (selectedIds.length === 0) {\n console.log(chalk.yellow('No components selected.'));\n return;\n }\n\n // Add each selected component\n for (const componentId of selectedIds) {\n await addSingleComponent(componentId, options);\n }\n } else {\n // Add single component\n await addSingleComponent(id, options);\n }\n } catch (error) {\n console.error(chalk.red('āŒ Failed to add component:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n process.exit(1);\n }\n });\n}\n\n/**\n * Interactive component selection\n */\nasync function selectComponentsInteractively(): Promise<string[]> {\n console.log(chalk.blue('šŸ“¦ Select components to add:'));\n console.log(\n chalk.gray(' Use arrow keys to navigate, space to select, a to toggle all')\n );\n console.log(chalk.gray(' Press enter when done\\n'));\n\n const registry = getRegistry();\n\n try {\n // Fetch all available components from registry\n console.log(chalk.gray('Fetching components from registry...'));\n const allComponents = await registry.getComponents();\n\n if (allComponents.length === 0) {\n console.log(chalk.yellow('No components available in the registry.'));\n return [];\n }\n\n // Group components by category\n const groupedChoices = createGroupedChoices(allComponents);\n\n const { selectedComponents } = await inquirer.prompt([\n {\n type: 'checkbox',\n name: 'selectedComponents',\n message: 'Which components would you like to add?',\n choices: groupedChoices,\n pageSize: 20,\n loop: false,\n },\n ]);\n\n return selectedComponents;\n } catch (error) {\n console.error(chalk.red('Failed to fetch components from registry:'));\n console.error(\n chalk.red(error instanceof Error ? error.message : String(error))\n );\n throw error;\n }\n}\n\n/**\n * Create grouped choices for the interactive selector\n */\nfunction createGroupedChoices(components: ComponentMeta[]) {\n const categories: ComponentCategory[] = [\n 'primitives',\n 'components',\n 'blocks',\n 'animations',\n ];\n\n const choices: any[] = [];\n\n for (const category of categories) {\n const categoryComponents = components.filter(c => c.category === category);\n\n if (categoryComponents.length === 0) continue;\n\n // Add category separator\n choices.push({\n name: chalk.bold.cyan(`─── ${category.toUpperCase()} ───`),\n disabled: true,\n value: `separator-${category}`,\n });\n\n // Add components in this category\n for (const component of categoryComponents) {\n choices.push({\n name: `${component.name} - ${chalk.gray(component.description)}`,\n value: component.id,\n short: component.name,\n });\n }\n }\n\n return choices;\n}\n\n/**\n * Add a single component to the project\n */\nasync function addSingleComponent(\n id: string,\n options: AddOptions\n): Promise<void> {\n console.log(chalk.blue(`\\nšŸ“¦ Adding ${id} to your project...`));\n\n // Validate project is initialized\n await validateProject();\n\n const registry = getRegistry();\n\n try {\n // Fetch component data from registry\n const componentData = await registry.getComponent(id);\n\n // Check for existing files\n if (\n !options.overwrite &&\n (await hasConflictingFiles(componentData, options))\n ) {\n const { shouldContinue } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'shouldContinue',\n message: `Some files for ${componentData.name} already exist. Overwrite?`,\n default: false,\n },\n ]);\n\n if (!shouldContinue) {\n console.log(chalk.yellow(`ā­ļø Skipping ${componentData.name}.`));\n return;\n }\n }\n\n // Install registry dependencies first\n if (componentData.registryDependencies?.length) {\n console.log(chalk.blue('šŸ“¦ Installing required dependencies...'));\n for (const dep of componentData.registryDependencies) {\n // Check if dependency is already installed\n const depData = await registry.getComponent(dep);\n if (!(await hasConflictingFiles(depData, options))) {\n await installComponentFiles(depData, options);\n console.log(chalk.green(` āœ“ Installed ${dep}`));\n }\n }\n }\n\n // Install the component files\n await installComponentFiles(componentData, options);\n\n console.log(chalk.green(`āœ… ${componentData.name} added successfully!`));\n\n // Show usage example\n showUsageExample(componentData);\n\n // Show package dependencies if any\n if (componentData.packageDependencies?.length) {\n console.log(chalk.yellow('\\nšŸ“¦ Required npm packages:'));\n console.log(\n chalk.gray(` ${componentData.packageDependencies.join(', ')}`)\n );\n console.log(chalk.gray(' Install them with:'));\n console.log(\n chalk.cyan(` pnpm add ${componentData.packageDependencies.join(' ')}`)\n );\n }\n } catch (error) {\n console.error(chalk.red(`Failed to add ${id}:`));\n throw error;\n }\n}\n\n/**\n * Validate that the project is properly initialized\n */\nasync function validateProject(): Promise<void> {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n throw new Error(\n 'No package.json found. Please run this command in a project root.'\n );\n }\n\n const packageJson = await fs.readJson(packageJsonPath);\n const dependencies = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n // Check for Next.js or FoundryKit packages\n const hasFoundryKit = Object.keys(dependencies).some(dep =>\n dep.startsWith('@foundrykit/')\n );\n\n if (!hasFoundryKit && !dependencies.next) {\n throw new Error('FoundryKit not initialized. Run \"foundrykit init\" first.');\n }\n}\n\n/**\n * Check if component files already exist\n */\nasync function hasConflictingFiles(\n componentData: ComponentData,\n options: AddOptions\n): Promise<boolean> {\n const basePath = options.path || process.cwd();\n\n for (const file of componentData.files) {\n const filePath = path.join(basePath, file.path);\n if (fs.existsSync(filePath)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Install component files to the project\n */\nasync function installComponentFiles(\n componentData: ComponentData,\n options: AddOptions\n): Promise<void> {\n const basePath = options.path || process.cwd();\n\n console.log(chalk.blue('šŸ“ Installing component files...'));\n\n for (const file of componentData.files) {\n const filePath = path.join(basePath, file.path);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(filePath));\n\n // Write file\n await fs.writeFile(filePath, file.content);\n\n console.log(chalk.green(` āœ“ ${file.path}`));\n }\n}\n\n/**\n * Show usage example for the installed component\n */\nfunction showUsageExample(componentData: ComponentData): void {\n console.log(chalk.cyan('\\nšŸ’” Usage:'));\n\n const componentName = componentData.name.replace(/\\s+/g, '');\n\n if (\n componentData.category === 'primitives' ||\n componentData.category === 'components'\n ) {\n console.log(\n chalk.gray(\n `import { ${componentName} } from \"@/components/ui/${componentData.id}\"`\n )\n );\n } else if (componentData.category === 'blocks') {\n console.log(\n chalk.gray(\n `import { ${componentName} } from \"@/components/blocks/${componentData.id}\"`\n )\n );\n } else if (componentData.category === 'animations') {\n console.log(\n chalk.gray(\n `import { ${componentName} } from \"@/components/animations/${componentData.id}\"`\n )\n );\n }\n\n // Show basic usage examples based on component type\n if (componentData.id === 'button') {\n console.log(chalk.gray('\\n<Button>Click me</Button>'));\n console.log(chalk.gray('<Button variant=\"outline\">Outline</Button>'));\n } else if (componentData.id === 'input') {\n console.log(chalk.gray('\\n<Input placeholder=\"Enter text...\" />'));\n } else if (componentData.id.includes('hero')) {\n console.log(chalk.gray(`\\n<${componentName} />`));\n } else if (componentData.id === 'card') {\n console.log(chalk.gray('\\n<Card>'));\n console.log(chalk.gray(' <CardHeader>'));\n console.log(chalk.gray(' <CardTitle>Title</CardTitle>'));\n console.log(\n chalk.gray(' <CardDescription>Description</CardDescription>')\n );\n console.log(chalk.gray(' </CardHeader>'));\n console.log(chalk.gray(' <CardContent>Content</CardContent>'));\n console.log(chalk.gray('</Card>'));\n }\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\n\nexport function updateCommand() {\n return new Command('update')\n .description('Update an existing component or block')\n .argument('<id>', 'Component or block ID')\n .action(async id => {\n console.log(chalk.blue(`šŸ”„ Updating ${id}...`));\n console.log(chalk.green(`āœ… ${id} updated successfully!`));\n });\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\n\nexport function doctorCommand() {\n return new Command('doctor')\n .description('Check project health and configuration')\n .action(async () => {\n console.log(chalk.blue('šŸ” Checking project health...'));\n console.log(chalk.green('āœ… All checks passed!'));\n });\n}\n"],"mappings":";;;AAEA,SAAS,WAAAA,gBAAe;AACxB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,YAAY;;;ACL9B,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,gBAAgB;AACzB,OAAO,cAAc;AAOd,SAAS,cAAc;AAC5B,SAAO,IAAI,QAAQ,MAAM,EACtB,YAAY,+CAA+C,EAC3D,OAAO,eAAe,0BAA0B,EAChD,OAAO,kBAAkB,8BAA8B,EACvD,OAAO,OAAO,YAAyB;AACtC,QAAI;AACF,cAAQ,IAAI,MAAM,KAAK,sCAA+B,CAAC;AAGvD,YAAM,sBAAsB;AAG5B,UAAI,CAAC,QAAQ,SAAU,MAAM,wBAAwB,GAAI;AACvD,cAAM,EAAE,eAAe,IAAI,MAAM,SAAS,OAAO;AAAA,UAC/C;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,SAAS;AAAA,YACT,SAAS;AAAA,UACX;AAAA,QACF,CAAC;AAED,YAAI,CAAC,gBAAgB;AACnB,kBAAQ,IAAI,MAAM,OAAO,kCAA6B,CAAC;AACvD;AAAA,QACF;AAAA,MACF;AAGA,UAAI,CAAC,QAAQ,aAAa;AACxB,cAAM,oBAAoB;AAAA,MAC5B;AAGA,YAAM,gBAAgB;AAGtB,YAAM,kBAAkB;AAGxB,YAAM,mBAAmB;AAGzB,YAAM,qBAAqB;AAE3B,cAAQ,IAAI,MAAM,MAAM,+CAA0C,CAAC;AACnE,cAAQ,IAAI,MAAM,KAAK,yBAAkB,CAAC;AAC1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,KAAK,WAAW,MAAM,cAAc,GAAG,OAAO;AAC7D;AAEA,IAAM,UAAU,IAAIC,SAAQ;AAE5B,QACG,KAAK,YAAY,EACjB,YAAY,oDAAoD,EAChE,QAAQ,YAAY,OAAO;AAG9B,QAAQ,WAAW,YAAY,CAAC;AAChC,QAAQ,WAAW,YAAY,CAAC;AAChC,QAAQ,WAAW,WAAW,CAAC;AAC/B,QAAQ,WAAW,cAAc,CAAC;AAClC,QAAQ,WAAW,cAAc,CAAC;AAElC,QAAQ,MAAM;","names":["Command","packageJson","layoutDir","cssRelativePath","importPath","updatedContent","Command","chalk","fs","path","chalk","Command","chalk","Command","chalk","fs","path","inquirer","Command","chalk","inquirer","path","fs","packageJson","Command","chalk","Command","chalk","Command"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foundrykit/cli",
3
- "version": "0.1.1",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -24,7 +24,8 @@
24
24
  "fs-extra": "^11.2.0",
25
25
  "glob": "^10.3.10",
26
26
  "inquirer": "^9.2.15",
27
- "node-fetch": "^3.3.0"
27
+ "node-fetch": "^3.3.0",
28
+ "@foundrykit/types": "1.0.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/node": "^20.19.9",
@@ -33,8 +34,8 @@
33
34
  "eslint": "^9.0.0",
34
35
  "tsup": "^8.0.0",
35
36
  "typescript": "^5.9.2",
36
- "@foundrykit/eslint-config": "0.1.1",
37
- "@foundrykit/typescript-config": "0.1.1"
37
+ "@foundrykit/eslint-config": "1.0.0",
38
+ "@foundrykit/typescript-config": "1.0.0"
38
39
  },
39
40
  "scripts": {
40
41
  "build": "tsup",