@kubb/core 5.0.0-beta.91 → 5.0.0-beta.94
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 +17 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -34
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +5 -7
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +7 -9
- package/dist/mocks.js.map +1 -1
- package/dist/{types-aNebW3Ui.d.ts → types-DF9c3DGO.d.ts} +42 -68
- package/dist/usingCtx-BriKju-v.js.map +1 -1
- package/dist/usingCtx-eyNeehd2.cjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -192,7 +192,7 @@ function memoize(store, factory) {
|
|
|
192
192
|
}
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region package.json
|
|
195
|
-
var version = "5.0.0-beta.
|
|
195
|
+
var version = "5.0.0-beta.94";
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region src/constants.ts
|
|
198
198
|
/**
|
|
@@ -274,9 +274,9 @@ const diagnosticCode = {
|
|
|
274
274
|
*/
|
|
275
275
|
invalidPluginOptions: "KUBB_INVALID_PLUGIN_OPTIONS",
|
|
276
276
|
/**
|
|
277
|
-
* A post-generate
|
|
277
|
+
* A post-generate command (`output.postGenerate`) exited with a failure.
|
|
278
278
|
*/
|
|
279
|
-
|
|
279
|
+
postGenerateFailed: "KUBB_POST_GENERATE_FAILED",
|
|
280
280
|
/**
|
|
281
281
|
* The formatter pass over the generated files failed.
|
|
282
282
|
*/
|
|
@@ -301,20 +301,6 @@ const diagnosticCode = {
|
|
|
301
301
|
*/
|
|
302
302
|
const docsMajor = version.split(".")[0] ?? "5";
|
|
303
303
|
/**
|
|
304
|
-
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
305
|
-
*
|
|
306
|
-
* @example
|
|
307
|
-
* ```ts
|
|
308
|
-
* const update = narrow(diagnostic, diagnosticCode.updateAvailable)
|
|
309
|
-
* if (update) {
|
|
310
|
-
* console.log(update.latestVersion)
|
|
311
|
-
* }
|
|
312
|
-
* ```
|
|
313
|
-
*/
|
|
314
|
-
function narrow(diagnostic, code) {
|
|
315
|
-
return diagnostic.code === code ? diagnostic : null;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
304
|
* Builds a type guard that narrows a {@link Diagnostic} to the variant for `kind`. A diagnostic
|
|
319
305
|
* with no `kind` is treated as a `problem`.
|
|
320
306
|
*/
|
|
@@ -436,9 +422,9 @@ const diagnosticCatalog = {
|
|
|
436
422
|
cause: "A plugin was configured with options that cannot be honored, for example `output.mode: 'file'` paired with a `group` option.",
|
|
437
423
|
fix: "Fix the plugin options. A single-file output has nothing to group, so remove the `group` option or use `output.mode: 'directory'`."
|
|
438
424
|
},
|
|
439
|
-
[diagnosticCode.
|
|
440
|
-
title: "
|
|
441
|
-
cause: "A post-generate
|
|
425
|
+
[diagnosticCode.postGenerateFailed]: {
|
|
426
|
+
title: "Post-generate command failed",
|
|
427
|
+
cause: "A post-generate command (`output.postGenerate`) exited with a non-zero status.",
|
|
442
428
|
fix: "Check the command is installed and correct, and run it manually to see the error."
|
|
443
429
|
},
|
|
444
430
|
[diagnosticCode.formatFailed]: {
|
|
@@ -490,10 +476,6 @@ var Diagnostics = class Diagnostics {
|
|
|
490
476
|
*/
|
|
491
477
|
static isPerformance = isPerformance;
|
|
492
478
|
/**
|
|
493
|
-
* Narrows a {@link Diagnostic} to the variant for `code`, or `null` when it does not match.
|
|
494
|
-
*/
|
|
495
|
-
static narrow = narrow;
|
|
496
|
-
/**
|
|
497
479
|
* An `Error` that carries a {@link Diagnostic}, so structured problems can flow
|
|
498
480
|
* through the existing throw/catch paths while keeping their code and location.
|
|
499
481
|
*
|
|
@@ -1321,7 +1303,8 @@ var KubbDriver = class {
|
|
|
1321
1303
|
},
|
|
1322
1304
|
exclude: [],
|
|
1323
1305
|
override: []
|
|
1324
|
-
}
|
|
1306
|
+
},
|
|
1307
|
+
resolver: this.#getDefaultResolver(rawPlugin.name)
|
|
1325
1308
|
};
|
|
1326
1309
|
}));
|
|
1327
1310
|
for (const plugin of normalized) {
|
|
@@ -2161,10 +2144,10 @@ const logLevel = {
|
|
|
2161
2144
|
verbose: 4
|
|
2162
2145
|
};
|
|
2163
2146
|
/**
|
|
2164
|
-
* Defines a reporter.
|
|
2165
|
-
*
|
|
2166
|
-
*
|
|
2167
|
-
*
|
|
2147
|
+
* Defines a reporter. The returned reporter buffers each value `report` returns in order and, when
|
|
2148
|
+
* the definition has a `drain`, hands the array to `drain` once and then clears it. Wiring the
|
|
2149
|
+
* reporter onto the run's hooks is the host's job, so the reporter only ever deals with a
|
|
2150
|
+
* {@link GenerationResult}.
|
|
2168
2151
|
*
|
|
2169
2152
|
* @example
|
|
2170
2153
|
* ```ts
|
|
@@ -2182,19 +2165,19 @@ const logLevel = {
|
|
|
2182
2165
|
* ```
|
|
2183
2166
|
*/
|
|
2184
2167
|
function createReporter(reporter) {
|
|
2185
|
-
const reports =
|
|
2168
|
+
const reports = [];
|
|
2186
2169
|
return {
|
|
2187
2170
|
name: reporter.name,
|
|
2188
2171
|
async report(result, context) {
|
|
2189
2172
|
const report = await reporter.report(result, context);
|
|
2190
|
-
reports.
|
|
2173
|
+
if (reporter.drain) reports.push(report);
|
|
2191
2174
|
},
|
|
2192
2175
|
async drain(context) {
|
|
2193
|
-
await reporter.drain?.(context,
|
|
2194
|
-
reports.
|
|
2176
|
+
await reporter.drain?.(context, [...reports]);
|
|
2177
|
+
reports.length = 0;
|
|
2195
2178
|
},
|
|
2196
2179
|
[Symbol.dispose]() {
|
|
2197
|
-
reports.
|
|
2180
|
+
reports.length = 0;
|
|
2198
2181
|
}
|
|
2199
2182
|
};
|
|
2200
2183
|
}
|