@kubb/core 5.0.0-beta.61 → 5.0.0-beta.62

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 "./chunk-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-DiaUv_iK.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-D0G07LHG.js";
3
3
  import * as ast from "@kubb/ast";
4
4
 
5
5
  //#region ../../internals/utils/src/url.d.ts
package/dist/index.js CHANGED
@@ -608,7 +608,7 @@ function createAdapter(build) {
608
608
  /**
609
609
  * Docs major version, derived from the package version so the link tracks the published major.
610
610
  */
611
- const docsMajor = "5.0.0-beta.61".split(".")[0] ?? "5";
611
+ const docsMajor = "5.0.0-beta.62".split(".")[0] ?? "5";
612
612
  /**
613
613
  * Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
614
614
  *
@@ -1785,39 +1785,21 @@ var KubbDriver = class {
1785
1785
  * Call this method inside `addGenerator()` (in `kubb:plugin:setup`) to wire up a generator.
1786
1786
  */
1787
1787
  registerGenerator(pluginName, generator) {
1788
- if (generator.schema) {
1789
- const schemaHandler = async (node, ctx) => {
1788
+ const register = (event, method) => {
1789
+ if (!method) return;
1790
+ const handler = async (node, ctx) => {
1790
1791
  if (ctx.plugin.name !== pluginName) return;
1791
- const result = await generator.schema(node, ctx);
1792
+ const result = await method(node, ctx);
1792
1793
  await this.dispatch({
1793
1794
  result,
1794
1795
  renderer: generator.renderer
1795
1796
  });
1796
1797
  };
1797
- this.#trackListener("kubb:generate:schema", schemaHandler);
1798
- }
1799
- if (generator.operation) {
1800
- const operationHandler = async (node, ctx) => {
1801
- if (ctx.plugin.name !== pluginName) return;
1802
- const result = await generator.operation(node, ctx);
1803
- await this.dispatch({
1804
- result,
1805
- renderer: generator.renderer
1806
- });
1807
- };
1808
- this.#trackListener("kubb:generate:operation", operationHandler);
1809
- }
1810
- if (generator.operations) {
1811
- const operationsHandler = async (nodes, ctx) => {
1812
- if (ctx.plugin.name !== pluginName) return;
1813
- const result = await generator.operations(nodes, ctx);
1814
- await this.dispatch({
1815
- result,
1816
- renderer: generator.renderer
1817
- });
1818
- };
1819
- this.#trackListener("kubb:generate:operations", operationsHandler);
1820
- }
1798
+ this.#trackListener(event, handler);
1799
+ };
1800
+ register("kubb:generate:schema", generator.schema);
1801
+ register("kubb:generate:operation", generator.operation);
1802
+ register("kubb:generate:operations", generator.operations);
1821
1803
  this.#eventGeneratorPlugins.add(pluginName);
1822
1804
  }
1823
1805
  /**