This package aims to reduce the pain of writing all datamodels on the prisma.yml file. It will regenerate it with populating datamodels field by intropecting your project.
This is the default structure where prismafire
will work with zero conf
├── src
│ └── prisma
│ └── datamodels
│ └── **/*.graphql
├── prisma.yml ( default input and default ouput )
└── package.json
npm install -D prismafire
If your prisma.yml is elsewhere, you can specify --input
to indicate where to fetch the file.
If your prisma.yml should be elsewhere, you can specify --output
to indicate where to write the file.
You can also set a different glob to match your datamodels fils through the --glob
option
I suggest adding this script on the package json :
{
// ...
"scripts": {
// ...
"prisma:deploy":"prismafire && prisma deploy ", // you can pass options after prismafire
// or with options ( ex with --glob)
"prisma:deploy":"prismafire --glob custom/**.glob && prisma deploy ",
}
}
or
then run prisma deploy via the script.
This way, you'll trigger the hook to generate the prisma file before asking for deployment