Skip to content

Commit

Permalink
changes in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishoermann committed Mar 27, 2023
1 parent c147f46 commit af9292c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions packages/generator/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ generator zod {
}
```

Then import the schema's into your file:

```ts
import { mySchema } from '/prisma/generated/zod'; // All schemas are here by default, use the 'output' option to change it
```

> If you encounter errors like the following `/bin/sh: zod-prisma-types: command not found` please try to use the `npx` command with the `zod-prisma-types` command.
```prisma
generator zod {
provider = "npx zod-prisma-types"
}
```

If you want to customize the behaviour of the generator you can use the following options:

```prisma
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zod-prisma-types",
"version": "2.5.2",
"version": "2.5.3",
"description": "Generates zod schemas from Prisma models with advanced validation",
"author": "Chris Hörmann",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/usage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"validator": "^13.9.0",
"vitest": "^0.25.8",
"zod": "^3.21.1",
"zod-prisma-types": "workspace:2.5.1"
"zod-prisma-types": "workspace:2.5.3"
}
}

0 comments on commit af9292c

Please sign in to comment.