@kubb/plugin-ts 5.0.0-alpha.2 → 5.0.0-alpha.4
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.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +3 -2
- package/dist/generators.d.ts +26 -42
- package/dist/generators.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-Bgm8TNUt.js +965 -0
- package/dist/plugin-Bgm8TNUt.js.map +1 -0
- package/dist/plugin-DvK-Uhvv.cjs +1013 -0
- package/dist/plugin-DvK-Uhvv.cjs.map +1 -0
- package/dist/{types-BpeKGgCn.d.ts → types-aotMcdUB.d.ts} +3 -3
- 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 +2 -2
- package/src/generators/v2/typeGenerator.tsx +196 -0
- package/src/plugin.ts +46 -9
- 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-CNkzbtpl.cjs +0 -508
- package/dist/plugin-CNkzbtpl.cjs.map +0 -1
- package/dist/plugin-DoLrDl9P.js +0 -476
- package/dist/plugin-DoLrDl9P.js.map +0 -1
package/dist/generators.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { n as PluginTs } from "./types-
|
|
3
|
-
import
|
|
2
|
+
import { n as PluginTs } from "./types-aotMcdUB.js";
|
|
3
|
+
import * as _kubb_core0 from "@kubb/core";
|
|
4
|
+
import { AsyncEventEmitter, Config, FileMetaBase, Generator, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
|
|
4
5
|
import { Fabric } from "@kubb/react-fabric";
|
|
5
6
|
import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
|
|
6
7
|
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
7
|
-
import { OperationNode, SchemaNode } from "@kubb/ast/types";
|
|
8
8
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
9
9
|
|
|
10
10
|
//#region ../plugin-oas/src/types.d.ts
|
|
@@ -93,8 +93,8 @@ type ByContentType = {
|
|
|
93
93
|
type: 'contentType';
|
|
94
94
|
pattern: string | RegExp;
|
|
95
95
|
};
|
|
96
|
-
type Exclude = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
97
|
-
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
96
|
+
type Exclude = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName;
|
|
97
|
+
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName;
|
|
98
98
|
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
99
99
|
options: Partial<TOptions>;
|
|
100
100
|
};
|
|
@@ -133,7 +133,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
133
133
|
method: HttpMethod;
|
|
134
134
|
operation: Operation;
|
|
135
135
|
}>>;
|
|
136
|
-
build(...generators: Array<Generator<TPluginOptions
|
|
136
|
+
build(...generators: Array<Generator$1<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
@@ -423,46 +423,33 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
423
423
|
static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
|
|
424
424
|
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
425
425
|
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
426
|
-
build(...generators: Array<Generator<TPluginOptions
|
|
426
|
+
build(...generators: Array<Generator$1<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
427
427
|
}
|
|
428
428
|
//#endregion
|
|
429
429
|
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
430
|
-
type CoreGenerator<TOptions extends PluginFactoryOptions
|
|
430
|
+
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
431
431
|
name: string;
|
|
432
432
|
type: 'core';
|
|
433
|
-
version:
|
|
434
|
-
operations: (props: OperationsProps<TOptions
|
|
435
|
-
operation: (props: OperationProps<TOptions
|
|
436
|
-
schema: (props: SchemaProps<TOptions
|
|
433
|
+
version: '1';
|
|
434
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
435
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
436
|
+
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
437
437
|
};
|
|
438
438
|
//#endregion
|
|
439
439
|
//#region ../plugin-oas/src/generators/types.d.ts
|
|
440
|
-
type
|
|
441
|
-
type OperationsV1Props<TOptions extends PluginFactoryOptions> = {
|
|
440
|
+
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
442
441
|
config: Config;
|
|
443
442
|
generator: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
444
443
|
plugin: Plugin<TOptions>;
|
|
445
444
|
operations: Array<Operation>;
|
|
446
445
|
};
|
|
447
|
-
type
|
|
448
|
-
config: Config;
|
|
449
|
-
plugin: Plugin<TOptions>;
|
|
450
|
-
nodes: Array<OperationNode>;
|
|
451
|
-
};
|
|
452
|
-
type OperationV1Props<TOptions extends PluginFactoryOptions> = {
|
|
446
|
+
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
453
447
|
config: Config;
|
|
454
448
|
generator: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
455
449
|
plugin: Plugin<TOptions>;
|
|
456
450
|
operation: Operation;
|
|
457
451
|
};
|
|
458
|
-
type
|
|
459
|
-
config: Config;
|
|
460
|
-
plugin: Plugin<TOptions>;
|
|
461
|
-
node: OperationNode;
|
|
462
|
-
};
|
|
463
|
-
type OperationsProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationsV2Props<TOptions> : OperationsV1Props<TOptions>;
|
|
464
|
-
type OperationProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationV2Props<TOptions> : OperationV1Props<TOptions>;
|
|
465
|
-
type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
|
|
452
|
+
type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
466
453
|
config: Config;
|
|
467
454
|
generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
468
455
|
plugin: Plugin<TOptions>;
|
|
@@ -472,26 +459,23 @@ type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
|
|
|
472
459
|
value: SchemaObject;
|
|
473
460
|
};
|
|
474
461
|
};
|
|
475
|
-
type
|
|
476
|
-
config: Config;
|
|
477
|
-
plugin: Plugin<TOptions>;
|
|
478
|
-
node: SchemaNode;
|
|
479
|
-
};
|
|
480
|
-
type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
|
|
481
|
-
type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion>;
|
|
462
|
+
type Generator$1<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions> | Generator<TOptions>;
|
|
482
463
|
//#endregion
|
|
483
464
|
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
484
|
-
type ReactGenerator<TOptions extends PluginFactoryOptions
|
|
465
|
+
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
485
466
|
name: string;
|
|
486
467
|
type: 'react';
|
|
487
|
-
version:
|
|
488
|
-
Operations: (props: OperationsProps<TOptions
|
|
489
|
-
Operation: (props: OperationProps<TOptions
|
|
490
|
-
Schema: (props: SchemaProps<TOptions
|
|
468
|
+
version: '1';
|
|
469
|
+
Operations: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
470
|
+
Operation: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
471
|
+
Schema: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
491
472
|
};
|
|
492
473
|
//#endregion
|
|
493
474
|
//#region src/generators/typeGenerator.d.ts
|
|
494
|
-
declare const typeGenerator: ReactGenerator<PluginTs
|
|
475
|
+
declare const typeGenerator: ReactGenerator<PluginTs>;
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/generators/v2/typeGenerator.d.ts
|
|
478
|
+
declare const typeGenerator$1: _kubb_core0.ReactGeneratorV2<PluginTs>;
|
|
495
479
|
//#endregion
|
|
496
|
-
export { typeGenerator };
|
|
480
|
+
export { typeGenerator, typeGenerator$1 as typeGeneratorV2 };
|
|
497
481
|
//# 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-Bgm8TNUt.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-DvK-Uhvv.cjs");
|
|
3
3
|
exports.pluginTs = require_plugin.pluginTs;
|
|
4
4
|
exports.pluginTsName = require_plugin.pluginTsName;
|
package/dist/index.d.ts
CHANGED
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-Bgm8TNUt.js";
|
|
2
2
|
export { pluginTs, pluginTsName };
|