@kubb/core 5.0.0-alpha.8 → 5.0.0-beta.75
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 +23 -20
- package/dist/PluginDriver-BXibeQk-.cjs +1036 -0
- package/dist/PluginDriver-BXibeQk-.cjs.map +1 -0
- package/dist/PluginDriver-DV3p2Hky.js +945 -0
- package/dist/PluginDriver-DV3p2Hky.js.map +1 -0
- package/dist/index.cjs +756 -1693
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +297 -239
- package/dist/index.js +743 -1661
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +145 -0
- package/dist/mocks.cjs.map +1 -0
- package/dist/mocks.d.ts +80 -0
- package/dist/mocks.js +140 -0
- package/dist/mocks.js.map +1 -0
- package/dist/types-CuNocrbJ.d.ts +2148 -0
- package/package.json +51 -57
- package/src/FileManager.ts +115 -0
- package/src/FileProcessor.ts +86 -0
- package/src/Kubb.ts +208 -160
- package/src/PluginDriver.ts +326 -565
- package/src/constants.ts +20 -47
- package/src/createAdapter.ts +16 -6
- package/src/createKubb.ts +548 -0
- package/src/createRenderer.ts +57 -0
- package/src/createStorage.ts +40 -26
- package/src/defineGenerator.ts +87 -0
- package/src/defineLogger.ts +19 -0
- package/src/defineMiddleware.ts +62 -0
- package/src/defineParser.ts +44 -0
- package/src/definePlugin.ts +83 -0
- package/src/defineResolver.ts +521 -0
- package/src/devtools.ts +14 -14
- package/src/index.ts +14 -17
- package/src/mocks.ts +178 -0
- package/src/renderNode.ts +35 -0
- package/src/storages/fsStorage.ts +41 -11
- package/src/storages/memoryStorage.ts +4 -2
- package/src/types.ts +1054 -270
- package/src/utils/diagnostics.ts +4 -1
- package/src/utils/isInputPath.ts +10 -0
- package/src/utils/packageJSON.ts +99 -0
- package/dist/PluginDriver-DRfJIbG1.d.ts +0 -1056
- package/dist/chunk-ByKO4r7w.cjs +0 -38
- package/dist/hooks.cjs +0 -102
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.d.ts +0 -75
- package/dist/hooks.js +0 -97
- package/dist/hooks.js.map +0 -1
- package/src/PackageManager.ts +0 -180
- package/src/build.ts +0 -419
- package/src/config.ts +0 -56
- package/src/createGenerator.ts +0 -106
- package/src/createLogger.ts +0 -7
- package/src/createPlugin.ts +0 -12
- package/src/errors.ts +0 -1
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useKubb.ts +0 -138
- package/src/hooks/useMode.ts +0 -11
- package/src/hooks/usePlugin.ts +0 -11
- package/src/hooks/usePluginDriver.ts +0 -11
- package/src/utils/FunctionParams.ts +0 -155
- package/src/utils/TreeNode.ts +0 -215
- package/src/utils/executeStrategies.ts +0 -81
- package/src/utils/formatters.ts +0 -56
- package/src/utils/getBarrelFiles.ts +0 -141
- package/src/utils/getConfigs.ts +0 -30
- package/src/utils/getPlugins.ts +0 -23
- package/src/utils/linters.ts +0 -25
- package/src/utils/resolveOptions.ts +0 -93
package/dist/mocks.cjs
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_PluginDriver = require("./PluginDriver-BXibeQk-.cjs");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
let _kubb_ast = require("@kubb/ast");
|
|
5
|
+
//#region src/mocks.ts
|
|
6
|
+
/**
|
|
7
|
+
|
|
8
|
+
* Creates a minimal `PluginDriver` mock for unit tests.
|
|
9
|
+
*/
|
|
10
|
+
function createMockedPluginDriver(options = {}) {
|
|
11
|
+
return {
|
|
12
|
+
config: options?.config ?? {
|
|
13
|
+
root: ".",
|
|
14
|
+
output: { path: "./path" }
|
|
15
|
+
},
|
|
16
|
+
getPlugin(_pluginName) {
|
|
17
|
+
return options?.plugin;
|
|
18
|
+
},
|
|
19
|
+
getResolver: (_pluginName) => options?.plugin?.resolver,
|
|
20
|
+
fileManager: new require_PluginDriver.FileManager()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a minimal `Adapter` mock for unit tests.
|
|
25
|
+
* `parse` returns an empty `InputNode` by default; override via `options.parse`.
|
|
26
|
+
* `getImports` returns `[]` by default.
|
|
27
|
+
*/
|
|
28
|
+
function createMockedAdapter(options = {}) {
|
|
29
|
+
const inputNode = options.inputNode ?? null;
|
|
30
|
+
return {
|
|
31
|
+
name: options.name ?? "oas",
|
|
32
|
+
options: options.resolvedOptions ?? {},
|
|
33
|
+
inputNode,
|
|
34
|
+
parse: options.parse ?? (async () => ({
|
|
35
|
+
kind: "Input",
|
|
36
|
+
schemas: [],
|
|
37
|
+
operations: []
|
|
38
|
+
})),
|
|
39
|
+
getImports: options.getImports ?? ((_node, _resolve) => [])
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a minimal plugin mock for unit tests.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`
|
|
47
|
+
*/
|
|
48
|
+
function createMockedPlugin(params) {
|
|
49
|
+
return {
|
|
50
|
+
name: params.name,
|
|
51
|
+
options: params.options,
|
|
52
|
+
resolver: params.resolver,
|
|
53
|
+
transformer: params.transformer,
|
|
54
|
+
dependencies: params.dependencies,
|
|
55
|
+
hooks: {}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function createMockedPluginContext(opts) {
|
|
59
|
+
const root = (0, node_path.resolve)(opts.config.root, opts.config.output.path);
|
|
60
|
+
return {
|
|
61
|
+
config: opts.config,
|
|
62
|
+
root,
|
|
63
|
+
getMode: (output) => require_PluginDriver.PluginDriver.getMode((0, node_path.resolve)(root, output.path)),
|
|
64
|
+
adapter: opts.adapter,
|
|
65
|
+
resolver: opts.resolver,
|
|
66
|
+
plugin: opts.plugin,
|
|
67
|
+
driver: opts.driver,
|
|
68
|
+
getResolver: (name) => opts.driver.getResolver(name),
|
|
69
|
+
inputNode: {
|
|
70
|
+
kind: "Input",
|
|
71
|
+
schemas: [],
|
|
72
|
+
operations: []
|
|
73
|
+
},
|
|
74
|
+
addFile: async (...files) => opts.driver.fileManager.add(...files),
|
|
75
|
+
upsertFile: async (...files) => opts.driver.fileManager.upsert(...files),
|
|
76
|
+
hooks: opts.driver.hooks ?? {},
|
|
77
|
+
warn: (msg) => console.warn(msg),
|
|
78
|
+
error: (msg) => console.error(msg),
|
|
79
|
+
info: (msg) => console.info(msg),
|
|
80
|
+
openInStudio: async () => {}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Renders a generator's `schema` method in a test context.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
89
|
+
* await matchFiles(driver.fileManager.files)
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
async function renderGeneratorSchema(generator, node, opts) {
|
|
93
|
+
if (!generator.schema) return;
|
|
94
|
+
const context = createMockedPluginContext(opts);
|
|
95
|
+
const transformedNode = opts.plugin.transformer ? (0, _kubb_ast.transform)(node, opts.plugin.transformer) : node;
|
|
96
|
+
await require_PluginDriver.applyHookResult(await generator.schema(transformedNode, {
|
|
97
|
+
...context,
|
|
98
|
+
options: opts.options
|
|
99
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Renders a generator's `operation` method in a test context.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
107
|
+
* await matchFiles(driver.fileManager.files)
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
async function renderGeneratorOperation(generator, node, opts) {
|
|
111
|
+
if (!generator.operation) return;
|
|
112
|
+
const context = createMockedPluginContext(opts);
|
|
113
|
+
const transformedNode = opts.plugin.transformer ? (0, _kubb_ast.transform)(node, opts.plugin.transformer) : node;
|
|
114
|
+
await require_PluginDriver.applyHookResult(await generator.operation(transformedNode, {
|
|
115
|
+
...context,
|
|
116
|
+
options: opts.options
|
|
117
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Renders a generator's `operations` method in a test context.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })
|
|
125
|
+
* await matchFiles(driver.fileManager.files)
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
async function renderGeneratorOperations(generator, nodes, opts) {
|
|
129
|
+
if (!generator.operations) return;
|
|
130
|
+
const context = createMockedPluginContext(opts);
|
|
131
|
+
const transformedNodes = opts.plugin.transformer ? nodes.map((n) => (0, _kubb_ast.transform)(n, opts.plugin.transformer)) : nodes;
|
|
132
|
+
await require_PluginDriver.applyHookResult(await generator.operations(transformedNodes, {
|
|
133
|
+
...context,
|
|
134
|
+
options: opts.options
|
|
135
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.createMockedAdapter = createMockedAdapter;
|
|
139
|
+
exports.createMockedPlugin = createMockedPlugin;
|
|
140
|
+
exports.createMockedPluginDriver = createMockedPluginDriver;
|
|
141
|
+
exports.renderGeneratorOperation = renderGeneratorOperation;
|
|
142
|
+
exports.renderGeneratorOperations = renderGeneratorOperations;
|
|
143
|
+
exports.renderGeneratorSchema = renderGeneratorSchema;
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=mocks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.cjs","names":["FileManager","PluginDriver","applyHookResult"],"sources":["../src/mocks.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport type { FileNode, OperationNode, SchemaNode, Visitor } from '@kubb/ast'\nimport { transform } from '@kubb/ast'\nimport { FileManager } from './FileManager.ts'\nimport { PluginDriver } from './PluginDriver.ts'\nimport { applyHookResult } from './renderNode.ts'\nimport type { Adapter, AdapterFactoryOptions, Config, Generator, GeneratorContext, NormalizedPlugin, PluginFactoryOptions } from './types.ts'\n\n/**\n\n * Creates a minimal `PluginDriver` mock for unit tests.\n */\nexport function createMockedPluginDriver(options: { name?: string; plugin?: NormalizedPlugin; config?: Config } = {}): PluginDriver {\n return {\n config: options?.config ?? {\n root: '.',\n output: {\n path: './path',\n },\n },\n getPlugin(_pluginName: string): NormalizedPlugin | undefined {\n return options?.plugin\n },\n getResolver: (_pluginName: string) => options?.plugin?.resolver,\n fileManager: new FileManager(),\n } as unknown as PluginDriver\n}\n\n/**\n * Creates a minimal `Adapter` mock for unit tests.\n * `parse` returns an empty `InputNode` by default; override via `options.parse`.\n * `getImports` returns `[]` by default.\n */\nexport function createMockedAdapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions>(\n options: {\n name?: TOptions['name']\n resolvedOptions?: TOptions['resolvedOptions']\n inputNode?: Adapter<TOptions>['inputNode']\n parse?: Adapter<TOptions>['parse']\n getImports?: Adapter<TOptions>['getImports']\n } = {},\n): Adapter<TOptions> {\n const inputNode = options.inputNode ?? null\n return {\n name: (options.name ?? 'oas') as TOptions['name'],\n options: (options.resolvedOptions ?? {}) as TOptions['resolvedOptions'],\n inputNode,\n parse: options.parse ?? (async () => ({ kind: 'Input' as const, schemas: [], operations: [] })),\n getImports: options.getImports ?? ((_node: SchemaNode, _resolve: (schemaName: string) => { name: string; path: string }) => []),\n } as Adapter<TOptions>\n}\n\n/**\n * Creates a minimal plugin mock for unit tests.\n *\n * @example\n * `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`\n */\nexport function createMockedPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(params: {\n name: TOptions['name']\n options: TOptions['resolvedOptions']\n resolver?: TOptions['resolver']\n transformer?: Visitor\n dependencies?: Array<string>\n}): NormalizedPlugin<TOptions> {\n return {\n name: params.name,\n options: params.options,\n resolver: params.resolver,\n transformer: params.transformer,\n dependencies: params.dependencies,\n hooks: {},\n } as unknown as NormalizedPlugin<TOptions>\n}\n\ntype RenderGeneratorOptions<TOptions extends PluginFactoryOptions> = {\n config: Config\n adapter: Adapter\n driver: PluginDriver\n plugin: NormalizedPlugin<TOptions>\n options: TOptions['resolvedOptions']\n resolver: TOptions['resolver']\n}\n\nfunction createMockedPluginContext<TOptions extends PluginFactoryOptions>(opts: RenderGeneratorOptions<TOptions>): Omit<GeneratorContext<TOptions>, 'options'> {\n const root = resolve(opts.config.root, opts.config.output.path)\n\n return {\n config: opts.config,\n root,\n getMode: (output: { path: string }) => PluginDriver.getMode(resolve(root, output.path)),\n adapter: opts.adapter,\n resolver: opts.resolver,\n plugin: opts.plugin,\n driver: opts.driver,\n getResolver: (name: string) => opts.driver.getResolver(name),\n inputNode: { kind: 'Input', schemas: [], operations: [] },\n addFile: async (...files: Array<FileNode>) => opts.driver.fileManager.add(...files),\n upsertFile: async (...files: Array<FileNode>) => opts.driver.fileManager.upsert(...files),\n hooks: opts.driver.hooks ?? ({} as never),\n warn: (msg: string) => console.warn(msg),\n error: (msg: string) => console.error(msg),\n info: (msg: string) => console.info(msg),\n openInStudio: async () => {},\n } as unknown as Omit<GeneratorContext<TOptions>, 'options'>\n}\n\n/**\n * Renders a generator's `schema` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorSchema<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n node: SchemaNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.schema) return\n const context = createMockedPluginContext(opts)\n const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node\n const result = await generator.schema(transformedNode, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n\n/**\n * Renders a generator's `operation` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperation<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n node: OperationNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operation) return\n const context = createMockedPluginContext(opts)\n const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node\n const result = await generator.operation(transformedNode, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n\n/**\n * Renders a generator's `operations` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperations<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n nodes: Array<OperationNode>,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operations) return\n const context = createMockedPluginContext(opts)\n const transformedNodes = opts.plugin.transformer ? nodes.map((n) => transform(n, opts.plugin.transformer!)) : nodes\n const result = await generator.operations(transformedNodes, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,yBAAyB,UAAyE,EAAE,EAAgB;AAClI,QAAO;EACL,QAAQ,SAAS,UAAU;GACzB,MAAM;GACN,QAAQ,EACN,MAAM,UACP;GACF;EACD,UAAU,aAAmD;AAC3D,UAAO,SAAS;;EAElB,cAAc,gBAAwB,SAAS,QAAQ;EACvD,aAAa,IAAIA,qBAAAA,aAAa;EAC/B;;;;;;;AAQH,SAAgB,oB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ACvB,MAAM,UAAU,0BAA0B,KAAK;CAC/C,MAAM,kBAAkB,KAAK,OAAO,eAAA,GAAA,UAAA,WAAwB,MAAM,KAAK,OAAO,YAAY,GAAG;AAK7F,OAAMC,qBAAAA,gBAAgB,MAJD,UAAU,OAAO,iBAAiB;EACrD,GAAG;EACH,SAAS,KAAK;EACf,CAAC,EAC4B,KAAK,QAAQ,UAAU,YAAY,KAAA,EAAU;;;;;;;;;;;AAY7E,eAAsB,yBACpB,WACA,MACA,MACe;AACf,KAAI,CAAC,UAAU,UAAW;CAC1B,MAAM,UAAU,0BAA0B,KAAK;CAC/C,MAAM,kBAAkB,KAAK,OAAO,eAAA,GAAA,UAAA,WAAwB,MAAM,KAAK,OAAO,YAAY,GAAG;AAK7F,OAAMA,qBAAAA,gBAAgB,MAJD,UAAU,UAAU,iBAAiB;EACxD,GAAG;EACH,SAAS,KAAK;EACf,CAAC,EAC4B,KAAK,QAAQ,UAAU,YAAY,KAAA,EAAU;;;;;;;;;;;AAY7E,eAAsB,0BACpB,WACA,OACA,MACe;AACf,KAAI,CAAC,UAAU,WAAY;CAC3B,MAAM,UAAU,0BAA0B,KAAK;CAC/C,MAAM,mBAAmB,KAAK,OAAO,cAAc,MAAM,KAAK,OAAA,GAAA,UAAA,WAAgB,GAAG,KAAK,OAAO,YAAa,CAAC,GAAG;AAK9G,OAAMA,qBAAAA,gBAAgB,MAJD,UAAU,WAAW,kBAAkB;EAC1D,GAAG;EACH,SAAS,KAAK;EACf,CAAC,EAC4B,KAAK,QAAQ,UAAU,YAAY,KAAA,EAAU"}
|
package/dist/mocks.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
+
import { R as NormalizedPlugin, V as PluginFactoryOptions, a as Config, n as AdapterFactoryOptions, ot as PluginDriver, t as Adapter, ut as Generator } from "./types-CuNocrbJ.js";
|
|
3
|
+
import { OperationNode, SchemaNode, Visitor } from "@kubb/ast";
|
|
4
|
+
|
|
5
|
+
//#region src/mocks.d.ts
|
|
6
|
+
/**
|
|
7
|
+
|
|
8
|
+
* Creates a minimal `PluginDriver` mock for unit tests.
|
|
9
|
+
*/
|
|
10
|
+
declare function createMockedPluginDriver(options?: {
|
|
11
|
+
name?: string;
|
|
12
|
+
plugin?: NormalizedPlugin;
|
|
13
|
+
config?: Config;
|
|
14
|
+
}): PluginDriver;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a minimal `Adapter` mock for unit tests.
|
|
17
|
+
* `parse` returns an empty `InputNode` by default; override via `options.parse`.
|
|
18
|
+
* `getImports` returns `[]` by default.
|
|
19
|
+
*/
|
|
20
|
+
declare function createMockedAdapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions>(options?: {
|
|
21
|
+
name?: TOptions['name'];
|
|
22
|
+
resolvedOptions?: TOptions['resolvedOptions'];
|
|
23
|
+
inputNode?: Adapter<TOptions>['inputNode'];
|
|
24
|
+
parse?: Adapter<TOptions>['parse'];
|
|
25
|
+
getImports?: Adapter<TOptions>['getImports'];
|
|
26
|
+
}): Adapter<TOptions>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a minimal plugin mock for unit tests.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`
|
|
32
|
+
*/
|
|
33
|
+
declare function createMockedPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(params: {
|
|
34
|
+
name: TOptions['name'];
|
|
35
|
+
options: TOptions['resolvedOptions'];
|
|
36
|
+
resolver?: TOptions['resolver'];
|
|
37
|
+
transformer?: Visitor;
|
|
38
|
+
dependencies?: Array<string>;
|
|
39
|
+
}): NormalizedPlugin<TOptions>;
|
|
40
|
+
type RenderGeneratorOptions<TOptions extends PluginFactoryOptions> = {
|
|
41
|
+
config: Config;
|
|
42
|
+
adapter: Adapter;
|
|
43
|
+
driver: PluginDriver;
|
|
44
|
+
plugin: NormalizedPlugin<TOptions>;
|
|
45
|
+
options: TOptions['resolvedOptions'];
|
|
46
|
+
resolver: TOptions['resolver'];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Renders a generator's `schema` method in a test context.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
54
|
+
* await matchFiles(driver.fileManager.files)
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare function renderGeneratorSchema<TOptions extends PluginFactoryOptions>(generator: Generator<TOptions>, node: SchemaNode, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Renders a generator's `operation` method in a test context.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
64
|
+
* await matchFiles(driver.fileManager.files)
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
declare function renderGeneratorOperation<TOptions extends PluginFactoryOptions>(generator: Generator<TOptions>, node: OperationNode, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Renders a generator's `operations` method in a test context.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })
|
|
74
|
+
* await matchFiles(driver.fileManager.files)
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function renderGeneratorOperations<TOptions extends PluginFactoryOptions>(generator: Generator<TOptions>, nodes: Array<OperationNode>, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { createMockedAdapter, createMockedPlugin, createMockedPluginDriver, renderGeneratorOperation, renderGeneratorOperations, renderGeneratorSchema };
|
|
80
|
+
//# sourceMappingURL=mocks.d.ts.map
|
package/dist/mocks.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import "./chunk--u3MIqq1.js";
|
|
2
|
+
import { n as applyHookResult, r as FileManager, t as PluginDriver } from "./PluginDriver-DV3p2Hky.js";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { transform } from "@kubb/ast";
|
|
5
|
+
//#region src/mocks.ts
|
|
6
|
+
/**
|
|
7
|
+
|
|
8
|
+
* Creates a minimal `PluginDriver` mock for unit tests.
|
|
9
|
+
*/
|
|
10
|
+
function createMockedPluginDriver(options = {}) {
|
|
11
|
+
return {
|
|
12
|
+
config: options?.config ?? {
|
|
13
|
+
root: ".",
|
|
14
|
+
output: { path: "./path" }
|
|
15
|
+
},
|
|
16
|
+
getPlugin(_pluginName) {
|
|
17
|
+
return options?.plugin;
|
|
18
|
+
},
|
|
19
|
+
getResolver: (_pluginName) => options?.plugin?.resolver,
|
|
20
|
+
fileManager: new FileManager()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a minimal `Adapter` mock for unit tests.
|
|
25
|
+
* `parse` returns an empty `InputNode` by default; override via `options.parse`.
|
|
26
|
+
* `getImports` returns `[]` by default.
|
|
27
|
+
*/
|
|
28
|
+
function createMockedAdapter(options = {}) {
|
|
29
|
+
const inputNode = options.inputNode ?? null;
|
|
30
|
+
return {
|
|
31
|
+
name: options.name ?? "oas",
|
|
32
|
+
options: options.resolvedOptions ?? {},
|
|
33
|
+
inputNode,
|
|
34
|
+
parse: options.parse ?? (async () => ({
|
|
35
|
+
kind: "Input",
|
|
36
|
+
schemas: [],
|
|
37
|
+
operations: []
|
|
38
|
+
})),
|
|
39
|
+
getImports: options.getImports ?? ((_node, _resolve) => [])
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a minimal plugin mock for unit tests.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`
|
|
47
|
+
*/
|
|
48
|
+
function createMockedPlugin(params) {
|
|
49
|
+
return {
|
|
50
|
+
name: params.name,
|
|
51
|
+
options: params.options,
|
|
52
|
+
resolver: params.resolver,
|
|
53
|
+
transformer: params.transformer,
|
|
54
|
+
dependencies: params.dependencies,
|
|
55
|
+
hooks: {}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function createMockedPluginContext(opts) {
|
|
59
|
+
const root = resolve(opts.config.root, opts.config.output.path);
|
|
60
|
+
return {
|
|
61
|
+
config: opts.config,
|
|
62
|
+
root,
|
|
63
|
+
getMode: (output) => PluginDriver.getMode(resolve(root, output.path)),
|
|
64
|
+
adapter: opts.adapter,
|
|
65
|
+
resolver: opts.resolver,
|
|
66
|
+
plugin: opts.plugin,
|
|
67
|
+
driver: opts.driver,
|
|
68
|
+
getResolver: (name) => opts.driver.getResolver(name),
|
|
69
|
+
inputNode: {
|
|
70
|
+
kind: "Input",
|
|
71
|
+
schemas: [],
|
|
72
|
+
operations: []
|
|
73
|
+
},
|
|
74
|
+
addFile: async (...files) => opts.driver.fileManager.add(...files),
|
|
75
|
+
upsertFile: async (...files) => opts.driver.fileManager.upsert(...files),
|
|
76
|
+
hooks: opts.driver.hooks ?? {},
|
|
77
|
+
warn: (msg) => console.warn(msg),
|
|
78
|
+
error: (msg) => console.error(msg),
|
|
79
|
+
info: (msg) => console.info(msg),
|
|
80
|
+
openInStudio: async () => {}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Renders a generator's `schema` method in a test context.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
89
|
+
* await matchFiles(driver.fileManager.files)
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
async function renderGeneratorSchema(generator, node, opts) {
|
|
93
|
+
if (!generator.schema) return;
|
|
94
|
+
const context = createMockedPluginContext(opts);
|
|
95
|
+
const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node;
|
|
96
|
+
await applyHookResult(await generator.schema(transformedNode, {
|
|
97
|
+
...context,
|
|
98
|
+
options: opts.options
|
|
99
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Renders a generator's `operation` method in a test context.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
|
|
107
|
+
* await matchFiles(driver.fileManager.files)
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
async function renderGeneratorOperation(generator, node, opts) {
|
|
111
|
+
if (!generator.operation) return;
|
|
112
|
+
const context = createMockedPluginContext(opts);
|
|
113
|
+
const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node;
|
|
114
|
+
await applyHookResult(await generator.operation(transformedNode, {
|
|
115
|
+
...context,
|
|
116
|
+
options: opts.options
|
|
117
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Renders a generator's `operations` method in a test context.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })
|
|
125
|
+
* await matchFiles(driver.fileManager.files)
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
async function renderGeneratorOperations(generator, nodes, opts) {
|
|
129
|
+
if (!generator.operations) return;
|
|
130
|
+
const context = createMockedPluginContext(opts);
|
|
131
|
+
const transformedNodes = opts.plugin.transformer ? nodes.map((n) => transform(n, opts.plugin.transformer)) : nodes;
|
|
132
|
+
await applyHookResult(await generator.operations(transformedNodes, {
|
|
133
|
+
...context,
|
|
134
|
+
options: opts.options
|
|
135
|
+
}), opts.driver, generator.renderer ?? void 0);
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { createMockedAdapter, createMockedPlugin, createMockedPluginDriver, renderGeneratorOperation, renderGeneratorOperations, renderGeneratorSchema };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.js","names":[],"sources":["../src/mocks.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport type { FileNode, OperationNode, SchemaNode, Visitor } from '@kubb/ast'\nimport { transform } from '@kubb/ast'\nimport { FileManager } from './FileManager.ts'\nimport { PluginDriver } from './PluginDriver.ts'\nimport { applyHookResult } from './renderNode.ts'\nimport type { Adapter, AdapterFactoryOptions, Config, Generator, GeneratorContext, NormalizedPlugin, PluginFactoryOptions } from './types.ts'\n\n/**\n\n * Creates a minimal `PluginDriver` mock for unit tests.\n */\nexport function createMockedPluginDriver(options: { name?: string; plugin?: NormalizedPlugin; config?: Config } = {}): PluginDriver {\n return {\n config: options?.config ?? {\n root: '.',\n output: {\n path: './path',\n },\n },\n getPlugin(_pluginName: string): NormalizedPlugin | undefined {\n return options?.plugin\n },\n getResolver: (_pluginName: string) => options?.plugin?.resolver,\n fileManager: new FileManager(),\n } as unknown as PluginDriver\n}\n\n/**\n * Creates a minimal `Adapter` mock for unit tests.\n * `parse` returns an empty `InputNode` by default; override via `options.parse`.\n * `getImports` returns `[]` by default.\n */\nexport function createMockedAdapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions>(\n options: {\n name?: TOptions['name']\n resolvedOptions?: TOptions['resolvedOptions']\n inputNode?: Adapter<TOptions>['inputNode']\n parse?: Adapter<TOptions>['parse']\n getImports?: Adapter<TOptions>['getImports']\n } = {},\n): Adapter<TOptions> {\n const inputNode = options.inputNode ?? null\n return {\n name: (options.name ?? 'oas') as TOptions['name'],\n options: (options.resolvedOptions ?? {}) as TOptions['resolvedOptions'],\n inputNode,\n parse: options.parse ?? (async () => ({ kind: 'Input' as const, schemas: [], operations: [] })),\n getImports: options.getImports ?? ((_node: SchemaNode, _resolve: (schemaName: string) => { name: string; path: string }) => []),\n } as Adapter<TOptions>\n}\n\n/**\n * Creates a minimal plugin mock for unit tests.\n *\n * @example\n * `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`\n */\nexport function createMockedPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(params: {\n name: TOptions['name']\n options: TOptions['resolvedOptions']\n resolver?: TOptions['resolver']\n transformer?: Visitor\n dependencies?: Array<string>\n}): NormalizedPlugin<TOptions> {\n return {\n name: params.name,\n options: params.options,\n resolver: params.resolver,\n transformer: params.transformer,\n dependencies: params.dependencies,\n hooks: {},\n } as unknown as NormalizedPlugin<TOptions>\n}\n\ntype RenderGeneratorOptions<TOptions extends PluginFactoryOptions> = {\n config: Config\n adapter: Adapter\n driver: PluginDriver\n plugin: NormalizedPlugin<TOptions>\n options: TOptions['resolvedOptions']\n resolver: TOptions['resolver']\n}\n\nfunction createMockedPluginContext<TOptions extends PluginFactoryOptions>(opts: RenderGeneratorOptions<TOptions>): Omit<GeneratorContext<TOptions>, 'options'> {\n const root = resolve(opts.config.root, opts.config.output.path)\n\n return {\n config: opts.config,\n root,\n getMode: (output: { path: string }) => PluginDriver.getMode(resolve(root, output.path)),\n adapter: opts.adapter,\n resolver: opts.resolver,\n plugin: opts.plugin,\n driver: opts.driver,\n getResolver: (name: string) => opts.driver.getResolver(name),\n inputNode: { kind: 'Input', schemas: [], operations: [] },\n addFile: async (...files: Array<FileNode>) => opts.driver.fileManager.add(...files),\n upsertFile: async (...files: Array<FileNode>) => opts.driver.fileManager.upsert(...files),\n hooks: opts.driver.hooks ?? ({} as never),\n warn: (msg: string) => console.warn(msg),\n error: (msg: string) => console.error(msg),\n info: (msg: string) => console.info(msg),\n openInStudio: async () => {},\n } as unknown as Omit<GeneratorContext<TOptions>, 'options'>\n}\n\n/**\n * Renders a generator's `schema` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorSchema<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n node: SchemaNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.schema) return\n const context = createMockedPluginContext(opts)\n const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node\n const result = await generator.schema(transformedNode, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n\n/**\n * Renders a generator's `operation` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperation<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n node: OperationNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operation) return\n const context = createMockedPluginContext(opts)\n const transformedNode = opts.plugin.transformer ? transform(node, opts.plugin.transformer) : node\n const result = await generator.operation(transformedNode, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n\n/**\n * Renders a generator's `operations` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperations<TOptions extends PluginFactoryOptions>(\n generator: Generator<TOptions>,\n nodes: Array<OperationNode>,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operations) return\n const context = createMockedPluginContext(opts)\n const transformedNodes = opts.plugin.transformer ? nodes.map((n) => transform(n, opts.plugin.transformer!)) : nodes\n const result = await generator.operations(transformedNodes, {\n ...context,\n options: opts.options,\n })\n await applyHookResult(result, opts.driver, generator.renderer ?? undefined)\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,yBAAyB,UAAyE,EAAE,EAAgB;AAClI,QAAO;EACL,QAAQ,SAAS,UAAU;GACzB,MAAM;GACN,QAAQ,EACN,MAAM,UACP;GACF;EACD,UAAU,aAAmD;AAC3D,UAAO,SAAS;;EAElB,cAAc,gBAAwB,SAAS,QAAQ;EACvD,aAAa,IAAI,aAAa;EAC/B;;;;;;;AAQH,SAAgB,oBACd,UAMI,EAAE,EACa;CACnB,MAAM,YAAY,QAAQ,aAAa;AACvC,QAAO;EACL,MAAO,QAAQ,QAAQ;EACvB,SAAU,QAAQ,mBAAmB,EAAE;EACvC;EACA,OAAO,QAAQ,UAAU,aAAa;GAAE,MAAM;GAAkB,SAAS,EAAE;GAAE,YAAY,EAAE;GAAE;EAC7F,YAAY,QAAQ,gBAAgB,OAAmB,aAAqE,EAAE;EAC/H;;;;;;;;AASH,SAAgB,mBAAiF,QAMlE;AAC7B,QAAO;EACL,MAAM,OAAO;EACb,SAAS,OAAO;EAChB,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,cAAc,OAAO;EACrB,OAAO,EAAE;EACV;;AAYH,SAAS,0BAAiE,MAAqF;CAC7J,MAAM,OAAO,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;AAE/D,QAAO;EACL,QAAQ,KAAK;EACb;EACA,UAAU,WAA6B,aAAa,QAAQ,QAAQ,MAAM,OAAO,KAAK,CAAC;EACvF,SAAS,KAAK;EACd,UAAU,KAAK;EACf,QAAQ,KAAK;EACb,QAAQ,KAAK;EACb,cAAc,SAAiB,KAAK,OAAO,YAAY,KAAK;EAC5D,WAAW;GAAE,MAAM;GAAS,SAAS,EAAE;GAAE,YAAY,EAAE;GAAE;EACzD,SAAS,OAAO,GAAG,UAA2B,KAAK,OAAO,YAAY,IAAI,G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