mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix native scaffolding
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import path from "node:path";
|
||||
import fs from "fs-extra";
|
||||
import type { ProjectConfig } from "../types";
|
||||
import { addPackageDependency } from "../utils/add-package-deps";
|
||||
|
||||
@@ -8,11 +9,16 @@ export async function setupExamples(config: ProjectConfig): Promise<void> {
|
||||
|
||||
if (examples.includes("ai")) {
|
||||
const clientDir = path.join(projectDir, "apps/web");
|
||||
await addPackageDependency({
|
||||
dependencies: ["ai"],
|
||||
projectDir: clientDir,
|
||||
});
|
||||
const serverDir = path.join(projectDir, "apps/server");
|
||||
const clientDirExists = await fs.pathExists(clientDir);
|
||||
|
||||
if (clientDirExists) {
|
||||
await addPackageDependency({
|
||||
dependencies: ["ai"],
|
||||
projectDir: clientDir,
|
||||
});
|
||||
}
|
||||
|
||||
await addPackageDependency({
|
||||
dependencies: ["ai", "@ai-sdk/google"],
|
||||
projectDir: serverDir,
|
||||
|
||||
Reference in New Issue
Block a user