From 69e7147f96180c1f39ae33da56fe87ed1b3d9fef Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 9 Dec 2024 07:51:44 +0000 Subject: [PATCH] fix(prisma): add useDefineForClassFields option to default ts compilation option Closes: #2927 --- packages/orm/prisma/src/generator/generateCode.ts | 7 +++++-- packages/orm/prisma/vitest.config.mts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/orm/prisma/src/generator/generateCode.ts b/packages/orm/prisma/src/generator/generateCode.ts index b6d68571afe..9d8ed4a50d1 100644 --- a/packages/orm/prisma/src/generator/generateCode.ts +++ b/packages/orm/prisma/src/generator/generateCode.ts @@ -15,7 +15,8 @@ const baseCompilerOptions: CompilerOptions = { module: ModuleKind.ESNext, emitDecoratorMetadata: true, experimentalDecorators: true, - esModuleInterop: true + esModuleInterop: true, + useDefineForClassFields: false }; export interface GenerateCodeOptions { @@ -31,7 +32,9 @@ export async function generateCode(dmmf: DMMF.Document, options: GenerateCodeOpt const project = new Project({ compilerOptions: { ...baseCompilerOptions, - ...(emitTranspiledCode && {declaration: true}) + ...(emitTranspiledCode && { + declaration: true + }) } }); diff --git a/packages/orm/prisma/vitest.config.mts b/packages/orm/prisma/vitest.config.mts index 3a9b3813ae0..93b60778947 100644 --- a/packages/orm/prisma/vitest.config.mts +++ b/packages/orm/prisma/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 91.11, + statements: 91.02, branches: 92.2, functions: 92.59, - lines: 91.11 + lines: 91.02 } } }