@mgansler/nx-prisma
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Nx Plugin for prisma

This plugin helps with the usage of Prisma in a Nx workspace.

How to use

Put this into targets of your project.json.

{
  "format": {
    "executor": "@mgansler/nx-prisma:format"
  },
  "generate": {
    "executor": "@mgansler/nx-prisma:generate"
  }
}

Your schema should be located at <sourceRoot>/libs/schema.prisma

Running nx run <projectName>:generate will generate the Prisma client under libs/client. This directory can be added to your .gitignore.

You may want a src/index.ts with the following content:

export * from './lib/client/index'

Also, don't forget to add "src/lib/client/**" to the ignorePatterns of your .eslintrc.json.

Options

schema: Path to schema.prisma relative to the sourceRoot of the application/library. Default is libs/schema.prisma

Package Sidebar

Install

npm i @mgansler/nx-prisma

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

7.7 kB

Total Files

17

Last publish

Collaborators

  • mgansler