@kubb/plugin-ts 3.0.0-alpha.11 → 3.0.0-alpha.13
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/README.md +13 -0
- package/dist/{chunk-TBTR5K32.js → chunk-ACLOC5VF.js} +15 -15
- package/dist/chunk-ACLOC5VF.js.map +1 -0
- package/dist/{chunk-X5LPJZGF.js → chunk-GHD7XUM4.js} +4 -4
- package/dist/{chunk-X5LPJZGF.js.map → chunk-GHD7XUM4.js.map} +1 -1
- package/dist/{chunk-ZGKAXNFT.cjs → chunk-NNWWVCR6.cjs} +30 -30
- package/dist/chunk-NNWWVCR6.cjs.map +1 -0
- package/dist/{chunk-ADFKVVPE.cjs → chunk-WG3GHGN2.cjs} +4 -4
- package/dist/{chunk-ADFKVVPE.cjs.map → chunk-WG3GHGN2.cjs.map} +1 -1
- package/dist/components.cjs +6 -6
- package/dist/components.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/oas.cjs +2 -2
- package/dist/oas.js +1 -1
- package/package.json +11 -11
- package/src/OperationGenerator.tsx +14 -4
- package/src/SchemaGenerator.tsx +7 -2
- package/src/components/OperationSchema.tsx +1 -1
- package/src/components/Schema.tsx +2 -2
- package/dist/chunk-TBTR5K32.js.map +0 -1
- package/dist/chunk-ZGKAXNFT.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -29,6 +29,19 @@
|
|
|
29
29
|
</h4>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
+
## Supporting Kubb
|
|
33
|
+
|
|
34
|
+
Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
|
|
35
|
+
|
|
36
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
40
|
+
<img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
|
|
41
|
+
</a>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
|
|
32
45
|
<!-- Badges -->
|
|
33
46
|
|
|
34
47
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-ts?flat&colorA=18181B&colorB=f58517
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, init_esm_shims, __toESM } from './chunk-
|
|
1
|
+
import { __commonJS, init_esm_shims, __toESM } from './chunk-GHD7XUM4.js';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
4
4
|
import transformers2, { camelCase, pascalCase } from '@kubb/core/transformers';
|
|
@@ -2500,8 +2500,8 @@ function Schema(props) {
|
|
|
2500
2500
|
);
|
|
2501
2501
|
return /* @__PURE__ */ jsxs(import_react3.Fragment, { children: [
|
|
2502
2502
|
enums.map(({ name: name2, nameNode, typeName: typeName2, typeNode }, index) => /* @__PURE__ */ jsxs(import_react3.Fragment, { children: [
|
|
2503
|
-
nameNode && /* @__PURE__ */ jsx(File.Source, { name: name2, isExportable: true, isIndexable: true, children: print(nameNode) }),
|
|
2504
|
-
/* @__PURE__ */ jsx(File.Source, { name: typeName2, isIndexable: true, isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType), isTypeOnly: true, children: print(typeNode) })
|
|
2503
|
+
nameNode && /* @__PURE__ */ jsx(File.Source, { name: name2, isExportable: true, isIndexable: true, children: print([nameNode]) }),
|
|
2504
|
+
/* @__PURE__ */ jsx(File.Source, { name: typeName2, isIndexable: true, isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType), isTypeOnly: true, children: print([typeNode]) })
|
|
2505
2505
|
] }, [name2, nameNode].join("-"))),
|
|
2506
2506
|
enums.every((item) => item.typeName !== resolvedName) && /* @__PURE__ */ jsx(File.Source, { name: typeName, isTypeOnly: true, isExportable: true, isIndexable: true, children: print(typeNodes) })
|
|
2507
2507
|
] });
|
|
@@ -2518,9 +2518,9 @@ var SchemaGenerator2 = class extends SchemaGenerator {
|
|
|
2518
2518
|
logger: pluginManager.logger
|
|
2519
2519
|
});
|
|
2520
2520
|
const tree = this.parse({ schema, name });
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
);
|
|
2521
|
+
const Component = () => /* @__PURE__ */ jsx(App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ jsx(Oas, { oas, children: /* @__PURE__ */ jsx(Oas.Schema, { name, value: schema, tree, children: /* @__PURE__ */ jsx(Schema.File, {}) }) }) });
|
|
2522
|
+
Component.displayName = pascalCase(name);
|
|
2523
|
+
root.render(/* @__PURE__ */ jsx(Component, {}));
|
|
2524
2524
|
return root.files;
|
|
2525
2525
|
}
|
|
2526
2526
|
};
|
|
@@ -2599,7 +2599,7 @@ function printCombinedSchema({
|
|
|
2599
2599
|
),
|
|
2600
2600
|
modifiers: [factory.modifiers.export]
|
|
2601
2601
|
});
|
|
2602
|
-
return print(namespaceNode);
|
|
2602
|
+
return print([namespaceNode]);
|
|
2603
2603
|
}
|
|
2604
2604
|
function OperationSchema({ keysToOmit, description }) {
|
|
2605
2605
|
return /* @__PURE__ */ jsx(Schema, { keysToOmit, description });
|
|
@@ -2639,9 +2639,9 @@ var OperationGenerator = class extends OperationGenerator$1 {
|
|
|
2639
2639
|
const root = createRoot({
|
|
2640
2640
|
logger: pluginManager.logger
|
|
2641
2641
|
});
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
);
|
|
2642
|
+
const Component = () => /* @__PURE__ */ jsx(App, { pluginManager, plugin, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations, generator: this, children: plugin.options.oasType && /* @__PURE__ */ jsx(OasType.File, { name: "oas", typeName: "Oas" }) }) });
|
|
2643
|
+
Component.displayName = pascalCase("operations");
|
|
2644
|
+
root.render(/* @__PURE__ */ jsx(Component, {}));
|
|
2645
2645
|
return root.files;
|
|
2646
2646
|
}
|
|
2647
2647
|
async operation(operation, options) {
|
|
@@ -2649,9 +2649,9 @@ var OperationGenerator = class extends OperationGenerator$1 {
|
|
|
2649
2649
|
const root = createRoot({
|
|
2650
2650
|
logger: pluginManager.logger
|
|
2651
2651
|
});
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
);
|
|
2652
|
+
const Component = () => /* @__PURE__ */ jsx(App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations: [operation], generator: this, children: /* @__PURE__ */ jsx(Oas.Operation, { operation, children: /* @__PURE__ */ jsx(OperationSchema.File, {}) }) }) });
|
|
2653
|
+
Component.displayName = pascalCase(operation.getOperationId());
|
|
2654
|
+
root.render(/* @__PURE__ */ jsx(Component, {}));
|
|
2655
2655
|
return root.files;
|
|
2656
2656
|
}
|
|
2657
2657
|
};
|
|
@@ -2785,5 +2785,5 @@ react/cjs/react.development.js:
|
|
|
2785
2785
|
*/
|
|
2786
2786
|
|
|
2787
2787
|
export { OasType, OperationSchema, Schema, pluginTs, pluginTsName };
|
|
2788
|
-
//# sourceMappingURL=chunk-
|
|
2789
|
-
//# sourceMappingURL=chunk-
|
|
2788
|
+
//# sourceMappingURL=chunk-ACLOC5VF.js.map
|
|
2789
|
+
//# sourceMappingURL=chunk-ACLOC5VF.js.map
|