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:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user