mikeseese / prisma-pkg-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prisma <> pkg Test Repo

This project reproduces an issue with packaging Prisma in a pkg bundle.

Reproduction steps

  1. Run this on a Windows 11 OS (10 will likely be fine) with node@18
  2. Clone
  3. corepack prepare or yarn set version 1.22.19 (or if you're using 1.22.19 by default, skip this step)
  4. yarn - Runs all of the commands necessary, but you can rerun them if you'd like:
    • yarn generate - generates two clients, one with a custom output
    • yarn build - compiles TS
    • yarn pkg - packages both builds, one with the custom output client
    • yarn test - runs both exes, showing the normal output passes but he custom fails

Workarounds Applied

I've applied these workarounds to this project to try to get the test to pass:

  1. pkg doesn't support node@20 yet, so just to make sure we weren't using Prisma's node addon files built for v20 but pkg was using node@18, I've set the engines restriction of this project to 18.
  2. I've added the workaround that adds the client's index.js to the assets array or pkg, which is required to get the normal test passing, but the custom one continues to fail using the same strategy
  3. This isn't applied, but I've tried adding --public-packages '*' to the custom test as mentioned in the prior GH issue workaround, but this doesn't change the end result

About


Languages

Language:JavaScript 59.5%Language:TypeScript 40.5%