@kubb/core 5.0.0-beta.91 → 5.0.0-beta.93
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.cjs +6 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -24
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/{types-aNebW3Ui.d.ts → types-BLFyAJLZ.d.ts} +33 -63
- package/package.json +2 -2
package/dist/mocks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as Generator, F as Parser, Ft as Adapter, It as AdapterFactoryOptions, N as KubbDriver, W as NormalizedPlugin, X as PluginFactoryOptions, r as Config } from "./types-BLFyAJLZ.js";
|
|
3
3
|
import { FileNode, InputMeta, Macro, OperationNode, SchemaNode } from "@kubb/ast";
|
|
4
4
|
|
|
5
5
|
//#region src/mocks.d.ts
|
|
@@ -199,9 +199,9 @@ declare const diagnosticCode: {
|
|
|
199
199
|
*/
|
|
200
200
|
readonly invalidPluginOptions: "KUBB_INVALID_PLUGIN_OPTIONS";
|
|
201
201
|
/**
|
|
202
|
-
* A post-generate
|
|
202
|
+
* A post-generate command (`output.postGenerate`) exited with a failure.
|
|
203
203
|
*/
|
|
204
|
-
readonly
|
|
204
|
+
readonly postGenerateFailed: "KUBB_POST_GENERATE_FAILED";
|
|
205
205
|
/**
|
|
206
206
|
* The formatter pass over the generated files failed.
|
|
207
207
|
*/
|
|
@@ -453,24 +453,6 @@ type UpdateDiagnostic = {
|
|
|
453
453
|
* timing, or an {@link UpdateDiagnostic} for a version notice.
|
|
454
454
|
*/
|
|
455
455
|
type Diagnostic = ProblemDiagnostic | PerformanceDiagnostic | UpdateDiagnostic;
|
|
456
|
-
/**
|
|
457
|
-
* Maps each {@link DiagnosticCode} to the variant it selects, for {@link narrow}.
|
|
458
|
-
* Every {@link ProblemCode} selects a {@link ProblemDiagnostic}, and the two bookkeeping codes
|
|
459
|
-
* select their own variant.
|
|
460
|
-
*/
|
|
461
|
-
type DiagnosticByCode = Record<ProblemCode, ProblemDiagnostic> & Record<typeof diagnosticCode.performance, PerformanceDiagnostic> & Record<typeof diagnosticCode.updateAvailable, UpdateDiagnostic>;
|
|
462
|
-
/**
|
|
463
|
-
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
464
|
-
*
|
|
465
|
-
* @example
|
|
466
|
-
* ```ts
|
|
467
|
-
* const update = narrow(diagnostic, diagnosticCode.updateAvailable)
|
|
468
|
-
* if (update) {
|
|
469
|
-
* console.log(update.latestVersion)
|
|
470
|
-
* }
|
|
471
|
-
* ```
|
|
472
|
-
*/
|
|
473
|
-
declare function narrow<C extends DiagnosticCode>(diagnostic: Diagnostic, code: C): DiagnosticByCode[C] | null;
|
|
474
456
|
/**
|
|
475
457
|
* A {@link Diagnostic} reduced to its JSON-safe fields plus a `docsUrl`, for
|
|
476
458
|
* machine-readable output (the `--reporter json` report, the MCP tools). Drops the
|
|
@@ -517,7 +499,7 @@ declare class Diagnostics {
|
|
|
517
499
|
readonly adapterRequired: "KUBB_ADAPTER_REQUIRED";
|
|
518
500
|
readonly pathTraversal: "KUBB_PATH_TRAVERSAL";
|
|
519
501
|
readonly invalidPluginOptions: "KUBB_INVALID_PLUGIN_OPTIONS";
|
|
520
|
-
readonly
|
|
502
|
+
readonly postGenerateFailed: "KUBB_POST_GENERATE_FAILED";
|
|
521
503
|
readonly formatFailed: "KUBB_FORMAT_FAILED";
|
|
522
504
|
readonly lintFailed: "KUBB_LINT_FAILED";
|
|
523
505
|
readonly performance: "KUBB_PERFORMANCE";
|
|
@@ -535,10 +517,6 @@ declare class Diagnostics {
|
|
|
535
517
|
* Type guard for a per-plugin {@link PerformanceDiagnostic}.
|
|
536
518
|
*/
|
|
537
519
|
static isPerformance: (diagnostic: Diagnostic) => diagnostic is PerformanceDiagnostic;
|
|
538
|
-
/**
|
|
539
|
-
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
540
|
-
*/
|
|
541
|
-
static narrow: typeof narrow;
|
|
542
520
|
/**
|
|
543
521
|
* An `Error` that carries a {@link Diagnostic}, so structured problems can flow
|
|
544
522
|
* through the existing throw/catch paths while keeping their code and location.
|
|
@@ -1535,13 +1513,6 @@ type NormalizedPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptio
|
|
|
1535
1513
|
resolver: TOptions['resolver'];
|
|
1536
1514
|
macros?: Array<Macro>;
|
|
1537
1515
|
generators?: Array<Generator>;
|
|
1538
|
-
/**
|
|
1539
|
-
* Set by the driver when the plugin registers a generator via `addGenerator()` in
|
|
1540
|
-
* `kubb:plugin:setup`. Drives whether the build walks the AST for this plugin.
|
|
1541
|
-
*/
|
|
1542
|
-
hasHookGenerators?: boolean;
|
|
1543
|
-
apply?: (config: Config) => boolean;
|
|
1544
|
-
version?: string;
|
|
1545
1516
|
};
|
|
1546
1517
|
type KubbPluginStartContext = {
|
|
1547
1518
|
plugin: NormalizedPlugin;
|
|
@@ -2125,6 +2096,14 @@ type ExtractRegistryKey<T, K extends PropertyKey> = K extends keyof T ? T[K] : {
|
|
|
2125
2096
|
* ```
|
|
2126
2097
|
*/
|
|
2127
2098
|
type Input = string | Record<string, unknown>;
|
|
2099
|
+
/**
|
|
2100
|
+
* A post-generate step: a shell command string, or an object that pairs the command with a `name`
|
|
2101
|
+
* shown in the CLI output. Steps run in sequence after the generated files are formatted and linted.
|
|
2102
|
+
*/
|
|
2103
|
+
type PostGenerateCommand = string | {
|
|
2104
|
+
name?: string;
|
|
2105
|
+
command: string;
|
|
2106
|
+
};
|
|
2128
2107
|
/**
|
|
2129
2108
|
* Resolved build configuration for a Kubb run: what to generate from (adapter, input), where to
|
|
2130
2109
|
* write it (output), how (plugins), and the runtime pieces (parsers, storage). See
|
|
@@ -2238,6 +2217,18 @@ type Config<TInput = Input> = {
|
|
|
2238
2217
|
* ```
|
|
2239
2218
|
*/
|
|
2240
2219
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
2220
|
+
/**
|
|
2221
|
+
* Shell commands to run after the generated files are formatted and linted, for post-processing
|
|
2222
|
+
* such as a type check or a custom script. Steps run in sequence from the `root` directory. Pass
|
|
2223
|
+
* a plain command string, or `{ name, command }` to label the step in the CLI output.
|
|
2224
|
+
*
|
|
2225
|
+
* @example
|
|
2226
|
+
* ```ts
|
|
2227
|
+
* postGenerate: ['npm run typecheck']
|
|
2228
|
+
* postGenerate: [{ name: 'types', command: 'npm run typecheck' }, 'biome check --write ./src/gen']
|
|
2229
|
+
* ```
|
|
2230
|
+
*/
|
|
2231
|
+
postGenerate?: Array<PostGenerateCommand>;
|
|
2241
2232
|
/**
|
|
2242
2233
|
* Banner prepended to every generated file. `'simple'` is the basic Kubb notice, `'full'` adds
|
|
2243
2234
|
* source, title, description, and API version, and `false` omits it.
|
|
@@ -2288,35 +2279,6 @@ type Config<TInput = Input> = {
|
|
|
2288
2279
|
* ```
|
|
2289
2280
|
*/
|
|
2290
2281
|
plugins: Array<Plugin>;
|
|
2291
|
-
/**
|
|
2292
|
-
* Lifecycle hooks that run external tools (prettier, eslint, a custom script) at points in the build.
|
|
2293
|
-
*
|
|
2294
|
-
* Currently supports the `done` hook, which fires after all plugins complete.
|
|
2295
|
-
*
|
|
2296
|
-
* @example
|
|
2297
|
-
* ```ts
|
|
2298
|
-
* hooks: {
|
|
2299
|
-
* done: 'prettier --write "./src/gen"', // auto-format generated files
|
|
2300
|
-
* // or multiple commands:
|
|
2301
|
-
* done: ['prettier --write "./src/gen"', 'eslint --fix "./src/gen"']
|
|
2302
|
-
* }
|
|
2303
|
-
* ```
|
|
2304
|
-
*/
|
|
2305
|
-
hooks?: {
|
|
2306
|
-
/**
|
|
2307
|
-
* Command(s) to run after all plugins finish generating, for post-processing the output.
|
|
2308
|
-
*
|
|
2309
|
-
* Pass a single command string, or an array to run them in sequence.
|
|
2310
|
-
* Commands run relative to the `root` directory.
|
|
2311
|
-
*
|
|
2312
|
-
* @example
|
|
2313
|
-
* ```ts
|
|
2314
|
-
* done: 'prettier --write "./src/gen"'
|
|
2315
|
-
* done: ['prettier --write "./src/gen"', 'eslint --fix "./src/gen"']
|
|
2316
|
-
* ```
|
|
2317
|
-
*/
|
|
2318
|
-
done?: string | Array<string>;
|
|
2319
|
-
};
|
|
2320
2282
|
/**
|
|
2321
2283
|
* The reporters available to the run, registered as instances. The host
|
|
2322
2284
|
* (the CLI via `--reporter`) selects which ones to trigger by `name` with {@link selectReporters}.
|
|
@@ -2700,6 +2662,10 @@ type KubbHookStartContext = {
|
|
|
2700
2662
|
* The shell command that is about to run.
|
|
2701
2663
|
*/
|
|
2702
2664
|
command: string;
|
|
2665
|
+
/**
|
|
2666
|
+
* Optional label for the command, shown in the CLI output when set.
|
|
2667
|
+
*/
|
|
2668
|
+
name?: string;
|
|
2703
2669
|
/**
|
|
2704
2670
|
* Parsed argument list, when available.
|
|
2705
2671
|
*/
|
|
@@ -2728,6 +2694,10 @@ type KubbHookEndContext = {
|
|
|
2728
2694
|
* The shell command that ran.
|
|
2729
2695
|
*/
|
|
2730
2696
|
command: string;
|
|
2697
|
+
/**
|
|
2698
|
+
* Optional label for the command, shown in the CLI output when set.
|
|
2699
|
+
*/
|
|
2700
|
+
name?: string;
|
|
2731
2701
|
/**
|
|
2732
2702
|
* Parsed argument list, when available.
|
|
2733
2703
|
*/
|
|
@@ -2811,5 +2781,5 @@ type BuildOutput = {
|
|
|
2811
2781
|
storage: Storage;
|
|
2812
2782
|
};
|
|
2813
2783
|
//#endregion
|
|
2814
|
-
export {
|
|
2815
|
-
//# sourceMappingURL=types-
|
|
2784
|
+
export { ResolveBannerContext as $, Generator as A, ProblemCode as At, Include as B, KubbWarnContext as C, Diagnostic as Ct, CreateKubbOptions as D, DiagnosticSeverity as Dt, UserConfig as E, DiagnosticLocation as Et, Parser as F, Adapter as Ft, Output as G, KubbPluginSetupContext as H, defineParser as I, AdapterFactoryOptions as It, Override as J, OutputMode as K, Exclude$1 as L, AdapterSource as Lt, defineGenerator as M, SerializedDiagnostic as Mt, KubbDriver as N, UpdateDiagnostic as Nt, Kubb$1 as O, Diagnostics as Ot, FileManagerHooks as P, Hookable as Pt, BannerMeta as Q, Filter as R, createAdapter as Rt, KubbSuccessContext as S, logLevel as St, PostGenerateCommand as T, DiagnosticKind as Tt, KubbPluginStartContext as U, KubbPluginEndContext as V, NormalizedPlugin as W, PluginFactoryOptions as X, Plugin as Y, definePlugin as Z, KubbHookStartContext as _, Reporter as _t, KubbBuildEndContext as a, ResolverDefault as at, KubbLifecycleStartContext as b, UserReporter as bt, KubbErrorContext as c, ResolverFilePathParams as ct, KubbFilesProcessingStartContext as d, Renderer as dt, ResolveBannerFile as et, KubbFilesProcessingUpdateContext as f, RendererFactory as ft, KubbHookLineContext as g, GenerationResult as gt, KubbHookEndContext as h, createStorage as ht, Input as i, Resolver as it, GeneratorContext as j, ProblemDiagnostic as jt, createKubb as k, PerformanceDiagnostic as kt, KubbFileProcessingUpdate as l, ResolverPatch as lt, KubbGenerationStartContext as m, Storage as mt, CLIOptions as n, ResolveOptionsContext as nt, KubbBuildStartContext as o, ResolverFile as ot, KubbGenerationEndContext as p, createRenderer as pt, OutputOptions as q, Config as r, ResolvePathOptions as rt, KubbDiagnosticContext as s, ResolverFileParams as st, BuildOutput as t, ResolveFileOptions as tt, KubbFilesProcessingEndContext as u, ResolverPathParams as ut, KubbHooks as v, ReporterContext as vt, PossibleConfig as w, DiagnosticDoc as wt, KubbPluginsEndContext as x, createReporter as xt, KubbInfoContext as y, ReporterName as yt, Group as z };
|
|
2785
|
+
//# sourceMappingURL=types-BLFyAJLZ.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.93",
|
|
4
4
|
"description": "Core engine for Kubb. Provides the plugin driver, file manager and build orchestration used by every Kubb plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-generator",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"registry": "https://registry.npmjs.org/"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@kubb/ast": "5.0.0-beta.
|
|
58
|
+
"@kubb/ast": "5.0.0-beta.93"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@internals/utils": "0.0.0"
|