import inquirer from 'inquirer'; import chalk from 'chalk'; export interface Answers { projectName: string; framework: 'React' | 'Next.js'; useTypeScript: boolean; uiLibrary: 'Hiro UI' | 'Material UI' | 'Chakra UI' | 'No UI Library'; template: 'Blog' | 'Ecommerce' | 'Portfolio' | 'Blank'; } async function askQuestions(): Promise { console.log(chalk.cyan.bold('\nWelcome to KPM CLI! Let\'s set up your project.\n')); const questions = [ { type: 'input' as const, name: 'projectName' as const, message: chalk.green('Enter your project name:'), default: 'my-app', validate: (input: string) => input.trim() !== '' || 'Project name cannot be empty!', }, { type: 'list' as const, name: 'framework' as const, message: chalk.green('Which framework would you like to use?'), choices: ['React', 'Next.js'], default: 'React', }, { type: 'confirm' as const, name: 'useTypeScript' as const, message: chalk.green('Use TypeScript?'), default: true, }, { type: 'list' as const, name: 'uiLibrary' as const, message: chalk.green('Choose a UI Library:'), choices: ['Hiro UI', 'Material UI', 'Chakra UI', 'No UI Library'], default: 'Hiro UI', }, { type: 'list' as const, name: 'template' as const, message: chalk.green('Select a starter template:'), choices: ['Blog', 'Ecommerce', 'Portfolio', 'Blank'], default: 'Blog', }, ]; const rawAnswers = await inquirer.prompt(questions); const answers = rawAnswers as Answers; console.log('\n' + chalk.green.bold('Your project setup:')); console.log(chalk.blue(JSON.stringify(answers, null, 2))); console.log(); return answers; } export default askQuestions;