Hey, I know it's been asked before but I couldn't ...
# orm-help
a
Hey, I know it's been asked before but I couldn't understand from previous responses how to solve this thing: I've a monorepo, I've two packages that both should represent Prisma client, each one with a different database (different RDS instance for that matter) and different schema. I need to use these two packages, call them
@me/db1
and
@me/db2
from every other package (
@me/*
). This is Typescript so generating to
src
or the root of the package is not ideal, generating straight into
dist
will cause compilation to potentially fail, or make
tsserver
unhappy. Creating the packages in another repo, outside of the monorepo is kinda losing the entire point of monorepo. Did anyone solve something similar to that?
l
You must decide what you want. tsserver is for typescript, so no need to compile what you have in src. If you are going to run with node or something else that don't understand typescript, compile to dist. I compile everything to dist, and set up package.json to have "main": "dist/index.js" such that is what is used by those that depends on the package. This is also works for yarn link.
a
Thanks!
How are you exporting types from the schema?
l
I'm on prisma1, so not entirely the same, but i compile the schema files with my prisma package and the -d (--declarations) switch so the type files also goes in the dist folder.