@kubb/core 5.14.4 → 5.14.5

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.cts CHANGED
@@ -2532,8 +2532,10 @@ type ResolveNameOptions = {
2532
2532
  name: string;
2533
2533
  /**
2534
2534
  * Compares emitted identifiers while returning raw names. Keep numeric suffixes distinct.
2535
+ * Return several names when one declaration emits more than one identifier, such as an enum's
2536
+ * value and its type alias: the raw name is only taken when all of them are free.
2535
2537
  */
2536
- normalize?: (name: string) => string;
2538
+ normalize?: (name: string) => string | ReadonlyArray<string>;
2537
2539
  };
2538
2540
  /**
2539
2541
  * Partial resolver fields accepted by `Resolver.merge` and `setResolver`. Parameterize with a
@@ -2609,6 +2611,11 @@ export declare class Resolver {
2609
2611
  * resolver.resolveName({ key: ['operation', 'POST', '/containers', 'body'], name: 'CreateContainerBody' })
2610
2612
  * // 'CreateContainerBody2'
2611
2613
  * ```
2614
+ *
2615
+ * @example Resolve a name that has to be free as both an enum value and a type alias
2616
+ * ```ts
2617
+ * resolver.resolveName({ key: ['enum', 'Pet', 'status'], name: 'Status', normalize: (name) => [camelCase(name), `${name}Key`] })
2618
+ * ```
2612
2619
  */
2613
2620
  resolveName({ key, name, normalize }: ResolveNameOptions): string;
2614
2621
  file(options: ResolveFileOptions): FileNode;
@@ -3171,7 +3178,8 @@ export declare function defineExtension<TFactory extends PluginType = PluginType
3171
3178
  * input shape with paths resolved to absolute.
3172
3179
  *
3173
3180
  * - `{ type: 'path' }`: single file on disk.
3174
- * - `{ type: 'data' }`: raw string or parsed object provided inline.
3181
+ * - `{ type: 'data' }`: raw string or parsed object provided inline. `root` is the folder that
3182
+ * relative external `$ref`s in it resolve from.
3175
3183
  */
3176
3184
  type AdapterSource = {
3177
3185
  type: 'path';
@@ -3179,6 +3187,7 @@ type AdapterSource = {
3179
3187
  } | {
3180
3188
  type: 'data';
3181
3189
  data: string | unknown;
3190
+ root?: string;
3182
3191
  };
3183
3192
  /**
3184
3193
  * Generic parameters used by `defineExtension` with `kind: 'adapter'` and the resulting `Adapter` type.
@@ -3231,6 +3240,11 @@ type Adapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions> = {
3231
3240
  * Parsed source document after the first `parse()` call. `null` before parsing.
3232
3241
  */
3233
3242
  document: TOptions['document'] | null;
3243
+ /**
3244
+ * The files and URLs the last `parse()` read, such as the ones external `$ref`s point at, including
3245
+ * any that could not be read. Inline data is not listed. A watcher rebuilds when one of them changes.
3246
+ */
3247
+ sources?: Array<string>;
3234
3248
  /**
3235
3249
  * Parse the source into a universal `InputNode`.
3236
3250
  *
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as defineGenerator, $t as Reporter, A as PluginFactory, At as KubbHooks, B as ResolveImportsOptions, Bt as HookResult, C as NormalizedPlugin, Ct as KubbFilesProcessingUpdateContext, D as Override, Dt as KubbHookEndContext, E as OutputOptions, Et as KubbGenerationSummaryContext, F as definePlugin, Ft as KubbSuccessContext, G as ResolverFile, Gt as OutputManifest, H as ResolvePathOptions, Ht as runHook, I as BannerMeta, It as KubbWarnContext, J as ResolverPatch, Jt as RendererFactory, K as ResolverFileParams, Kt as createOutputManifest, L as ResolveBannerContext, Lt as PossibleConfig, M as PluginType, Mt as KubbLifecycleStartContext, N as ResolvePluginOptions, Nt as KubbMessageContext, O as Plugin, Ot as KubbHookLineContext, P as assertPluginOption, Pt as KubbPluginsEndContext, Q as GeneratorContext, Qt as GenerationResult, R as ResolveBannerFile, Rt as PostGenerateCommand, S as KubbPluginStartContext, St as KubbFilesProcessingStartContext, T as OutputMode, Tt as KubbGenerationStartContext, U as Resolver, Ut as KubbDriver, V as ResolveNameOptions, Vt as RunHookOptions, W as ResolverDefault, Wt as Hookable, X as ResolveOptionsContext, Xt as Storage, Y as ResolverPathParams, Yt as createRenderer, Z as Generator, Zt as createStorage, _ as Filter, _t as KubbBuildStartContext, a as AdapterSource, an as logLevel, at as DiagnosticSeverity, b as KubbPluginEndContext, bt as KubbFileProcessingUpdate, c as ExtensionDependency, cn as Parser, ct as ProblemCode, d as ExtensionKind, dn as defineParser, dt as BuildOutput, en as ReporterContext, et as NodeCache, f as ExtensionMeta, ft as CLIOptions, g as Exclude, gt as KubbBuildEndContext, h as resolveMeta, ht as Input, i as AdapterFactoryOptions, in as createReporter, it as DiagnosticLocation, j as PluginName, jt as KubbInfoContext, k as PluginDefinition, kt as KubbHookStartContext, l as ExtensionDependencyRecord, ln as ParserDefinition, lt as ProblemDiagnostic, m as defineExtension, mt as FilesContext, n as AdapterDefinition, nn as ReporterPluginFiles, nt as DiagnosticDoc, o as createAdapter, on as DiagnosticFormatOptions, ot as Diagnostics, p as checkCompatibility, pt as Config, q as ResolverFilePathParams, qt as Renderer, r as AdapterFactory, rn as UserReporter, rt as DiagnosticKind, s as ExtensionDependencies, sn as SerializedDiagnostic, st as PerformanceDiagnostic, t as Adapter, tn as ReporterName, tt as Diagnostic, u as ExtensionFactory, un as ParserFactory, ut as UpdateDiagnostic, v as Group, vt as KubbDiagnosticContext, w as Output, wt as KubbGenerationEndContext, x as KubbPluginSetupContext, xt as KubbFilesProcessingEndContext, y as Include, yt as KubbErrorContext, z as ResolveFileOptions, zt as UserConfig } from "./createAdapter-y4ey5daI.js";
1
+ import { $ as defineGenerator, $t as Reporter, A as PluginFactory, At as KubbHooks, B as ResolveImportsOptions, Bt as HookResult, C as NormalizedPlugin, Ct as KubbFilesProcessingUpdateContext, D as Override, Dt as KubbHookEndContext, E as OutputOptions, Et as KubbGenerationSummaryContext, F as definePlugin, Ft as KubbSuccessContext, G as ResolverFile, Gt as OutputManifest, H as ResolvePathOptions, Ht as runHook, I as BannerMeta, It as KubbWarnContext, J as ResolverPatch, Jt as RendererFactory, K as ResolverFileParams, Kt as createOutputManifest, L as ResolveBannerContext, Lt as PossibleConfig, M as PluginType, Mt as KubbLifecycleStartContext, N as ResolvePluginOptions, Nt as KubbMessageContext, O as Plugin, Ot as KubbHookLineContext, P as assertPluginOption, Pt as KubbPluginsEndContext, Q as GeneratorContext, Qt as GenerationResult, R as ResolveBannerFile, Rt as PostGenerateCommand, S as KubbPluginStartContext, St as KubbFilesProcessingStartContext, T as OutputMode, Tt as KubbGenerationStartContext, U as Resolver, Ut as KubbDriver, V as ResolveNameOptions, Vt as RunHookOptions, W as ResolverDefault, Wt as Hookable, X as ResolveOptionsContext, Xt as Storage, Y as ResolverPathParams, Yt as createRenderer, Z as Generator, Zt as createStorage, _ as Filter, _t as KubbBuildStartContext, a as AdapterSource, an as logLevel, at as DiagnosticSeverity, b as KubbPluginEndContext, bt as KubbFileProcessingUpdate, c as ExtensionDependency, cn as Parser, ct as ProblemCode, d as ExtensionKind, dn as defineParser, dt as BuildOutput, en as ReporterContext, et as NodeCache, f as ExtensionMeta, ft as CLIOptions, g as Exclude, gt as KubbBuildEndContext, h as resolveMeta, ht as Input, i as AdapterFactoryOptions, in as createReporter, it as DiagnosticLocation, j as PluginName, jt as KubbInfoContext, k as PluginDefinition, kt as KubbHookStartContext, l as ExtensionDependencyRecord, ln as ParserDefinition, lt as ProblemDiagnostic, m as defineExtension, mt as FilesContext, n as AdapterDefinition, nn as ReporterPluginFiles, nt as DiagnosticDoc, o as createAdapter, on as DiagnosticFormatOptions, ot as Diagnostics, p as checkCompatibility, pt as Config, q as ResolverFilePathParams, qt as Renderer, r as AdapterFactory, rn as UserReporter, rt as DiagnosticKind, s as ExtensionDependencies, sn as SerializedDiagnostic, st as PerformanceDiagnostic, t as Adapter, tn as ReporterName, tt as Diagnostic, u as ExtensionFactory, un as ParserFactory, ut as UpdateDiagnostic, v as Group, vt as KubbDiagnosticContext, w as Output, wt as KubbGenerationEndContext, x as KubbPluginSetupContext, xt as KubbFilesProcessingEndContext, y as Include, yt as KubbErrorContext, z as ResolveFileOptions, zt as UserConfig } from "./createAdapter-BD4waEKc.js";
2
2
  import { FileNode, Macro, UserFileNode } from "@kubb/ast";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import net from "node:net";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as formatMs, B as writeRaw, C as useConfig, D as defineExtension, E as checkCompatibility, F as isPathInside, I as listFiles, L as read, M as inParallel, N as exists, O as resolveMeta, P as existsSync$1, R as rm$1, S as tryUseKubb, T as useOptions, V as toError, _ as kubbContext, b as setOptions, c as Resolver, d as isPublicAddress, f as assertPluginOption, g as injectFile, h as addMacro, j as getElapsedMs, k as Diagnostics, l as getInputKind, m as addGenerator, n as KubbDriver, o as _usingCtx, p as definePlugin, s as createResolver, t as Hookable, u as checkoutGitInput, v as requirePlugin, w as useKubb, x as setResolver, y as setMacros, z as write } from "./Hookable-CPbYCCpI.js";
1
+ import { A as formatMs, B as writeRaw, C as useConfig, D as defineExtension, E as checkCompatibility, F as isPathInside, I as listFiles, L as read, M as inParallel, N as exists, O as resolveMeta, P as existsSync$1, R as rm$1, S as tryUseKubb, T as useOptions, V as toError, _ as kubbContext, b as setOptions, c as Resolver, d as isPublicAddress, f as assertPluginOption, g as injectFile, h as addMacro, j as getElapsedMs, k as Diagnostics, l as getInputKind, m as addGenerator, n as KubbDriver, o as _usingCtx, p as definePlugin, s as createResolver, t as Hookable, u as checkoutGitInput, v as requirePlugin, w as useKubb, x as setResolver, y as setMacros, z as write } from "./Hookable-BLHdV93L.js";
2
2
  import { createRequire } from "node:module";
3
3
  import { isValid } from "verkit";
4
4
  import process$1 from "node:process";