zenstackhq / zenstack

Fullstack TypeScript toolkit enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
1.83k stars 78 forks source link

generate command not working for multirepo project #1503

Open iolathief108 opened 3 weeks ago

iolathief108 commented 3 weeks ago

Description and expected behavior This is a multirepo project which have server and web inside the root directory.

server/package.json

 "scripts": {
    "with-env": "dotenv -e ../.env --",
    "db:gen": "yarn with-env prisma generate --schema=./lib/prisma/prisma/schema.prisma",
    "db:push": "yarn with-env prisma db push --schema=./lib/prisma/prisma/schema.prisma",
    "zen:gen": "yarn zenstack generate --schema=./lib/prisma/schema.zmodel",
  },

Screenshots 2024-06-12_185825 2024-06-12_185840

Running the same command at the root directory is working.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

ymc9 commented 2 weeks ago

Hi @iolathief108 , thanks for reporting this. Does it work if you run "yarn db:gen" inside the "server" directory?

iolathief108 commented 1 week ago

Hi @iolathief108 , thanks for reporting this. Does it work if you run "yarn db:gen" inside the "server" directory?

yes