@kubb/plugin-zod 3.8.0 → 3.9.1
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/dist/{chunk-VPOWWZEW.js → chunk-3KBN4WTO.js} +71 -36
- package/dist/chunk-3KBN4WTO.js.map +1 -0
- package/dist/{chunk-DKAOGAVN.cjs → chunk-7GPORWCL.cjs} +70 -35
- package/dist/chunk-7GPORWCL.cjs.map +1 -0
- package/dist/{chunk-BWBRIHPY.cjs → chunk-F3XH7OGO.cjs} +50 -29
- package/dist/chunk-F3XH7OGO.cjs.map +1 -0
- package/dist/{chunk-2JCBW3TA.js → chunk-WS5LFZBH.js} +49 -28
- package/dist/chunk-WS5LFZBH.js.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +12 -12
- package/src/components/Zod.tsx +12 -11
- package/src/generators/__snapshots__/anyof.ts +4 -0
- package/src/generators/__snapshots__/coercion.ts +4 -0
- package/src/generators/__snapshots__/coercionDates.ts +4 -0
- package/src/generators/__snapshots__/coercionNumbers.ts +4 -0
- package/src/generators/__snapshots__/coercionStrings.ts +4 -0
- package/src/generators/__snapshots__/createPet.ts +4 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +4 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput.ts +4 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput_entire_.ts +4 -0
- package/src/generators/__snapshots__/createPet_wrapOutput.ts +4 -0
- package/src/generators/__snapshots__/deletePet.ts +4 -0
- package/src/generators/__snapshots__/deletePet_wrapOutput.ts +4 -0
- package/src/generators/__snapshots__/discriminator.ts +4 -0
- package/src/generators/__snapshots__/enumBooleanLiteral.ts +4 -0
- package/src/generators/__snapshots__/enumNamesType.ts +4 -0
- package/src/generators/__snapshots__/enumNullable.ts +4 -0
- package/src/generators/__snapshots__/enumSingleLiteral.ts +4 -0
- package/src/generators/__snapshots__/enumVarNamesType.ts +4 -0
- package/src/generators/__snapshots__/example.ts +4 -0
- package/src/generators/__snapshots__/getPets.ts +4 -0
- package/src/generators/__snapshots__/getPets_wrapOutput.ts +4 -0
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +4 -0
- package/src/generators/__snapshots__/nullableString.ts +4 -0
- package/src/generators/__snapshots__/nullableStringUuid.ts +4 -0
- package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +4 -0
- package/src/generators/__snapshots__/numberValueConst.ts +4 -0
- package/src/generators/__snapshots__/oneof.ts +4 -0
- package/src/generators/__snapshots__/operations.ts +4 -0
- package/src/generators/__snapshots__/optionalPetInfer.ts +4 -0
- package/src/generators/__snapshots__/optionalPetTyped.ts +4 -0
- package/src/generators/__snapshots__/order.ts +4 -0
- package/src/generators/__snapshots__/orderDateTypeFalse.ts +4 -0
- package/src/generators/__snapshots__/orderDateTypeString.ts +4 -0
- package/src/generators/__snapshots__/pet.ts +4 -0
- package/src/generators/__snapshots__/petArray.ts +4 -0
- package/src/generators/__snapshots__/petCoercion.ts +4 -0
- package/src/generators/__snapshots__/petTupleObject.ts +4 -0
- package/src/generators/__snapshots__/petWithMapper.ts +4 -0
- package/src/generators/__snapshots__/pets.ts +4 -0
- package/src/generators/__snapshots__/recursive.ts +4 -0
- package/src/generators/__snapshots__/showPetById.ts +4 -0
- package/src/generators/__snapshots__/showPetById_wrapOutput.ts +4 -0
- package/src/generators/__snapshots__/stringValueConst.ts +4 -0
- package/src/generators/__snapshots__/toy.ts +4 -0
- package/src/generators/__snapshots__/uuidSchema.ts +4 -0
- package/src/generators/operationsGenerator.tsx +7 -1
- package/src/generators/zodGenerator.tsx +9 -2
- package/src/parser.ts +71 -30
- package/src/utils/ToZod.ts +1 -2
- package/dist/chunk-2JCBW3TA.js.map +0 -1
- package/dist/chunk-BWBRIHPY.cjs.map +0 -1
- package/dist/chunk-DKAOGAVN.cjs.map +0 -1
- package/dist/chunk-VPOWWZEW.js.map +0 -1
|
@@ -32,7 +32,13 @@ export const operationsGenerator = createReactGenerator<PluginZod>({
|
|
|
32
32
|
.filter(Boolean)
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<File
|
|
35
|
+
<File
|
|
36
|
+
baseName={file.baseName}
|
|
37
|
+
path={file.path}
|
|
38
|
+
meta={file.meta}
|
|
39
|
+
banner={getBanner({ oas, output, config: pluginManager.config })}
|
|
40
|
+
footer={getFooter({ oas, output })}
|
|
41
|
+
>
|
|
36
42
|
{imports}
|
|
37
43
|
<Operations name={name} operations={transformedOperations} />
|
|
38
44
|
</File>
|
|
@@ -84,7 +84,7 @@ export const zodGenerator = createReactGenerator<PluginZod>({
|
|
|
84
84
|
baseName={file.baseName}
|
|
85
85
|
path={file.path}
|
|
86
86
|
meta={file.meta}
|
|
87
|
-
banner={getBanner({ oas, output: plugin.options.output })}
|
|
87
|
+
banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}
|
|
88
88
|
footer={getFooter({ oas, output: plugin.options.output })}
|
|
89
89
|
>
|
|
90
90
|
<File.Import name={['z']} path={plugin.options.importPath} />
|
|
@@ -97,6 +97,7 @@ export const zodGenerator = createReactGenerator<PluginZod>({
|
|
|
97
97
|
|
|
98
98
|
const { getName, getFile, getImports } = useSchemaManager()
|
|
99
99
|
const {
|
|
100
|
+
pluginManager,
|
|
100
101
|
plugin: {
|
|
101
102
|
options: { output },
|
|
102
103
|
},
|
|
@@ -117,7 +118,13 @@ export const zodGenerator = createReactGenerator<PluginZod>({
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
return (
|
|
120
|
-
<File
|
|
121
|
+
<File
|
|
122
|
+
baseName={zod.file.baseName}
|
|
123
|
+
path={zod.file.path}
|
|
124
|
+
meta={zod.file.meta}
|
|
125
|
+
banner={getBanner({ oas, output, config: pluginManager.config })}
|
|
126
|
+
footer={getFooter({ oas, output })}
|
|
127
|
+
>
|
|
121
128
|
<File.Import name={['z']} path={importPath} />
|
|
122
129
|
{typed && <File.Import isTypeOnly root={zod.file.path} path={type.file.path} name={[type.name]} />}
|
|
123
130
|
{typed && <File.Import isTypeOnly path={'@kubb/plugin-zod/utils'} name={['ToZod']} />}
|