setup of the monorepo database :

image.png

file structure

1 - index.ts

export * from "@prisma/client";
  1. package.json
{
  "name": "@repo/database",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \\"Error: no test specified\\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "devDependencies": {
    "prisma": "^6.11.1"
  },
  "dependencies": {
    "@prisma/client": "^6.11.1"
  },
  "exports" : {
    "./client" : "./generated/prisma/index.js"
  }
}

tsconfig.json

{
  "extends": "@repo/typescript-config/base.json",
  "compilerOptions": {
    "outDir": "dist"
  },
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
}