hendrikniemann
08/03/2022, 1:57 PMyarn prisma generate in both and that would generate my clients. For this I set the schema property in the package.json of the scripts:
"prisma": {
"schema": "../../backend/prisma/schema.prisma"
},
I even have it documented like this. In the scripts repo a rather old version of prisma was installed (3.9.x) and today it stopped working, so I installed prisma 4 (as we have in the backend already). Calling yarn prisma generate from my scripts repo now generates the files in the backend and no longer for the client installed in scripts ⚠️. I am pretty sure this was not the old behaviour 😕 Is there a way how I can change that? How am I supposed to share a Prisma schema across repositories?Nurul
08/03/2022, 2:44 PMschema property was working for you but suddenly stopped working? Or did it stop working after you upgraded to prisma 4?
For sharing prisma schema across repositories you can create a private npm package which exports the generated types and the PrismaClient instance. I have seen this approach being used by many users.hendrikniemann
08/03/2022, 4:20 PMhendrikniemann
08/03/2022, 10:01 PMhendrikniemann
08/04/2022, 8:55 AMNurul
08/04/2022, 10:31 AM