mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add nuxt and expo with orpc
This commit is contained in:
@@ -2,7 +2,6 @@ import { cancel, isCancel, multiselect } from "@clack/prompts";
|
||||
import pc from "picocolors";
|
||||
import { DEFAULT_CONFIG } from "../constants";
|
||||
import type {
|
||||
ProjectApi,
|
||||
ProjectBackend,
|
||||
ProjectDatabase,
|
||||
ProjectExamples,
|
||||
@@ -22,46 +21,36 @@ export async function getExamplesChoice(
|
||||
const hasWebFrontend =
|
||||
frontends?.includes("react-router") ||
|
||||
frontends?.includes("tanstack-router") ||
|
||||
frontends?.includes("tanstack-start");
|
||||
frontends?.includes("tanstack-start") ||
|
||||
frontends?.includes("next") || // Added next
|
||||
frontends?.includes("nuxt"); // Added nuxt
|
||||
|
||||
if (!hasWebFrontend) return [];
|
||||
|
||||
let response: ProjectExamples[] | symbol = [];
|
||||
const options: { value: ProjectExamples; label: string; hint: string }[] = [
|
||||
{
|
||||
value: "todo" as const,
|
||||
label: "Todo App",
|
||||
hint: "A simple CRUD example app",
|
||||
},
|
||||
];
|
||||
|
||||
if (backend === "elysia") {
|
||||
response = await multiselect<ProjectExamples>({
|
||||
message: "Include examples",
|
||||
options: [
|
||||
{
|
||||
value: "todo",
|
||||
label: "Todo App",
|
||||
hint: "A simple CRUD example app",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
initialValues: DEFAULT_CONFIG.examples,
|
||||
// AI example is available for hono, express, next backends, and Nuxt (if backend is not elysia)
|
||||
if (backend !== "elysia") {
|
||||
options.push({
|
||||
value: "ai" as const,
|
||||
label: "AI Chat",
|
||||
hint: "A simple AI chat interface using AI SDK",
|
||||
});
|
||||
}
|
||||
|
||||
if (backend === "hono" || backend === "express") {
|
||||
response = await multiselect<ProjectExamples>({
|
||||
message: "Include examples",
|
||||
options: [
|
||||
{
|
||||
value: "todo",
|
||||
label: "Todo App",
|
||||
hint: "A simple CRUD example app",
|
||||
},
|
||||
{
|
||||
value: "ai",
|
||||
label: "AI Chat",
|
||||
hint: "A simple AI chat interface using AI SDK",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
initialValues: DEFAULT_CONFIG.examples,
|
||||
});
|
||||
}
|
||||
response = await multiselect<ProjectExamples>({
|
||||
message: "Include examples",
|
||||
options: options,
|
||||
required: false,
|
||||
initialValues: DEFAULT_CONFIG.examples,
|
||||
});
|
||||
|
||||
if (isCancel(response)) {
|
||||
cancel(pc.red("Operation cancelled"));
|
||||
|
||||
Reference in New Issue
Block a user