zod-prisma
zod-prisma copied to clipboard
imports that use non-relative paths are generated with relative paths.
Hi there, thanks for building this!
Are non-relative paths supported for the imports
config property? I'm seeing the following:
Observed Behavior
Given the following config in schema.prisma
:
generator zod {
imports = "@my-org/custom-zod"
}
The generated typescript contains a relative import path:
import * as imports from "../../prisma/@my-org/custom-zod"
Expected Behavior
import * as imports from "@my-org/custom-zod"
Hey @obibring, glad you are enjoying the package!
Right now the generator is not setup to handle this use case but this makes a ton of sense! I'll get to work on a fix for you and let you know when a fix is out.
For now simply pointing to the package in the node_modules directory (ie. ../../node_modules/@my-org/custom-zod
) should mitigate the issue.
Thanks @CarterGrimmeisen !