add nuxt and expo with orpc

This commit is contained in:
Aman Varshney
2025-04-23 13:03:38 +05:30
parent 49c7d4f436
commit d3a80b7e63
145 changed files with 2013 additions and 874 deletions

View File

@@ -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"));