@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.
Files changed (39) hide show
  1. package/dist/{diagnostics-IjkPEgAO.d.ts → diagnostics-BqiNAWVS.d.ts} +9 -10
  2. package/dist/index.cjs +24 -34
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +25 -35
  6. package/dist/index.js.map +1 -1
  7. package/dist/{memoryStorage-CWFzAz4o.js → memoryStorage-DWnhqUf2.js} +3 -3
  8. package/dist/{memoryStorage-CWFzAz4o.js.map → memoryStorage-DWnhqUf2.js.map} +1 -1
  9. package/dist/{memoryStorage-CUj1hrxa.cjs → memoryStorage-mojU6pbA.cjs} +2 -2
  10. package/dist/{memoryStorage-CUj1hrxa.cjs.map → memoryStorage-mojU6pbA.cjs.map} +1 -1
  11. package/dist/mocks.cjs +1 -1
  12. package/dist/mocks.d.ts +2 -2
  13. package/dist/mocks.js +2 -2
  14. package/package.json +4 -5
  15. package/src/FileManager.ts +0 -137
  16. package/src/FileProcessor.ts +0 -212
  17. package/src/KubbDriver.ts +0 -900
  18. package/src/Transform.ts +0 -105
  19. package/src/constants.ts +0 -126
  20. package/src/createAdapter.ts +0 -127
  21. package/src/createKubb.ts +0 -195
  22. package/src/createRenderer.ts +0 -72
  23. package/src/createReporter.ts +0 -134
  24. package/src/createStorage.ts +0 -83
  25. package/src/defineGenerator.ts +0 -211
  26. package/src/defineParser.ts +0 -63
  27. package/src/definePlugin.ts +0 -438
  28. package/src/defineResolver.ts +0 -711
  29. package/src/diagnostics.ts +0 -662
  30. package/src/index.ts +0 -20
  31. package/src/mocks.ts +0 -249
  32. package/src/reporters/cliReporter.ts +0 -89
  33. package/src/reporters/fileReporter.ts +0 -102
  34. package/src/reporters/jsonReporter.ts +0 -20
  35. package/src/reporters/report.ts +0 -85
  36. package/src/storages/fsStorage.ts +0 -82
  37. package/src/storages/memoryStorage.ts +0 -55
  38. package/src/types.ts +0 -829
  39. /package/dist/{chunk-C0LytTxp.js → rolldown-runtime-C0LytTxp.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as __name } from "./chunk-C0LytTxp.js";
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
@@ -2889,24 +2889,23 @@ declare class Diagnostics {
2889
2889
  */
2890
2890
  static serialize(diagnostic: Diagnostic): SerializedDiagnostic;
2891
2891
  /**
2892
- * Renders a {@link Diagnostic} for terminal output as its parts: the colored severity `symbol`
2893
- * (the gutter glyph), the `plugin(CODE): message` `headline`, and the `details` lines (optional
2894
- * `at <pointer>`, `help:`, and `docs:`).
2892
+ * Renders a {@link Diagnostic} for terminal output as its parts: the `headline`
2893
+ * (`[CODE] plugin: message`, with the code in the severity color) and the indented `details`
2894
+ * rows (`at:` pointer, `fix:` help, `see:` docs link).
2895
2895
  *
2896
- * Hosts compose these to fit their gutter: a clack logger passes `symbol` as its own gutter and
2897
- * `[headline, ...details]` as the message, while plain text outputs use {@link Diagnostics.formatLines}.
2896
+ * Hosts compose these to fit their gutter: a clack logger passes `[headline, ...details]` as the
2897
+ * message with no gutter symbol, while plain text outputs use {@link Diagnostics.formatLines}.
2898
2898
  */
2899
2899
  static format(diagnostic: Diagnostic): {
2900
- symbol: string;
2901
2900
  headline: string;
2902
2901
  details: Array<string>;
2903
2902
  };
2904
2903
  /**
2905
- * The self-contained block form of {@link Diagnostics.format}: `${symbol} ${headline}` followed by
2906
- * the detail lines. Used where there is no gutter to own the symbol (plain and file output).
2904
+ * The self-contained block form of {@link Diagnostics.format}: the `headline` followed by the
2905
+ * indented detail rows. Used where there is no gutter (plain and file output).
2907
2906
  */
2908
2907
  static formatLines(diagnostic: Diagnostic): Array<string>;
2909
2908
  }
2910
2909
  //#endregion
2911
2910
  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-IjkPEgAO.d.ts.map
2911
+ //# sourceMappingURL=diagnostics-BqiNAWVS.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-CUj1hrxa.cjs");
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.63".split(".")[0] ?? "5";
613
+ const docsMajor = "5.0.0-beta.64".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
- * Glyph and accent color per severity, matching the miette/oxlint convention
669
- * (`×` error, `⚠` warning, `ℹ` advice).
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
- glyph: "×",
674
- color: "red"
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 colored severity `symbol`
1007
- * (the gutter glyph), the `plugin(CODE): message` `headline`, and the `details` lines (optional
1008
- * `at <pointer>`, `help:`, and `docs:`).
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 `symbol` as its own gutter and
1011
- * `[headline, ...details]` as the message, while plain text outputs use {@link Diagnostics.formatLines}.
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 { glyph, color } = severityStyle[severity];
1005
+ const { color } = severityStyle[severity];
1016
1006
  const problem = isProblem(diagnostic) ? diagnostic : void 0;
1017
- const rule = (0, node_util.styleText)(color, (0, node_util.styleText)("bold", problem?.plugin ? `${problem.plugin}(${code})` : code));
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", "help:")} ${problem.help}`);
1021
- if (code !== require_memoryStorage.diagnosticCode.unknown) details.push(` ${(0, node_util.styleText)("dim", "docs:")} ${(0, node_util.styleText)("cyan", Diagnostics.docsUrl(code))}`);
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
- symbol: (0, node_util.styleText)(color, (0, node_util.styleText)("bold", glyph)),
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}: `${symbol} ${headline}` followed by
1030
- * the detail lines. Used where there is no gutter to own the symbol (plain and file output).
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 { symbol, headline, details } = Diagnostics.format(diagnostic);
1034
- return [`${symbol} ${headline}`, ...details];
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;