Skip to content

Commit baff76b

Browse files
authoredJul 20, 2024··
feat: built-in support for multiple validation libraries (#202)
Make use of built-in modular support for multiple validation libraries, instead of TypeSchema.
1 parent e00829a commit baff76b

Some content is hidden

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

54 files changed

+612
-2817
lines changed
 

‎apps/playground/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"zod-form-data": "^2.0.2"
2222
},
2323
"devDependencies": {
24-
"@types/node": "^20.12.10",
24+
"@types/node": "^20.14.11",
2525
"@types/react": "^18.3.1",
2626
"@types/react-dom": "18.3.0",
2727
"autoprefixer": "10.4.19",
2828
"eslint": "^8.57.0",
2929
"eslint-config-next": "15.0.0-canary.25",
3030
"postcss": "8.4.38",
3131
"tailwindcss": "3.4.3",
32-
"typescript": "^5.4.5"
32+
"typescript": "^5.5.3"
3333
}
3434
}

‎apps/playground/src/lib/safe-action.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import {
22
DEFAULT_SERVER_ERROR_MESSAGE,
33
createSafeActionClient,
44
} from "next-safe-action";
5+
import { zodAdapter } from "next-safe-action/adapters/zod";
56
import { z } from "zod";
67

78
export class ActionError extends Error {}
89

910
export const action = createSafeActionClient({
11+
validationAdapter: zodAdapter(),
1012
// You can provide a custom logging function, otherwise the lib will use `console.error`
1113
// as the default logging system. If you want to disable server errors logging,
1214
// just pass an empty Promise.

0 commit comments

Comments
 (0)
Please sign in to comment.