kirimase
kirimase copied to clipboard
feature add: update package.json so that it has script for prisma generate for development and production
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.
probably better instead of modifying dev and build -
- add new script
"prisma:update": "npx prisma db push && npx prisma generate"
- 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