Skip to content

Commit 00ea8ca

Browse files
fix(deps): update dependency zod to v4.1.9 (#539)
* fix(deps): update dependency zod to v4.1.9 * refactor: @zod/mini -> zod/mini * refactor: @zod/core -> zod/v4/core * fix: discriminatedUnion * fix: date * fix: default * fix: base64url * feat: function * feat: prefault * fix: type --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ernest <soc221b.e@gmail.com>
1 parent d8aeb1f commit 00ea8ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+161
-138
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ npm install --save-dev zod-schema-faker@beta
2323
Built-in zod types:
2424

2525
```ts
26-
import * as z from 'zod' // or import * as z from '@zod/mini'
26+
import * as z from 'zod' // or import * as z from 'zod/mini'
2727
import { faker } from '@faker-js/faker'
2828
import { fake, fakeSchema, setFaker } from 'zod-schema-faker'
2929

@@ -42,7 +42,7 @@ if (process.env.NODE_ENV === 'development') {
4242
Custom zod types:
4343

4444
```ts
45-
import * as z from 'zod' // or import * as z from '@zod/mini'
45+
import * as z from 'zod' // or import * as z from 'zod/mini'
4646
import { faker } from '@faker-js/faker'
4747
import { custom, fake, Fake, getFaker, setFaker } from 'zod-schema-faker'
4848

e2e/issue-189/package-lock.json

Lines changed: 10 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/issue-189/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "npx tsc -p tsconfig.json"
77
},
88
"dependencies": {
9-
"zod": "4.0.0-beta.20250505T195954"
9+
"zod": "4.1.9"
1010
},
1111
"devDependencies": {
1212
"ts-expect": "1.3.0",

example/package-lock.json

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"@zod/mini": "4.0.0-beta.0"
12+
"zod": "^4.1.9"
1313
},
1414
"devDependencies": {
1515
"@types/node": "22.18.6",

example/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { faker } from '@faker-js/faker'
2-
import { z } from '@zod/mini'
32
import { fake, setFaker } from 'zod-schema-faker'
3+
import { z } from 'zod/mini'
44

55
const main = async () => {
66
const schema = z.uuid()

package-lock.json

Lines changed: 4 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
"devDependencies": {
4949
"@types/node": "22.18.6",
5050
"@vitest/coverage-v8": "3.2.4",
51-
"@zod/core": "0.11.6",
52-
"@zod/mini": "4.0.0-beta.20250505T195954",
5351
"prettier": "3.6.2",
5452
"prettier-plugin-multiline-arrays": "4.0.3",
5553
"prettier-plugin-organize-imports": "4.3.0",
@@ -62,10 +60,7 @@
6260
"vite": "7.1.6",
6361
"vite-plugin-dts": "4.5.4",
6462
"vitest": "3.2.4",
65-
"zod": "4.0.0-beta.20250505T195954"
66-
},
67-
"peerDependencies": {
68-
"@zod/core": "*"
63+
"zod": "4.1.9"
6964
},
7065
"publishConfig": {
7166
"tag": "beta"

src/internals/fake.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as core from '@zod/core'
1+
import * as core from 'zod/v4/core'
22
import { fakeAny } from './schemas/any'
33
import { fakeArray } from './schemas/array'
44
import { fakeBigInt } from './schemas/big-int'
@@ -8,6 +8,7 @@ import { fakeCustom } from './schemas/custom'
88
import { fakeDate } from './schemas/date'
99
import { fakeDefault } from './schemas/default'
1010
import { fakeEnum } from './schemas/enum'
11+
import { fakeFunction } from './schemas/function'
1112
import { fakeLazy } from './schemas/lazy'
1213
import { fakeLiteral } from './schemas/literal'
1314
import { fakeMap } from './schemas/map'
@@ -20,6 +21,7 @@ import { fakeNumber } from './schemas/number'
2021
import { fakeObject } from './schemas/object'
2122
import { fakeOptional } from './schemas/optional'
2223
import { fakePipe } from './schemas/pipe'
24+
import { fakePrefault } from './schemas/prefault'
2325
import { fakePromise } from './schemas/promise'
2426
import { fakeReadonly } from './schemas/readonly'
2527
import { fakeRecord } from './schemas/record'
@@ -54,6 +56,8 @@ export const rootFake: RootFake = ((schema: core.$ZodType, context) => {
5456
return fakeDefault(schema as any, context, rootFake)
5557
case 'enum':
5658
return fakeEnum(schema as any, context, rootFake)
59+
case 'function':
60+
return fakeFunction(schema as any, context, rootFake)
5761
case 'file':
5862
// TODO
5963
break
@@ -87,6 +91,8 @@ export const rootFake: RootFake = ((schema: core.$ZodType, context) => {
8791
return fakeOptional(schema as any, context, rootFake)
8892
case 'pipe':
8993
return fakePipe(schema as any, context, rootFake)
94+
case 'prefault':
95+
return fakePrefault(schema as any, context, rootFake)
9096
case 'promise':
9197
return fakePromise(schema as any, context, rootFake)
9298
case 'readonly':
@@ -118,7 +124,7 @@ export const rootFake: RootFake = ((schema: core.$ZodType, context) => {
118124
case 'void':
119125
return fakeVoid(schema as any, context, rootFake)
120126
default: {
121-
const _: 'interface' = schema._zod.def.type
127+
const _: never = schema._zod.def.type
122128
break
123129
}
124130
}

src/internals/schemas/any.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as core from '@zod/core'
1+
import * as core from 'zod/v4/core'
22
import { Context } from '../context'
33
import { rootFake as internalFake } from '../fake'
44
import { Infer } from '../type'

0 commit comments

Comments
 (0)