From d798b3041bbdcada88ac7aeee56fd85c6351503e Mon Sep 17 00:00:00 2001 From: Pascal Martineau Date: Wed, 20 Nov 2024 10:16:21 -0500 Subject: [PATCH 1/4] feat: Add writeClientInLib option to disable lib/prisma.ts --- src/module.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 90779dc..412cc94 100644 --- a/src/module.ts +++ b/src/module.ts @@ -25,6 +25,7 @@ import { log, PREDEFINED_LOG_MESSAGES } from "./package-utils/log-helpers"; import type { Prisma } from "@prisma/client"; interface ModuleOptions extends Prisma.PrismaClientOptions { + writeClientInLib: boolean; writeToSchema: boolean; formatSchema: boolean; runMigration: boolean; @@ -52,6 +53,7 @@ export default defineNuxtModule({ }, log: [], errorFormat: "pretty", + writeClientInLib: true, writeToSchema: true, formatSchema: true, runMigration: true, @@ -228,7 +230,9 @@ export default defineNuxtModule({ await prismaMigrateWorkflow(); } - await writeClientInLib(resolveProject("lib", "prisma.ts")); + if (options.writeClientInLib) { + await writeClientInLib(resolveProject("lib", "prisma.ts")); + } if (options.generateClient) { await generateClient(PROJECT_PATH, options.installClient); From 289b03c73dfa479f43981df27d2a39d945c37b28 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:16:46 +0600 Subject: [PATCH 2/4] Update src/module.ts --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 412cc94..1aba778 100644 --- a/src/module.ts +++ b/src/module.ts @@ -230,7 +230,7 @@ export default defineNuxtModule({ await prismaMigrateWorkflow(); } - if (options.writeClientInLib) { + if (options.setupGlobalPrismaClientInLib) { await writeClientInLib(resolveProject("lib", "prisma.ts")); } From 3a1656a7e53711c799c80a4d217dea2a9e13d495 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:16:54 +0600 Subject: [PATCH 3/4] Update src/module.ts --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 1aba778..24873ba 100644 --- a/src/module.ts +++ b/src/module.ts @@ -25,7 +25,7 @@ import { log, PREDEFINED_LOG_MESSAGES } from "./package-utils/log-helpers"; import type { Prisma } from "@prisma/client"; interface ModuleOptions extends Prisma.PrismaClientOptions { - writeClientInLib: boolean; + setupGlobalPrismaClientInLib: boolean; writeToSchema: boolean; formatSchema: boolean; runMigration: boolean; From de6489df7744362cf82ad4ec93d25b20f8671e65 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Mon, 23 Dec 2024 22:45:03 +0600 Subject: [PATCH 4/4] Update src/module.ts --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 24873ba..32dbb97 100644 --- a/src/module.ts +++ b/src/module.ts @@ -53,7 +53,7 @@ export default defineNuxtModule({ }, log: [], errorFormat: "pretty", - writeClientInLib: true, + setupGlobalPrismaClientInLib: true, writeToSchema: true, formatSchema: true, runMigration: true,