kirimase icon indicating copy to clipboard operation
kirimase copied to clipboard

feature add: update package.json so that it has script for prisma generate for development and production

Open me-imfhd opened this issue 1 year ago • 1 comments

when we try to do pnpm dev, if we don't do npx prisma db push && npx prisma generate we face some db issue, so this is manually done by developer, if we can update our dev script from: "dev": "next dev" to: "dev": "npx prisma db push && npx prisma generate && next dev"

the developer no longer needs to db push and the db generate

but that was not the big deal

when we deploy our app we must have this script in our build script else while deploying prisma/db will complain us that something is missing

so basically cli should update the build script from: "build": "next dev" to: "build": "npx prisma db push && npx prisma generate && next build",

if the cli could update tha package.json for dev and build scripts some pain can be taken away, with this automatically people will not face issue while production in case they forget about this part.

me-imfhd avatar Sep 18 '23 22:09 me-imfhd

probably better instead of modifying dev and build -

  1. add new script "prisma:update": "npx prisma db push && npx prisma generate"
  2. add new scripts "predev": "npm run prisma:update" and "prebuild": "npm run prisma:update"

also, would be nice to detect the package manager of choice - npm / yarn / pnpm / bun

olehmelnyk avatar Oct 13 '23 19:10 olehmelnyk