prisma-class-generator
prisma-class-generator copied to clipboard
Relational imports not given proper snakecased file names that match generated files
Expected Behavior
I am receiving numerous typescript errors because the file import declarations are incorrect. What I should be seeing:
import { OrderEntity } from 'order_entity';
import { CurrencyCode, CheckoutTransportationMethod } from '@prisma/client';
import { Money } from './money';
import { MailingAddress } from './mailing_address';
Actual Behavior
import { OrderEntity } from 'orderentity';
import { CurrencyCode, CheckoutTransportationMethod } from '@prisma/client';
import { Money } from './money';
import { MailingAddress } from './mailingaddress';
The filenames for the types that were actually generated are order_entity.ts and mailing_address.ts, so the mismatch is problematic here.
Steps to Reproduce the Problem
- Create Prisma schema with pascal-cased model names
- Generate types with PrismaClassGenerator definition:
generator prismaClassGenerator {
provider = "prisma-class-generator"
output = "../src/@generated/prisma-class"
useSwagger = false
dryRun = false
}
- Done
Specifications
- Version: 0.2.9
- Prisma Version: 5.7.0
- Platform: macOS