@kubb/cli 4.32.4 → 4.33.1
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/agent-Bd1QdPVV.cjs +91 -0
- package/dist/agent-Bd1QdPVV.cjs.map +1 -0
- package/dist/agent-D83d9Pud.cjs +60 -0
- package/dist/agent-D83d9Pud.cjs.map +1 -0
- package/dist/agent-DgKQXSmR.js +57 -0
- package/dist/agent-DgKQXSmR.js.map +1 -0
- package/dist/agent-u_Ehwz6r.js +87 -0
- package/dist/agent-u_Ehwz6r.js.map +1 -0
- package/dist/constants-BTUap0zs.cjs +108 -0
- package/dist/constants-BTUap0zs.cjs.map +1 -0
- package/dist/constants-CM3dJzjK.js +67 -0
- package/dist/constants-CM3dJzjK.js.map +1 -0
- package/dist/define--M_JMcDC.js +25 -0
- package/dist/define--M_JMcDC.js.map +1 -0
- package/dist/define-D6Kfm7-Z.cjs +36 -0
- package/dist/define-D6Kfm7-Z.cjs.map +1 -0
- package/dist/errors-6mF_WKxg.js +27 -0
- package/dist/errors-6mF_WKxg.js.map +1 -0
- package/dist/errors-DBW0N9w4.cjs +44 -0
- package/dist/errors-DBW0N9w4.cjs.map +1 -0
- package/dist/generate-Bn8n4w1O.cjs +65 -0
- package/dist/generate-Bn8n4w1O.cjs.map +1 -0
- package/dist/{generate-CpWtSc45.js → generate-CAsV9wSx.js} +656 -689
- package/dist/generate-CAsV9wSx.js.map +1 -0
- package/dist/generate-D-59YK0L.js +66 -0
- package/dist/generate-D-59YK0L.js.map +1 -0
- package/dist/{generate-COj0aMS6.cjs → generate-JC65igQh.cjs} +662 -694
- package/dist/generate-JC65igQh.cjs.map +1 -0
- package/dist/index.cjs +226 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +226 -35
- package/dist/index.js.map +1 -1
- package/dist/init-C-InrmSY.js +302 -0
- package/dist/init-C-InrmSY.js.map +1 -0
- package/dist/init-CXP8OfMe.js +25 -0
- package/dist/init-CXP8OfMe.js.map +1 -0
- package/dist/init-CbeE-L-0.cjs +25 -0
- package/dist/init-CbeE-L-0.cjs.map +1 -0
- package/dist/init-hmolV6B4.cjs +306 -0
- package/dist/init-hmolV6B4.cjs.map +1 -0
- package/dist/jiti-Cd3S0xwr.cjs +16 -0
- package/dist/jiti-Cd3S0xwr.cjs.map +1 -0
- package/dist/jiti-e08mD2Ph.js +11 -0
- package/dist/jiti-e08mD2Ph.js.map +1 -0
- package/dist/mcp-BDxg2oJm.cjs +16 -0
- package/dist/mcp-BDxg2oJm.cjs.map +1 -0
- package/dist/mcp-ChHFPRzD.cjs +42 -0
- package/dist/mcp-ChHFPRzD.cjs.map +1 -0
- package/dist/mcp-D2SHEg_d.js +41 -0
- package/dist/mcp-D2SHEg_d.js.map +1 -0
- package/dist/mcp-MSoE4vNA.js +16 -0
- package/dist/mcp-MSoE4vNA.js.map +1 -0
- package/dist/{package-aNQWvWbS.cjs → package-CUVyeIbt.cjs} +2 -2
- package/dist/package-CUVyeIbt.cjs.map +1 -0
- package/dist/package-Cbd8OC6q.js +6 -0
- package/dist/package-Cbd8OC6q.js.map +1 -0
- package/dist/shell-7HPrTCJ5.cjs +57 -0
- package/dist/shell-7HPrTCJ5.cjs.map +1 -0
- package/dist/shell-DqqWsHCD.js +46 -0
- package/dist/shell-DqqWsHCD.js.map +1 -0
- package/dist/{telemetry-BDSSqUiG.cjs → telemetry-Cn9X1I5B.cjs} +79 -9
- package/dist/telemetry-Cn9X1I5B.cjs.map +1 -0
- package/dist/{telemetry-DYWvlxqs.js → telemetry-DxiR7clS.js} +63 -11
- package/dist/telemetry-DxiR7clS.js.map +1 -0
- package/dist/validate-BG8A3aQS.cjs +25 -0
- package/dist/validate-BG8A3aQS.cjs.map +1 -0
- package/dist/validate-BZ1UFkwA.js +25 -0
- package/dist/validate-BZ1UFkwA.js.map +1 -0
- package/dist/validate-Bbrn3Q-A.cjs +42 -0
- package/dist/validate-Bbrn3Q-A.cjs.map +1 -0
- package/dist/validate-l8vLmwKA.js +41 -0
- package/dist/validate-l8vLmwKA.js.map +1 -0
- package/package.json +6 -6
- package/src/commands/agent/start.ts +27 -136
- package/src/commands/agent.ts +6 -25
- package/src/commands/generate.ts +26 -158
- package/src/commands/init.ts +9 -360
- package/src/commands/mcp.ts +7 -52
- package/src/commands/validate.ts +9 -60
- package/src/constants.ts +76 -0
- package/src/index.ts +36 -42
- package/src/loggers/clackLogger.ts +65 -165
- package/src/loggers/fileSystemLogger.ts +2 -14
- package/src/loggers/githubActionsLogger.ts +58 -125
- package/src/loggers/plainLogger.ts +44 -92
- package/src/loggers/utils.ts +67 -4
- package/src/runners/agent.ts +100 -0
- package/src/runners/generate.ts +223 -102
- package/src/runners/init.ts +323 -0
- package/src/runners/mcp.ts +32 -0
- package/src/runners/validate.ts +35 -0
- package/src/utils/Writables.ts +2 -2
- package/src/utils/executeHooks.ts +20 -8
- package/src/utils/getCosmiConfig.ts +10 -11
- package/src/utils/getIntro.ts +1 -81
- package/src/utils/getSummary.ts +12 -17
- package/src/utils/jiti.ts +9 -0
- package/src/utils/packageManager.ts +4 -4
- package/src/utils/runHook.ts +75 -0
- package/src/utils/telemetry.ts +8 -26
- package/src/utils/watcher.ts +2 -4
- package/dist/agent-6COck3B9.cjs +0 -20
- package/dist/agent-6COck3B9.cjs.map +0 -1
- package/dist/agent-DMm6c5Vg.js +0 -20
- package/dist/agent-DMm6c5Vg.js.map +0 -1
- package/dist/generate-COj0aMS6.cjs.map +0 -1
- package/dist/generate-CpWtSc45.js.map +0 -1
- package/dist/init-Bdn3_qir.js +0 -304
- package/dist/init-Bdn3_qir.js.map +0 -1
- package/dist/init-CFW2kWY8.cjs +0 -308
- package/dist/init-CFW2kWY8.cjs.map +0 -1
- package/dist/mcp-DkwtARfo.cjs +0 -57
- package/dist/mcp-DkwtARfo.cjs.map +0 -1
- package/dist/mcp-DrH93Vq4.js +0 -57
- package/dist/mcp-DrH93Vq4.js.map +0 -1
- package/dist/package-BnJbGmLm.js +0 -6
- package/dist/package-BnJbGmLm.js.map +0 -1
- package/dist/package-aNQWvWbS.cjs.map +0 -1
- package/dist/start-CqTUu14n.js +0 -131
- package/dist/start-CqTUu14n.js.map +0 -1
- package/dist/start-D-rsIJGo.cjs +0 -134
- package/dist/start-D-rsIJGo.cjs.map +0 -1
- package/dist/telemetry-BDSSqUiG.cjs.map +0 -1
- package/dist/telemetry-DYWvlxqs.js.map +0 -1
- package/dist/validate-BlV8L8gC.js +0 -66
- package/dist/validate-BlV8L8gC.js.map +0 -1
- package/dist/validate-COhZUXF8.cjs +0 -66
- package/dist/validate-COhZUXF8.cjs.map +0 -1
- package/src/loggers/envDetection.ts +0 -28
- package/src/loggers/index.ts +0 -5
- package/src/utils/formatMsWithColor.ts +0 -22
- package/src/utils/randomColor.ts +0 -23
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
+
//#region ../../internals/utils/src/errors.ts
|
|
3
|
+
/**
|
|
4
|
+
* Coerces an unknown thrown value to an `Error` instance.
|
|
5
|
+
* When the value is already an `Error` it is returned as-is;
|
|
6
|
+
* otherwise a new `Error` is created whose message is `String(value)`.
|
|
7
|
+
*/
|
|
8
|
+
function toError(value) {
|
|
9
|
+
return value instanceof Error ? value : new Error(String(value));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Safely extracts a human-readable message from any thrown value.
|
|
13
|
+
*/
|
|
14
|
+
function getErrorMessage(value) {
|
|
15
|
+
return value instanceof Error ? value.message : String(value);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extracts the `.cause` of an `Error` as an `Error | undefined`.
|
|
19
|
+
* Returns `undefined` when the cause is absent or is not an `Error`.
|
|
20
|
+
*/
|
|
21
|
+
function toCause(error) {
|
|
22
|
+
return error.cause instanceof Error ? error.cause : void 0;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
Object.defineProperty(exports, "getErrorMessage", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return getErrorMessage;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "toCause", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function() {
|
|
34
|
+
return toCause;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "toError", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function() {
|
|
40
|
+
return toError;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=errors-DBW0N9w4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-DBW0N9w4.cjs","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/** Thrown when a plugin's configuration or input fails validation. */\nexport class ValidationPluginError extends Error {}\n\n/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * When the value is already an `Error` it is returned as-is;\n * otherwise a new `Error` is created whose message is `String(value)`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Safely extracts a human-readable message from any thrown value.\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error | undefined`.\n * Returns `undefined` when the cause is absent or is not an `Error`.\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,QAAQ,OAAuB;AAC7C,QAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;AAMlE,SAAgB,gBAAgB,OAAwB;AACtD,QAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;;;;;AAO/D,SAAgB,QAAQ,OAAiC;AACvD,QAAO,MAAM,iBAAiB,QAAQ,MAAM,QAAQ,KAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
+
//#region src/commands/generate.ts
|
|
3
|
+
const command = require("./define-D6Kfm7-Z.cjs").defineCommand({
|
|
4
|
+
name: "generate",
|
|
5
|
+
description: "[input] Generate files based on a 'kubb.config.ts' file",
|
|
6
|
+
arguments: ["[input]"],
|
|
7
|
+
options: {
|
|
8
|
+
config: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Path to the Kubb config",
|
|
11
|
+
short: "c"
|
|
12
|
+
},
|
|
13
|
+
logLevel: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "Info, silent, verbose or debug",
|
|
16
|
+
short: "l",
|
|
17
|
+
default: "info",
|
|
18
|
+
hint: "silent|info|verbose|debug",
|
|
19
|
+
enum: [
|
|
20
|
+
"silent",
|
|
21
|
+
"info",
|
|
22
|
+
"verbose",
|
|
23
|
+
"debug"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
watch: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
description: "Watch mode based on the input file",
|
|
29
|
+
short: "w",
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
debug: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Override logLevel to debug",
|
|
35
|
+
short: "d",
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
verbose: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Override logLevel to verbose",
|
|
41
|
+
short: "v",
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
silent: {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description: "Override logLevel to silent",
|
|
47
|
+
short: "s",
|
|
48
|
+
default: false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
async run({ values, positionals }) {
|
|
52
|
+
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
53
|
+
const { runGenerateCommand } = await Promise.resolve().then(() => require("./generate-JC65igQh.cjs"));
|
|
54
|
+
await runGenerateCommand({
|
|
55
|
+
input: positionals[0],
|
|
56
|
+
configPath: values.config,
|
|
57
|
+
logLevel,
|
|
58
|
+
watch: values.watch
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.command = command;
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=generate-Bn8n4w1O.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-Bn8n4w1O.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\n name: 'generate',\n description: \"[input] Generate files based on a 'kubb.config.ts' file\",\n arguments: ['[input]'],\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },\n debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },\n verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },\n silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })\n },\n})\n"],"mappings":";;AAEA,MAAa,2CAAUA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GAAE,MAAM;GAAW,aAAa;GAAsC,OAAO;GAAK,SAAS;GAAO;EACzG,OAAO;GAAE,MAAM;GAAW,aAAa;GAA8B,OAAO;GAAK,SAAS;GAAO;EACjG,SAAS;GAAE,MAAM;GAAW,aAAa;GAAgC,OAAO;GAAK,SAAS;GAAO;EACrG,QAAQ;GAAE,MAAM;GAAW,aAAa;GAA+B,OAAO;GAAK,SAAS;GAAO;EACpG;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAErC,QAAM,mBAAmB;GAAE,OAAO,YAAY;GAAI,YAAY,OAAO;GAAQ;GAAU,OAAO,OAAO;GAAO,CAAC;;CAEhH,CAAC"}
|