@kubb/core 5.0.0-beta.61 → 5.0.0-beta.63
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-DiaUv_iK.d.ts → diagnostics-IjkPEgAO.d.ts} +41 -33
- package/dist/index.cjs +33 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +34 -47
- package/dist/index.js.map +1 -1
- package/dist/memoryStorage-CUj1hrxa.cjs.map +1 -1
- package/dist/memoryStorage-CWFzAz4o.js.map +1 -1
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.ts +2 -2
- package/dist/mocks.js +1 -1
- package/dist/mocks.js.map +1 -1
- package/package.json +4 -4
- package/src/FileManager.ts +3 -3
- package/src/KubbDriver.ts +24 -33
- package/src/Transform.ts +1 -1
- package/src/createAdapter.ts +2 -2
- package/src/createKubb.ts +2 -3
- package/src/createReporter.ts +4 -4
- package/src/createStorage.ts +2 -2
- package/src/defineGenerator.ts +8 -7
- package/src/defineParser.ts +3 -2
- package/src/definePlugin.ts +8 -7
- package/src/diagnostics.ts +3 -3
- package/src/mocks.ts +1 -1
- package/src/reporters/fileReporter.ts +4 -5
- package/src/types.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-C0LytTxp.js";
|
|
2
|
-
import { FileNode, HttpMethod, ImportNode, InputMeta, InputNode, Macro, Node, OperationNode, SchemaNode, UserFileNode } from "@kubb/ast";
|
|
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
|
|
5
5
|
/**
|
|
@@ -225,12 +225,12 @@ type AdapterBuilder<T extends AdapterFactoryOptions> = (options: T['options']) =
|
|
|
225
225
|
* options,
|
|
226
226
|
* document: null,
|
|
227
227
|
* async parse(_source) {
|
|
228
|
-
* // Convert
|
|
228
|
+
* // Convert the source (path or inline data) into an InputNode.
|
|
229
229
|
* return ast.factory.createInput()
|
|
230
230
|
* },
|
|
231
231
|
* getImports: () => [],
|
|
232
232
|
* async validate() {
|
|
233
|
-
* // Throw
|
|
233
|
+
* // Throw here when the spec is invalid.
|
|
234
234
|
* },
|
|
235
235
|
* }))
|
|
236
236
|
* ```
|
|
@@ -371,13 +371,13 @@ type GenerationResult = {
|
|
|
371
371
|
hrStart: [number, number];
|
|
372
372
|
};
|
|
373
373
|
/**
|
|
374
|
-
* Render
|
|
375
|
-
*
|
|
374
|
+
* Render settings passed alongside the {@link GenerationResult}. These are not part of the run
|
|
375
|
+
* data, such as the output verbosity.
|
|
376
376
|
*/
|
|
377
377
|
type ReporterContext = {
|
|
378
378
|
/**
|
|
379
379
|
* Output verbosity. Use the `logLevel` constants exported from `@kubb/core`
|
|
380
|
-
* (`silent`, `error`, `warn`, `info`, `verbose
|
|
380
|
+
* (`silent`, `error`, `warn`, `info`, `verbose`).
|
|
381
381
|
*/
|
|
382
382
|
logLevel: (typeof logLevel)[keyof typeof logLevel];
|
|
383
383
|
};
|
|
@@ -397,7 +397,7 @@ type Reporter = {
|
|
|
397
397
|
report: (result: GenerationResult, context: ReporterContext) => void | Promise<void>;
|
|
398
398
|
/**
|
|
399
399
|
* Optional finalizer called once after the run's last config. The host wires it to
|
|
400
|
-
* `kubb:lifecycle:end`. {@link createReporter} closes it over the
|
|
400
|
+
* `kubb:lifecycle:end`. {@link createReporter} closes it over the values that `report` returned.
|
|
401
401
|
*/
|
|
402
402
|
drain?: (context: ReporterContext) => void | Promise<void>;
|
|
403
403
|
};
|
|
@@ -471,8 +471,8 @@ type Storage = {
|
|
|
471
471
|
*/
|
|
472
472
|
clear(base?: string): Promise<void>;
|
|
473
473
|
/**
|
|
474
|
-
* Optional teardown hook
|
|
475
|
-
*
|
|
474
|
+
* Optional teardown hook for a backend to flush buffers, close connections,
|
|
475
|
+
* or release file locks.
|
|
476
476
|
*/
|
|
477
477
|
dispose?(): Promise<void>;
|
|
478
478
|
};
|
|
@@ -950,8 +950,8 @@ type Group = {
|
|
|
950
950
|
*/
|
|
951
951
|
type: 'tag' | 'path';
|
|
952
952
|
/**
|
|
953
|
-
* Returns the subdirectory name from the group key. Defaults to the
|
|
954
|
-
*
|
|
953
|
+
* Returns the subdirectory name from the group key. Defaults to the camelCased tag for
|
|
954
|
+
* `tag` groups, or the camelCased first path segment for `path` groups.
|
|
955
955
|
*/
|
|
956
956
|
name?: (context: {
|
|
957
957
|
group: string;
|
|
@@ -1017,11 +1017,12 @@ type ByPath = {
|
|
|
1017
1017
|
};
|
|
1018
1018
|
type ByMethod = {
|
|
1019
1019
|
/**
|
|
1020
|
-
* Filter by HTTP method: `'
|
|
1020
|
+
* Filter by HTTP method: `'GET'`, `'POST'`, `'PUT'`, `'PATCH'`, `'DELETE'`, `'HEAD'`, `'OPTIONS'`, `'TRACE'`.
|
|
1021
1021
|
*/
|
|
1022
1022
|
type: 'method';
|
|
1023
1023
|
/**
|
|
1024
|
-
* HTTP method to match
|
|
1024
|
+
* HTTP method to match, as one of the `HttpMethod` values (`'GET'`, `'POST'`, `'PUT'`,
|
|
1025
|
+
* `'PATCH'`, `'DELETE'`, `'HEAD'`, `'OPTIONS'`, `'TRACE'`) or a regex.
|
|
1025
1026
|
*/
|
|
1026
1027
|
pattern: HttpMethod | RegExp;
|
|
1027
1028
|
};
|
|
@@ -1186,11 +1187,11 @@ type Plugin<TFactory extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
1186
1187
|
*
|
|
1187
1188
|
* - `'pre'` runs before all normal plugins.
|
|
1188
1189
|
* - `'post'` runs after all normal plugins.
|
|
1189
|
-
* - `undefined` (default)
|
|
1190
|
+
* - `undefined` (default) runs in declaration order among normal plugins.
|
|
1190
1191
|
*
|
|
1191
1192
|
* Dependency constraints always take precedence over `enforce`.
|
|
1192
1193
|
*/
|
|
1193
|
-
enforce?:
|
|
1194
|
+
enforce?: Enforce;
|
|
1194
1195
|
/**
|
|
1195
1196
|
* The options passed by the user when calling the plugin factory.
|
|
1196
1197
|
*/
|
|
@@ -1340,13 +1341,19 @@ declare class KubbDriver {
|
|
|
1340
1341
|
readonly fileManager: FileManager;
|
|
1341
1342
|
readonly plugins: Map<string, NormalizedPlugin>;
|
|
1342
1343
|
constructor(config: Config, options: Options);
|
|
1344
|
+
/**
|
|
1345
|
+
* Normalizes every configured plugin, orders them, and registers their lifecycle handlers.
|
|
1346
|
+
* A plugin that another lists as a dependency runs first, then `enforce: 'pre'` before
|
|
1347
|
+
* `'post'`. When the config has an adapter, the adapter source is resolved from the input
|
|
1348
|
+
* so `run` can parse it later.
|
|
1349
|
+
*/
|
|
1343
1350
|
setup(): Promise<void>;
|
|
1344
1351
|
get hooks(): AsyncEventEmitter<KubbHooks>;
|
|
1345
1352
|
/**
|
|
1346
1353
|
* Emits the `kubb:plugin:setup` event so that all registered hook-style plugin listeners
|
|
1347
1354
|
* can configure generators, resolvers, macros and renderers before `buildStart` runs.
|
|
1348
1355
|
*
|
|
1349
|
-
*
|
|
1356
|
+
* Called once from `run` before the plugin execution loop begins.
|
|
1350
1357
|
*/
|
|
1351
1358
|
emitSetupHooks(): Promise<void>;
|
|
1352
1359
|
/**
|
|
@@ -1437,11 +1444,11 @@ declare class KubbDriver {
|
|
|
1437
1444
|
//#endregion
|
|
1438
1445
|
//#region src/defineGenerator.d.ts
|
|
1439
1446
|
/**
|
|
1440
|
-
* Context
|
|
1447
|
+
* Context passed to a generator's `schema`, `operation`, and `operations` methods.
|
|
1441
1448
|
*
|
|
1442
|
-
* The adapter
|
|
1443
|
-
*
|
|
1444
|
-
* filtering for
|
|
1449
|
+
* The driver sets `adapter` on the context before it runs a generator, so methods can read it
|
|
1450
|
+
* without a null check. `ctx.options` carries the per-node options after exclude/include/override
|
|
1451
|
+
* filtering for `schema` and `operation`, or the plugin-level options for `operations`.
|
|
1445
1452
|
*/
|
|
1446
1453
|
type GeneratorContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
1447
1454
|
/**
|
|
@@ -1536,9 +1543,10 @@ type GeneratorContext<TOptions extends PluginFactoryOptions = PluginFactoryOptio
|
|
|
1536
1543
|
/**
|
|
1537
1544
|
* Declares a named generator unit that walks the AST and emits files.
|
|
1538
1545
|
*
|
|
1539
|
-
*
|
|
1540
|
-
* JSX-based generators require a `renderer` factory.
|
|
1541
|
-
* `ctx.upsertFile()` manually and return `null` to
|
|
1546
|
+
* `schema` runs for each schema node and `operation` for each operation node. `operations` runs
|
|
1547
|
+
* once after every operation node is walked. JSX-based generators require a `renderer` factory.
|
|
1548
|
+
* Return `Array<FileNode>` directly, or call `ctx.upsertFile()` manually and return `null` to
|
|
1549
|
+
* bypass rendering.
|
|
1542
1550
|
*
|
|
1543
1551
|
* @note Generators are consumed by plugins and registered via `ctx.addGenerator()` in `kubb:plugin:setup`.
|
|
1544
1552
|
*
|
|
@@ -1646,8 +1654,9 @@ type Parser<TMeta extends object = object, TNode = unknown> = {
|
|
|
1646
1654
|
*/
|
|
1647
1655
|
name: string;
|
|
1648
1656
|
/**
|
|
1649
|
-
* File extensions this parser handles.
|
|
1650
|
-
*
|
|
1657
|
+
* File extensions this parser handles. The driver registers the parser for each
|
|
1658
|
+
* extension in this list. A parser with `undefined` here is not registered, so
|
|
1659
|
+
* files of an unclaimed extension fall back to joining their sources verbatim.
|
|
1651
1660
|
*
|
|
1652
1661
|
* @example
|
|
1653
1662
|
* `['.ts', '.js']`
|
|
@@ -1698,9 +1707,8 @@ type CreateKubbOptions = {
|
|
|
1698
1707
|
* config in the constructor, so `config` is available right away, and shares `hooks`,
|
|
1699
1708
|
* `storage`, and `driver` across the `setup → build` lifecycle.
|
|
1700
1709
|
*
|
|
1701
|
-
* `createKubb` takes a plain
|
|
1702
|
-
*
|
|
1703
|
-
* fingerprinted and validated against the shipped JSON schema.
|
|
1710
|
+
* `createKubb` takes a plain config object (the shape `defineConfig` produces),
|
|
1711
|
+
* not a fluent builder.
|
|
1704
1712
|
*
|
|
1705
1713
|
* Attach event listeners to `.hooks` before calling `setup()` or `build()`.
|
|
1706
1714
|
*
|
|
@@ -1929,7 +1937,7 @@ type Config<TInput = Input> = {
|
|
|
1929
1937
|
*
|
|
1930
1938
|
* @example
|
|
1931
1939
|
* ```ts
|
|
1932
|
-
* format: 'auto' // auto-detect
|
|
1940
|
+
* format: 'auto' // auto-detect oxfmt, biome, or prettier
|
|
1933
1941
|
* format: 'prettier' // force prettier
|
|
1934
1942
|
* format: false // skip formatting
|
|
1935
1943
|
* ```
|
|
@@ -2701,7 +2709,7 @@ declare function narrow<C extends DiagnosticCode>(diagnostic: Diagnostic, code:
|
|
|
2701
2709
|
/**
|
|
2702
2710
|
* A {@link Diagnostic} reduced to its JSON-safe fields plus a `docsUrl`, for
|
|
2703
2711
|
* machine-readable output (the `--reporter json` report, the MCP tools). Drops the
|
|
2704
|
-
* non-serializable `cause` and the `
|
|
2712
|
+
* non-serializable `cause` and the `kind`/`duration` bookkeeping.
|
|
2705
2713
|
*/
|
|
2706
2714
|
type SerializedDiagnostic = {
|
|
2707
2715
|
code: DiagnosticCode;
|
|
@@ -2850,8 +2858,8 @@ declare class Diagnostics {
|
|
|
2850
2858
|
*/
|
|
2851
2859
|
static failedPlugins(diagnostics: ReadonlyArray<Diagnostic>): Array<string>;
|
|
2852
2860
|
/**
|
|
2853
|
-
* Counts `problem` diagnostics by severity for the run summary. `
|
|
2854
|
-
* diagnostics are ignored.
|
|
2861
|
+
* Counts `problem` diagnostics by severity for the run summary. `performance` and
|
|
2862
|
+
* `update` diagnostics are ignored.
|
|
2855
2863
|
*/
|
|
2856
2864
|
static count(diagnostics: ReadonlyArray<Diagnostic>): {
|
|
2857
2865
|
errors: number;
|
|
@@ -2901,4 +2909,4 @@ declare class Diagnostics {
|
|
|
2901
2909
|
}
|
|
2902
2910
|
//#endregion
|
|
2903
2911
|
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 };
|
|
2904
|
-
//# sourceMappingURL=diagnostics-
|
|
2912
|
+
//# sourceMappingURL=diagnostics-IjkPEgAO.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -593,12 +593,12 @@ var Url = class Url {
|
|
|
593
593
|
* options,
|
|
594
594
|
* document: null,
|
|
595
595
|
* async parse(_source) {
|
|
596
|
-
* // Convert
|
|
596
|
+
* // Convert the source (path or inline data) into an InputNode.
|
|
597
597
|
* return ast.factory.createInput()
|
|
598
598
|
* },
|
|
599
599
|
* getImports: () => [],
|
|
600
600
|
* async validate() {
|
|
601
|
-
* // Throw
|
|
601
|
+
* // Throw here when the spec is invalid.
|
|
602
602
|
* },
|
|
603
603
|
* }))
|
|
604
604
|
* ```
|
|
@@ -611,7 +611,7 @@ function createAdapter(build) {
|
|
|
611
611
|
/**
|
|
612
612
|
* Docs major version, derived from the package version so the link tracks the published major.
|
|
613
613
|
*/
|
|
614
|
-
const docsMajor = "5.0.0-beta.
|
|
614
|
+
const docsMajor = "5.0.0-beta.63".split(".")[0] ?? "5";
|
|
615
615
|
/**
|
|
616
616
|
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
617
617
|
*
|
|
@@ -931,8 +931,8 @@ var Diagnostics = class Diagnostics {
|
|
|
931
931
|
return [...names];
|
|
932
932
|
}
|
|
933
933
|
/**
|
|
934
|
-
* Counts `problem` diagnostics by severity for the run summary. `
|
|
935
|
-
* diagnostics are ignored.
|
|
934
|
+
* Counts `problem` diagnostics by severity for the run summary. `performance` and
|
|
935
|
+
* `update` diagnostics are ignored.
|
|
936
936
|
*/
|
|
937
937
|
static count(diagnostics) {
|
|
938
938
|
let errors = 0;
|
|
@@ -1500,7 +1500,7 @@ function defineResolver(build) {
|
|
|
1500
1500
|
* leaves the tree untouched, so callers can detect a no-op by identity.
|
|
1501
1501
|
*
|
|
1502
1502
|
* Registration order matches the order setup hooks fire, which the driver has already sorted by
|
|
1503
|
-
* `enforce` and dependency edges. The registry preserves that order
|
|
1503
|
+
* `enforce` and dependency edges. The registry preserves that order. Macro `enforce` only reorders
|
|
1504
1504
|
* within a single plugin's list.
|
|
1505
1505
|
*/
|
|
1506
1506
|
var Transform = class {
|
|
@@ -1633,6 +1633,12 @@ var KubbDriver = class {
|
|
|
1633
1633
|
this.hooks.on(event, handler);
|
|
1634
1634
|
this.#listeners.push([event, handler]);
|
|
1635
1635
|
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Normalizes every configured plugin, orders them, and registers their lifecycle handlers.
|
|
1638
|
+
* A plugin that another lists as a dependency runs first, then `enforce: 'pre'` before
|
|
1639
|
+
* `'post'`. When the config has an adapter, the adapter source is resolved from the input
|
|
1640
|
+
* so `run` can parse it later.
|
|
1641
|
+
*/
|
|
1636
1642
|
async setup() {
|
|
1637
1643
|
const normalized = this.config.plugins.map((rawPlugin) => this.#normalizePlugin(rawPlugin));
|
|
1638
1644
|
const dependenciesByName = new Map(normalized.map((plugin) => [plugin.name, new Set(plugin.dependencies ?? [])]));
|
|
@@ -1652,8 +1658,9 @@ var KubbDriver = class {
|
|
|
1652
1658
|
return this.options.hooks;
|
|
1653
1659
|
}
|
|
1654
1660
|
/**
|
|
1655
|
-
*
|
|
1656
|
-
* its lifecycle handlers
|
|
1661
|
+
* Builds a `NormalizedPlugin` from a hook-style plugin, filling in default
|
|
1662
|
+
* options and copying `apply` when present. Registering its lifecycle handlers
|
|
1663
|
+
* on the `AsyncEventEmitter` is done separately by `#registerPlugin`.
|
|
1657
1664
|
*/
|
|
1658
1665
|
#normalizePlugin(plugin) {
|
|
1659
1666
|
const normalized = {
|
|
@@ -1758,7 +1765,7 @@ var KubbDriver = class {
|
|
|
1758
1765
|
* Emits the `kubb:plugin:setup` event so that all registered hook-style plugin listeners
|
|
1759
1766
|
* can configure generators, resolvers, macros and renderers before `buildStart` runs.
|
|
1760
1767
|
*
|
|
1761
|
-
*
|
|
1768
|
+
* Called once from `run` before the plugin execution loop begins.
|
|
1762
1769
|
*/
|
|
1763
1770
|
async emitSetupHooks() {
|
|
1764
1771
|
const noop = () => {};
|
|
@@ -1788,39 +1795,21 @@ var KubbDriver = class {
|
|
|
1788
1795
|
* Call this method inside `addGenerator()` (in `kubb:plugin:setup`) to wire up a generator.
|
|
1789
1796
|
*/
|
|
1790
1797
|
registerGenerator(pluginName, generator) {
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
const result = await generator.schema(node, ctx);
|
|
1795
|
-
await this.dispatch({
|
|
1796
|
-
result,
|
|
1797
|
-
renderer: generator.renderer
|
|
1798
|
-
});
|
|
1799
|
-
};
|
|
1800
|
-
this.#trackListener("kubb:generate:schema", schemaHandler);
|
|
1801
|
-
}
|
|
1802
|
-
if (generator.operation) {
|
|
1803
|
-
const operationHandler = async (node, ctx) => {
|
|
1798
|
+
const register = (event, method) => {
|
|
1799
|
+
if (!method) return;
|
|
1800
|
+
const handler = async (node, ctx) => {
|
|
1804
1801
|
if (ctx.plugin.name !== pluginName) return;
|
|
1805
|
-
const result = await
|
|
1802
|
+
const result = await method(node, ctx);
|
|
1806
1803
|
await this.dispatch({
|
|
1807
1804
|
result,
|
|
1808
1805
|
renderer: generator.renderer
|
|
1809
1806
|
});
|
|
1810
1807
|
};
|
|
1811
|
-
this.#trackListener(
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
const result = await generator.operations(nodes, ctx);
|
|
1817
|
-
await this.dispatch({
|
|
1818
|
-
result,
|
|
1819
|
-
renderer: generator.renderer
|
|
1820
|
-
});
|
|
1821
|
-
};
|
|
1822
|
-
this.#trackListener("kubb:generate:operations", operationsHandler);
|
|
1823
|
-
}
|
|
1808
|
+
this.#trackListener(event, handler);
|
|
1809
|
+
};
|
|
1810
|
+
register("kubb:generate:schema", generator.schema);
|
|
1811
|
+
register("kubb:generate:operation", generator.operation);
|
|
1812
|
+
register("kubb:generate:operations", generator.operations);
|
|
1824
1813
|
this.#eventGeneratorPlugins.add(pluginName);
|
|
1825
1814
|
}
|
|
1826
1815
|
/**
|
|
@@ -1971,8 +1960,8 @@ var KubbDriver = class {
|
|
|
1971
1960
|
* That ordering is what drives the CLI's `Plugins N/M` counter. Without it the bar would
|
|
1972
1961
|
* sit at the initial value until the very end of the run.
|
|
1973
1962
|
*
|
|
1974
|
-
* When `
|
|
1975
|
-
*
|
|
1963
|
+
* When `this.inputNode` is `null`, every entry still gets a `kubb:plugin:end` so
|
|
1964
|
+
* post-plugin listeners (the barrel writer and friends) complete.
|
|
1976
1965
|
*/
|
|
1977
1966
|
async #runGenerators(entries, flushPending) {
|
|
1978
1967
|
const diagnostics = [];
|
|
@@ -2463,9 +2452,8 @@ function resolveConfig(userConfig) {
|
|
|
2463
2452
|
* config in the constructor, so `config` is available right away, and shares `hooks`,
|
|
2464
2453
|
* `storage`, and `driver` across the `setup → build` lifecycle.
|
|
2465
2454
|
*
|
|
2466
|
-
* `createKubb` takes a plain
|
|
2467
|
-
*
|
|
2468
|
-
* fingerprinted and validated against the shipped JSON schema.
|
|
2455
|
+
* `createKubb` takes a plain config object (the shape `defineConfig` produces),
|
|
2456
|
+
* not a fluent builder.
|
|
2469
2457
|
*
|
|
2470
2458
|
* Attach event listeners to `.hooks` before calling `setup()` or `build()`.
|
|
2471
2459
|
*
|
|
@@ -2774,12 +2762,11 @@ function buildTimingSection(report) {
|
|
|
2774
2762
|
* The `file` reporter. Writes a config's {@link Report} to `.kubb/kubb-<name>-<timestamp>.log` as a
|
|
2775
2763
|
* plain-text document: a `# <name> — <timestamp>` header, a `## Summary` with the same counts the
|
|
2776
2764
|
* cli and json reporters expose, a `## Problems` section in the miette block format, and a
|
|
2777
|
-
* `## Timings` section. Selected with `--reporter file` (or `reporters: ['file']`)
|
|
2778
|
-
* old `--debug` flag.
|
|
2765
|
+
* `## Timings` section. Selected with `--reporter file` (or `reporters: ['file']`).
|
|
2779
2766
|
*
|
|
2780
|
-
* @note
|
|
2781
|
-
*
|
|
2782
|
-
*
|
|
2767
|
+
* @note It captures the collected diagnostics once a config finishes, not the live
|
|
2768
|
+
* `kubb:info`/`kubb:plugin` event stream. Color is stripped so the file stays plain text even when
|
|
2769
|
+
* the run is attached to a TTY.
|
|
2783
2770
|
*/
|
|
2784
2771
|
const fileReporter = createReporter({
|
|
2785
2772
|
name: "file",
|