Add Todo button to homepage when examples are included

Add project creation time display in success message
This commit is contained in:
Aman Varshney
2025-03-24 01:38:53 +05:30
parent df0aa04503
commit b5f47fc23b
8 changed files with 47 additions and 113 deletions

View File

@@ -50,7 +50,8 @@ export async function gatherConfig(
? getTursoSetupChoice(flags.turso)
: Promise.resolve(false),
addons: () => getAddonsChoice(flags.addons),
examples: () => getExamplesChoice(flags.examples),
examples: ({ results }) =>
getExamplesChoice(flags.examples, results.database),
git: () => getGitChoice(flags.git),
packageManager: () => getPackageManagerChoice(flags.packageManager),
noInstall: () => getNoInstallChoice(flags.noInstall),

View File

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