Skip to content

Commit

Permalink
feat(driver-adapters-wasm): updated convert-to-custom-output.mjs to i…
Browse files Browse the repository at this point in the history
…nclude Remix projects
  • Loading branch information
jkomyno committed Jul 17, 2024
1 parent e2f861c commit a497c42
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/scripts/convert-to-custom-output.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ import fs from 'node:fs/promises'
import { glob } from 'glob'

const projectPath = process.argv[2]
const isD1CfPagesNuxt = process.cwd().includes('d1-cfpages-nuxt')

// Evaluates to `true` when the project requires explicit `"db": "link:prisma/client"` in package.json to
// support Prisma Client's custom output.
const customOutputNeedsLinking = [
'd1-cfpages-nuxt',
'neon-cf-remix',
'neon-cfpages-remix',
].some(sustring => process.cwd().includes(sustring))

// See https://github.com/prisma/ecosystem-tests/pull/5040#issuecomment-2152970656
// Add the db link to the package.json
if (isD1CfPagesNuxt) {
if (customOutputNeedsLinking) {
const packageJson = JSON.parse(await fs.readFile(path.join(projectPath, 'package.json'), 'utf8'))
packageJson.dependencies['db'] = 'link:prisma/client'
fs.writeFile(path.join(projectPath, 'package.json'), JSON.stringify(packageJson, null, 2), 'utf8')
Expand Down

0 comments on commit a497c42

Please sign in to comment.