Skip to content

Commit f536d80

Browse files
Update project to use zod v4 (#18)
* Initial plan * Complete zod v4 migration with updated import syntax and documentation Co-authored-by: ondrejsevcik <[email protected]> * Delete MIGRATION-ZOD-V4.md --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: ondrejsevcik <[email protected]>
1 parent b4b297e commit f536d80

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

package-lock.json

Lines changed: 4 additions & 4 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@mozilla/readability": "^0.6.0",
1515
"vite": "^6.3.5",
1616
"vite-plugin-web-extension": "^4.4.3",
17-
"zod": "^3.25.55"
17+
"zod": "^4.1.5"
1818
},
1919
"engines": {
2020
"node": ">=22.14.0"

src/types.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
import zod from "zod";
1+
import { z } from "zod";
22

3-
export const MessageSchema = zod.object({
4-
action: zod.string(),
5-
payload: zod.unknown(),
3+
export const MessageSchema = z.object({
4+
action: z.string(),
5+
payload: z.unknown(),
66
});
77

8-
export type Message = zod.infer<typeof MessageSchema>;
8+
export type Message = z.infer<typeof MessageSchema>;
99

10-
export const PromptSchema = zod.object({
11-
promptText: zod
10+
export const PromptSchema = z.object({
11+
promptText: z
1212
.string()
1313
.min(1, "Prompt text must be at least 1 character long"),
14-
attachment: zod
15-
.string()
16-
.min(1, "Attachment must be at least 1 character long"),
14+
attachment: z.string().min(1, "Attachment must be at least 1 character long"),
1715
});
1816

19-
export type Prompt = zod.infer<typeof PromptSchema>;
17+
export type Prompt = z.infer<typeof PromptSchema>;
2018

2119
export const GET_CONTENT = "GET_CONTENT";
2220
export const ACTION_SUMMARIZE = "ACTION_SUMMARIZE";

0 commit comments

Comments
 (0)