several bug fixes

This commit is contained in:
Aman Varshney
2025-03-29 18:09:36 +05:30
parent bf0625ce08
commit b0e3432554
12 changed files with 304 additions and 65 deletions

View File

@@ -1,16 +1,24 @@
import { cancel, isCancel, multiselect } from "@clack/prompts";
import pc from "picocolors";
import { DEFAULT_CONFIG } from "../constants";
import type { ProjectDatabase, ProjectExamples } from "../types";
import type {
ProjectDatabase,
ProjectExamples,
ProjectFrontend,
} from "../types";
export async function getExamplesChoice(
examples?: ProjectExamples[],
database?: ProjectDatabase,
frontends?: ProjectFrontend[],
): Promise<ProjectExamples[]> {
if (examples !== undefined) return examples;
if (database === "none") return [];
const hasWebFrontend = frontends?.includes("web");
if (!hasWebFrontend) return [];
const response = await multiselect<ProjectExamples>({
message: "Which examples would you like to include?",
options: [