Skip to content

Commit 98ff39c

Browse files
committed
bump zod
1 parent 5ef5c80 commit 98ff39c

File tree

6 files changed

+22
-59
lines changed

6 files changed

+22
-59
lines changed

packages/client/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
"typescript-eslint": "^7.1.0",
5555
"valibot": "1.1.0",
5656
"vitest": "^1.2.2",
57-
"zod": "3.25.0-beta.20250515T085033",
58-
"zod-validation-error": "^3.3.0"
57+
"zod": "^3.24.4"
5958
},
6059
"dependencies": {
6160
"pg": "^8.11.3",

packages/client/src/sql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const sqlMethodHelpers: SQLMethodHelpers = {
2525
type: type => {
2626
if (!looksLikeStandardSchema(type)) {
2727
const typeName = (type as {})?.constructor?.name
28-
const hint = typeName?.includes('Zod') ? ` Try upgrading zod` : ''
28+
const hint = typeName?.includes('Zod') ? ` Try upgrading zod to v3.24.0 or greater` : ''
2929
throw new Error(`Invalid type parser. Must be a Standard Schema. Got ${typeName}.${hint}`, {
3030
cause: type,
3131
})

packages/client/test/api-usage.test.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import * as v from 'valibot'
33
import {beforeAll, beforeEach, expect, expectTypeOf, test, vi} from 'vitest'
44
import {z} from 'zod'
5-
import {fromError, isZodErrorLike} from 'zod-validation-error'
6-
import {createClient, createSqlTag, QueryError, sql} from '../src'
5+
import {createClient, createSqlTag, sql} from '../src'
76
import {printErrorCompact as printError} from './snapshots'
87

98
expect.addSnapshotSerializer({
@@ -418,20 +417,6 @@ test('sql.type with custom error message', async () => {
418417
application_name: 'impatient',
419418
},
420419
},
421-
wrapQueryFn: queryFn => {
422-
const parentWrapper = client.options.wrapQueryFn || (x => x)
423-
return async (...args) => {
424-
const parentQueryFn = parentWrapper(queryFn)
425-
try {
426-
return await parentQueryFn(...args)
427-
} catch (e) {
428-
if (e instanceof QueryError && isZodErrorLike(e.cause)) {
429-
e.cause = fromError(e.cause)
430-
}
431-
throw e
432-
}
433-
}
434-
},
435420
})
436421
const StringId = z.object({id: z.string()})
437422

packages/client/test/snapshots.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import {isValidationErrorLike, fromError, isZodErrorLike} from 'zod-validation-error'
2-
31
export function printError(val: any): string {
42
const message = val instanceof Error ? `[${val.constructor.name}]: ${val.message}` : undefined
5-
if (message && isValidationErrorLike(val)) {
6-
return message
7-
}
83
const props = JSON.stringify(
94
val,
105
function reviver(this: any, key, value: any) {
@@ -32,10 +27,7 @@ export function printErrorCompact(val: any): string {
3227
const lines: string[] = []
3328
let e = val as Error | undefined
3429
while (e) {
35-
if (isValidationErrorLike(e)) {
36-
return printError(e)
37-
}
38-
const message = isZodErrorLike(e) ? `${fromError(e).message} (**auto-formatted for snapshot**)` : e.message
30+
const message = e.message
3931
lines.push(`${' '.repeat(lines.length)}${lines.length ? 'Caused by: ' : ''}[${e.constructor.name}]: ${message}`)
4032
e = e.cause as Error | undefined
4133
}

packages/typegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"pgsql-ast-parser": "^11.1.0",
4545
"pluralize": "^8.0.0",
4646
"trpc-cli": "^0.6.0-15",
47-
"zod": "^3.23.8"
47+
"zod": "^3.24.4"
4848
},
4949
"devDependencies": {
5050
"@types/glob": "7.2.0",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)