@kubb/core 5.0.0-beta.80 → 5.0.0-beta.81

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/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
- import { $ as KubbPluginSetupContext, A as KubbHookStartContext, At as Adapter, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as GenerationResult, D as KubbGenerationStartContext, Dt as UserReporter, E as KubbGenerationEndContext, Et as ReporterName, F as KubbSuccessContext, G as Generator, H as createKubb, I as KubbWarnContext, J as KubbDriver, K as GeneratorContext, L as PossibleConfig, M as KubbInfoContext, Mt as AdapterSource, N as KubbLifecycleStartContext, Nt as createAdapter, O as KubbHookEndContext, Ot as createReporter, P as KubbPluginsEndContext, Pt as AsyncEventEmitter, Q as KubbPluginEndContext, R as UserConfig, S as KubbFileProcessingUpdate, St as createStorage, T as KubbFilesProcessingUpdateContext, Tt as ReporterContext, U as Parser, V as Kubb, W as defineParser, X as Group, Y as Exclude, Z as Include, _ as InputPath, _t as defineResolver, a as DiagnosticLocation, at as Override, b as KubbDiagnosticContext, bt as createRenderer, c as PerformanceDiagnostic, ct as definePlugin, d as SerializedDiagnostic, dt as ResolveBannerFile, et as KubbPluginStartContext, f as UpdateDiagnostic, ft as ResolveOptionsContext, g as InputData, gt as ResolverPathParams, h as Config, ht as ResolverFileParams, i as DiagnosticKind, it as OutputOptions, j as KubbHooks, jt as AdapterFactoryOptions, k as KubbHookLineContext, kt as logLevel, l as ProblemCode, lt as BannerMeta, m as CLIOptions, mt as ResolverContext, n as DiagnosticByCode, nt as Output, o as DiagnosticSeverity, ot as Plugin, p as BuildOutput, pt as Resolver, q as defineGenerator, r as DiagnosticDoc, rt as OutputMode, s as Diagnostics, st as PluginFactoryOptions, t as Diagnostic, tt as NormalizedPlugin, u as ProblemDiagnostic, ut as ResolveBannerContext, v as KubbBuildEndContext, vt as Renderer, w as KubbFilesProcessingStartContext, wt as Reporter, x as KubbErrorContext, xt as Storage, y as KubbBuildStartContext, yt as RendererFactory, z as FileProcessorHooks } from "./diagnostics-CQYd4UQZ.js";
3
- import { ast } from "@kubb/ast";
2
+ import { $ as KubbPluginSetupContext, A as KubbHookStartContext, At as Adapter, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as GenerationResult, D as KubbGenerationStartContext, Dt as UserReporter, E as KubbGenerationEndContext, Et as ReporterName, F as KubbSuccessContext, G as Generator, H as createKubb, I as KubbWarnContext, J as KubbDriver, K as GeneratorContext, L as PossibleConfig, M as KubbInfoContext, Mt as AdapterSource, N as KubbLifecycleStartContext, Nt as createAdapter, O as KubbHookEndContext, Ot as createReporter, P as KubbPluginsEndContext, Pt as AsyncEventEmitter, Q as KubbPluginEndContext, R as UserConfig, S as KubbFileProcessingUpdate, St as createStorage, T as KubbFilesProcessingUpdateContext, Tt as ReporterContext, U as Parser, V as Kubb, W as defineParser, X as Group, Y as Exclude, Z as Include, _ as InputPath, _t as defineResolver, a as DiagnosticLocation, at as Override, b as KubbDiagnosticContext, bt as createRenderer, c as PerformanceDiagnostic, ct as definePlugin, d as SerializedDiagnostic, dt as ResolveBannerFile, et as KubbPluginStartContext, f as UpdateDiagnostic, ft as ResolveOptionsContext, g as InputData, gt as ResolverPathParams, h as Config, ht as ResolverFileParams, i as DiagnosticKind, it as OutputOptions, j as KubbHooks, jt as AdapterFactoryOptions, k as KubbHookLineContext, kt as logLevel, l as ProblemCode, lt as BannerMeta, m as CLIOptions, mt as ResolverContext, n as DiagnosticByCode, nt as Output, o as DiagnosticSeverity, ot as Plugin, p as BuildOutput, pt as Resolver, q as defineGenerator, r as DiagnosticDoc, rt as OutputMode, s as Diagnostics, st as PluginFactoryOptions, t as Diagnostic, tt as NormalizedPlugin, u as ProblemDiagnostic, ut as ResolveBannerContext, v as KubbBuildEndContext, vt as Renderer, w as KubbFilesProcessingStartContext, wt as Reporter, x as KubbErrorContext, xt as Storage, y as KubbBuildStartContext, yt as RendererFactory, z as FileProcessorHooks } from "./diagnostics-DcFh-77r.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, ast, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
175
+ 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, 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-C-3NpTDQ.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-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/utils";
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, ast, type AdapterFactoryOptions } from '@kubb/core'
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.80".split(".")[0] ?? "5";
397
+ const docsMajor = "5.0.0-beta.81".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
- const optionsKey = options;
973
- let byOptions = resolveOptionsCache.get(optionsKey);
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(optionsKey, byOptions);
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$1.factory.createFile({
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$1.factory.createInput({
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$1.factory.createFile(userFileNode));
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/utils'
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, ast, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
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