@kubb/core 5.0.0-beta.95 → 5.0.0-beta.96

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,5 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
- import { $ as definePlugin, A as Generator, At as DiagnosticSeverity, B as Include, Bt as AdapterSource, C as KubbWarnContext, Ct as UserReporter, D as CreateKubbOptions, Dt as DiagnosticDoc, E as UserConfig, Et as Diagnostic, F as Parser, Ft as SerializedDiagnostic, G as Output, H as KubbPluginSetupContext, I as defineParser, It as UpdateDiagnostic, J as Override, K as OutputMode, L as Exclude, Lt as Hookable, M as defineGenerator, Mt as PerformanceDiagnostic, N as KubbDriver, Nt as ProblemCode, O as Kubb, Ot as DiagnosticKind, P as FileManagerHooks, Pt as ProblemDiagnostic, Q as ResolvePluginOptions, R as Filter, Rt as Adapter, S as KubbSuccessContext, St as ReporterName, T as PostGenerateCommand, Tt as logLevel, U as KubbPluginStartContext, V as KubbPluginEndContext, Vt as createAdapter, W as NormalizedPlugin, X as PluginFactoryOptions, Y as Plugin, Z as PluginName, _ as KubbHookStartContext, _t as Storage, a as KubbBuildEndContext, at as ResolveOptionsContext, b as KubbLifecycleStartContext, bt as Reporter, c as KubbErrorContext, ct as ResolverDefault, d as KubbFilesProcessingStartContext, dt as ResolverFilePathParams, et as BannerMeta, f as KubbFilesProcessingUpdateContext, ft as ResolverPatch, g as KubbHookLineContext, gt as createRenderer, h as KubbHookEndContext, ht as RendererFactory, i as Input, it as ResolveImportsOptions, j as GeneratorContext, jt as Diagnostics, k as createKubb, kt as DiagnosticLocation, l as KubbFileProcessingUpdate, lt as ResolverFile, m as KubbGenerationStartContext, mt as Renderer, n as CLIOptions, nt as ResolveBannerFile, o as KubbBuildStartContext, ot as ResolvePathOptions, p as KubbGenerationEndContext, pt as ResolverPathParams, q as OutputOptions, r as Config, rt as ResolveFileOptions, s as KubbDiagnosticContext, st as Resolver, t as BuildOutput, tt as ResolveBannerContext, u as KubbFilesProcessingEndContext, ut as ResolverFileParams, v as KubbHooks, vt as createStorage, w as PossibleConfig, wt as createReporter, x as KubbPluginsEndContext, xt as ReporterContext, y as KubbInfoContext, yt as GenerationResult, z as Group, zt as AdapterFactoryOptions } from "./types-Bl0feoGY.js";
2
+ import { $ as definePlugin, A as Generator, At as DiagnosticSeverity, B as Include, Bt as AdapterSource, C as KubbWarnContext, Ct as UserReporter, D as CreateKubbOptions, Dt as DiagnosticDoc, E as UserConfig, Et as Diagnostic, F as Parser, Ft as SerializedDiagnostic, G as Output, H as KubbPluginSetupContext, I as defineParser, It as UpdateDiagnostic, J as Override, K as OutputMode, L as Exclude, Lt as Hookable, M as defineGenerator, Mt as PerformanceDiagnostic, N as KubbDriver, Nt as ProblemCode, O as Kubb, Ot as DiagnosticKind, P as FileManagerHooks, Pt as ProblemDiagnostic, Q as ResolvePluginOptions, R as Filter, Rt as Adapter, S as KubbSuccessContext, St as ReporterName, T as PostGenerateCommand, Tt as logLevel, U as KubbPluginStartContext, V as KubbPluginEndContext, Vt as createAdapter, W as NormalizedPlugin, X as PluginFactoryOptions, Y as Plugin, Z as PluginName, _ as KubbHookStartContext, _t as Storage, a as KubbBuildEndContext, at as ResolveOptionsContext, b as KubbLifecycleStartContext, bt as Reporter, c as KubbErrorContext, ct as ResolverDefault, d as KubbFilesProcessingStartContext, dt as ResolverFilePathParams, et as BannerMeta, f as KubbFilesProcessingUpdateContext, ft as ResolverPatch, g as KubbHookLineContext, gt as createRenderer, h as KubbHookEndContext, ht as RendererFactory, i as Input, it as ResolveImportsOptions, j as GeneratorContext, jt as Diagnostics, k as createKubb, kt as DiagnosticLocation, l as KubbFileProcessingUpdate, lt as ResolverFile, m as KubbGenerationStartContext, mt as Renderer, n as CLIOptions, nt as ResolveBannerFile, o as KubbBuildStartContext, ot as ResolvePathOptions, p as KubbGenerationEndContext, pt as ResolverPathParams, q as OutputOptions, r as Config, rt as ResolveFileOptions, s as KubbDiagnosticContext, st as Resolver, t as BuildOutput, tt as ResolveBannerContext, u as KubbFilesProcessingEndContext, ut as ResolverFileParams, v as KubbHooks, vt as createStorage, w as PossibleConfig, wt as createReporter, x as KubbPluginsEndContext, xt as ReporterContext, y as KubbInfoContext, yt as GenerationResult, z as Group, zt as AdapterFactoryOptions } from "./types-DQlIpfWN.js";
3
3
  //#region src/applyConfigDefaults.d.ts
4
4
  type ApplyConfigDefaultsOptions<TOutput> = {
5
5
  defaultAdapter: Adapter;
package/dist/index.js CHANGED
@@ -189,7 +189,7 @@ function memoize(store, factory) {
189
189
  }
190
190
  //#endregion
191
191
  //#region package.json
192
- var version = "5.0.0-beta.95";
192
+ var version = "5.0.0-beta.96";
193
193
  //#endregion
194
194
  //#region src/constants.ts
195
195
  /**
@@ -899,23 +899,32 @@ var Resolver = class Resolver {
899
899
  } });
900
900
  }
901
901
  /**
902
- * Merges `override` over `base` and returns a new resolver with helpers re-bound. Top-level
903
- * keys replace, and a namespace (or `file`) merges per method, so overriding `query.name`
904
- * keeps the base `query.keyName`. Used when applying `setResolver` partial overrides. Reads a
905
- * resolver's options through the shared brand rather than `instanceof`, so a `file` override
906
- * survives even when `base` and `override` come from different `@kubb/core` copies.
907
- */
908
- static merge(base, override) {
909
- const patch = resolverOptions in override ? override[resolverOptions] : override;
910
- const merged = { ...base[resolverOptions] };
911
- for (const [key, value] of Object.entries(patch)) {
912
- if (value === void 0) continue;
913
- const current = merged[key];
914
- merged[key] = isNamespace(value) && isNamespace(current) ? {
915
- ...current,
916
- ...value
917
- } : value;
918
- }
902
+ * Folds each `override` over `base`, left to right, and returns a new resolver with helpers
903
+ * re-bound. Top-level keys replace, and a namespace (or `file`) merges per method, so overriding
904
+ * `query.name` keeps the base `query.keyName`. The last override wins per key. Used when applying
905
+ * `setResolver` partial overrides, and to compose shared resolver fragments without spreading each
906
+ * namespace by hand. Reads a resolver's options through the shared brand rather than `instanceof`,
907
+ * so a `file` override survives even when `base` and `override` come from different `@kubb/core`
908
+ * copies.
909
+ *
910
+ * @example Fold several partial overrides onto a resolver
911
+ * ```ts
912
+ * const resolver = Resolver.merge(defaultResolver, sharedNamingPatch, { name: (name) => name.toUpperCase() })
913
+ * ```
914
+ */
915
+ static merge(base, ...overrides) {
916
+ const merged = overrides.reduce((acc, override) => {
917
+ const patch = resolverOptions in override ? override[resolverOptions] : override;
918
+ for (const [key, value] of Object.entries(patch)) {
919
+ if (value === void 0) continue;
920
+ const current = acc[key];
921
+ acc[key] = isNamespace(value) && isNamespace(current) ? {
922
+ ...current,
923
+ ...value
924
+ } : value;
925
+ }
926
+ return acc;
927
+ }, { ...base[resolverOptions] });
919
928
  return new Resolver(merged);
920
929
  }
921
930
  /**