/prisma-json-generator

Primary LanguageTypeScriptMIT LicenseMIT

prisma-json-generator

npm GitHub Workflow Status (with branch)

prisma-json-generator is a Prisma Generator to expose into a single file (.ts, .json or .js) all attributes coming from the Prisma Schema, in particular comments and annotations.

Get started

  • Setup your Prisma project as usual (Get Started With Prisma)
  • Install this package
    • npm install -D prisma-json-generator
    • yarn add -D prisma-json-generator
    • pnpm install -D prisma-json-generator
  • Modify your Prisma model file
    generator json {
        provider = "prisma-json-generator"
        output   = "./schema.ts"
    }
  • Run npx prisma generate

Enjoy !

Thanks

Special Thanks to @loancrate for his powerful and fast AST parser, and to @luisrudge for his prisma-generator-fake-data generator which help me bootstrap this project!