Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add writeClientInLib option to disable lib/prisma.ts #60

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import type { Prisma } from "@prisma/client";

interface ModuleOptions extends Prisma.PrismaClientOptions {
setupGlobalPrismaClientInLib: boolean;
writeToSchema: boolean;
formatSchema: boolean;
runMigration: boolean;
Expand Down Expand Up @@ -52,6 +53,7 @@
},
log: [],
errorFormat: "pretty",
writeClientInLib: true,

Check failure on line 56 in src/module.ts

View workflow job for this annotation

GitHub Actions / Experimental Dev Release

Object literal may only specify known properties, and 'writeClientInLib' does not exist in type 'ModuleOptions | ((nuxt: Nuxt) => ModuleOptions)'.
writeToSchema: true,
formatSchema: true,
runMigration: true,
Expand Down Expand Up @@ -228,7 +230,9 @@
await prismaMigrateWorkflow();
}

await writeClientInLib(resolveProject("lib", "prisma.ts"));
if (options.setupGlobalPrismaClientInLib) {
await writeClientInLib(resolveProject("lib", "prisma.ts"));
}

if (options.generateClient) {
await generateClient(PROJECT_PATH, options.installClient);
Expand Down
Loading