UNPKG

create-vhs

Version:

Create a VHS monorepo with one command.

91 lines 3.16 kB
import chalk from "chalk"; import inquirer from "inquirer"; export async function promptForOptions(projectName, existingOptions = {}) { const questions = []; // Project name if not provided if (!projectName) { questions.push({ type: "input", name: "projectName", message: "📦 What is your project named?", default: "my-vhs-app", filter: (input) => input.trim().toLowerCase(), }); } // Template selection if not provided if (!existingOptions.template) { questions.push({ type: "list", name: "template", message: "🎨 Which template would you like to use?", choices: [ { name: `${chalk.green("Basic")} - Simple monorepo with shared packages`, value: "basic", short: "Basic", }, // TODO: Add support to create Farcaster Mini-apps using the create-vhs cli // { // name: `${chalk.magenta("Farcaster mini-app")} - All you need to create your Farcaster mini-app.`, // value: "mini-app" as TemplateType, // short: "Farcaster Mini App", // }, ], default: "basic", }); } // Package manager if not specified if (!existingOptions.useNpm && !existingOptions.useYarn && !existingOptions.usePnpm) { questions.push({ type: "list", name: "packageManager", message: "📦 Which package manager would you like to use?", choices: [ { name: `${chalk.yellow("Bun")} (recommended for speed)`, value: "bun", short: "Bun", }, { name: `${chalk.red("npm")} (Node.js default)`, value: "npm", short: "npm", }, { name: `${chalk.blue("yarn")} (Classic choice)`, value: "yarn", short: "yarn", }, { name: `${chalk.green("pnpm")} (Efficient storage)`, value: "pnpm", short: "pnpm", }, ], default: "bun", }); } // Additional features // questions.push({ // type: "checkbox", // name: "features", // message: "🔧 Select additional features:", // choices: [ // { // name: `${chalk.cyan("Biome")} - Fast linter and formatter (recommended)`, // value: "biome" as Feature, // checked: true, // }, // ], // }); const answers = await inquirer.prompt(questions); return { projectName: projectName || answers.projectName, template: (existingOptions.template || answers.template), packageManager: answers.packageManager || "bun", skipInstall: existingOptions.skipInstall || false, }; } //# sourceMappingURL=prompts.js.map