@kubb/core 5.0.0-beta.63 → 5.0.0-beta.65
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-M8ckppMO.d.ts} +9 -14
- package/dist/index.cjs +24 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +26 -36
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __name } from "./
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { Enforce, FileNode, HttpMethod, ImportNode, InputMeta, InputNode, Macro, Node, OperationNode, SchemaNode, UserFileNode } from "@kubb/ast";
|
|
3
3
|
|
|
4
4
|
//#region ../../internals/utils/src/asyncEventEmitter.d.ts
|
|
@@ -114,7 +114,6 @@ type PossiblePromise<T> = Promise<T> | T;
|
|
|
114
114
|
* input shape with paths resolved to absolute.
|
|
115
115
|
*
|
|
116
116
|
* - `{ type: 'path' }`: single file on disk.
|
|
117
|
-
* - `{ type: 'paths' }`: multiple files (e.g. split spec).
|
|
118
117
|
* - `{ type: 'data' }`: raw string or parsed object provided inline.
|
|
119
118
|
*/
|
|
120
119
|
type AdapterSource = {
|
|
@@ -123,9 +122,6 @@ type AdapterSource = {
|
|
|
123
122
|
} | {
|
|
124
123
|
type: 'data';
|
|
125
124
|
data: string | unknown;
|
|
126
|
-
} | {
|
|
127
|
-
type: 'paths';
|
|
128
|
-
paths: Array<string>;
|
|
129
125
|
};
|
|
130
126
|
/**
|
|
131
127
|
* Generic parameters used by `createAdapter` and the resulting `Adapter` type.
|
|
@@ -2889,24 +2885,23 @@ declare class Diagnostics {
|
|
|
2889
2885
|
*/
|
|
2890
2886
|
static serialize(diagnostic: Diagnostic): SerializedDiagnostic;
|
|
2891
2887
|
/**
|
|
2892
|
-
* Renders a {@link Diagnostic} for terminal output as its parts: the
|
|
2893
|
-
* (the
|
|
2894
|
-
* `at
|
|
2888
|
+
* Renders a {@link Diagnostic} for terminal output as its parts: the `headline`
|
|
2889
|
+
* (`[CODE] plugin: message`, with the code in the severity color) and the indented `details`
|
|
2890
|
+
* rows (`at:` pointer, `fix:` help, `see:` docs link).
|
|
2895
2891
|
*
|
|
2896
|
-
* Hosts compose these to fit their gutter: a clack logger passes `
|
|
2897
|
-
*
|
|
2892
|
+
* Hosts compose these to fit their gutter: a clack logger passes `[headline, ...details]` as the
|
|
2893
|
+
* message with no gutter symbol, while plain text outputs use {@link Diagnostics.formatLines}.
|
|
2898
2894
|
*/
|
|
2899
2895
|
static format(diagnostic: Diagnostic): {
|
|
2900
|
-
symbol: string;
|
|
2901
2896
|
headline: string;
|
|
2902
2897
|
details: Array<string>;
|
|
2903
2898
|
};
|
|
2904
2899
|
/**
|
|
2905
|
-
* The self-contained block form of {@link Diagnostics.format}:
|
|
2906
|
-
*
|
|
2900
|
+
* The self-contained block form of {@link Diagnostics.format}: the `headline` followed by the
|
|
2901
|
+
* indented detail rows. Used where there is no gutter (plain and file output).
|
|
2907
2902
|
*/
|
|
2908
2903
|
static formatLines(diagnostic: Diagnostic): Array<string>;
|
|
2909
2904
|
}
|
|
2910
2905
|
//#endregion
|
|
2911
2906
|
export { KubbPluginSetupContext as $, KubbHookStartContext as A, Adapter as At, ParsedFile as B, KubbFilesProcessingEndContext as C, GenerationResult as Ct, KubbGenerationStartContext as D, UserReporter as Dt, KubbGenerationEndContext as E, ReporterName as Et, KubbSuccessContext as F, Generator$1 as G, createKubb as H, KubbWarnContext as I, KubbDriver as J, GeneratorContext as K, PossibleConfig as L, KubbInfoContext as M, AdapterSource as Mt, KubbLifecycleStartContext as N, createAdapter as Nt, KubbHookEndContext as O, createReporter as Ot, KubbPluginsEndContext as P, AsyncEventEmitter as Pt, KubbPluginEndContext as Q, UserConfig as R, KubbFileProcessingUpdate as S, createStorage as St, KubbFilesProcessingUpdateContext as T, ReporterContext as Tt, Parser as U, Kubb$1 as V, defineParser as W, Group as X, Exclude$1 as Y, Include as Z, InputPath as _, defineResolver as _t, DiagnosticLocation as a, Override as at, KubbDiagnosticContext as b, createRenderer as bt, PerformanceDiagnostic as c, definePlugin as ct, SerializedDiagnostic as d, ResolveBannerFile as dt, KubbPluginStartContext as et, UpdateDiagnostic as f, ResolveOptionsContext as ft, InputData as g, ResolverPathParams as gt, Config as h, ResolverFileParams as ht, DiagnosticKind as i, OutputOptions as it, KubbHooks as j, AdapterFactoryOptions as jt, KubbHookLineContext as k, logLevel as kt, ProblemCode as l, BannerMeta as lt, CLIOptions as m, ResolverContext as mt, DiagnosticByCode as n, Output as nt, DiagnosticSeverity as o, Plugin as ot, BuildOutput as p, Resolver as pt, defineGenerator as q, DiagnosticDoc as r, OutputMode as rt, Diagnostics as s, PluginFactoryOptions as st, Diagnostic as t, NormalizedPlugin as tt, ProblemDiagnostic as u, ResolveBannerContext as ut, KubbBuildEndContext as v, Renderer as vt, KubbFilesProcessingStartContext as w, Reporter as wt, KubbErrorContext as x, Storage as xt, KubbBuildStartContext as y, RendererFactory as yt, FileProcessorHooks as z };
|
|
2912
|
-
//# sourceMappingURL=diagnostics-
|
|
2907
|
+
//# sourceMappingURL=diagnostics-M8ckppMO.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_memoryStorage = require("./memoryStorage-
|
|
2
|
+
const require_memoryStorage = require("./memoryStorage-mojU6pbA.cjs");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let node_util = require("node:util");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
node_path = require_memoryStorage.__toESM(node_path, 1);
|
|
8
8
|
let _kubb_ast = require("@kubb/ast");
|
|
9
|
-
_kubb_ast = require_memoryStorage.__toESM(_kubb_ast, 1);
|
|
10
9
|
let node_async_hooks = require("node:async_hooks");
|
|
11
10
|
let _kubb_ast_factory = require("@kubb/ast/factory");
|
|
12
11
|
_kubb_ast_factory = require_memoryStorage.__toESM(_kubb_ast_factory, 1);
|
|
@@ -611,7 +610,7 @@ function createAdapter(build) {
|
|
|
611
610
|
/**
|
|
612
611
|
* Docs major version, derived from the package version so the link tracks the published major.
|
|
613
612
|
*/
|
|
614
|
-
const docsMajor = "5.0.0-beta.
|
|
613
|
+
const docsMajor = "5.0.0-beta.65".split(".")[0] ?? "5";
|
|
615
614
|
/**
|
|
616
615
|
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
617
616
|
*
|
|
@@ -665,22 +664,13 @@ const isPerformance = isKind("performance");
|
|
|
665
664
|
*/
|
|
666
665
|
const isUpdate = isKind("update");
|
|
667
666
|
/**
|
|
668
|
-
*
|
|
669
|
-
*
|
|
667
|
+
* Accent color per severity. The color tints the `[CODE]` tag (red error, yellow warning,
|
|
668
|
+
* blue info).
|
|
670
669
|
*/
|
|
671
670
|
const severityStyle = {
|
|
672
|
-
error: {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
warning: {
|
|
677
|
-
glyph: "⚠",
|
|
678
|
-
color: "yellow"
|
|
679
|
-
},
|
|
680
|
-
info: {
|
|
681
|
-
glyph: "ℹ",
|
|
682
|
-
color: "blue"
|
|
683
|
-
}
|
|
671
|
+
error: { color: "red" },
|
|
672
|
+
warning: { color: "yellow" },
|
|
673
|
+
info: { color: "blue" }
|
|
684
674
|
};
|
|
685
675
|
/**
|
|
686
676
|
* Explanation for every {@link diagnosticCode}. Use {@link Diagnostics.explain} to look one up
|
|
@@ -1003,35 +993,35 @@ var Diagnostics = class Diagnostics {
|
|
|
1003
993
|
};
|
|
1004
994
|
}
|
|
1005
995
|
/**
|
|
1006
|
-
* Renders a {@link Diagnostic} for terminal output as its parts: the
|
|
1007
|
-
* (the
|
|
1008
|
-
* `at
|
|
996
|
+
* Renders a {@link Diagnostic} for terminal output as its parts: the `headline`
|
|
997
|
+
* (`[CODE] plugin: message`, with the code in the severity color) and the indented `details`
|
|
998
|
+
* rows (`at:` pointer, `fix:` help, `see:` docs link).
|
|
1009
999
|
*
|
|
1010
|
-
* Hosts compose these to fit their gutter: a clack logger passes `
|
|
1011
|
-
*
|
|
1000
|
+
* Hosts compose these to fit their gutter: a clack logger passes `[headline, ...details]` as the
|
|
1001
|
+
* message with no gutter symbol, while plain text outputs use {@link Diagnostics.formatLines}.
|
|
1012
1002
|
*/
|
|
1013
1003
|
static format(diagnostic) {
|
|
1014
1004
|
const { code, severity, message } = diagnostic;
|
|
1015
|
-
const {
|
|
1005
|
+
const { color } = severityStyle[severity];
|
|
1016
1006
|
const problem = isProblem(diagnostic) ? diagnostic : void 0;
|
|
1017
|
-
const
|
|
1007
|
+
const tag = (0, node_util.styleText)(color, (0, node_util.styleText)("bold", `[${code}]`));
|
|
1008
|
+
const headline = problem?.plugin ? `${tag} ${problem.plugin}: ${message}` : `${tag}: ${message}`;
|
|
1018
1009
|
const details = [];
|
|
1019
|
-
if (problem?.location && "pointer" in problem.location) details.push(` ${(0, node_util.styleText)("dim", "at")} ${(0, node_util.styleText)("cyan", problem.location.pointer)}`);
|
|
1020
|
-
if (problem?.help) details.push(` ${(0, node_util.styleText)("cyan", "
|
|
1021
|
-
if (code !== require_memoryStorage.diagnosticCode.unknown) details.push(` ${(0, node_util.styleText)("dim", "
|
|
1010
|
+
if (problem?.location && "pointer" in problem.location) details.push(` ${(0, node_util.styleText)("dim", "at:")} ${(0, node_util.styleText)("cyan", problem.location.pointer)}`);
|
|
1011
|
+
if (problem?.help) details.push(` ${(0, node_util.styleText)("cyan", "fix:")} ${problem.help}`);
|
|
1012
|
+
if (code !== require_memoryStorage.diagnosticCode.unknown) details.push(` ${(0, node_util.styleText)("dim", "see:")} ${(0, node_util.styleText)("cyan", Diagnostics.docsUrl(code))}`);
|
|
1022
1013
|
return {
|
|
1023
|
-
|
|
1024
|
-
headline: `${rule}: ${message}`,
|
|
1014
|
+
headline,
|
|
1025
1015
|
details
|
|
1026
1016
|
};
|
|
1027
1017
|
}
|
|
1028
1018
|
/**
|
|
1029
|
-
* The self-contained block form of {@link Diagnostics.format}:
|
|
1030
|
-
*
|
|
1019
|
+
* The self-contained block form of {@link Diagnostics.format}: the `headline` followed by the
|
|
1020
|
+
* indented detail rows. Used where there is no gutter (plain and file output).
|
|
1031
1021
|
*/
|
|
1032
1022
|
static formatLines(diagnostic) {
|
|
1033
|
-
const {
|
|
1034
|
-
return [
|
|
1023
|
+
const { headline, details } = Diagnostics.format(diagnostic);
|
|
1024
|
+
return [headline, ...details];
|
|
1035
1025
|
}
|
|
1036
1026
|
};
|
|
1037
1027
|
//#endregion
|
|
@@ -2910,7 +2900,7 @@ exports.Url = Url;
|
|
|
2910
2900
|
Object.defineProperty(exports, "ast", {
|
|
2911
2901
|
enumerable: true,
|
|
2912
2902
|
get: function() {
|
|
2913
|
-
return _kubb_ast;
|
|
2903
|
+
return _kubb_ast.ast;
|
|
2914
2904
|
}
|
|
2915
2905
|
});
|
|
2916
2906
|
exports.cliReporter = cliReporter;
|