feat(cli): add elysia + aisdk support and fix fastify ai example

This commit is contained in:
Aman Varshney
2025-09-09 23:39:35 +05:30
parent d0a9a5d223
commit e5ba83fe3b
7 changed files with 112 additions and 130 deletions

View File

@@ -92,7 +92,7 @@ export const dependencyVersionMap = {
"@elysiajs/cors": "^1.3.3",
"@elysiajs/trpc": "^1.1.0",
elysia: "^1.3.20",
"elysia": "^1.3.21",
"@hono/node-server": "^1.14.4",
"@hono/trpc-server": "^0.4.0",
@@ -108,12 +108,12 @@ export const dependencyVersionMap = {
turbo: "^2.5.4",
ai: "^5.0.9",
"@ai-sdk/google": "^2.0.3",
"@ai-sdk/vue": "^2.0.9",
"@ai-sdk/svelte": "^3.0.9",
"@ai-sdk/react": "^2.0.9",
streamdown: "^1.1.6",
"ai": "^5.0.39",
"@ai-sdk/google": "^2.0.13",
"@ai-sdk/vue": "^2.0.39",
"@ai-sdk/svelte": "^3.0.39",
"@ai-sdk/react": "^2.0.39",
streamdown: "^1.2.0",
"@orpc/server": "^1.8.6",
"@orpc/client": "^1.8.6",

View File

@@ -33,10 +33,6 @@ export async function getExamplesChoice(
if (database === "none") return [];
const noFrontendSelected = !frontends || frontends.length === 0;
if (noFrontendSelected) return [];
let response: Examples[] | symbol = [];
const options: { value: Examples; label: string; hint: string }[] = [];

View File

@@ -157,11 +157,10 @@ export function isExampleTodoAllowed(
}
export function isExampleAIAllowed(
backend?: ProjectConfig["backend"],
_backend?: ProjectConfig["backend"],
frontends: Frontend[] = [],
) {
const includesSolid = frontends.includes("solid");
if (backend === "elysia") return false;
if (includesSolid) return false;
return true;
}
@@ -226,11 +225,6 @@ export function validateExamplesCompatibility(
"The 'todo' example requires a database if a backend (other than Convex) is present. Cannot use --examples todo when database is 'none' and a backend is selected.",
);
}
if (examplesArr.includes("ai") && backend === "elysia") {
exitWithError(
"The 'ai' example is not compatible with the Elysia backend.",
);
}
if (examplesArr.includes("ai") && (frontend ?? []).includes("solid")) {
exitWithError(
"The 'ai' example is not compatible with the Solid frontend.",