Abdul Munim
Abdul Munim
PPrisma
Created by Abdul Munim on 10/28/2024 in #help-and-questions
pnpm install puts prisma generate in the wrong folder
this is my root pnpm-worspaces.yaml
packages:
- 'database'
- 'website'
- 'microservice'
- 'lib'
packages:
- 'database'
- 'website'
- 'microservice'
- 'lib'
inside my database I have prisma/schema.prisma and postinstall script of prisma generate and a prisma.ts file that exports default the prisma client and * from prisma/client. If I manually prisma generate then my website resolves models correctly. If I run pnpm install this does not work. FYI: I cannot cd and do npx prisma generate because vercel only clones the webiste directory, so I have to make it work with pnpm.
2 replies
PPrisma
Created by Abdul Munim on 10/20/2024 in #help-and-questions
link local prisma database project into other projects
Question I have two services that is in need of my prisma project that has all the types and prisma client, now I need a way to install it into both projects. My database project only has one file prisma.ts that exports the prisma client, I also need the types of my models as well. my database project package.json { "name": "pricing-oygula-database", "version": "0.0.1", "description": "", "main": "prisma.ts", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "author": "amunim", "license": "ISC", "dependencies": { "@prisma/client": "^5.21.1", "prisma": "^5.21.1", "tsc": "^2.0.4", "typescript": "^5.6.3" } } I tried npm link and then cd into my next.js project to npm link but that does not work. How to reproduce (optional) create 3 folders website some-other-service database Initialize a next.js project in website npm init some-other-service and install express npm i prisma inside database and write a schema.prisma, create prisma.ts file exporting the default prisma client.
6 replies