@kubb/core 5.0.0-beta.63 → 5.0.0-beta.64
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/{diagnostics-IjkPEgAO.d.ts → diagnostics-BqiNAWVS.d.ts} +9 -10
- package/dist/index.cjs +24 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +25 -35
- package/dist/index.js.map +1 -1
- package/dist/{memoryStorage-CWFzAz4o.js → memoryStorage-DWnhqUf2.js} +3 -3
- package/dist/{memoryStorage-CWFzAz4o.js.map → memoryStorage-DWnhqUf2.js.map} +1 -1
- package/dist/{memoryStorage-CUj1hrxa.cjs → memoryStorage-mojU6pbA.cjs} +2 -2
- package/dist/{memoryStorage-CUj1hrxa.cjs.map → memoryStorage-mojU6pbA.cjs.map} +1 -1
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.d.ts +2 -2
- package/dist/mocks.js +2 -2
- package/package.json +4 -5
- package/src/FileManager.ts +0 -137
- package/src/FileProcessor.ts +0 -212
- package/src/KubbDriver.ts +0 -900
- package/src/Transform.ts +0 -105
- package/src/constants.ts +0 -126
- package/src/createAdapter.ts +0 -127
- package/src/createKubb.ts +0 -195
- package/src/createRenderer.ts +0 -72
- package/src/createReporter.ts +0 -134
- package/src/createStorage.ts +0 -83
- package/src/defineGenerator.ts +0 -211
- package/src/defineParser.ts +0 -63
- package/src/definePlugin.ts +0 -438
- package/src/defineResolver.ts +0 -711
- package/src/diagnostics.ts +0 -662
- package/src/index.ts +0 -20
- package/src/mocks.ts +0 -249
- package/src/reporters/cliReporter.ts +0 -89
- package/src/reporters/fileReporter.ts +0 -102
- package/src/reporters/jsonReporter.ts +0 -20
- package/src/reporters/report.ts +0 -85
- package/src/storages/fsStorage.ts +0 -82
- package/src/storages/memoryStorage.ts +0 -55
- package/src/types.ts +0 -829
- /package/dist/{chunk-C0LytTxp.js → rolldown-runtime-C0LytTxp.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as __name } from "./
|
|
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-
|
|
3
|
-
import
|
|
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-BqiNAWVS.js";
|
|
3
|
+
import { ast } from "@kubb/ast";
|
|
4
4
|
|
|
5
5
|
//#region ../../internals/utils/src/url.d.ts
|
|
6
6
|
type URLObject = {
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { a as createStorage, c as camelCase, d as BuildError, f as getErrorMessage, i as FileManager, l as pascalCase, n as _usingCtx, o as OPERATION_FILTER_TYPES, r as FileProcessor, s as diagnosticCode, t as memoryStorage, u as AsyncEventEmitter } from "./memoryStorage-
|
|
1
|
+
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
+
import { a as createStorage, c as camelCase, d as BuildError, f as getErrorMessage, i as FileManager, l as pascalCase, n as _usingCtx, o as OPERATION_FILTER_TYPES, r as FileProcessor, s as diagnosticCode, t as memoryStorage, u as AsyncEventEmitter } from "./memoryStorage-DWnhqUf2.js";
|
|
3
3
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
4
4
|
import { hash } from "node:crypto";
|
|
5
5
|
import { access, glob, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
6
6
|
import path, { dirname, join, relative, resolve } from "node:path";
|
|
7
|
-
import
|
|
8
|
-
import { composeMacros, operationDef, schemaDef, transform } from "@kubb/ast";
|
|
7
|
+
import { ast, composeMacros, operationDef, schemaDef, transform } from "@kubb/ast";
|
|
9
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10
9
|
import * as factory from "@kubb/ast/factory";
|
|
11
10
|
import { collectUsedSchemaNames } from "@kubb/ast/utils";
|
|
@@ -608,7 +607,7 @@ function createAdapter(build) {
|
|
|
608
607
|
/**
|
|
609
608
|
* Docs major version, derived from the package version so the link tracks the published major.
|
|
610
609
|
*/
|
|
611
|
-
const docsMajor = "5.0.0-beta.
|
|
610
|
+
const docsMajor = "5.0.0-beta.64".split(".")[0] ?? "5";
|
|
612
611
|
/**
|
|
613
612
|
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
614
613
|
*
|
|
@@ -662,22 +661,13 @@ const isPerformance = isKind("performance");
|
|
|
662
661
|
*/
|
|
663
662
|
const isUpdate = isKind("update");
|
|
664
663
|
/**
|
|
665
|
-
*
|
|
666
|
-
*
|
|
664
|
+
* Accent color per severity. The color tints the `[CODE]` tag (red error, yellow warning,
|
|
665
|
+
* blue info).
|
|
667
666
|
*/
|
|
668
667
|
const severityStyle = {
|
|
669
|
-
error: {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
},
|
|
673
|
-
warning: {
|
|
674
|
-
glyph: "⚠",
|
|
675
|
-
color: "yellow"
|
|
676
|
-
},
|
|
677
|
-
info: {
|
|
678
|
-
glyph: "ℹ",
|
|
679
|
-
color: "blue"
|
|
680
|
-
}
|
|
668
|
+
error: { color: "red" },
|
|
669
|
+
warning: { color: "yellow" },
|
|
670
|
+
info: { color: "blue" }
|
|
681
671
|
};
|
|
682
672
|
/**
|
|
683
673
|
* Explanation for every {@link diagnosticCode}. Use {@link Diagnostics.explain} to look one up
|
|
@@ -1000,35 +990,35 @@ var Diagnostics = class Diagnostics {
|
|
|
1000
990
|
};
|
|
1001
991
|
}
|
|
1002
992
|
/**
|
|
1003
|
-
* Renders a {@link Diagnostic} for terminal output as its parts: the
|
|
1004
|
-
* (the
|
|
1005
|
-
* `at
|
|
993
|
+
* Renders a {@link Diagnostic} for terminal output as its parts: the `headline`
|
|
994
|
+
* (`[CODE] plugin: message`, with the code in the severity color) and the indented `details`
|
|
995
|
+
* rows (`at:` pointer, `fix:` help, `see:` docs link).
|
|
1006
996
|
*
|
|
1007
|
-
* Hosts compose these to fit their gutter: a clack logger passes `
|
|
1008
|
-
*
|
|
997
|
+
* Hosts compose these to fit their gutter: a clack logger passes `[headline, ...details]` as the
|
|
998
|
+
* message with no gutter symbol, while plain text outputs use {@link Diagnostics.formatLines}.
|
|
1009
999
|
*/
|
|
1010
1000
|
static format(diagnostic) {
|
|
1011
1001
|
const { code, severity, message } = diagnostic;
|
|
1012
|
-
const {
|
|
1002
|
+
const { color } = severityStyle[severity];
|
|
1013
1003
|
const problem = isProblem(diagnostic) ? diagnostic : void 0;
|
|
1014
|
-
const
|
|
1004
|
+
const tag = styleText(color, styleText("bold", `[${code}]`));
|
|
1005
|
+
const headline = problem?.plugin ? `${tag} ${problem.plugin}: ${message}` : `${tag}: ${message}`;
|
|
1015
1006
|
const details = [];
|
|
1016
|
-
if (problem?.location && "pointer" in problem.location) details.push(` ${styleText("dim", "at")} ${styleText("cyan", problem.location.pointer)}`);
|
|
1017
|
-
if (problem?.help) details.push(` ${styleText("cyan", "
|
|
1018
|
-
if (code !== diagnosticCode.unknown) details.push(` ${styleText("dim", "
|
|
1007
|
+
if (problem?.location && "pointer" in problem.location) details.push(` ${styleText("dim", "at:")} ${styleText("cyan", problem.location.pointer)}`);
|
|
1008
|
+
if (problem?.help) details.push(` ${styleText("cyan", "fix:")} ${problem.help}`);
|
|
1009
|
+
if (code !== diagnosticCode.unknown) details.push(` ${styleText("dim", "see:")} ${styleText("cyan", Diagnostics.docsUrl(code))}`);
|
|
1019
1010
|
return {
|
|
1020
|
-
|
|
1021
|
-
headline: `${rule}: ${message}`,
|
|
1011
|
+
headline,
|
|
1022
1012
|
details
|
|
1023
1013
|
};
|
|
1024
1014
|
}
|
|
1025
1015
|
/**
|
|
1026
|
-
* The self-contained block form of {@link Diagnostics.format}:
|
|
1027
|
-
*
|
|
1016
|
+
* The self-contained block form of {@link Diagnostics.format}: the `headline` followed by the
|
|
1017
|
+
* indented detail rows. Used where there is no gutter (plain and file output).
|
|
1028
1018
|
*/
|
|
1029
1019
|
static formatLines(diagnostic) {
|
|
1030
|
-
const {
|
|
1031
|
-
return [
|
|
1020
|
+
const { headline, details } = Diagnostics.format(diagnostic);
|
|
1021
|
+
return [headline, ...details];
|
|
1032
1022
|
}
|
|
1033
1023
|
};
|
|
1034
1024
|
//#endregion
|