@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.
- package/OVERVIEW.md +20 -0
- package/dist/index.cjs +39 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +40 -31
- package/dist/index.js.map +1 -1
- package/kubb-extension.json +204 -0
- package/package.json +7 -4
package/dist/index.d.ts
CHANGED
|
@@ -533,7 +533,7 @@ export declare const pluginZodName = "plugin-zod";
|
|
|
533
533
|
* })
|
|
534
534
|
* ```
|
|
535
535
|
*/
|
|
536
|
-
export declare const pluginZod:
|
|
536
|
+
export declare const pluginZod: import("kubb/kit").PluginFactory<PluginZod>;
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region src/resolvers/resolverZod.d.ts
|
|
539
539
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Resolver, ast, containsCircularRef, createResolver, defineGenerator, definePlugin, extractRefName, syncSchemaRef } from "kubb/kit";
|
|
2
|
+
import { Resolver, addGenerator, ast, containsCircularRef, createResolver, defineGenerator, definePlugin, extractRefName, setMacros, setResolver, syncSchemaRef } from "kubb/kit";
|
|
3
3
|
import { Const, File, Function, Type, jsxRenderer } from "kubb/jsx";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "kubb/jsx/jsx-runtime";
|
|
5
5
|
//#region ../../internals/shared/src/params.ts
|
|
@@ -2219,6 +2219,15 @@ const zodGenerator = defineGenerator({
|
|
|
2219
2219
|
}
|
|
2220
2220
|
});
|
|
2221
2221
|
//#endregion
|
|
2222
|
+
//#region kubb-extension.json
|
|
2223
|
+
var compatibility = {
|
|
2224
|
+
"kubb": ">=5.8.0",
|
|
2225
|
+
"node": ">=22"
|
|
2226
|
+
};
|
|
2227
|
+
//#endregion
|
|
2228
|
+
//#region package.json
|
|
2229
|
+
var version = "5.4.6";
|
|
2230
|
+
//#endregion
|
|
2222
2231
|
//#region src/resolvers/resolverZod.ts
|
|
2223
2232
|
/**
|
|
2224
2233
|
* Default resolver used by `@kubb/plugin-zod`. Decides the names and file
|
|
@@ -2305,37 +2314,37 @@ const pluginZodName = "plugin-zod";
|
|
|
2305
2314
|
* })
|
|
2306
2315
|
* ```
|
|
2307
2316
|
*/
|
|
2308
|
-
const pluginZod = definePlugin(
|
|
2309
|
-
|
|
2310
|
-
path: "zod",
|
|
2311
|
-
barrel: { type: "named" }
|
|
2312
|
-
}, group, exclude = [], include, override = [], compile = false, mini = false, guidType = "uuid", regexType = "literal", importPath = mini ? "zod/mini" : "zod", coercion = false, inferred = false, typeGuards = false, printer, resolver: userResolver, macros: userMacros } = options;
|
|
2313
|
-
const groupConfig = createGroupConfig(group);
|
|
2314
|
-
return {
|
|
2317
|
+
const pluginZod = definePlugin({
|
|
2318
|
+
meta: {
|
|
2315
2319
|
name: pluginZodName,
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2320
|
+
version,
|
|
2321
|
+
compatibility
|
|
2322
|
+
},
|
|
2323
|
+
setup(options) {
|
|
2324
|
+
const { output = {
|
|
2325
|
+
path: "zod",
|
|
2326
|
+
barrel: { type: "named" }
|
|
2327
|
+
}, group, exclude = [], include, override = [], compile = false, mini = false, guidType = "uuid", regexType = "literal", importPath = mini ? "zod/mini" : "zod", coercion = false, inferred = false, typeGuards = false, printer, resolver: userResolver, macros: userMacros } = options;
|
|
2328
|
+
setResolver(userResolver ? Resolver.merge(resolverZod, userResolver) : resolverZod);
|
|
2329
|
+
if (userMacros?.length) setMacros(userMacros);
|
|
2330
|
+
addGenerator(zodGenerator);
|
|
2331
|
+
return {
|
|
2332
|
+
output,
|
|
2333
|
+
exclude,
|
|
2334
|
+
include,
|
|
2335
|
+
override,
|
|
2336
|
+
group: createGroupConfig(group),
|
|
2337
|
+
importPath,
|
|
2338
|
+
coercion,
|
|
2339
|
+
inferred,
|
|
2340
|
+
guidType,
|
|
2341
|
+
regexType,
|
|
2342
|
+
compile,
|
|
2343
|
+
mini,
|
|
2344
|
+
typeGuards,
|
|
2345
|
+
printer
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2339
2348
|
});
|
|
2340
2349
|
//#endregion
|
|
2341
2350
|
export { pluginZod as default, pluginZod, pluginZodName, printerZod, printerZodMini, resolverZod, zodGenerator };
|