galaxy-design 0.2.3 → 0.2.4

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.
@@ -129,6 +129,11 @@ export async function addCommand(components, options) {
129
129
  // Create component folder
130
130
  const componentFolderPath = join(fullDestPath, componentKey);
131
131
  ensureDir(componentFolderPath);
132
+ // Map framework to actual package framework for GitHub path
133
+ // Next.js uses React components, Nuxt.js uses Vue components
134
+ let packageFramework = framework;
135
+ if (framework === 'nextjs') packageFramework = 'react';
136
+ if (framework === 'nuxtjs') packageFramework = 'vue';
132
137
  // Copy component files from GitHub
133
138
  for (const file of component.files){
134
139
  const fileName = file.includes('/') ? file.split('/').pop() : file;
@@ -139,9 +144,9 @@ export async function addCommand(components, options) {
139
144
  continue;
140
145
  }
141
146
  try {
142
- // Fetch file from GitHub
147
+ // Fetch file from GitHub (use packageFramework for correct path)
143
148
  const sourceFolder = component.type === 'block' ? 'blocks' : 'components';
144
- const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${file}`;
149
+ const githubPath = `packages/${packageFramework}/src/${sourceFolder}/${componentKey}/${file}`;
145
150
  const content = await fetchFileFromGitHub(githubPath);
146
151
  writeFile(destFilePath, content);
147
152
  } catch (error) {
@@ -149,7 +154,7 @@ export async function addCommand(components, options) {
149
154
  try {
150
155
  const capitalizedFile = file.charAt(0).toUpperCase() + file.slice(1);
151
156
  const sourceFolder = component.type === 'block' ? 'blocks' : 'components';
152
- const githubPath = `packages/${framework}/src/${sourceFolder}/${componentKey}/${capitalizedFile}`;
157
+ const githubPath = `packages/${packageFramework}/src/${sourceFolder}/${componentKey}/${capitalizedFile}`;
153
158
  const content = await fetchFileFromGitHub(githubPath);
154
159
  writeFile(destFilePath, content);
155
160
  } catch (capitalizedError) {
@@ -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-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,qBAAqB,EACrBC,qBAAqB,EACrBC,iCAAiC,EACjCC,yBAAyB,QACpB,iCAAiC;AACxC,SAASC,SAAS,EAAEC,UAAU,EAAYC,SAAS,QAAQ,oBAAoB;AAC/E,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,SAASC,mBAAmB,QAAgC,6BAA6B;AAEzF,MAAMC,aAAaZ,cAAc,YAAYa,GAAG;AAChD,MAAMC,YAAYf,QAAQa;AAO1B,OAAO,eAAeG,WAAWC,UAAoB,EAAEC,OAAmB;IACxE,MAAMC,MAAMD,QAAQC,GAAG;IAEvB,sDAAsD;IACtD,IAAI,CAAChB,oBAAoBgB,MAAM;QAC7BC,QAAQC,GAAG,CAACzB,MAAM0B,GAAG,CAAC;QACtBF,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC,SAAS3B,MAAM4B,IAAI,CAAC,0BAA0B5B,MAAM2B,IAAI,CAAC;QAChF;IACF;IAE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,EAAE7C,OAAO,EAAEjC,MAAM;IAErDb,QAAQC,GAAG,CAAC;IAEZ,IAAIwF,aAAa,GAAG;QAClBzF,QAAQC,GAAG,CACTzB,MAAMsG,KAAK,CAACnD,IAAI,CAAC,CAAC,qBAAqB,EAAE8D,WAAW,aAAa,CAAC;IAEtE;IAEA,IAAIG,SAAS,GAAG;QACd5F,QAAQC,GAAG,CAACzB,MAAM0B,GAAG,CAACyB,IAAI,CAAC,CAAC,gBAAgB,EAAEiE,OAAO,aAAa,CAAC;QACnE,KAAK,MAAMC,UAAUjD,QAAQ8C,MAAM,CAACC,CAAAA,IAAK,CAACA,EAAE7C,OAAO,EAAG;YACpD9C,QAAQC,GAAG,CAACzB,MAAM0B,GAAG,CAAC,CAAC,IAAI,EAAE2F,OAAO5D,IAAI,CAAC,EAAE,EAAE4D,OAAO9C,KAAK,EAAE;QAC7D;IACF;IAEA,aAAa;IACb,IAAI0C,aAAa,GAAG;QAClBzF,QAAQC,GAAG,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 // Map framework to actual package framework for GitHub path\n // Next.js uses React components, Nuxt.js uses Vue components\n let packageFramework = framework;\n if (framework === 'nextjs') packageFramework = 'react';\n if (framework === 'nuxtjs') packageFramework = 'vue';\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 (use packageFramework for correct path)\n const sourceFolder = component.type === 'block' ? 'blocks' : 'components';\n const githubPath = `packages/${packageFramework}/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/${packageFramework}/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","packageFramework","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,qBAAqB,EACrBC,qBAAqB,EACrBC,iCAAiC,EACjCC,yBAAyB,QACpB,iCAAiC;AACxC,SAASC,SAAS,EAAEC,UAAU,EAAYC,SAAS,QAAQ,oBAAoB;AAC/E,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,SAASC,mBAAmB,QAAgC,6BAA6B;AAEzF,MAAMC,aAAaZ,cAAc,YAAYa,GAAG;AAChD,MAAMC,YAAYf,QAAQa;AAO1B,OAAO,eAAeG,WAAWC,UAAoB,EAAEC,OAAmB;IACxE,MAAMC,MAAMD,QAAQC,GAAG;IAEvB,sDAAsD;IACtD,IAAI,CAAChB,oBAAoBgB,MAAM;QAC7BC,QAAQC,GAAG,CAACzB,MAAM0B,GAAG,CAAC;QACtBF,QAAQC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I,CAAC;gBACvB;QACJ;QAEAH,QAAQC,GAAG,CAACzB,MAAM2B,IAAI,CAAC;IACzB;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "galaxy-design",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "CLI tool for adding Galaxy UI components to your Vue, React, Angular, Next.js, Nuxt.js, React Native, or Flutter project",
5
5
  "author": "Bùi Trọng Hiếu (kevinbui) <kevinbui210191@gmail.com>",
6
6
  "license": "MIT",