Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installation step #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,19 @@ npm install -g yarn
0. **Ensure your tsconfig.json enables the compiler's strict mode.**
**Zod requires it and so do we, you will experience TS errors without strict mode enabled**

1. Add zod-prisma as a dev dependency
1. Add zod as a dependency

```sh
yarn add zod
```

2. Add zod-prisma as a dev dependency

```sh
yarn add -D zod-prisma
```

2. Add the zod-prisma generator to your schema.prisma
3. Add the zod-prisma generator to your schema.prisma

```prisma
generator zod {
Expand All @@ -152,8 +158,8 @@ npm install -g yarn
}
```

3. Run `npx prisma generate` or `yarn prisma generate` to generate your zod schemas
4. Import the generated schemas form your selected output location
4. Run `npx prisma generate` or `yarn prisma generate` to generate your zod schemas
5. Import the generated schemas form your selected output location

<!-- USAGE EXAMPLES -->

Expand Down