From a497c42b77399c0b0e8fa1711092231391f67df1 Mon Sep 17 00:00:00 2001 From: jkomyno Date: Wed, 17 Jul 2024 15:00:52 +0200 Subject: [PATCH] feat(driver-adapters-wasm): updated convert-to-custom-output.mjs to include Remix projects --- .github/scripts/convert-to-custom-output.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/scripts/convert-to-custom-output.mjs b/.github/scripts/convert-to-custom-output.mjs index 6f742e1357e7..1ce89d2a26ab 100644 --- a/.github/scripts/convert-to-custom-output.mjs +++ b/.github/scripts/convert-to-custom-output.mjs @@ -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')