(options: PluckComponentOptions)
| 22 | |
| 23 | // Main pluck-component command function |
| 24 | export async function pluckComponentCommand(options: PluckComponentOptions) { |
| 25 | intro( |
| 26 | pc.bgMagenta(pc.black(' cedar pluck-component ')) + |
| 27 | '\n' + |
| 28 | pc.green('Pluck components from cedar-os-components package!') + |
| 29 | '\n' + |
| 30 | pc.cyan( |
| 31 | '🌿 Download specific components locally for full customization...' |
| 32 | ) |
| 33 | ); |
| 34 | |
| 35 | try { |
| 36 | // Use the shared download components flow |
| 37 | const result = await downloadComponentsFlow( |
| 38 | options as ComponentDownloadOptions, |
| 39 | { |
| 40 | promptMessage: 'Which components would you like to download locally?', |
| 41 | skipDependencyInstall: true, // Don't auto-install npm deps for pluck |
| 42 | } |
| 43 | ); |
| 44 | |
| 45 | // Show next steps |
| 46 | showLocalImportSteps(result.componentsInstalled, result.targetDirectory); |
| 47 | |
| 48 | if (result.npmDependencies.length > 0) { |
| 49 | console.log( |
| 50 | '\n' + |
| 51 | pc.yellow("⚠️ Don't forget to install the required dependencies:") |
| 52 | ); |
| 53 | console.log( |
| 54 | pc.gray(' npm install ' + result.npmDependencies.join(' ')) |
| 55 | ); |
| 56 | } |
| 57 | |
| 58 | outro(pc.green('Happy coding! 🚀')); |
| 59 | } catch (err) { |
| 60 | p.cancel( |
| 61 | `Something went wrong${err instanceof Error ? ': ' + err.message : ''}` |
| 62 | ); |
| 63 | process.exit(1); |
| 64 | } |
| 65 | } |
nothing calls this directly
no test coverage detected