@kubb/core 5.10.1 → 5.10.3
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/{Hookable-ZX2OqaPh.js → Hookable-BsWZ8pHO.js} +427 -323
- package/dist/Hookable-BsWZ8pHO.js.map +1 -0
- package/dist/Hookable-C4S0gBso.cjs +3030 -0
- package/dist/Hookable-C4S0gBso.cjs.map +1 -0
- package/dist/{Hookable-BnYDebfN.cjs → Hookable-pvEb-nN9.cjs} +418 -321
- package/dist/Hookable-pvEb-nN9.cjs.map +1 -0
- package/dist/{createAdapter-D55JE9lX.d.ts → createAdapter-B5kKMsWV.d.cts} +851 -732
- package/dist/createAdapter-B5kKMsWV.d.ts +3147 -0
- package/dist/index.cjs +31 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +620 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +31 -19
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.d.cts +107 -0
- package/dist/mocks.d.ts +1 -2
- package/dist/mocks.js +1 -2
- package/dist/mocks.js.map +1 -1
- package/package.json +26 -8
- package/dist/Hookable-BnYDebfN.cjs.map +0 -1
- package/dist/Hookable-ZX2OqaPh.js.map +0 -1
- package/dist/rolldown-runtime-CRm0XQPb.js +0 -9
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_Hookable = require("./Hookable-
|
|
2
|
+
const require_Hookable = require("./Hookable-pvEb-nN9.cjs");
|
|
3
3
|
let verkit = require("verkit");
|
|
4
|
-
let node_util = require("node:util");
|
|
5
4
|
let node_process = require("node:process");
|
|
6
5
|
node_process = require_Hookable.__toESM(node_process, 1);
|
|
7
6
|
let tinyexec = require("tinyexec");
|
|
8
7
|
let node_fs_promises = require("node:fs/promises");
|
|
9
8
|
let node_path = require("node:path");
|
|
10
9
|
node_path = require_Hookable.__toESM(node_path, 1);
|
|
10
|
+
let node_util = require("node:util");
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
12
12
|
let node_fs = require("node:fs");
|
|
13
13
|
let node_os = require("node:os");
|
|
@@ -635,7 +635,11 @@ var Kubb = class {
|
|
|
635
635
|
return this.config.storage;
|
|
636
636
|
}
|
|
637
637
|
get driver() {
|
|
638
|
-
if (!this.#driver) throw new Error(
|
|
638
|
+
if (!this.#driver) throw new require_Hookable.Diagnostics.Error({
|
|
639
|
+
code: require_Hookable.Diagnostics.code.internalError,
|
|
640
|
+
severity: "error",
|
|
641
|
+
message: "[kubb] setup() must be called before accessing driver"
|
|
642
|
+
});
|
|
639
643
|
return this.#driver;
|
|
640
644
|
}
|
|
641
645
|
/**
|
|
@@ -723,19 +727,23 @@ var Kubb = class {
|
|
|
723
727
|
const { hooks, config } = this;
|
|
724
728
|
const hrStart = process.hrtime();
|
|
725
729
|
await hooks.callHook("kubb:generation:start", { config });
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
if (
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
730
|
+
let output;
|
|
731
|
+
try {
|
|
732
|
+
await hooks.callHook("kubb:setup:start");
|
|
733
|
+
await this.setup();
|
|
734
|
+
await hooks.callHook("kubb:setup:end");
|
|
735
|
+
output = await this.safeBuild();
|
|
736
|
+
} catch (caughtError) {
|
|
737
|
+
if (signal?.aborted) throw caughtError;
|
|
738
|
+
output = {
|
|
739
|
+
files: [],
|
|
740
|
+
diagnostics: [require_Hookable.Diagnostics.from(caughtError)]
|
|
741
|
+
};
|
|
738
742
|
}
|
|
743
|
+
const { files, diagnostics } = output;
|
|
744
|
+
const storage = this.storage;
|
|
745
|
+
signal?.throwIfAborted();
|
|
746
|
+
for (const diagnostic of diagnostics) if (require_Hookable.Diagnostics.isProblem(diagnostic)) await require_Hookable.Diagnostics.emit(hooks, diagnostic);
|
|
739
747
|
if (require_Hookable.Diagnostics.hasError(diagnostics)) {
|
|
740
748
|
await hooks.callHook("kubb:generation:end", {
|
|
741
749
|
config,
|
|
@@ -876,7 +884,7 @@ function buildReport(result) {
|
|
|
876
884
|
name: config.name ?? "",
|
|
877
885
|
status,
|
|
878
886
|
plugins: {
|
|
879
|
-
passed: total - failed.length,
|
|
887
|
+
passed: status === "failed" && timings.length === 0 ? 0 : total - failed.length,
|
|
880
888
|
failed,
|
|
881
889
|
total
|
|
882
890
|
},
|
|
@@ -898,7 +906,12 @@ function buildReport(result) {
|
|
|
898
906
|
function formatSummary(report, { showTimings }) {
|
|
899
907
|
const { status, plugins, counts, filesCreated, durationMs, output, timings } = report;
|
|
900
908
|
const rows = [];
|
|
901
|
-
|
|
909
|
+
const notRun = plugins.total - plugins.passed - plugins.failed.length;
|
|
910
|
+
rows.push(["Plugins", status === "success" ? `${(0, node_util.styleText)("green", `${plugins.passed} passed`)} (${plugins.total})` : [
|
|
911
|
+
(0, node_util.styleText)("green", `${plugins.passed} passed`),
|
|
912
|
+
(0, node_util.styleText)("red", `${plugins.failed.length} failed`),
|
|
913
|
+
notRun > 0 ? (0, node_util.styleText)("dim", `${notRun} not run`) : void 0
|
|
914
|
+
].filter(Boolean).join(" | ") + ` (${plugins.total})`]);
|
|
902
915
|
if (status === "failed" && plugins.failed.length > 0) rows.push(["Failed", plugins.failed.map((name) => (0, node_util.styleText)("red", name)).join(", ")]);
|
|
903
916
|
if (counts.errors > 0 || counts.warnings > 0) {
|
|
904
917
|
const issues = [counts.errors > 0 ? (0, node_util.styleText)("red", `${counts.errors} ${counts.errors === 1 ? "error" : "errors"}`) : void 0, counts.warnings > 0 ? (0, node_util.styleText)("yellow", `${counts.warnings} ${counts.warnings === 1 ? "warning" : "warnings"}`) : void 0].filter(Boolean).join(" | ");
|
|
@@ -1014,7 +1027,7 @@ function buildProblemSection(diagnostics) {
|
|
|
1014
1027
|
return [
|
|
1015
1028
|
"## Problems",
|
|
1016
1029
|
"",
|
|
1017
|
-
problems.map((diagnostic) => require_Hookable.Diagnostics.
|
|
1030
|
+
problems.map((diagnostic) => require_Hookable.Diagnostics.format(diagnostic, { verbose: true }).join("\n")).join("\n\n")
|
|
1018
1031
|
];
|
|
1019
1032
|
}
|
|
1020
1033
|
/**
|