galaxy-design 0.2.1 → 0.2.2

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/bin.js CHANGED
@@ -3,7 +3,7 @@ import { Command } from 'commander';
3
3
  import { initCommand } from './commands/init.js';
4
4
  import { addCommand } from './commands/add.js';
5
5
  const program = new Command();
6
- program.name('galaxy-ui-cli').description('CLI tool for Galaxy UI component library').version('0.2.0');
6
+ program.name('galaxy-design').description('CLI tool for Galaxy UI component library').version('0.2.2');
7
7
  program.command('init').description('Initialize Galaxy UI in your project').option('-y, --yes', 'Skip prompts and use defaults').option('-c, --cwd <path>', 'Current working directory', process.cwd()).action(initCommand);
8
8
  program.command('add').description('Add components to your project').argument('[components...]', 'Component names to add').option('-a, --all', 'Add all components').option('-c, --cwd <path>', 'Current working directory', process.cwd()).action(addCommand);
9
9
  program.parse();
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { initCommand } from './commands/init.js';\nimport { addCommand } from './commands/add.js';\n\nconst program = new Command();\n\nprogram\n .name('galaxy-ui-cli')\n .description('CLI tool for Galaxy UI component library')\n .version('0.2.0');\n\nprogram\n .command('init')\n .description('Initialize Galaxy UI in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('-c, --cwd <path>', 'Current working directory', process.cwd())\n .action(initCommand);\n\nprogram\n .command('add')\n .description('Add components to your project')\n .argument('[components...]', 'Component names to add')\n .option('-a, --all', 'Add all components')\n .option('-c, --cwd <path>', 'Current working directory', process.cwd())\n .action(addCommand);\n\nprogram.parse();\n"],"names":["Command","initCommand","addCommand","program","name","description","version","command","option","process","cwd","action","argument","parse"],"mappings":";AACA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,MAAMC,UAAU,IAAIH;AAEpBG,QACGC,IAAI,CAAC,iBACLC,WAAW,CAAC,4CACZC,OAAO,CAAC;AAEXH,QACGI,OAAO,CAAC,QACRF,WAAW,CAAC,wCACZG,MAAM,CAAC,aAAa,iCACpBA,MAAM,CAAC,oBAAoB,6BAA6BC,QAAQC,GAAG,IACnEC,MAAM,CAACV;AAEVE,QACGI,OAAO,CAAC,OACRF,WAAW,CAAC,kCACZO,QAAQ,CAAC,mBAAmB,0BAC5BJ,MAAM,CAAC,aAAa,sBACpBA,MAAM,CAAC,oBAAoB,6BAA6BC,QAAQC,GAAG,IACnEC,MAAM,CAACT;AAEVC,QAAQU,KAAK"}
1
+ {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { initCommand } from './commands/init.js';\nimport { addCommand } from './commands/add.js';\n\nconst program = new Command();\n\nprogram\n .name('galaxy-design')\n .description('CLI tool for Galaxy UI component library')\n .version('0.2.2');\n\nprogram\n .command('init')\n .description('Initialize Galaxy UI in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('-c, --cwd <path>', 'Current working directory', process.cwd())\n .action(initCommand);\n\nprogram\n .command('add')\n .description('Add components to your project')\n .argument('[components...]', 'Component names to add')\n .option('-a, --all', 'Add all components')\n .option('-c, --cwd <path>', 'Current working directory', process.cwd())\n .action(addCommand);\n\nprogram.parse();\n"],"names":["Command","initCommand","addCommand","program","name","description","version","command","option","process","cwd","action","argument","parse"],"mappings":";AACA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,MAAMC,UAAU,IAAIH;AAEpBG,QACGC,IAAI,CAAC,iBACLC,WAAW,CAAC,4CACZC,OAAO,CAAC;AAEXH,QACGI,OAAO,CAAC,QACRF,WAAW,CAAC,wCACZG,MAAM,CAAC,aAAa,iCACpBA,MAAM,CAAC,oBAAoB,6BAA6BC,QAAQC,GAAG,IACnEC,MAAM,CAACV;AAEVE,QACGI,OAAO,CAAC,OACRF,WAAW,CAAC,kCACZO,QAAQ,CAAC,mBAAmB,0BAC5BJ,MAAM,CAAC,aAAa,sBACpBA,MAAM,CAAC,oBAAoB,6BAA6BC,QAAQC,GAAG,IACnEC,MAAM,CAACT;AAEVC,QAAQU,KAAK"}
@@ -15,7 +15,7 @@ export async function addCommand(components, options) {
15
15
  // Check if components.json exists (new config system)
16
16
  if (!hasComponentsConfig(cwd)) {
17
17
  console.log(chalk.red('❌ Galaxy UI is not initialized in this project.'));
18
- console.log(chalk.gray('Run') + chalk.cyan(' galaxy-ui init ') + chalk.gray('first.'));
18
+ console.log(chalk.gray('Run') + chalk.cyan(' galaxy-design init ') + chalk.gray('first.'));
19
19
  return;
20
20
  }
21
21
  // Load components.json configuration
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/add.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { resolve, join, dirname } from 'path';\nimport { existsSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { loadConfig, configExists } from '../utils/config.js';\nimport {\n loadComponentsConfig,\n hasComponentsConfig,\n getFrameworkFromConfig,\n} from '../utils/components-config.js';\nimport {\n loadFrameworkRegistry,\n getFrameworkComponent,\n getFrameworkComponentDependencies,\n getAllFrameworkComponents,\n} from '../utils/framework-registry.js';\nimport { writeFile, fileExists, readFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport type { Framework } from '../utils/config-schema.js';\nimport { fetchFileFromGitHub, getComponentGitHubPath } from '../utils/github-fetcher.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface AddOptions {\n all?: boolean;\n cwd: string;\n}\n\nexport async function addCommand(components: string[], options: AddOptions) {\n const cwd = options.cwd;\n\n // Check if components.json exists (new config system)\n if (!hasComponentsConfig(cwd)) {\n console.log(chalk.red('❌ Galaxy UI is not initialized in this project.'));\n console.log(chalk.gray('Run') + chalk.cyan(' galaxy-ui init ') + chalk.gray('first.'));\n return;\n }\n\n // Load components.json configuration\n const componentsConfig = loadComponentsConfig(cwd);\n if (!componentsConfig) {\n console.log(chalk.red('❌ Failed to load components.json configuration.'));\n return;\n }\n\n const framework = componentsConfig.framework;\n console.log(chalk.gray(`Framework detected: ${chalk.cyan(framework)}\\n`));\n\n // Load framework-specific registry\n const registry = loadFrameworkRegistry(framework);\n const allComponents = getAllFrameworkComponents(framework);\n\n // Determine which components to add\n let componentsToAdd: string[] = [];\n\n if (options.all) {\n // Add all components\n componentsToAdd = Object.keys(allComponents);\n } else if (components.length === 0) {\n // Interactive mode\n const choices = [];\n\n // Create choices organized by category\n const categories = new Map<string, any[]>();\n\n for (const [key, component] of Object.entries(allComponents)) {\n const category = component.category || 'other';\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push({ key, component });\n }\n\n for (const [category, items] of categories) {\n choices.push({\n title: chalk.bold.cyan(category.charAt(0).toUpperCase() + category.slice(1)),\n value: `category:${category}`,\n disabled: true,\n });\n\n for (const { key, component } of items) {\n choices.push({\n title: ` ${component.name}`,\n description: component.description || '',\n value: key,\n });\n }\n }\n\n const response = await prompts({\n type: 'multiselect',\n name: 'components',\n message: 'Which components would you like to add?',\n choices,\n hint: '- Space to select. Return to submit',\n });\n\n if (!response.components || response.components.length === 0) {\n console.log(chalk.gray('No components selected.'));\n return;\n }\n\n componentsToAdd = response.components;\n } else {\n // Add specified components\n for (const input of components) {\n // Check if component exists in registry\n if (allComponents[input]) {\n componentsToAdd.push(input);\n } else {\n console.log(chalk.yellow(`⚠ Component \"${input}\" not found. Skipping.`));\n }\n }\n }\n\n if (componentsToAdd.length === 0) {\n console.log(chalk.yellow('No valid components to add.'));\n return;\n }\n\n // Remove duplicates\n componentsToAdd = [...new Set(componentsToAdd)];\n\n console.log(chalk.bold.cyan(`\\n📦 Adding ${componentsToAdd.length} component(s)...\\n`));\n\n // Collect all dependencies\n const allDependencies: string[] = [];\n const allDevDependencies: string[] = [];\n\n // Add each component\n const results: { name: string; success: boolean; path?: string; error?: string }[] = [];\n\n for (const componentKey of componentsToAdd) {\n const component = getFrameworkComponent(framework, componentKey);\n\n if (!component) {\n results.push({\n name: componentKey,\n success: false,\n error: 'Component not found in registry',\n });\n continue;\n }\n\n const spinner = ora(`Adding ${chalk.cyan(component.name)}...`).start();\n\n try {\n // Get component destination path from aliases\n const componentsAlias = componentsConfig.aliases.components;\n const destPath = componentsAlias.replace('@/', '');\n const fullDestPath = resolve(cwd, destPath, 'ui');\n ensureDir(fullDestPath);\n\n // Get file extension based on framework\n const fileExtensions: Record<Framework, string> = {\n vue: '.vue',\n react: '.tsx',\n angular: '.component.ts',\n 'react-native': '.tsx',\n flutter: '.dart',\n };\n const ext = fileExtensions[framework];\n\n // Create component folder\n const componentFolderPath = join(fullDestPath, componentKey);\n ensureDir(componentFolderPath);\n\n // Copy component files from GitHub\n for (const file of component.files) {\n const fileName = file.includes('/') ? file.split('/').pop()! : file;\n const destFilePath = join(componentFolderPath, fileName);\n\n // Check if file already exists\n if (fileExists(destFilePath)) {\n spinner.warn(\n `${chalk.cyan(component.name)} - File already exists: ${fileName}`\n );\n continue;\n }\n\n try {\n // Fetch file from GitHub\n const sourceFolder = component.type === 'block' ? 'blocks' : 'components';\n const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${file}`;\n const content = await fetchFileFromGitHub(githubPath);\n writeFile(destFilePath, content);\n } catch (error) {\n // Try with capitalized file name\n try {\n const capitalizedFile = file.charAt(0).toUpperCase() + file.slice(1);\n const sourceFolder = component.type === 'block' ? 'blocks' : 'components';\n const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${capitalizedFile}`;\n const content = await fetchFileFromGitHub(githubPath);\n writeFile(destFilePath, content);\n } catch (capitalizedError) {\n // If both attempts fail, write a placeholder\n const placeholderContent = `// ${component.name} component for ${framework}\\n// TODO: Failed to fetch component from GitHub: ${error instanceof Error ? error.message : 'Unknown error'}\\n`;\n writeFile(destFilePath, placeholderContent);\n spinner.warn(`${chalk.yellow('⚠')} Failed to fetch ${file} from GitHub, created placeholder`);\n }\n }\n }\n\n spinner.succeed(\n `${chalk.green('✓')} Added ${chalk.cyan(component.name)} to ${chalk.gray(\n destPath + '/ui/' + componentKey + '/'\n )}`\n );\n\n results.push({\n name: component.name,\n success: true,\n path: componentFolderPath,\n });\n\n // Collect dependencies\n const deps = getFrameworkComponentDependencies(framework, componentKey);\n allDependencies.push(...deps.dependencies);\n allDevDependencies.push(...deps.devDependencies);\n } catch (error) {\n spinner.fail(`Failed to add ${chalk.cyan(component.name)}`);\n results.push({\n name: component.name,\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n\n // Install dependencies\n const uniqueDependencies = [...new Set(allDependencies)];\n const uniqueDevDependencies = [...new Set(allDevDependencies)];\n\n if (uniqueDependencies.length > 0 || uniqueDevDependencies.length > 0) {\n console.log('\\n');\n const installSpinner = ora('Installing dependencies...').start();\n\n try {\n if (uniqueDependencies.length > 0) {\n await installDependencies(uniqueDependencies, { cwd, dev: false, silent: true });\n }\n if (uniqueDevDependencies.length > 0) {\n await installDependencies(uniqueDevDependencies, { cwd, dev: true, silent: true });\n }\n installSpinner.succeed('Dependencies installed');\n } catch (error) {\n installSpinner.fail('Failed to install dependencies');\n console.log(chalk.yellow('Please install them manually:'));\n if (uniqueDependencies.length > 0) {\n console.log(chalk.gray(` npm install ${uniqueDependencies.join(' ')}`));\n }\n if (uniqueDevDependencies.length > 0) {\n console.log(chalk.gray(` npm install -D ${uniqueDevDependencies.join(' ')}`));\n }\n }\n }\n\n // Summary\n const successful = results.filter(r => r.success).length;\n const failed = results.filter(r => !r.success).length;\n\n console.log('\\n');\n\n if (successful > 0) {\n console.log(\n chalk.green.bold(`✓ Successfully added ${successful} component(s)`)\n );\n }\n\n if (failed > 0) {\n console.log(chalk.red.bold(`✗ Failed to add ${failed} component(s)`));\n for (const result of results.filter(r => !r.success)) {\n console.log(chalk.red(` - ${result.name}: ${result.error}`));\n }\n }\n\n // Next steps\n if (successful > 0) {\n console.log('\\n' + chalk.gray('Next steps:'));\n\n switch (framework) {\n case 'vue':\n console.log(chalk.gray(' 1. Import the components in your Vue component'));\n console.log(chalk.gray(' 2. Use them in your template'));\n break;\n case 'react':\n console.log(chalk.gray(' 1. Import the components in your React component'));\n console.log(chalk.gray(' 2. Use them in your JSX'));\n break;\n case 'angular':\n console.log(chalk.gray(' 1. Import the components in your Angular module or component'));\n console.log(chalk.gray(' 2. Use them in your templates'));\n break;\n }\n\n console.log(chalk.gray(' 3. Enjoy building with Galaxy UI! 🚀\\n'));\n }\n}\n"],"names":["prompts","chalk","ora","resolve","join","dirname","fileURLToPath","loadComponentsConfig","hasComponentsConfig","loadFrameworkRegistry","getFrameworkComponent","getFrameworkComponentDependencies","getAllFrameworkComponents","writeFile","fileExists","ensureDir","installDependencies","fetchFileFromGitHub","__filename","url","__dirname","addCommand","components","options","cwd","console","log","red","gray","cyan","componentsConfig","framework","registry","allComponents","componentsToAdd","all","Object","keys","length","choices","categories","Map","key","component","entries","category","has","set","get","push","items","title","bold","charAt","toUpperCase","slice","value","disabled","name","description","response","type","message","hint","input","yellow","Set","allDependencies","allDevDependencies","results","componentKey","success","error","spinner","start","componentsAlias","aliases","destPath","replace","fullDestPath","fileExtensions","vue","react","angular","flutter","ext","componentFolderPath","file","files","fileName","includes","split","pop","destFilePath","warn","sourceFolder","githubPath","content","capitalizedFile","capitalizedError","placeholderContent","Error","succeed","green","path","deps","dependencies","devDependencies","fail","uniqueDependencies","uniqueDevDependencies","installSpinner","dev","silent","successful","filter","r","failed","result"],"mappings":"AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAE9C,SAASC,aAAa,QAAQ,MAAM;AAEpC,SACEC,oBAA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G,CAAC,OAAOzB,MAAM2B,IAAI,CAAC;QAE9B,OAAQG;YACN,KAAK;gBACHN,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;QACJ;QAEAH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;IACzB;AACF"}
1
+ {"version":3,"sources":["../../src/commands/add.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { resolve, join, dirname } from 'path';\nimport { existsSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { loadConfig, configExists } from '../utils/config.js';\nimport {\n loadComponentsConfig,\n hasComponentsConfig,\n getFrameworkFromConfig,\n} from '../utils/components-config.js';\nimport {\n loadFrameworkRegistry,\n getFrameworkComponent,\n getFrameworkComponentDependencies,\n getAllFrameworkComponents,\n} from '../utils/framework-registry.js';\nimport { writeFile, fileExists, readFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport type { Framework } from '../utils/config-schema.js';\nimport { fetchFileFromGitHub, getComponentGitHubPath } from '../utils/github-fetcher.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface AddOptions {\n all?: boolean;\n cwd: string;\n}\n\nexport async function addCommand(components: string[], options: AddOptions) {\n const cwd = options.cwd;\n\n // Check if components.json exists (new config system)\n if (!hasComponentsConfig(cwd)) {\n console.log(chalk.red('❌ Galaxy UI is not initialized in this project.'));\n console.log(chalk.gray('Run') + chalk.cyan(' galaxy-design init ') + chalk.gray('first.'));\n return;\n }\n\n // Load components.json configuration\n const componentsConfig = loadComponentsConfig(cwd);\n if (!componentsConfig) {\n console.log(chalk.red('❌ Failed to load components.json configuration.'));\n return;\n }\n\n const framework = componentsConfig.framework;\n console.log(chalk.gray(`Framework detected: ${chalk.cyan(framework)}\\n`));\n\n // Load framework-specific registry\n const registry = loadFrameworkRegistry(framework);\n const allComponents = getAllFrameworkComponents(framework);\n\n // Determine which components to add\n let componentsToAdd: string[] = [];\n\n if (options.all) {\n // Add all components\n componentsToAdd = Object.keys(allComponents);\n } else if (components.length === 0) {\n // Interactive mode\n const choices = [];\n\n // Create choices organized by category\n const categories = new Map<string, any[]>();\n\n for (const [key, component] of Object.entries(allComponents)) {\n const category = component.category || 'other';\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push({ key, component });\n }\n\n for (const [category, items] of categories) {\n choices.push({\n title: chalk.bold.cyan(category.charAt(0).toUpperCase() + category.slice(1)),\n value: `category:${category}`,\n disabled: true,\n });\n\n for (const { key, component } of items) {\n choices.push({\n title: ` ${component.name}`,\n description: component.description || '',\n value: key,\n });\n }\n }\n\n const response = await prompts({\n type: 'multiselect',\n name: 'components',\n message: 'Which components would you like to add?',\n choices,\n hint: '- Space to select. Return to submit',\n });\n\n if (!response.components || response.components.length === 0) {\n console.log(chalk.gray('No components selected.'));\n return;\n }\n\n componentsToAdd = response.components;\n } else {\n // Add specified components\n for (const input of components) {\n // Check if component exists in registry\n if (allComponents[input]) {\n componentsToAdd.push(input);\n } else {\n console.log(chalk.yellow(`⚠ Component \"${input}\" not found. Skipping.`));\n }\n }\n }\n\n if (componentsToAdd.length === 0) {\n console.log(chalk.yellow('No valid components to add.'));\n return;\n }\n\n // Remove duplicates\n componentsToAdd = [...new Set(componentsToAdd)];\n\n console.log(chalk.bold.cyan(`\\n📦 Adding ${componentsToAdd.length} component(s)...\\n`));\n\n // Collect all dependencies\n const allDependencies: string[] = [];\n const allDevDependencies: string[] = [];\n\n // Add each component\n const results: { name: string; success: boolean; path?: string; error?: string }[] = [];\n\n for (const componentKey of componentsToAdd) {\n const component = getFrameworkComponent(framework, componentKey);\n\n if (!component) {\n results.push({\n name: componentKey,\n success: false,\n error: 'Component not found in registry',\n });\n continue;\n }\n\n const spinner = ora(`Adding ${chalk.cyan(component.name)}...`).start();\n\n try {\n // Get component destination path from aliases\n const componentsAlias = componentsConfig.aliases.components;\n const destPath = componentsAlias.replace('@/', '');\n const fullDestPath = resolve(cwd, destPath, 'ui');\n ensureDir(fullDestPath);\n\n // Get file extension based on framework\n const fileExtensions: Record<Framework, string> = {\n vue: '.vue',\n react: '.tsx',\n angular: '.component.ts',\n 'react-native': '.tsx',\n flutter: '.dart',\n };\n const ext = fileExtensions[framework];\n\n // Create component folder\n const componentFolderPath = join(fullDestPath, componentKey);\n ensureDir(componentFolderPath);\n\n // Copy component files from GitHub\n for (const file of component.files) {\n const fileName = file.includes('/') ? file.split('/').pop()! : file;\n const destFilePath = join(componentFolderPath, fileName);\n\n // Check if file already exists\n if (fileExists(destFilePath)) {\n spinner.warn(\n `${chalk.cyan(component.name)} - File already exists: ${fileName}`\n );\n continue;\n }\n\n try {\n // Fetch file from GitHub\n const sourceFolder = component.type === 'block' ? 'blocks' : 'components';\n const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${file}`;\n const content = await fetchFileFromGitHub(githubPath);\n writeFile(destFilePath, content);\n } catch (error) {\n // Try with capitalized file name\n try {\n const capitalizedFile = file.charAt(0).toUpperCase() + file.slice(1);\n const sourceFolder = component.type === 'block' ? 'blocks' : 'components';\n const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${capitalizedFile}`;\n const content = await fetchFileFromGitHub(githubPath);\n writeFile(destFilePath, content);\n } catch (capitalizedError) {\n // If both attempts fail, write a placeholder\n const placeholderContent = `// ${component.name} component for ${framework}\\n// TODO: Failed to fetch component from GitHub: ${error instanceof Error ? error.message : 'Unknown error'}\\n`;\n writeFile(destFilePath, placeholderContent);\n spinner.warn(`${chalk.yellow('⚠')} Failed to fetch ${file} from GitHub, created placeholder`);\n }\n }\n }\n\n spinner.succeed(\n `${chalk.green('✓')} Added ${chalk.cyan(component.name)} to ${chalk.gray(\n destPath + '/ui/' + componentKey + '/'\n )}`\n );\n\n results.push({\n name: component.name,\n success: true,\n path: componentFolderPath,\n });\n\n // Collect dependencies\n const deps = getFrameworkComponentDependencies(framework, componentKey);\n allDependencies.push(...deps.dependencies);\n allDevDependencies.push(...deps.devDependencies);\n } catch (error) {\n spinner.fail(`Failed to add ${chalk.cyan(component.name)}`);\n results.push({\n name: component.name,\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n\n // Install dependencies\n const uniqueDependencies = [...new Set(allDependencies)];\n const uniqueDevDependencies = [...new Set(allDevDependencies)];\n\n if (uniqueDependencies.length > 0 || uniqueDevDependencies.length > 0) {\n console.log('\\n');\n const installSpinner = ora('Installing dependencies...').start();\n\n try {\n if (uniqueDependencies.length > 0) {\n await installDependencies(uniqueDependencies, { cwd, dev: false, silent: true });\n }\n if (uniqueDevDependencies.length > 0) {\n await installDependencies(uniqueDevDependencies, { cwd, dev: true, silent: true });\n }\n installSpinner.succeed('Dependencies installed');\n } catch (error) {\n installSpinner.fail('Failed to install dependencies');\n console.log(chalk.yellow('Please install them manually:'));\n if (uniqueDependencies.length > 0) {\n console.log(chalk.gray(` npm install ${uniqueDependencies.join(' ')}`));\n }\n if (uniqueDevDependencies.length > 0) {\n console.log(chalk.gray(` npm install -D ${uniqueDevDependencies.join(' ')}`));\n }\n }\n }\n\n // Summary\n const successful = results.filter(r => r.success).length;\n const failed = results.filter(r => !r.success).length;\n\n console.log('\\n');\n\n if (successful > 0) {\n console.log(\n chalk.green.bold(`✓ Successfully added ${successful} component(s)`)\n );\n }\n\n if (failed > 0) {\n console.log(chalk.red.bold(`✗ Failed to add ${failed} component(s)`));\n for (const result of results.filter(r => !r.success)) {\n console.log(chalk.red(` - ${result.name}: ${result.error}`));\n }\n }\n\n // Next steps\n if (successful > 0) {\n console.log('\\n' + chalk.gray('Next steps:'));\n\n switch (framework) {\n case 'vue':\n console.log(chalk.gray(' 1. Import the components in your Vue component'));\n console.log(chalk.gray(' 2. Use them in your template'));\n break;\n case 'react':\n console.log(chalk.gray(' 1. Import the components in your React component'));\n console.log(chalk.gray(' 2. Use them in your JSX'));\n break;\n case 'angular':\n console.log(chalk.gray(' 1. Import the components in your Angular module or component'));\n console.log(chalk.gray(' 2. Use them in your templates'));\n break;\n }\n\n console.log(chalk.gray(' 3. Enjoy building with Galaxy UI! 🚀\\n'));\n }\n}\n"],"names":["prompts","chalk","ora","resolve","join","dirname","fileURLToPath","loadComponentsConfig","hasComponentsConfig","loadFrameworkRegistry","getFrameworkComponent","getFrameworkComponentDependencies","getAllFrameworkComponents","writeFile","fileExists","ensureDir","installDependencies","fetchFileFromGitHub","__filename","url","__dirname","addCommand","components","options","cwd","console","log","red","gray","cyan","componentsConfig","framework","registry","allComponents","componentsToAdd","all","Object","keys","length","choices","categories","Map","key","component","entries","category","has","set","get","push","items","title","bold","charAt","toUpperCase","slice","value","disabled","name","description","response","type","message","hint","input","yellow","Set","allDependencies","allDevDependencies","results","componentKey","success","error","spinner","start","componentsAlias","aliases","destPath","replace","fullDestPath","fileExtensions","vue","react","angular","flutter","ext","componentFolderPath","file","files","fileName","includes","split","pop","destFilePath","warn","sourceFolder","githubPath","content","capitalizedFile","capitalizedError","placeholderContent","Error","succeed","green","path","deps","dependencies","devDependencies","fail","uniqueDependencies","uniqueDevDependencies","installSpinner","dev","silent","successful","filter","r","failed","result"],"mappings":"AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAE9C,SAASC,aAAa,QAAQ,MAAM;AAEpC,SACEC,oBAAoB,EACpBC,mBAAmB,QAEd,gCAAgC;AACvC,SACEC,qBA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;YACN,KAAK;gBACHN,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;gBACvB;QACJ;QAEAH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;IACzB;AACF"}
@@ -241,9 +241,9 @@ export async function initCommand(options) {
241
241
  console.log(chalk.white(` 1. Configure Tailwind CSS in ${config.tailwind.config}`));
242
242
  console.log(chalk.white(` 2. Import utilities in ${config.tailwind.css}`));
243
243
  console.log(chalk.white(` 3. Add components:`));
244
- console.log(chalk.gray(` galaxy-ui add button`));
245
- console.log(chalk.gray(` galaxy-ui add input card`));
246
- console.log(chalk.gray(` galaxy-ui add --all\n`));
244
+ console.log(chalk.gray(` galaxy-design add button`));
245
+ console.log(chalk.gray(` galaxy-design add input card`));
246
+ console.log(chalk.gray(` galaxy-design add --all\n`));
247
247
  console.log(chalk.cyan('Learn more:'));
248
248
  console.log(chalk.white(' Documentation: https://galaxy-design.vercel.app'));
249
249
  console.log(chalk.white(' GitHub: https://github.com/buikevin/galaxy-design\n'));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/init.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n detectFramework,\n detectPackageManager,\n type Framework as DetectedFramework,\n} from '../utils/detect.js';\nimport {\n createComponentsConfig,\n hasComponentsConfig,\n loadComponentsConfig,\n type Framework,\n} from '../utils/components-config.js';\nimport {\n getDefaultConfig,\n type BaseColor,\n type IconLibrary,\n} from '../utils/config-schema.js';\nimport { writeFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport { resolve } from 'path';\n\ninterface InitOptions {\n yes?: boolean;\n cwd: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n console.log(chalk.bold.cyan('\\n🌌 Galaxy UI CLI - Multi-Framework Edition\\n'));\n\n const cwd = options.cwd;\n\n // Check if already initialized\n if (hasComponentsConfig(cwd)) {\n console.log(chalk.yellow('⚠ components.json already exists in this project.'));\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'Do you want to overwrite the existing configuration?',\n initial: false,\n });\n\n if (!overwrite) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n }\n\n // Detect framework\n const detectedFramework = detectFramework(cwd);\n\n if (detectedFramework === 'unknown') {\n console.log(\n chalk.red(\n '❌ Could not detect framework. Please ensure you are in a valid Angular, React, Vue, React Native, or Flutter project.'\n )\n );\n return;\n }\n\n console.log(chalk.green(`✓ Detected ${chalk.bold(detectedFramework)} framework`));\n\n // Map detected framework to Framework type\n const frameworkMap: Record<DetectedFramework, Framework | null> = {\n angular: 'angular',\n react: 'react',\n vue: 'vue',\n 'react-native': 'react-native',\n flutter: 'flutter',\n unknown: null,\n };\n\n const framework = frameworkMap[detectedFramework];\n if (!framework) {\n console.log(chalk.red('❌ Unsupported framework detected.'));\n return;\n }\n\n // Detect package manager\n const packageManager = detectPackageManager(cwd);\n console.log(chalk.green(`✓ Using ${chalk.bold(packageManager)} package manager`));\n\n // Get configuration from user (or use defaults with --yes)\n let config = getDefaultConfig(framework);\n\n if (!options.yes) {\n console.log(chalk.cyan('\\n📝 Configuration\\n'));\n\n // Build prompts based on framework\n const promptQuestions: any[] = [];\n\n // TypeScript prompt (not for Flutter)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'toggle',\n name: 'typescript',\n message: 'Would you like to use TypeScript?',\n initial: true,\n active: 'yes',\n inactive: 'no',\n });\n }\n\n // Base color prompt (for all frameworks)\n promptQuestions.push({\n type: 'select',\n name: 'baseColor',\n message: 'Which base color would you like to use?',\n choices: [\n { title: 'Slate', value: 'slate' },\n { title: 'Gray', value: 'gray' },\n { title: 'Zinc', value: 'zinc' },\n { title: 'Neutral', value: 'neutral' },\n { title: 'Stone', value: 'stone' },\n ],\n initial: 0,\n });\n\n // Icon library prompt (not for Flutter - uses built-in icons)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'select',\n name: 'iconLibrary',\n message: 'Which icon library would you like to use?',\n choices: [\n { title: 'Lucide (Recommended)', value: 'lucide' },\n { title: 'Heroicons', value: 'heroicons' },\n { title: 'Radix Icons', value: 'radix-icons' },\n ],\n initial: 0,\n });\n }\n\n // CSS file prompt (only for web frameworks and React Native)\n if (framework !== 'flutter' && config.tailwind.css) {\n promptQuestions.push({\n type: 'text',\n name: 'cssFile',\n message: framework === 'react-native'\n ? 'Where is your global CSS file (for NativeWind)?'\n : 'Where is your global CSS file?',\n initial: config.tailwind.css,\n });\n }\n\n const answers = await prompts(promptQuestions);\n\n if (Object.keys(answers).length === 0) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n\n // Update config with user choices\n config = {\n ...config,\n typescript: answers.typescript ?? config.typescript,\n iconLibrary: (answers.iconLibrary as IconLibrary) ?? config.iconLibrary,\n tailwind: {\n ...config.tailwind,\n baseColor: (answers.baseColor as BaseColor) ?? config.tailwind.baseColor,\n css: answers.cssFile ?? config.tailwind.css,\n },\n };\n }\n\n console.log(chalk.cyan('\\n📦 Installing dependencies...\\n'));\n\n // Install dependencies\n const spinner = ora('Installing dependencies...').start();\n\n const dependencies: string[] = [];\n const devDependencies: string[] = [];\n\n // Common dependencies\n dependencies.push('clsx', 'tailwind-merge');\n\n // Framework-specific dependencies\n switch (framework) {\n case 'vue':\n dependencies.push('radix-vue');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-vue-next');\n }\n break;\n\n case 'react':\n dependencies.push('@radix-ui/react-slot');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-react');\n }\n if (config.typescript) {\n devDependencies.push('@types/react', '@types/react-dom');\n }\n break;\n\n case 'angular':\n // Angular components use Radix NG primitives\n dependencies.push('@radix-ng/primitives');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-angular');\n }\n break;\n }\n\n try {\n // Install dependencies\n if (dependencies.length > 0) {\n await installDependencies(dependencies, {\n cwd,\n silent: true,\n });\n }\n\n // Install devDependencies\n if (devDependencies.length > 0) {\n await installDependencies(devDependencies, {\n cwd,\n dev: true,\n silent: true,\n });\n }\n\n spinner.succeed('Dependencies installed');\n } catch (error) {\n spinner.fail('Failed to install dependencies');\n console.error(chalk.red(error));\n return;\n }\n\n // Create directories\n const dirSpinner = ora('Creating directories...').start();\n\n try {\n const componentsPath = resolve(cwd, config.aliases.components.replace('@/', ''));\n const utilsPath = resolve(cwd, config.aliases.utils.replace('@/', ''));\n\n await ensureDir(componentsPath);\n await ensureDir(resolve(componentsPath, 'ui'));\n await ensureDir(utilsPath.replace('/utils', '')); // Create lib dir\n\n dirSpinner.succeed('Directories created');\n } catch (error) {\n dirSpinner.fail('Failed to create directories');\n console.error(chalk.red(error));\n return;\n }\n\n // Create utils file\n const utilsSpinner = ora('Creating utility functions...').start();\n\n try {\n const utilsPath = resolve(cwd, config.aliases.utils.replace('@/', '') + '.ts');\n const utilsContent = getUtilsContent();\n writeFile(utilsPath, utilsContent);\n\n utilsSpinner.succeed('Utility functions created');\n } catch (error) {\n utilsSpinner.fail('Failed to create utility functions');\n console.error(chalk.red(error));\n return;\n }\n\n // Save components.json\n const configSpinner = ora('Creating components.json...').start();\n\n try {\n createComponentsConfig(cwd, framework);\n configSpinner.succeed('components.json created');\n } catch (error) {\n configSpinner.fail('Failed to create components.json');\n console.error(chalk.red(error));\n return;\n }\n\n // Success message\n console.log(chalk.green('\\n✨ Success! Galaxy UI has been initialized.\\n'));\n console.log(chalk.cyan('Next steps:\\n'));\n console.log(chalk.white(` 1. Configure Tailwind CSS in ${config.tailwind.config}`));\n console.log(chalk.white(` 2. Import utilities in ${config.tailwind.css}`));\n console.log(chalk.white(` 3. Add components:`));\n console.log(chalk.gray(` galaxy-ui add button`));\n console.log(chalk.gray(` galaxy-ui add input card`));\n console.log(chalk.gray(` galaxy-ui add --all\\n`));\n\n console.log(chalk.cyan('Learn more:'));\n console.log(chalk.white(' Documentation: https://galaxy-design.vercel.app'));\n console.log(chalk.white(' GitHub: https://github.com/buikevin/galaxy-design\\n'));\n}\n\n/**\n * Get utils.ts content\n */\nfunction getUtilsContent(): string {\n return `import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge Tailwind CSS classes\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n}\n"],"names":["prompts","chalk","ora","detectFramework","detectPackageManager","createComponentsConfig","hasComponentsConfig","getDefaultConfig","writeFile","ensureDir","installDependencies","resolve","initCommand","options","console","log","bold","cyan","cwd","yellow","overwrite","type","name","message","initial","gray","detectedFramework","red","green","frameworkMap","angular","react","vue","flutter","unknown","framework","packageManager","config","yes","promptQuestions","push","active","inactive","choices","title","value","tailwind","css","answers","Object","keys","length","typescript","iconLibrary","baseColor","cssFile","spinner","start","dependencies","devDependencies","silent","dev","succeed","error","fail","dirSpinner","componentsPath","aliases","components","replace","utilsPath","utils","utilsSpinner","utilsContent","getUtilsContent","configSpinner","white"],"mappings":";AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SACEC,eAAe,EACfC,oBAAoB,QAEf,qBAAqB;AAC5B,SACEC,sBAAsB,EACtBC,mBAAmB,QAGd,gCAAgC;AACvC,SACEC,gBAAgB,QAGX,4BAA4B;AACnC,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,mBAAmB,QAAQ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IACF;IAEA,uBAAuB;IACvB,MAAMY,gBAAgBzE,IAAI,+BAA+BuD,KAAK;IAE9D,IAAI;QACFpD,uBAAuBa,KAAKiB;QAC5BwC,cAAcb,OAAO,CAAC;IACxB,EAAE,OAAOC,OAAO;QACdY,cAAcX,IAAI,CAAC;QACnBlD,QAAQiD,KAAK,CAAC9D,MAAM0B,GAAG,CAACoC;QACxB;IACF;IAEA,kBAAkB;IAClBjD,QAAQC,GAAG,CAACd,MAAM2B,KAAK,CAAC;IACxBd,QAAQC,GAAG,CAACd,MAAMgB,IAAI,CAAC;IACvBH,QAAQC,GAAG,CAACd,MAAM2E,KAAK,CAAC,CAAC,+BAA+B,EAAEvC,OAAOS,QAAQ,CAACT,MAAM,EAAE;IAClFvB,QAAQC,GAAG,CAACd,MAAM2E,KAAK,CAAC,CAAC,yBAAyB,EAAEvC,OAAOS,QAAQ,CAACC,GAAG,EAAE;IACzEjC,QAAQC,GAAG,CAACd,MAAM2E,KAAK,CAAC,CAAC,oBAAoB,CAAC;IAC9C9D,QAAQC,GAAG,CAACd,MAAMwB,IAAI,CAAC,CAAC,yBAAyB,CAAC;IAClDX,QAAQC,GAAG,CAACd,MAAMwB,IAAI,CAAC,CAAC,6BAA6B,CAAC;IACtDX,QAAQC,GAAG,CAACd,MAAMwB,IAAI,CAAC,CAAC,0BAA0B,CAAC;IAEnDX,QAAQC,GAAG,CAACd,MAAMgB,IAAI,CAAC;IACvBH,QAAQC,GAAG,CAACd,MAAM2E,KAAK,CAAC;IACxB9D,QAAQC,GAAG,CAACd,MAAM2E,KAAK,CAAC;AAC1B;AAEA;;CAEC,GACD,SAASF;IACP,OAAO,CAAC;;;;;;;;;AASV,CAAC;AACD"}
1
+ {"version":3,"sources":["../../src/commands/init.ts"],"sourcesContent":["import prompts from 'prompts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n detectFramework,\n detectPackageManager,\n type Framework as DetectedFramework,\n} from '../utils/detect.js';\nimport {\n createComponentsConfig,\n hasComponentsConfig,\n loadComponentsConfig,\n type Framework,\n} from '../utils/components-config.js';\nimport {\n getDefaultConfig,\n type BaseColor,\n type IconLibrary,\n} from '../utils/config-schema.js';\nimport { writeFile, ensureDir } from '../utils/files.js';\nimport { installDependencies } from '../utils/package-manager.js';\nimport { resolve } from 'path';\n\ninterface InitOptions {\n yes?: boolean;\n cwd: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n console.log(chalk.bold.cyan('\\n🌌 Galaxy UI CLI - Multi-Framework Edition\\n'));\n\n const cwd = options.cwd;\n\n // Check if already initialized\n if (hasComponentsConfig(cwd)) {\n console.log(chalk.yellow('⚠ components.json already exists in this project.'));\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'Do you want to overwrite the existing configuration?',\n initial: false,\n });\n\n if (!overwrite) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n }\n\n // Detect framework\n const detectedFramework = detectFramework(cwd);\n\n if (detectedFramework === 'unknown') {\n console.log(\n chalk.red(\n '❌ Could not detect framework. Please ensure you are in a valid Angular, React, Vue, React Native, or Flutter project.'\n )\n );\n return;\n }\n\n console.log(chalk.green(`✓ Detected ${chalk.bold(detectedFramework)} framework`));\n\n // Map detected framework to Framework type\n const frameworkMap: Record<DetectedFramework, Framework | null> = {\n angular: 'angular',\n react: 'react',\n vue: 'vue',\n 'react-native': 'react-native',\n flutter: 'flutter',\n unknown: null,\n };\n\n const framework = frameworkMap[detectedFramework];\n if (!framework) {\n console.log(chalk.red('❌ Unsupported framework detected.'));\n return;\n }\n\n // Detect package manager\n const packageManager = detectPackageManager(cwd);\n console.log(chalk.green(`✓ Using ${chalk.bold(packageManager)} package manager`));\n\n // Get configuration from user (or use defaults with --yes)\n let config = getDefaultConfig(framework);\n\n if (!options.yes) {\n console.log(chalk.cyan('\\n📝 Configuration\\n'));\n\n // Build prompts based on framework\n const promptQuestions: any[] = [];\n\n // TypeScript prompt (not for Flutter)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'toggle',\n name: 'typescript',\n message: 'Would you like to use TypeScript?',\n initial: true,\n active: 'yes',\n inactive: 'no',\n });\n }\n\n // Base color prompt (for all frameworks)\n promptQuestions.push({\n type: 'select',\n name: 'baseColor',\n message: 'Which base color would you like to use?',\n choices: [\n { title: 'Slate', value: 'slate' },\n { title: 'Gray', value: 'gray' },\n { title: 'Zinc', value: 'zinc' },\n { title: 'Neutral', value: 'neutral' },\n { title: 'Stone', value: 'stone' },\n ],\n initial: 0,\n });\n\n // Icon library prompt (not for Flutter - uses built-in icons)\n if (framework !== 'flutter') {\n promptQuestions.push({\n type: 'select',\n name: 'iconLibrary',\n message: 'Which icon library would you like to use?',\n choices: [\n { title: 'Lucide (Recommended)', value: 'lucide' },\n { title: 'Heroicons', value: 'heroicons' },\n { title: 'Radix Icons', value: 'radix-icons' },\n ],\n initial: 0,\n });\n }\n\n // CSS file prompt (only for web frameworks and React Native)\n if (framework !== 'flutter' && config.tailwind.css) {\n promptQuestions.push({\n type: 'text',\n name: 'cssFile',\n message: framework === 'react-native'\n ? 'Where is your global CSS file (for NativeWind)?'\n : 'Where is your global CSS file?',\n initial: config.tailwind.css,\n });\n }\n\n const answers = await prompts(promptQuestions);\n\n if (Object.keys(answers).length === 0) {\n console.log(chalk.gray('Initialization cancelled.'));\n return;\n }\n\n // Update config with user choices\n config = {\n ...config,\n typescript: answers.typescript ?? config.typescript,\n iconLibrary: (answers.iconLibrary as IconLibrary) ?? config.iconLibrary,\n tailwind: {\n ...config.tailwind,\n baseColor: (answers.baseColor as BaseColor) ?? config.tailwind.baseColor,\n css: answers.cssFile ?? config.tailwind.css,\n },\n };\n }\n\n console.log(chalk.cyan('\\n📦 Installing dependencies...\\n'));\n\n // Install dependencies\n const spinner = ora('Installing dependencies...').start();\n\n const dependencies: string[] = [];\n const devDependencies: string[] = [];\n\n // Common dependencies\n dependencies.push('clsx', 'tailwind-merge');\n\n // Framework-specific dependencies\n switch (framework) {\n case 'vue':\n dependencies.push('radix-vue');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-vue-next');\n }\n break;\n\n case 'react':\n dependencies.push('@radix-ui/react-slot');\n devDependencies.push('tailwindcss', 'autoprefixer', 'postcss');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-react');\n }\n if (config.typescript) {\n devDependencies.push('@types/react', '@types/react-dom');\n }\n break;\n\n case 'angular':\n // Angular components use Radix NG primitives\n dependencies.push('@radix-ng/primitives');\n if (config.iconLibrary === 'lucide') {\n dependencies.push('lucide-angular');\n }\n break;\n }\n\n try {\n // Install dependencies\n if (dependencies.length > 0) {\n await installDependencies(dependencies, {\n cwd,\n silent: true,\n });\n }\n\n // Install devDependencies\n if (devDependencies.length > 0) {\n await installDependencies(devDependencies, {\n cwd,\n dev: true,\n silent: true,\n });\n }\n\n spinner.succeed('Dependencies installed');\n } catch (error) {\n spinner.fail('Failed to install dependencies');\n console.error(chalk.red(error));\n return;\n }\n\n // Create directories\n const dirSpinner = ora('Creating directories...').start();\n\n try {\n const componentsPath = resolve(cwd, config.aliases.components.replace('@/', ''));\n const utilsPath = resolve(cwd, config.aliases.utils.replace('@/', ''));\n\n await ensureDir(componentsPath);\n await ensureDir(resolve(componentsPath, 'ui'));\n await ensureDir(utilsPath.replace('/utils', '')); // Create lib dir\n\n dirSpinner.succeed('Directories created');\n } catch (error) {\n dirSpinner.fail('Failed to create directories');\n console.error(chalk.red(error));\n return;\n }\n\n // Create utils file\n const utilsSpinner = ora('Creating utility functions...').start();\n\n try {\n const utilsPath = resolve(cwd, config.aliases.utils.replace('@/', '') + '.ts');\n const utilsContent = getUtilsContent();\n writeFile(utilsPath, utilsContent);\n\n utilsSpinner.succeed('Utility functions created');\n } catch (error) {\n utilsSpinner.fail('Failed to create utility functions');\n console.error(chalk.red(error));\n return;\n }\n\n // Save components.json\n const configSpinner = ora('Creating components.json...').start();\n\n try {\n createComponentsConfig(cwd, framework);\n configSpinner.succeed('components.json created');\n } catch (error) {\n configSpinner.fail('Failed to create components.json');\n console.error(chalk.red(error));\n return;\n }\n\n // Success message\n console.log(chalk.green('\\n✨ Success! Galaxy UI has been initialized.\\n'));\n console.log(chalk.cyan('Next steps:\\n'));\n console.log(chalk.white(` 1. Configure Tailwind CSS in ${config.tailwind.config}`));\n console.log(chalk.white(` 2. Import utilities in ${config.tailwind.css}`));\n console.log(chalk.white(` 3. Add components:`));\n console.log(chalk.gray(` galaxy-design add button`));\n console.log(chalk.gray(` galaxy-design add input card`));\n console.log(chalk.gray(` galaxy-design add --all\\n`));\n\n console.log(chalk.cyan('Learn more:'));\n console.log(chalk.white(' Documentation: https://galaxy-design.vercel.app'));\n console.log(chalk.white(' GitHub: https://github.com/buikevin/galaxy-design\\n'));\n}\n\n/**\n * Get utils.ts content\n */\nfunction getUtilsContent(): string {\n return `import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge Tailwind CSS classes\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n`;\n}\n"],"names":["prompts","chalk","ora","detectFramework","detectPackageManager","createComponentsConfig","hasComponentsConfig","getDefaultConfig","writeFile","ensureDir","installDependencies","resolve","initCommand","options","console","log","bold","cyan","cwd","yellow","overwrite","type","name","message","initial","gray","detectedFramework","red","green","frameworkMap","angular","react","vue","flutter","unknown","framework","packageManager","config","yes","promptQuestions","push","active","inactive","choices","title","value","tailwind","css","answers","Object","keys","length","typescript","iconLibrary","baseColor","cssFile","spinner","start","dependencies","devDependencies","silent","dev","succeed","error","fail","dirSpinner","componentsPath","aliases","components","replace","utilsPath","utils","utilsSpinner","utilsContent","getUtilsContent","configSpinner","white"],"mappings":";AAAA,OAAOA,aAAa,UAAU;AAC9B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SACEC,eAAe,EACfC,oBAAoB,QAEf,qBAAqB;AAC5B,SACEC,sBAAsB,EACtBC,mBAAm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"galaxy-design",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI tool for adding Galaxy UI components to your Vue, React, Angular, React Native, or Flutter project",
5
5
  "author": "Bùi Trọng Hiếu (kevinbui) <kevinbui210191@gmail.com>",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "exports": {
50
50
  "./package.json": "./package.json",
51
51
  ".": {
52
- "@galaxy-ui-cli/source": "./src/index.ts",
52
+ "@galaxy-design/source": "./src/index.ts",
53
53
  "types": "./dist/index.d.ts",
54
54
  "import": "./dist/index.js",
55
55
  "default": "./dist/index.js"