@kubb/core 5.0.0-beta.80 → 5.0.0-beta.82
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/{diagnostics-CQYd4UQZ.d.ts → diagnostics-DuaXn2bT.d.ts} +5 -4
- package/dist/index.cjs +10 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/{memoryStorage-C-3NpTDQ.js → memoryStorage-BjUIqpYE.js} +2 -3
- package/dist/{memoryStorage-C-3NpTDQ.js.map → memoryStorage-BjUIqpYE.js.map} +1 -1
- package/dist/{memoryStorage-9cOBg7bL.cjs → memoryStorage-DQ6qXJ8o.cjs} +2 -3
- package/dist/{memoryStorage-9cOBg7bL.cjs.map → memoryStorage-DQ6qXJ8o.cjs.map} +1 -1
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +1 -1
- package/package.json +3 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { ast } from "@kubb/ast";
|
|
2
|
+
import { $ as KubbPluginEndContext, A as KubbHookStartContext, At as logLevel, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as createStorage, D as KubbGenerationStartContext, Dt as ReporterName, E as KubbGenerationEndContext, Et as ReporterContext, F as KubbSuccessContext, Ft as AsyncEventEmitter, G as defineParser, H as Kubb, I as KubbWarnContext, J as defineGenerator, K as Generator, L as PossibleConfig, M as KubbInfoContext, Mt as AdapterFactoryOptions, N as KubbLifecycleStartContext, Nt as AdapterSource, O as KubbHookEndContext, Ot as UserReporter, P as KubbPluginsEndContext, Pt as createAdapter, Q as Include, R as UserConfig, S as KubbFileProcessingUpdate, St as Storage, T as KubbFilesProcessingUpdateContext, Tt as Reporter, U as createKubb, V as CreateKubbOptions, W as Parser, X as Exclude, Y as KubbDriver, Z as Group, _ as InputPath, _t as ResolverPathParams, a as DiagnosticLocation, at as OutputOptions, b as KubbDiagnosticContext, bt as RendererFactory, c as PerformanceDiagnostic, ct as PluginFactoryOptions, d as SerializedDiagnostic, dt as ResolveBannerContext, et as KubbPluginSetupContext, f as UpdateDiagnostic, ft as ResolveBannerFile, g as InputData, gt as ResolverFileParams, h as Config, ht as ResolverContext, i as DiagnosticKind, it as OutputMode, j as KubbHooks, jt as Adapter, k as KubbHookLineContext, kt as createReporter, l as ProblemCode, lt as definePlugin, m as CLIOptions, mt as Resolver, n as DiagnosticByCode, nt as NormalizedPlugin, o as DiagnosticSeverity, ot as Override, p as BuildOutput, pt as ResolveOptionsContext, q as GeneratorContext, r as DiagnosticDoc, rt as Output, s as Diagnostics, st as Plugin, t as Diagnostic, tt as KubbPluginStartContext, u as ProblemDiagnostic, ut as BannerMeta, v as KubbBuildEndContext, vt as defineResolver, w as KubbFilesProcessingStartContext, wt as GenerationResult, x as KubbErrorContext, xt as createRenderer, y as KubbBuildStartContext, yt as Renderer, z as FileProcessorHooks } from "./diagnostics-DuaXn2bT.js";
|
|
4
3
|
|
|
5
4
|
//#region ../../internals/utils/src/url.d.ts
|
|
6
5
|
type URLObject = {
|
|
@@ -173,5 +172,5 @@ declare const fsStorage: (options?: Record<string, never> | undefined) => Storag
|
|
|
173
172
|
*/
|
|
174
173
|
declare const memoryStorage: (options?: Record<string, never> | undefined) => Storage;
|
|
175
174
|
//#endregion
|
|
176
|
-
export { type Adapter, type AdapterFactoryOptions, type AdapterSource, AsyncEventEmitter, type BannerMeta, BuildOutput, CLIOptions, Config, type Diagnostic, type DiagnosticByCode, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type FileProcessorHooks, type GenerationResult, type Generator, type GeneratorContext, type Group, type Include, InputData, InputPath, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type ParsedFile, type Parser, type PerformanceDiagnostic, type Plugin, type PluginFactoryOptions, PossibleConfig, type ProblemCode, type ProblemDiagnostic, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ResolveBannerContext, type ResolveBannerFile, type ResolveOptionsContext, type Resolver, type ResolverContext, type ResolverFileParams, type ResolverPathParams, type SerializedDiagnostic, type Storage, type UpdateDiagnostic, Url, UserConfig, type UserReporter,
|
|
175
|
+
export { type Adapter, type AdapterFactoryOptions, type AdapterSource, AsyncEventEmitter, type BannerMeta, BuildOutput, CLIOptions, Config, type CreateKubbOptions, type Diagnostic, type DiagnosticByCode, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type FileProcessorHooks, type GenerationResult, type Generator, type GeneratorContext, type Group, type Include, InputData, InputPath, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type ParsedFile, type Parser, type PerformanceDiagnostic, type Plugin, type PluginFactoryOptions, PossibleConfig, type ProblemCode, type ProblemDiagnostic, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ResolveBannerContext, type ResolveBannerFile, type ResolveOptionsContext, type Resolver, type ResolverContext, type ResolverFileParams, type ResolverPathParams, type SerializedDiagnostic, type Storage, type UpdateDiagnostic, Url, UserConfig, type UserReporter, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
|
|
177
176
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { _ as getErrorMessage, a as createStorage, c as clean, d as write, f as runtime, g as BuildError, h as AsyncEventEmitter, i as FileManager, l as toFilePath, m as pascalCase, n as _usingCtx, o as OPERATION_FILTER_TYPES, p as camelCase, r as FileProcessor, s as diagnosticCode, t as memoryStorage, u as toPosixPath } from "./memoryStorage-
|
|
2
|
+
import { _ as getErrorMessage, a as createStorage, c as clean, d as write, f as runtime, g as BuildError, h as AsyncEventEmitter, i as FileManager, l as toFilePath, m as pascalCase, n as _usingCtx, o as OPERATION_FILTER_TYPES, p as camelCase, r as FileProcessor, s as diagnosticCode, t as memoryStorage, u as toPosixPath } from "./memoryStorage-BjUIqpYE.js";
|
|
3
3
|
import { hash } from "node:crypto";
|
|
4
4
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
5
5
|
import { access, glob, readFile, rm } from "node:fs/promises";
|
|
6
6
|
import path, { join, relative, resolve } from "node:path";
|
|
7
|
-
import { ast, ast as ast$1, composeMacros, operationDef, schemaDef, transform } from "@kubb/ast";
|
|
8
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
|
-
import { collectUsedSchemaNames } from "@kubb/ast
|
|
8
|
+
import { ast, collectUsedSchemaNames, composeMacros, operationDef, schemaDef, transform } from "@kubb/ast";
|
|
10
9
|
import process$1 from "node:process";
|
|
11
10
|
//#region ../../internals/utils/src/time.ts
|
|
12
11
|
/**
|
|
@@ -367,7 +366,8 @@ var Url = class Url {
|
|
|
367
366
|
*
|
|
368
367
|
* @example
|
|
369
368
|
* ```ts
|
|
370
|
-
* import { createAdapter,
|
|
369
|
+
* import { createAdapter, type AdapterFactoryOptions } from '@kubb/core'
|
|
370
|
+
* import { ast } from '@kubb/ast'
|
|
371
371
|
*
|
|
372
372
|
* type MyAdapter = AdapterFactoryOptions<'my-adapter', { validate?: boolean }>
|
|
373
373
|
*
|
|
@@ -394,7 +394,7 @@ function createAdapter(build) {
|
|
|
394
394
|
/**
|
|
395
395
|
* Docs major version, derived from the package version so the link tracks the published major.
|
|
396
396
|
*/
|
|
397
|
-
const docsMajor = "5.0.0-beta.
|
|
397
|
+
const docsMajor = "5.0.0-beta.82".split(".")[0] ?? "5";
|
|
398
398
|
/**
|
|
399
399
|
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
400
400
|
*
|
|
@@ -969,11 +969,11 @@ function computeOptions(node, options, exclude, include, override) {
|
|
|
969
969
|
return options;
|
|
970
970
|
}
|
|
971
971
|
function defaultResolveOptions(node, { options, exclude = [], include, override = [] }) {
|
|
972
|
-
|
|
973
|
-
let byOptions = resolveOptionsCache.get(
|
|
972
|
+
if (typeof options !== "object" || options === null) return computeOptions(node, options, exclude, include, override);
|
|
973
|
+
let byOptions = resolveOptionsCache.get(options);
|
|
974
974
|
if (!byOptions) {
|
|
975
975
|
byOptions = /* @__PURE__ */ new WeakMap();
|
|
976
|
-
resolveOptionsCache.set(
|
|
976
|
+
resolveOptionsCache.set(options, byOptions);
|
|
977
977
|
}
|
|
978
978
|
const cached = byOptions.get(node);
|
|
979
979
|
if (cached !== void 0) return cached.value;
|
|
@@ -1086,7 +1086,7 @@ function defaultResolveFile({ name, extname, tag, path: groupPath }, context) {
|
|
|
1086
1086
|
tag,
|
|
1087
1087
|
path: groupPath
|
|
1088
1088
|
}, context);
|
|
1089
|
-
return ast
|
|
1089
|
+
return ast.factory.createFile({
|
|
1090
1090
|
path: filePath,
|
|
1091
1091
|
baseName: path.basename(filePath),
|
|
1092
1092
|
meta: { pluginName: this.pluginName },
|
|
@@ -1469,7 +1469,7 @@ var KubbDriver = class {
|
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
1471
|
const parsed = await adapter.parse(source);
|
|
1472
|
-
this.inputNode = ast
|
|
1472
|
+
this.inputNode = ast.factory.createInput({
|
|
1473
1473
|
stream: true,
|
|
1474
1474
|
schemas: arrayToAsyncIterable(parsed.schemas),
|
|
1475
1475
|
operations: arrayToAsyncIterable(parsed.operations),
|
|
@@ -1521,7 +1521,7 @@ var KubbDriver = class {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
},
|
|
1523
1523
|
injectFile: (userFileNode) => {
|
|
1524
|
-
this.fileManager.add(ast
|
|
1524
|
+
this.fileManager.add(ast.factory.createFile(userFileNode));
|
|
1525
1525
|
}
|
|
1526
1526
|
};
|
|
1527
1527
|
return hooks["kubb:plugin:setup"](pluginCtx);
|
|
@@ -2658,7 +2658,7 @@ function defineGenerator(generator) {
|
|
|
2658
2658
|
* @example
|
|
2659
2659
|
* ```ts
|
|
2660
2660
|
* import { defineParser } from '@kubb/core'
|
|
2661
|
-
* import { extractStringsFromNodes } from '@kubb/ast
|
|
2661
|
+
* import { extractStringsFromNodes } from '@kubb/ast'
|
|
2662
2662
|
*
|
|
2663
2663
|
* export const jsonParser = defineParser({
|
|
2664
2664
|
* name: 'json',
|
|
@@ -2678,6 +2678,6 @@ function defineParser(parser) {
|
|
|
2678
2678
|
return parser;
|
|
2679
2679
|
}
|
|
2680
2680
|
//#endregion
|
|
2681
|
-
export { AsyncEventEmitter, Diagnostics, KubbDriver, Url,
|
|
2681
|
+
export { AsyncEventEmitter, Diagnostics, KubbDriver, Url, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
|
|
2682
2682
|
|
|
2683
2683
|
//# sourceMappingURL=index.js.map
|