kimjbstar/prisma-class-generator

Invalid prisma client import path

tuvshinbay4r opened this issue · 1 comments

Expected Behavior

import { PermissionAction } from '@prisma/client'

Actual Behavior

import { PermissionAction } from '../../.prisma/client'

Steps to Reproduce the Problem

  1. Set custom prisma client path
generator client {
  provider = "prisma-client-js"
  output   = "../../../node_modules/.prisma/client"
}
  1. Set prisma class generator
generator prismaClassGenerator {
  provider   = "prisma-class-generator"
  dryRun     = false
  output     = "../src/generated"
}
  1. Run generate command
$ npx prisma generate --schema=libs/models/prisma/schema.prisma

Specifications

  • Version: 0.2.5
  • Prisma Version: 4.11.0
  • Platform: MacOs

Solution

I am using prisma-class-generator with Nx monorepo and my prisma schema is existing
on the path libs/models/prisma/schema.prisma.

Maybe it is nice to have generator argument like clientImportPath to set custom prisma client import path

In the process of creating the prisma client import path, unnecessary logic was found and removed.

From now on, this path is set to "@prisma/client" by default, and can be specified directly using the "clientImportPath" option.