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

@@ -1,10 +1,11 @@
import path from "node:path";
import fs from "fs-extra";
import type { AvailableDependencies } from "../constants";
import type { ProjectConfig } from "../types";
import { addPackageDependency } from "../utils/add-package-deps";
export async function setupExamples(config: ProjectConfig): Promise<void> {
const { projectName, examples } = config;
const { projectName, examples, frontend } = config;
const projectDir = path.resolve(process.cwd(), projectName);
if (examples.includes("ai")) {
@@ -12,9 +13,15 @@ export async function setupExamples(config: ProjectConfig): Promise<void> {
const serverDir = path.join(projectDir, "apps/server");
const clientDirExists = await fs.pathExists(clientDir);
const hasNuxt = frontend.includes("nuxt");
if (clientDirExists) {
const dependencies: AvailableDependencies[] = ["ai"];
if (hasNuxt) {
dependencies.push("@ai-sdk/vue");
}
await addPackageDependency({
dependencies: ["ai"],
dependencies,
projectDir: clientDir,
});
}