Closed altarrok closed 2 years ago
Hey @altarrok
Sadly, I do not have a Windows machine to try it out. On my Linux machine though, your config worked fine and generated this import:
import type { Prisma } from '../../../prisma-client';
So, is it possible that you attempt fixing this? I'm more than happy to accept your changes and guide you along the way.
Also, don't forget to star this project if you find it helpful :)
@omar-dulaimi Yeah sure, I already implemented a fix, I don't have the perms tho, how can I create a PR? thx
@altarrok 1- Fork 2- Clone 3- Create a local branch for the fix 4- Push to your fork 5- From your Github repo, create PR
@omar-dulaimi thanks for the steps, created the PR: #10
@altarrok Thanks for your contribution. Any others you have are welcomed, just make sure to start an issue first so we can discuss it :)
Released in: https://github.com/omar-dulaimi/prisma-zod-generator/releases/tag/0.4.1
Bug description
Generated object schemas have a bad prisma-client import when client output is "../src/generated/prisma-client" and zod output is "../src/generated/zod" in Windows:
How to reproduce
output = "../src/generated/prisma-client"
to client generator config in schema.prismaoutput = "../src/generated/zod"
to zod generator config in schema.prismayarn prisma generate
src\generated\zod\schemas\objects\XCreateInput.schema.ts
import type { Prisma } from '......prisma-client';
Expected behavior
import type { Prisma } from '../../../prisma-client';
Prisma information
generator client { provider = "prisma-client-js" output = "../src/generated/prisma-client" binaryTargets = ["native", "rhel-openssl-1.0.x"] }
generator zod { provider = "prisma-zod-generator" output = "../src/generated/zod" }
datasource db { provider = "mongodb" url = env("DATABASE_URL") }
model X { id String @id @default(auto()) @map("_id") @db.ObjectId }
Environment & setup
Prisma Version