@kubb/core 5.8.1 → 5.8.2

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-CRm0XQPb.js";
2
- import { $ as NodeCache, $t as Diagnostics, A as PluginFactoryOptions, At as RunHookOptions, B as ResolveImportsOptions, Bt as GenerationResult, C as Output, Ct as KubbPluginsEndContext, D as Plugin, Dt as PostGenerateCommand, E as Override, Et as PossibleConfig, F as definePlugin, Ft as ParserDefinition, G as ResolverFile, Gt as UserReporter, H as ResolvePathOptions, Ht as ReporterContext, I as BannerMeta, It as ParserFactory, J as ResolverPatch, Jt as Diagnostic, K as ResolverFileParams, Kt as createReporter, L as ResolveBannerContext, Lt as defineParser, M as PluginType, Mt as KubbDriver, N as ResolvePluginOptions, Nt as FileManagerHooks, O as PluginDefinition, Ot as UserConfig, P as assertPluginOption, Pt as Parser, Q as defineGenerator, Qt as DiagnosticSeverity, R as ResolveBannerFile, Rt as Storage, S as NormalizedPlugin, St as KubbMessageContext, T as OutputOptions, Tt as KubbWarnContext, U as Resolver, Ut as ReporterName, V as ResolveOptionsContext, Vt as Reporter, W as ResolverDefault, Wt as ReporterPluginFiles, X as Generator, Xt as DiagnosticKind, Y as ResolverPathParams, Yt as DiagnosticDoc, Z as GeneratorContext, Zt as DiagnosticLocation, _ as Group, _t as KubbHookLineContext, a as AdapterSource, an as Hookable, at as KubbBuildEndContext, b as KubbPluginSetupContext, bt as KubbInfoContext, c as ExtensionDependency, cn as createRenderer, ct as KubbErrorContext, d as ExtensionKind, dt as KubbFilesProcessingStartContext, en as PerformanceDiagnostic, et as BuildOutput, f as ExtensionMeta, ft as KubbFilesProcessingUpdateContext, g as Filter, gt as KubbHookEndContext, h as Exclude, ht as KubbGenerationSummaryContext, i as AdapterFactoryOptions, in as UpdateDiagnostic, it as Input, j as PluginName, jt as runHook, k as PluginFactory, kt as HookResult, l as ExtensionDependencyRecord, lt as KubbFileProcessingUpdate, m as resolveMeta, mt as KubbGenerationStartContext, n as AdapterDefinition, nn as ProblemDiagnostic, nt as Config, o as createAdapter, on as Renderer, ot as KubbBuildStartContext, p as checkCompatibility, pt as KubbGenerationEndContext, q as ResolverFilePathParams, qt as logLevel, r as AdapterFactory, rn as SerializedDiagnostic, rt as FilesContext, s as ExtensionDependencies, sn as RendererFactory, st as KubbDiagnosticContext, t as Adapter, tn as ProblemCode, tt as CLIOptions, u as ExtensionFactory, ut as KubbFilesProcessingEndContext, v as Include, vt as KubbHookStartContext, w as OutputMode, wt as KubbSuccessContext, x as KubbPluginStartContext, xt as KubbLifecycleStartContext, y as KubbPluginEndContext, yt as KubbHooks, z as ResolveFileOptions, zt as createStorage } from "./createAdapter-BO_AxI05.js";
2
+ import { $ as defineGenerator, $t as ProblemDiagnostic, A as PluginFactory, At as HookResult, B as ResolveFileOptions, Bt as ReporterName, C as NormalizedPlugin, Ct as KubbMessageContext, D as Override, Dt as PossibleConfig, E as OutputOptions, Et as KubbWarnContext, F as assertPluginOption, Ft as Storage, G as ResolverDefault, Gt as Diagnostic, H as ResolveOptionsContext, Ht as UserReporter, I as definePlugin, It as createStorage, J as ResolverFilePathParams, Jt as DiagnosticLocation, K as ResolverFile, Kt as DiagnosticDoc, L as BannerMeta, Lt as GenerationResult, M as PluginName, Mt as runHook, N as PluginType, Nt as KubbDriver, O as Plugin, Ot as PostGenerateCommand, P as ResolvePluginOptions, Pt as FileManagerHooks, Q as GeneratorContext, Qt as ProblemCode, R as ResolveBannerContext, Rt as Reporter, S as KubbPluginStartContext, St as KubbLifecycleStartContext, T as OutputMode, Tt as KubbSuccessContext, U as ResolvePathOptions, Ut as createReporter, V as ResolveImportsOptions, Vt as ReporterPluginFiles, W as Resolver, Wt as logLevel, X as ResolverPathParams, Xt as Diagnostics, Y as ResolverPatch, Yt as DiagnosticSeverity, Z as Generator, Zt as PerformanceDiagnostic, _ as Filter, _t as KubbHookEndContext, a as AdapterSource, an as createRenderer, at as Input, b as KubbPluginEndContext, bt as KubbHooks, c as ExtensionDependency, cn as ParserFactory, ct as KubbDiagnosticContext, d as ExtensionKind, dt as KubbFilesProcessingEndContext, en as SerializedDiagnostic, et as NodeCache, f as ExtensionMeta, ft as KubbFilesProcessingStartContext, g as Exclude, gt as KubbGenerationSummaryContext, h as resolveMeta, ht as KubbGenerationStartContext, i as AdapterFactoryOptions, in as RendererFactory, it as FilesContext, j as PluginFactoryOptions, jt as RunHookOptions, k as PluginDefinition, kt as UserConfig, l as ExtensionDependencyRecord, ln as defineParser, lt as KubbErrorContext, m as defineExtension, mt as KubbGenerationEndContext, n as AdapterDefinition, nn as Hookable, nt as CLIOptions, o as createAdapter, on as Parser, ot as KubbBuildEndContext, p as checkCompatibility, pt as KubbFilesProcessingUpdateContext, q as ResolverFileParams, qt as DiagnosticKind, r as AdapterFactory, rn as Renderer, rt as Config, s as ExtensionDependencies, sn as ParserDefinition, st as KubbBuildStartContext, t as Adapter, tn as UpdateDiagnostic, tt as BuildOutput, u as ExtensionFactory, ut as KubbFileProcessingUpdate, v as Group, vt as KubbHookLineContext, w as Output, wt as KubbPluginsEndContext, x as KubbPluginSetupContext, xt as KubbInfoContext, y as Include, yt as KubbHookStartContext, z as ResolveBannerFile, zt as ReporterContext } from "./createAdapter-BpJYvJTw.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { FileNode, Macro, UserFileNode } from "@kubb/ast";
5
5
  //#region src/applyConfigDefaults.d.ts
@@ -613,5 +613,5 @@ export declare function readInstalledPackages({ root, packages, resolveFrom }: {
613
613
  resolveFrom?: Array<string>;
614
614
  }): Promise<Array<InstalledPackage>>;
615
615
  //#endregion
616
- export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, BuildOutput, CLIOptions, Config, type CreateKubbOptions, type Diagnostic, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type FileManagerHooks, FilesContext, type Filter, type GenerateOptions, type GenerateResult, type GenerationResult, type Generator, type GeneratorContext, type Group, type HookResult, Hookable, type Include, Input, type InputKind, type InstalledPackage, type JSONValue, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbGenerationSummaryContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, KubbMessageContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NodeCache, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type PerformanceDiagnostic, type Plugin, type PluginDefinition, type PluginFactory, type PluginFactoryOptions, type PluginName, type PluginType, PossibleConfig, PostGenerateCommand, type ProblemCode, type ProblemDiagnostic, type RegistryDetail, type RegistryEntry, type RegistryIndex, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ReporterPluginFiles, type ResolveBannerContext, type ResolveBannerFile, type ResolveFileOptions, type ResolveImportsOptions, type ResolveOptionsContext, type ResolvePathOptions, type ResolvePluginOptions, Resolver, type ResolverDefault, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type ResolverPathParams, type RunHookOptions, type RunOutputPassesOptions, type SerializedDiagnostic, type Storage, type SummaryRenderer, type UpdateDiagnostic, UserConfig, type UserReporter, assertPluginOption, checkCompatibility, createAdapter, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, logLevel, resolveMeta, runHook };
616
+ export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, BuildOutput, CLIOptions, Config, type CreateKubbOptions, type Diagnostic, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type FileManagerHooks, FilesContext, type Filter, type GenerateOptions, type GenerateResult, type GenerationResult, type Generator, type GeneratorContext, type Group, type HookResult, Hookable, type Include, Input, type InputKind, type InstalledPackage, type JSONValue, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbGenerationSummaryContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, KubbMessageContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NodeCache, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type PerformanceDiagnostic, type Plugin, type PluginDefinition, type PluginFactory, type PluginFactoryOptions, type PluginName, type PluginType, PossibleConfig, PostGenerateCommand, type ProblemCode, type ProblemDiagnostic, type RegistryDetail, type RegistryEntry, type RegistryIndex, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ReporterPluginFiles, type ResolveBannerContext, type ResolveBannerFile, type ResolveFileOptions, type ResolveImportsOptions, type ResolveOptionsContext, type ResolvePathOptions, type ResolvePluginOptions, Resolver, type ResolverDefault, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type ResolverPathParams, type RunHookOptions, type RunOutputPassesOptions, type SerializedDiagnostic, type Storage, type SummaryRenderer, type UpdateDiagnostic, UserConfig, type UserReporter, assertPluginOption, checkCompatibility, createAdapter, createRenderer, createReporter, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, logLevel, resolveMeta, runHook };
617
617
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./rolldown-runtime-CRm0XQPb.js";
2
- import { A as inParallel, C as useOptions, D as Diagnostics, E as resolveMeta, F as toPosixPath, I as write, L as toError, M as exists, N as isPathInside, O as formatMs, P as read, S as useKubb, T as defineExtension, _ as setMacros, a as _usingCtx, b as tryUseKubb, c as Resolver, d as definePlugin, f as addGenerator, g as requirePlugin, h as kubbContext, j as clean, k as getElapsedMs, l as getInputKind, m as injectFile, o as Hookable, p as addMacro, s as createResolver, t as KubbDriver, u as assertPluginOption, v as setOptions, w as checkCompatibility, x as useConfig, y as setResolver } from "./KubbDriver-Dz36Klt9.js";
2
+ import { A as getElapsedMs, C as useOptions, D as resolveMeta, E as defineExtension, F as read, I as toPosixPath, L as write, M as clean, N as exists, O as Diagnostics, P as isPathInside, R as toError, S as useKubb, T as createExtensionFactory, _ as setMacros, a as _usingCtx, b as tryUseKubb, c as Resolver, d as definePlugin, f as addGenerator, g as requirePlugin, h as kubbContext, j as inParallel, k as formatMs, l as getInputKind, m as injectFile, o as Hookable, p as addMacro, s as createResolver, t as KubbDriver, u as assertPluginOption, v as setOptions, w as checkCompatibility, x as useConfig, y as setResolver } from "./KubbDriver-DBm4hRKA.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { isValid } from "verkit";
5
5
  import { stripVTControlCharacters, styleText } from "node:util";
@@ -154,22 +154,13 @@ function tokenize(command) {
154
154
  //#endregion
155
155
  //#region src/createAdapter.ts
156
156
  function createAdapter(input) {
157
- if (typeof input === "function") return defineExtension({
157
+ if (typeof input === "function") return createExtensionFactory({
158
158
  kind: "adapter",
159
159
  build: (options) => input(options)
160
160
  });
161
- const { meta, setup, build } = input;
162
161
  return defineExtension({
163
162
  kind: "adapter",
164
- meta,
165
- build: (raw) => {
166
- const options = setup ? setup(raw) : raw;
167
- return Object.assign(build(options), {
168
- name: meta.name,
169
- meta,
170
- options
171
- });
172
- }
163
+ ...input
173
164
  });
174
165
  }
175
166
  //#endregion
@@ -1285,7 +1276,7 @@ function defineGenerator(generator) {
1285
1276
  //#endregion
1286
1277
  //#region src/defineParser.ts
1287
1278
  function defineParser(input) {
1288
- if (typeof input === "function") return defineExtension({
1279
+ if (typeof input === "function") return createExtensionFactory({
1289
1280
  kind: "parser",
1290
1281
  build: (options) => {
1291
1282
  const parser = input(options);
@@ -1295,17 +1286,10 @@ function defineParser(input) {
1295
1286
  };
1296
1287
  }
1297
1288
  });
1298
- const { meta } = input;
1299
- const build = "build" in input ? input.build : input.setup;
1300
1289
  return defineExtension({
1301
1290
  kind: "parser",
1302
- meta,
1303
- build: (options) => ({
1304
- ...build(options),
1305
- name: meta.name,
1306
- meta,
1307
- options
1308
- })
1291
+ meta: input.meta,
1292
+ build: "build" in input ? input.build : input.setup
1309
1293
  });
1310
1294
  }
1311
1295
  //#endregion
@@ -1471,6 +1455,6 @@ async function readInstalledPackages({ root, packages = [], resolveFrom = [] })
1471
1455
  }));
1472
1456
  }
1473
1457
  //#endregion
1474
- export { Diagnostics, Hookable, KubbDriver, Resolver, addGenerator, addMacro, applyConfigDefaults, assertPluginOption, cacheStorage, checkCompatibility, cliReporter, createAdapter, createCliReporter, createKubb, createRenderer, createReporter, createResolver, createStorage, defineGenerator, defineParser, definePlugin, fileReporter, fsStorage, getInputKind, htmlReporter, injectFile, isExtensionManifest, isPackageName, isRegistryEntry, jsonReporter, kubbContext, kubbStorage, logLevel, manifestProblems, memoryStorage, readInstalledPackages, requirePlugin, resolveCacheDir, resolveKubbDir, resolveMeta, runHook, runOutputPasses, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions };
1458
+ export { Diagnostics, Hookable, KubbDriver, Resolver, addGenerator, addMacro, applyConfigDefaults, assertPluginOption, cacheStorage, checkCompatibility, cliReporter, createAdapter, createCliReporter, createKubb, createRenderer, createReporter, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fileReporter, fsStorage, getInputKind, htmlReporter, injectFile, isExtensionManifest, isPackageName, isRegistryEntry, jsonReporter, kubbContext, kubbStorage, logLevel, manifestProblems, memoryStorage, readInstalledPackages, requirePlugin, resolveCacheDir, resolveKubbDir, resolveMeta, runHook, runOutputPasses, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions };
1475
1459
 
1476
1460
  //# sourceMappingURL=index.js.map