vite-scaffolder
by Austin Crim
Step by step project scaffolding with Vite
// Menu: project-scaffolder 👷♂️// Description: Step by step project scaffolding with Viteconst projectsDirectory = '/Users/austin/repos';const folder = await arg({placeholder: 'Enter project name 📁',validate: (choice) => (choice ? true : 'Please enter a folder name.')});const framework = await arg('Pick a framework 👨💻', ['react','svelte','preact','vanilla']);const useTypescript =framework === 'vanilla'? 'false': await arg('Pick a flavor 🍦', [{ name: 'TypeScript', value: true },{ name: 'JavaScript', value: false }]);const packageManager = await arg('Package Manager?', ['npm', 'yarn', 'pnpm']);setPlaceholder('building...🔨');const command = `${packageManager} ${packageManager === 'yarn' ? 'create' : 'init'} @vitejs/app ${folder} -- --template ${framework}${useTypescript ? '-ts' : ''}`;cd(projectsDirectory);exec(command);edit(`${projectsDirectory}/${folder}`);