@kubb/plugin-zod 5.4.4 → 5.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,204 @@
1
+ {
2
+ "$schema": "https://kubb.dev/schemas/kubb-extension.json",
3
+ "kind": "plugin",
4
+ "name": "plugin-zod",
5
+ "export": "pluginZod",
6
+ "displayName": "Zod",
7
+ "description": "Generates Zod v4 schemas from your OpenAPI spec so you validate API responses, form input, and query params at runtime.",
8
+ "category": "validation",
9
+ "icon": {
10
+ "light": "https://kubb.dev/feature/zod.svg"
11
+ },
12
+ "tags": ["zod", "validation", "schema", "runtime-validation", "codegen", "openapi"],
13
+ "docs": "https://kubb.dev/plugins/plugin-zod",
14
+ "compatibility": {
15
+ "kubb": ">=5.8.0",
16
+ "node": ">=22"
17
+ },
18
+ "options": [
19
+ {
20
+ "key": "outputPath",
21
+ "path": ["output", "path"],
22
+ "label": "Output Path",
23
+ "description": "Output folder for generated files",
24
+ "type": "text",
25
+ "default": "zod"
26
+ },
27
+ {
28
+ "key": "barrel",
29
+ "path": ["output", "barrel"],
30
+ "label": "Barrel",
31
+ "description": "How index.ts barrel files are generated",
32
+ "type": "select",
33
+ "default": {
34
+ "type": "named"
35
+ },
36
+ "choices": [
37
+ {
38
+ "label": "named",
39
+ "value": {
40
+ "type": "named"
41
+ }
42
+ },
43
+ {
44
+ "label": "named (nested)",
45
+ "value": {
46
+ "type": "named",
47
+ "nested": true
48
+ }
49
+ },
50
+ {
51
+ "label": "all",
52
+ "value": {
53
+ "type": "all"
54
+ }
55
+ },
56
+ {
57
+ "label": "all (nested)",
58
+ "value": {
59
+ "type": "all",
60
+ "nested": true
61
+ }
62
+ },
63
+ {
64
+ "label": "false (disabled)",
65
+ "value": false
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "key": "outputMode",
71
+ "path": ["output", "mode"],
72
+ "label": "Output Mode",
73
+ "description": "How the plugin consolidates its code into files. File mode writes everything into a single file, so the output path must include a file extension and cannot be grouped.",
74
+ "type": "select",
75
+ "default": "directory",
76
+ "choices": [
77
+ {
78
+ "label": "directory (one file per schema)",
79
+ "value": "directory"
80
+ },
81
+ {
82
+ "label": "file (single file)",
83
+ "value": "file"
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "key": "group",
89
+ "path": ["group"],
90
+ "label": "Group",
91
+ "description": "Group generated operations by OpenAPI tag or path",
92
+ "type": "select",
93
+ "default": null,
94
+ "choices": [
95
+ {
96
+ "label": "none",
97
+ "value": null
98
+ },
99
+ {
100
+ "label": "by tag",
101
+ "value": {
102
+ "type": "tag"
103
+ }
104
+ },
105
+ {
106
+ "label": "by path",
107
+ "value": {
108
+ "type": "path"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "key": "excludeTags",
115
+ "path": ["exclude"],
116
+ "label": "Exclude Tags",
117
+ "description": "Comma-separated OpenAPI tags to exclude from generation",
118
+ "type": "list",
119
+ "item": {
120
+ "type": "tag",
121
+ "pattern": "$item"
122
+ }
123
+ },
124
+ {
125
+ "key": "includeTags",
126
+ "path": ["include"],
127
+ "label": "Include Tags",
128
+ "description": "Comma-separated OpenAPI tags to include. Only operations with these tags are generated",
129
+ "type": "list",
130
+ "item": {
131
+ "type": "tag",
132
+ "pattern": "$item"
133
+ }
134
+ },
135
+ {
136
+ "key": "mini",
137
+ "path": ["mini"],
138
+ "label": "Zod Mini",
139
+ "description": "Use Zod Mini functional API for better tree-shaking",
140
+ "type": "boolean",
141
+ "default": false
142
+ },
143
+ {
144
+ "key": "importPath",
145
+ "path": ["importPath"],
146
+ "label": "Import Path",
147
+ "description": "Module specifier used in the import statement",
148
+ "type": "text",
149
+ "default": "zod"
150
+ },
151
+ {
152
+ "key": "guidType",
153
+ "path": ["guidType"],
154
+ "label": "GUID Type",
155
+ "description": "Validator used for OpenAPI format: uuid",
156
+ "type": "select",
157
+ "default": "uuid",
158
+ "choices": [
159
+ {
160
+ "label": "uuid",
161
+ "value": "uuid"
162
+ },
163
+ {
164
+ "label": "guid",
165
+ "value": "guid"
166
+ }
167
+ ]
168
+ },
169
+ {
170
+ "key": "regexType",
171
+ "path": ["regexType"],
172
+ "label": "Regex Type",
173
+ "description": "Output form for an OpenAPI pattern inside .regex(...)",
174
+ "type": "select",
175
+ "default": "literal",
176
+ "choices": [
177
+ {
178
+ "label": "literal",
179
+ "value": "literal"
180
+ },
181
+ {
182
+ "label": "constructor",
183
+ "value": "constructor"
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "key": "inferred",
189
+ "path": ["inferred"],
190
+ "label": "Inferred",
191
+ "description": "Export a z.infer type alias next to every generated schema",
192
+ "type": "boolean",
193
+ "default": false
194
+ },
195
+ {
196
+ "key": "coercion",
197
+ "path": ["coercion"],
198
+ "label": "Coercion",
199
+ "description": "Wrap schemas in z.coerce so input is coerced before validation",
200
+ "type": "boolean",
201
+ "default": false
202
+ }
203
+ ]
204
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-zod",
3
- "version": "5.4.4",
3
+ "version": "5.4.6",
4
4
  "description": "Generate Zod validation schemas with Kubb for runtime data parsing and type safety. Pairs with @kubb/plugin-ts for end-to-end type coverage.",
5
5
  "keywords": [
6
6
  "code-generation",
@@ -39,6 +39,8 @@
39
39
  "files": [
40
40
  "templates",
41
41
  "dist",
42
+ "kubb-extension.json",
43
+ "OVERVIEW.md",
42
44
  "!/**/**.test.**",
43
45
  "!/**/__tests__/**",
44
46
  "!/**/__snapshots__/**"
@@ -54,7 +56,8 @@
54
56
  "import": "./dist/index.js",
55
57
  "require": "./dist/index.cjs"
56
58
  },
57
- "./package.json": "./package.json"
59
+ "./package.json": "./package.json",
60
+ "./kubb-extension.json": "./kubb-extension.json"
58
61
  },
59
62
  "publishConfig": {
60
63
  "access": "public",
@@ -63,11 +66,11 @@
63
66
  "devDependencies": {
64
67
  "@internals/shared": "0.0.0",
65
68
  "@internals/utils": "0.0.0",
66
- "kubb": "^5.6.3",
69
+ "kubb": "^5.8.1",
67
70
  "zod": "^4.6.5"
68
71
  },
69
72
  "peerDependencies": {
70
- "kubb": "^5.6.3",
73
+ "kubb": "^5.8.1",
71
74
  "zod": "^4.0.0"
72
75
  },
73
76
  "peerDependenciesMeta": {