Add todo example, remove yarn, change schema structure, update readme

This commit is contained in:
Aman Varshney
2025-03-24 00:04:53 +05:30
parent 5076bf4176
commit 4cc13bf382
42 changed files with 525 additions and 443 deletions

View File

@@ -0,0 +1,30 @@
import { cancel, isCancel, multiselect } from "@clack/prompts";
import pc from "picocolors";
import { DEFAULT_CONFIG } from "../constants";
import type { ProjectExamples } from "../types";
export async function getExamplesChoice(
examples?: ProjectExamples[],
): Promise<ProjectExamples[]> {
if (examples !== undefined) return examples;
const response = await multiselect<ProjectExamples>({
message: "Which examples would you like to include?",
options: [
{
value: "todo",
label: "Todo App",
hint: "A simple CRUD example app",
},
],
required: false,
initialValues: DEFAULT_CONFIG.examples,
});
if (isCancel(response)) {
cancel(pc.red("Operation cancelled"));
process.exit(0);
}
return response;
}