Skip to content

Commit c850088

Browse files
feat(router-valibot-adapter): upgrade valibot to v1 (#2470)
* feat: upgrade valibot adapter to v1 * chore: bump valibot in the example --------- Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
1 parent 8a848a4 commit c850088

File tree

4 files changed

+40
-43
lines changed

4 files changed

+40
-43
lines changed

examples/react/search-validator-adapters/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"start": "vite"
1010
},
1111
"dependencies": {
12+
"@tanstack/react-query": "^5.59.0",
1213
"@tanstack/react-router": "^1.59.0",
14+
"@tanstack/router-arktype-adapter": "^1.59.0",
1315
"@tanstack/router-devtools": "^1.59.0",
1416
"@tanstack/router-plugin": "^1.59.0",
15-
"@tanstack/router-zod-adapter": "^1.59.0",
1617
"@tanstack/router-valibot-adapter": "^1.59.0",
17-
"@tanstack/router-arktype-adapter": "^1.59.0",
18-
"@tanstack/react-query": "^5.59.0",
18+
"@tanstack/router-zod-adapter": "^1.59.0",
19+
"arktype": "^2.0.0-rc.14",
1920
"react": "^18.2.0",
2021
"react-dom": "^18.2.0",
21-
"zod": "^3.23.8",
22-
"valibot": "^0.42.1",
23-
"arktype": "^2.0.0-rc.14"
22+
"valibot": "1.0.0-beta.0",
23+
"zod": "^3.23.8"
2424
},
2525
"devDependencies": {
2626
"@types/react": "^18.2.47",

packages/router-valibot-adapter/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
"node": ">=12"
6565
},
6666
"devDependencies": {
67+
"@tanstack/react-router": "workspace:*",
6768
"@testing-library/jest-dom": "^6.5.0",
6869
"@testing-library/react": "^16.0.1",
69-
"@tanstack/react-router": "workspace:*",
70-
"valibot": "^0.42.1"
70+
"valibot": "1.0.0-beta.0"
7171
},
7272
"peerDependencies": {
73-
"valibot": ">=0.36.0",
74-
"@tanstack/react-router": ">=1.43.2"
73+
"@tanstack/react-router": ">=1.43.2",
74+
"valibot": "^1.0.0"
7575
}
7676
}

packages/router-valibot-adapter/src/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
import { parse } from 'valibot'
22
import type { SearchValidatorAdapter } from '@tanstack/react-router'
3-
import type { GenericSchema } from 'valibot'
3+
import type { GenericSchema, InferInput, InferOutput } from 'valibot'
44

55
export type ValibotSearchValidatorAdapter<TOptions extends GenericSchema> =
6-
SearchValidatorAdapter<
7-
NonNullable<TOptions['_types']>['input'],
8-
NonNullable<TOptions['_types']>['output']
9-
>
6+
SearchValidatorAdapter<InferInput<TOptions>, InferOutput<TOptions>>
107

118
export const valibotSearchValidator = <TOptions extends GenericSchema>(
129
options: TOptions,
1310
): ValibotSearchValidatorAdapter<TOptions> => {
1411
return {
1512
types: {
16-
input: options._types?.input,
17-
output: options._types?.output,
13+
input: null,
14+
output: null,
1815
},
1916
parse: (input) => parse(options, input),
2017
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)