Skip to content

Commit f755d71

Browse files
authored
chore(client): remove bundler warning (#19479)
1 parent b5dadf6 commit f755d71

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

packages/client/src/generation/utils/buildDirname.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ const fs = require('fs')
3434
3535
config.dirname = __dirname
3636
if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
37-
warnOnce('bundled-warning-1', 'Your generated Prisma Client could not immediately find its \`schema.prisma\`, falling back to finding it via the current working directory.')
38-
warnOnce('bundled-warning-2', 'We are interested in learning about your project setup. We\\'d appreciate if you could take the time to share some information with us.')
39-
warnOnce('bundled-warning-3', 'Please help us by answering a few questions: https://pris.ly/bundler-investigation')
40-
config.dirname = path.join(process.cwd(), ${JSON.stringify(pathToPosix(relativeOutdir))})
37+
config.dirname = path.join(process.cwd(), ${JSON.stringify(pathToPosix(relativeOutdir))})
4138
config.isBundled = true
4239
}`
4340
}

packages/client/tests/e2e/bundler-detection-error/tests/main.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,6 @@ afterEach(() => {
66
consoleMock.mockClear()
77
})
88

9-
test('importing the the bundled prisma client produces warning messages', () => {
10-
require('../dist/index.js')
11-
12-
expect(consoleMock.mock.calls[0]).toMatchInlineSnapshot(`
13-
[
14-
"prisma:warn Your generated Prisma Client could not immediately find its \`schema.prisma\`, falling back to finding it via the current working directory.",
15-
]
16-
`)
17-
expect(consoleMock.mock.calls[1]).toMatchInlineSnapshot(`
18-
[
19-
"prisma:warn We are interested in learning about your project setup. We'd appreciate if you could take the time to share some information with us.",
20-
]
21-
`)
22-
expect(consoleMock.mock.calls[2]).toMatchInlineSnapshot(`
23-
[
24-
"prisma:warn Please help us by answering a few questions: https://pris.ly/bundler-investigation",
25-
]
26-
`)
27-
})
28-
299
test('bundled prisma client will re-use the schema.prisma via cwd', async () => {
3010
const { somePrismaCall } = require('../dist/index.js')
3111

0 commit comments

Comments
 (0)