galaxy-design 0.2.24 β 0.2.25
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/commands/add.js +18 -0
- package/dist/commands/add.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/add.js
CHANGED
|
@@ -95,6 +95,24 @@ export async function addCommand(components, options) {
|
|
|
95
95
|
componentsToAdd = [
|
|
96
96
|
...new Set(componentsToAdd)
|
|
97
97
|
];
|
|
98
|
+
// Resolve registry dependencies
|
|
99
|
+
const resolvedComponents = new Set(componentsToAdd);
|
|
100
|
+
const toProcess = [
|
|
101
|
+
...componentsToAdd
|
|
102
|
+
];
|
|
103
|
+
while(toProcess.length > 0){
|
|
104
|
+
const componentKey = toProcess.pop();
|
|
105
|
+
const component = getFrameworkComponent(framework, componentKey);
|
|
106
|
+
if (component && component.registryDependencies && component.registryDependencies.length > 0) {
|
|
107
|
+
for (const depKey of component.registryDependencies){
|
|
108
|
+
if (!resolvedComponents.has(depKey)) {
|
|
109
|
+
resolvedComponents.add(depKey);
|
|
110
|
+
toProcess.push(depKey);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
componentsToAdd = Array.from(resolvedComponents);
|
|
98
116
|
console.log(chalk.bold.cyan(`\nπ¦ Adding ${componentsToAdd.length} component(s)...\n`));
|
|
99
117
|
// Collect all dependencies
|
|
100
118
|
const allDependencies = [];
|
package/dist/commands/add.js.map
CHANGED
|
@@ -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 { hasSrcDirectory } from '../utils/detect.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\n // Detect if project uses src/ directory and adjust path\n const usesSrcDir = hasSrcDirectory(cwd);\n const baseDir = usesSrcDir ? 'src/' : '';\n const fullDestPath = resolve(cwd, baseDir + 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","hasSrcDirectory","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","usesSrcDir","baseDir","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,SAASC,eAAe,QAAQ,qBAAqB;AACrD,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,aAAab,cAAc,YAAYc,GAAG;AAChD,MAAMC,YAAYhB,QAAQc;AAO1B,OAAO,eAAeG,WAAWC,UAAoB,EAAEC,OAAmB;IACxE,MAAMC,MAAMD,QAAQC,GAAG;IAEvB,sDAAsD;IACtD,IAAI,CAACjB,oBAAoBiB,MAAM;QAC7BC,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QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvB;QACJ;QAEAH,QAAQC,GAAG,CAAC1B,MAAM4B,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 { hasSrcDirectory } from '../utils/detect.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 // Resolve registry dependencies\n const resolvedComponents = new Set<string>(componentsToAdd);\n const toProcess = [...componentsToAdd];\n\n while (toProcess.length > 0) {\n const componentKey = toProcess.pop()!;\n const component = getFrameworkComponent(framework, componentKey);\n\n if (component && component.registryDependencies && component.registryDependencies.length > 0) {\n for (const depKey of component.registryDependencies) {\n if (!resolvedComponents.has(depKey)) {\n resolvedComponents.add(depKey);\n toProcess.push(depKey);\n }\n }\n }\n }\n\n componentsToAdd = Array.from(resolvedComponents);\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\n // Detect if project uses src/ directory and adjust path\n const usesSrcDir = hasSrcDirectory(cwd);\n const baseDir = usesSrcDir ? 'src/' : '';\n const fullDestPath = resolve(cwd, baseDir + 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","hasSrcDirectory","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","resolvedComponents","toProcess","componentKey","pop","registryDependencies","depKey","add","Array","from","allDependencies","allDevDependencies","results","success","error","spinner","start","componentsAlias","aliases","destPath","replace","usesSrcDir","baseDir","fullDestPath","fileExtensions","vue","react","angular","flutter","ext","componentFolderPath","packageFramework","file","files","fileName","includes","split","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,SAASC,eAAe,QAAQ,qBAAqB;AACrD,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,aAAab,cAAc,YAAYc,GAAG;AAChD,MAAMC,YAAYhB,QAAQc;AAO1B,OAAO,eAAeG,WAAWC,UAAoB,EAAEC,OAAmB;IACxE,MAAMC,MAAMD,QAAQC,GAAG;IAEvB,sDAAsD;IACtD,IAAI,CAACjB,oBAAoBiB,MAAM;QAC7BC,QAAQC,GAAG,CAAC1B,MAAM2B,GAAG,CAAC;QACtBF,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC,SAAS5B,MAAM6B,IAAI,CAAC,0BAA0B7B,MAAM4B,IAAI,CAAC;QAChF;IACF;IAEA,qCAAqC;IACrC,MAAME,mBAAmBxB,qBAAqBkB;IAC9C,IAAI,CAACM,kBAAkB;QACrBL,QAAQC,GAAG,CAAC1B,MAAM2B,GAAG,CAAC;QACtB;IACF;IAEA,MAAMI,YAAYD,iBAAiBC,SAAS;IAC5CN,QAAQC,GAAG,CAAC1B,MAAM4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ACN,KAAK;gBACHN,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvB;YACF,KAAK;gBACHH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvBH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;gBACvB;QACJ;QAEAH,QAAQC,GAAG,CAAC1B,MAAM4B,IAAI,CAAC;IACzB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "galaxy-design",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
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",
|