Creates ready to run latest prisma generator
.
Together with pre-configured packages, and pluggable architecture, it creates project ready for prisma generator development.
- typescript
- prisma
- eslint
- prettier
- jest
Read more about plugins here.
Install as dev dependency:
npm install prisma-generator-builder -D
Run the builder to get started.
npx prisma-generator-builder
Switch to the output directory and run
npm install
npx prisma generate
That's it.
Prisma ORM version 5.x.x
.
<project root>
└──src
├── bin.ts
└── generator
├── helper
├ ├── helper.file-writer.test.ts
├ ├── helper.file-writer.ts
├ ├── helper.hello-world.test.ts
├ ├── helper.hello-world.ts
└── builder.ts
├── package.json
...
└── README.md
The generator uses very basic HelloWorld
helper example.
However, thanks to this separation, prisma and custom generator
logic are not mixed together.
To see the example check builder.ts.
Handles file writing.
saveFile()
- saves any file
FileWriter.saveFile("foo.txt", `foo`);
saveTypescriptFile()
- saves and formats typescript file
FileWriter.saveTypescriptFile("foo.ts", `const foo="foo"; console.log(foo);`);
Generated package comes together with pre-configured jest
.
npx jest