Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chrishoermann/zod-prisma-types
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 26108d67c974070a29482cc30dc012104266748c
Choose a base ref
...
head repository: chrishoermann/zod-prisma-types
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c306530935b62db846d8f554b4fe77ec42b311d3
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on May 3, 2023

  1. fixed #137

    chrishoermann committed May 3, 2023
    Copy the full SHA
    c306530 View commit details
Showing with 26 additions and 29 deletions.
  1. +1 −1 packages/generator/package.json
  2. +2 −2 packages/generator/src/constants/regex.ts
  3. +3 −3 packages/usage/package.json
  4. +3 −2 packages/usage/prisma/schema.prisma
  5. +17 −21 pnpm-lock.yaml
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.7",
"version": "2.5.8",
"description": "Generates zod schemas from Prisma models with advanced validation",
"author": "Chris Hörmann",
"license": "MIT",
4 changes: 2 additions & 2 deletions packages/generator/src/constants/regex.ts
Original file line number Diff line number Diff line change
@@ -103,10 +103,10 @@ export const CUSTOM_VALIDATOR_MESSAGE_REGEX =
// ----------------------------------------

export const PRISMA_FUNCTION_TYPES_WITH_VALIDATORS =
/CreateInput|CreateMany|UpdateInput|UpdateMany/;
/CreateInput|CreateWithout|CreateMany|UpdateInput|UpdateWithout|UpdateMany/;

export const PRISMA_FUNCTION_TYPES_WITH_VALIDATORS_WHERE_UNIQUE =
/CreateInput|CreateMany|UpdateInput|UpdateMany|WhereUnique/;
/CreateInput|CreateWithout|CreateMany|UpdateInput|UpdateWithout|UpdateMany|WhereUnique/;

// IMPORT STATEMENT
// ----------------------------------------
6 changes: 3 additions & 3 deletions packages/usage/package.json
Original file line number Diff line number Diff line change
@@ -14,11 +14,11 @@
"license": "ISC",
"devDependencies": {
"@types/node": "^18.15.0",
"prisma": "^4.12.0",
"prisma": "^4.13.0",
"typescript": "^4.9.5"
},
"dependencies": {
"@prisma/client": "^4.12.0",
"@prisma/client": "^4.13.0",
"@trpc/client": "^10.15.0",
"@trpc/server": "^10.15.0",
"@types/validator": "^13.7.13",
@@ -30,6 +30,6 @@
"validator": "^13.9.0",
"vitest": "^0.25.8",
"zod": "^3.21.1",
"zod-prisma-types": "workspace:2.5.6"
"zod-prisma-types": "workspace:2.5.7"
}
}
5 changes: 3 additions & 2 deletions packages/usage/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -176,8 +176,8 @@ model User {

/// @zod.import(["import { myFunction } from "../../../../utils/myFunction";"])
model Post {
id Int @id @default(autoincrement())
title String
id Int @id @default(autoincrement()) /// @zod.number.int()
title String /// @zod.string.min(1)
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
@@ -189,6 +189,7 @@ model Post {

model Profile {
id Int @id @default(autoincrement())
/// @zod.string.min(1).max(400)
bio String
user User @relation(fields: [userId], references: [id])
userId String @unique
38 changes: 17 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.