Skip to content

Commit fff73d4

Browse files
committed
feat(driver-adapters-wasm): updated convert-to-custom-output.mjs to include Remix projects
1 parent e2f861c commit fff73d4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/scripts/convert-to-custom-output.mjs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ import fs from 'node:fs/promises'
33
import { glob } from 'glob'
44

55
const projectPath = process.argv[2]
6-
const isD1CfPagesNuxt = process.cwd().includes('d1-cfpages-nuxt')
6+
7+
// Evaluates to `true` when the project requires explicit `"db": "link:prisma/client"` in package.json to
8+
// support Prisma Client's custom output.
9+
const customOutputNeedsLinking = [
10+
'd1-cfpages-nuxt',
11+
'neon-cf-remix',
12+
'neon-cfpages-remix',
13+
].some(sustring => process.cwd().includes(sustring))
714

815
// See https://github.com/prisma/ecosystem-tests/pull/5040#issuecomment-2152970656
916
// Add the db link to the package.json
10-
if (isD1CfPagesNuxt) {
17+
if (customOutputNeedsLinking) {
1118
const packageJson = JSON.parse(await fs.readFile(path.join(projectPath, 'package.json'), 'utf8'))
1219
packageJson.dependencies['db'] = 'link:prisma/client'
1320
fs.writeFile(path.join(projectPath, 'package.json'), JSON.stringify(packageJson, null, 2), 'utf8')
@@ -29,7 +36,7 @@ for await (const file of sourceFiles) {
2936
if (!relImport.startsWith('.')) {
3037
relImport = `./${relImport}`
3138
}
32-
if (isD1CfPagesNuxt) {
39+
if (customOutputNeedsLinking) {
3340
// Replace '@prisma/client' with 'db'
3441
await replaceInFile(file, /@prisma\/client/g, 'db')
3542
} else {

0 commit comments

Comments
 (0)