@kubb/plugin-ts 5.0.0-alpha.1 → 5.0.0-alpha.3
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/{components-LmqJfxMv.js → components-CRjwjdyE.js} +8 -4
- package/dist/components-CRjwjdyE.js.map +1 -0
- package/dist/{components-9wydyqUx.cjs → components-DI0aTIBg.cjs} +133 -3
- package/dist/components-DI0aTIBg.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +3 -2
- package/dist/generators.d.ts +13 -7
- package/dist/generators.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-D5rCK1zO.cjs +992 -0
- package/dist/plugin-D5rCK1zO.cjs.map +1 -0
- package/dist/plugin-DmwgRHK8.js +944 -0
- package/dist/plugin-DmwgRHK8.js.map +1 -0
- package/package.json +5 -5
- package/src/components/v2/Type.tsx +165 -0
- package/src/factory.ts +2 -0
- package/src/generators/index.ts +1 -0
- package/src/generators/typeGenerator.tsx +15 -14
- package/src/generators/v2/typeGenerator.tsx +196 -0
- package/src/plugin.ts +32 -8
- package/src/printer.ts +24 -1
- package/dist/components-9wydyqUx.cjs.map +0 -1
- package/dist/components-LmqJfxMv.js.map +0 -1
- package/dist/plugin-BHE4J4aP.cjs +0 -508
- package/dist/plugin-BHE4J4aP.cjs.map +0 -1
- package/dist/plugin-DnKRpgGK.js +0 -476
- package/dist/plugin-DnKRpgGK.js.map +0 -1
package/dist/generators.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
2
|
import { n as PluginTs } from "./types-BpeKGgCn.js";
|
|
3
|
-
import { AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
|
|
3
|
+
import { Adapter, AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
|
|
4
4
|
import { Fabric } from "@kubb/react-fabric";
|
|
5
5
|
import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
|
|
6
6
|
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
@@ -26,14 +26,14 @@ declare global {
|
|
|
26
26
|
*
|
|
27
27
|
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
28
28
|
*
|
|
29
|
-
* `
|
|
29
|
+
* `pluginName` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
30
30
|
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
31
31
|
*/
|
|
32
32
|
type Ref = {
|
|
33
33
|
propertyName: string;
|
|
34
34
|
originalName: string;
|
|
35
35
|
path: KubbFile.Path;
|
|
36
|
-
|
|
36
|
+
pluginName?: string;
|
|
37
37
|
};
|
|
38
38
|
type Refs = Record<string, Ref>;
|
|
39
39
|
type OperationSchema = {
|
|
@@ -446,7 +446,8 @@ type OperationsV1Props<TOptions extends PluginFactoryOptions> = {
|
|
|
446
446
|
};
|
|
447
447
|
type OperationsV2Props<TOptions extends PluginFactoryOptions> = {
|
|
448
448
|
config: Config;
|
|
449
|
-
|
|
449
|
+
adapter: Adapter;
|
|
450
|
+
options: Plugin<TOptions>['options'];
|
|
450
451
|
nodes: Array<OperationNode>;
|
|
451
452
|
};
|
|
452
453
|
type OperationV1Props<TOptions extends PluginFactoryOptions> = {
|
|
@@ -457,7 +458,8 @@ type OperationV1Props<TOptions extends PluginFactoryOptions> = {
|
|
|
457
458
|
};
|
|
458
459
|
type OperationV2Props<TOptions extends PluginFactoryOptions> = {
|
|
459
460
|
config: Config;
|
|
460
|
-
|
|
461
|
+
adapter: Adapter;
|
|
462
|
+
options: Plugin<TOptions>['options'];
|
|
461
463
|
node: OperationNode;
|
|
462
464
|
};
|
|
463
465
|
type OperationsProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationsV2Props<TOptions> : OperationsV1Props<TOptions>;
|
|
@@ -474,8 +476,9 @@ type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
|
|
|
474
476
|
};
|
|
475
477
|
type SchemaV2Props<TOptions extends PluginFactoryOptions> = {
|
|
476
478
|
config: Config;
|
|
477
|
-
|
|
479
|
+
options: Plugin<TOptions>['options'];
|
|
478
480
|
node: SchemaNode;
|
|
481
|
+
adapter: Adapter;
|
|
479
482
|
};
|
|
480
483
|
type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
|
|
481
484
|
type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion>;
|
|
@@ -493,5 +496,8 @@ type ReactGenerator<TOptions extends PluginFactoryOptions, TVersion extends Vers
|
|
|
493
496
|
//#region src/generators/typeGenerator.d.ts
|
|
494
497
|
declare const typeGenerator: ReactGenerator<PluginTs, "1">;
|
|
495
498
|
//#endregion
|
|
496
|
-
|
|
499
|
+
//#region src/generators/v2/typeGenerator.d.ts
|
|
500
|
+
declare const typeGenerator$1: ReactGenerator<PluginTs, "2">;
|
|
501
|
+
//#endregion
|
|
502
|
+
export { typeGenerator, typeGenerator$1 as typeGeneratorV2 };
|
|
497
503
|
//# sourceMappingURL=generators.d.ts.map
|
package/dist/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as typeGenerator } from "./plugin-
|
|
2
|
-
export { typeGenerator };
|
|
1
|
+
import { i as typeGenerator, r as typeGenerator$1 } from "./plugin-DmwgRHK8.js";
|
|
2
|
+
export { typeGenerator, typeGenerator$1 as typeGeneratorV2 };
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_plugin = require("./plugin-
|
|
2
|
+
const require_plugin = require("./plugin-D5rCK1zO.cjs");
|
|
3
3
|
exports.pluginTs = require_plugin.pluginTs;
|
|
4
4
|
exports.pluginTsName = require_plugin.pluginTsName;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as pluginTsName, t as pluginTs } from "./plugin-
|
|
1
|
+
import { n as pluginTsName, t as pluginTs } from "./plugin-DmwgRHK8.js";
|
|
2
2
|
export { pluginTs, pluginTsName };
|