add auth, drizzle, prisma setup logic with template

This commit is contained in:
Aman Varshney
2025-03-04 09:33:31 +05:30
parent 54d63823bb
commit 792885b9c4
68 changed files with 2692 additions and 921 deletions

View File

@@ -5,24 +5,28 @@ import type {
ProjectConfig,
ProjectDatabase,
ProjectFeature,
ProjectORM,
ProjectOrm,
} from "../types";
import { getAuthChoice } from "./auth";
import { getDatabaseChoice } from "./database";
import { getFeaturesChoice } from "./features";
import { getGitChoice } from "./git";
import { getNoInstallChoice } from "./install";
import { getORMChoice } from "./orm";
import { getPackageManagerChoice } from "./package-manager";
import { getProjectName } from "./project-name";
import { getTursoSetupChoice } from "./turso";
interface PromptGroupResults {
projectName: string;
database: ProjectDatabase;
orm: ProjectORM;
orm: ProjectOrm;
auth: boolean;
features: ProjectFeature[];
git: boolean;
packageManager: PackageManager;
noInstall: boolean;
turso: boolean;
}
export async function gatherConfig(
@@ -38,9 +42,14 @@ export async function gatherConfig(
getORMChoice(flags.orm, results.database !== "none"),
auth: ({ results }) =>
getAuthChoice(flags.auth, results.database !== "none"),
turso: ({ results }) =>
results.database === "sqlite"
? getTursoSetupChoice(flags.turso)
: Promise.resolve(false),
features: () => getFeaturesChoice(flags.features),
git: () => getGitChoice(flags.git),
packageManager: () => getPackageManagerChoice(flags.packageManager),
noInstall: () => getNoInstallChoice(flags.noInstall),
},
{
onCancel: () => {
@@ -58,5 +67,7 @@ export async function gatherConfig(
features: result.features,
git: result.git,
packageManager: result.packageManager,
noInstall: result.noInstall,
turso: result.turso,
};
}