Skip to content

Commit 7514e6a

Browse files
committed
chore(prisma): relocate generated client to prisma/generated and update references
1 parent 026bb1a commit 7514e6a

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ storage
77
coverage
88
.DS_Store
99
data
10-
src/generated/prisma-client
10+
prisma/generated/prisma-client

build/run-esbuild.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ await esbuild.build({
66
platform: 'node',
77
packages: 'external',
88
format: 'esm',
9-
external: ['./src/generated/*'],
9+
external: ['./prisma/generated/*'],
1010
bundle: true
1111
});

prisma/schema.prisma

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
generator client {
22
provider = "prisma-client-js"
3-
output = "../src/generated/prisma-client"
4-
engineType = "client"
3+
output = "./generated/prisma-client"
54
}
65

76
datasource db {

src/base/Prisma.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PrismaClient } from '../generated/prisma-client';
1+
import { PrismaClient } from '../../prisma/generated/prisma-client';
22

33
// PrismaClient is attached to the `global` object in development to prevent
44
// exhausting your database connection limit.
@@ -9,10 +9,6 @@ declare global {
99
var prisma: PrismaClient | undefined;
1010
}
1111

12-
export const prisma =
13-
global.prisma ||
14-
new PrismaClient({
15-
log: ['query'],
16-
});
12+
export const prisma = global.prisma || new PrismaClient({ log: ['query'] });
1713

1814
if (process.env.NODE_ENV !== 'production') global.prisma = prisma;

0 commit comments

Comments
 (0)