Added support for building mobile applications with Expo

This commit is contained in:
Aman Varshney
2025-03-29 12:31:51 +05:30
parent 228f24d6db
commit 1c66d64be5
90 changed files with 981 additions and 204 deletions

View File

@@ -0,0 +1,35 @@
import { cancel, isCancel, multiselect } from "@clack/prompts";
import pc from "picocolors";
import { DEFAULT_CONFIG } from "../constants";
import type { ProjectFrontend } from "../types";
export async function getFrontendChoice(
frontendOptions?: ProjectFrontend[],
): Promise<ProjectFrontend[]> {
if (frontendOptions !== undefined) return frontendOptions;
const response = await multiselect<ProjectFrontend>({
message: "Which frontend applications would you like to create?",
options: [
{
value: "web",
label: "Web App",
hint: "React + TanStack Router web application",
},
{
value: "native",
label: "Native App",
hint: "React Native + Expo application",
},
],
initialValues: DEFAULT_CONFIG.frontend,
required: false,
});
if (isCancel(response)) {
cancel(pc.red("Operation cancelled"));
process.exit(0);
}
return response;
}