@kubb/cli 5.0.0-beta.37 → 5.0.0-beta.38
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-DtuTV_Qk.cjs → agent-Bl8JwjMa.cjs} +2 -2
- package/dist/{agent-DtuTV_Qk.cjs.map → agent-Bl8JwjMa.cjs.map} +1 -1
- package/dist/{agent-B8oJFhcN.js → agent-CfZ_Uqde.js} +2 -2
- package/dist/{agent-B8oJFhcN.js.map → agent-CfZ_Uqde.js.map} +1 -1
- package/dist/{generate-BvaMqrBk.cjs → generate-Bgds6Zx3.cjs} +3 -4
- package/dist/generate-Bgds6Zx3.cjs.map +1 -0
- package/dist/{generate-CzTjeiji.js → generate-CfxFqNeb.js} +3 -4
- package/dist/{generate-CzTjeiji.js.map → generate-CfxFqNeb.js.map} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +6 -6
- package/dist/{init-C59u3T68.cjs → init-C5wnuzeK.cjs} +2 -2
- package/dist/{init-C59u3T68.cjs.map → init-C5wnuzeK.cjs.map} +1 -1
- package/dist/{init-CaMeuE1-.js → init-TIec3Dym.js} +2 -2
- package/dist/{init-CaMeuE1-.js.map → init-TIec3Dym.js.map} +1 -1
- package/dist/{mcp-D4NMV9lk.cjs → mcp-Cr753GW1.cjs} +2 -2
- package/dist/{mcp-D4NMV9lk.cjs.map → mcp-Cr753GW1.cjs.map} +1 -1
- package/dist/{mcp-Ca3ZcpKB.js → mcp-Damue5Mq.js} +2 -2
- package/dist/{mcp-Ca3ZcpKB.js.map → mcp-Damue5Mq.js.map} +1 -1
- package/dist/package-Cnt1K03J.js +6 -0
- package/dist/package-Cnt1K03J.js.map +1 -0
- package/dist/{package-DQFf9DB2.cjs → package-guApEHiW.cjs} +2 -2
- package/dist/package-guApEHiW.cjs.map +1 -0
- package/dist/{run-CK8Cvq6n.cjs → run-BFZtWpcW.cjs} +14 -12
- package/dist/run-BFZtWpcW.cjs.map +1 -0
- package/dist/{run-Ca2h07rN.js → run-C752fag9.js} +14 -12
- package/dist/run-C752fag9.js.map +1 -0
- package/dist/{validate-BEEerg2-.js → validate-CYTKdezO.js} +2 -2
- package/dist/{validate-BEEerg2-.js.map → validate-CYTKdezO.js.map} +1 -1
- package/dist/{validate-B_wfDSHQ.cjs → validate-DMzjP-hd.cjs} +2 -2
- package/dist/{validate-B_wfDSHQ.cjs.map → validate-DMzjP-hd.cjs.map} +1 -1
- package/package.json +6 -6
- package/src/commands/generate.ts +2 -3
- package/src/loggers/utils.ts +6 -0
- package/src/reporters/jsonReporter.ts +9 -4
- package/src/runners/generate/utils.ts +2 -2
- package/dist/generate-BvaMqrBk.cjs.map +0 -1
- package/dist/package-DQFf9DB2.cjs.map +0 -1
- package/dist/package-DUwUSFeL.js +0 -6
- package/dist/package-DUwUSFeL.js.map +0 -1
- package/dist/run-CK8Cvq6n.cjs.map +0 -1
- package/dist/run-Ca2h07rN.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
4
|
const require_constants = require("./constants-CAKUpLcQ.cjs");
|
|
5
5
|
//#region src/commands/agent/start.ts
|
|
6
6
|
const command$1 = require_define.defineCommand({
|
|
@@ -67,4 +67,4 @@ const command = require_define.defineCommand({
|
|
|
67
67
|
//#endregion
|
|
68
68
|
exports.command = command;
|
|
69
69
|
|
|
70
|
-
//# sourceMappingURL=agent-
|
|
70
|
+
//# sourceMappingURL=agent-Bl8JwjMa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-Bl8JwjMa.cjs","names":["command","defineCommand","agentDefaults","defineCommand","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description:\n 'Start the Kubb Agent HTTP server. Exposes a REST API that accepts a kubb.config.ts patch and returns generated code as a stream. Use --allow-write to also write files to disk.',\n examples: ['kubb agent start', 'kubb agent start --port 4000', 'kubb agent start --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config file',\n short: 'c',\n },\n port: {\n type: 'string',\n description: 'Port the HTTP server listens on',\n short: 'p',\n default: agentDefaults.port,\n },\n host: {\n type: 'string',\n description: 'Hostname the HTTP server binds to',\n default: agentDefaults.host,\n },\n 'allow-write': {\n type: 'boolean',\n description: 'Write generated files to the filesystem. When omitted, output is streamed only and no files are written.',\n default: false,\n },\n 'allow-all': {\n type: 'boolean',\n description: 'Grant all permissions (implies --allow-write).',\n default: false,\n },\n },\n async run({ values }) {\n const { run } = await import('../../runners/agent/run.ts')\n\n await run({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description:\n 'Manage the Kubb Agent — an HTTP server that lets AI agents trigger code generation programmatically via a REST API. Useful when an AI workflow needs to generate code without direct CLI access.',\n examples: ['kubb agent start', 'kubb agent start --port 4000 --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;AAIA,MAAaA,YAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAAgC;EAAkC;CAAwD;CACzJ,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAASC,kBAAAA,cAAc;EACzB;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAASA,kBAAAA,cAAc;EACzB;EACA,eAAe;GACb,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,aAAa;GACX,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;GAChD,MAAM,OAAO;GACb,YAAY,OAAO;GACnB,YAAY,OAAO;GACnB,UAAU,OAAO;GACjB,SAAA,gBAAA;EACF,CAAC;CACH;AACF,CAAC;;;AC9CD,MAAa,UAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAA8C;CAAwD;CACrI,aAAa,CAACC,SAAY;AAC5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
4
|
import { a as agentDefaults } from "./constants-CYxk4aNm.js";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/commands/agent.ts
|
|
@@ -65,4 +65,4 @@ const command = defineCommand({
|
|
|
65
65
|
//#endregion
|
|
66
66
|
export { command };
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=agent-
|
|
68
|
+
//# sourceMappingURL=agent-CfZ_Uqde.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-CfZ_Uqde.js","names":["command","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description:\n 'Start the Kubb Agent HTTP server. Exposes a REST API that accepts a kubb.config.ts patch and returns generated code as a stream. Use --allow-write to also write files to disk.',\n examples: ['kubb agent start', 'kubb agent start --port 4000', 'kubb agent start --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config file',\n short: 'c',\n },\n port: {\n type: 'string',\n description: 'Port the HTTP server listens on',\n short: 'p',\n default: agentDefaults.port,\n },\n host: {\n type: 'string',\n description: 'Hostname the HTTP server binds to',\n default: agentDefaults.host,\n },\n 'allow-write': {\n type: 'boolean',\n description: 'Write generated files to the filesystem. When omitted, output is streamed only and no files are written.',\n default: false,\n },\n 'allow-all': {\n type: 'boolean',\n description: 'Grant all permissions (implies --allow-write).',\n default: false,\n },\n },\n async run({ values }) {\n const { run } = await import('../../runners/agent/run.ts')\n\n await run({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description:\n 'Manage the Kubb Agent — an HTTP server that lets AI agents trigger code generation programmatically via a REST API. Useful when an AI workflow needs to generate code without direct CLI access.',\n examples: ['kubb agent start', 'kubb agent start --port 4000 --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;;ACGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAA8C;CAAwD;CACrI,aAAa,CDJQ,cAAc;EACnC,MAAM;EACN,aACE;EACF,UAAU;GAAC;GAAoB;GAAgC;GAAkC;EAAwD;EACzJ,SAAS;GACP,QAAQ;IACN,MAAM;IACN,aAAa;IACb,OAAO;GACT;GACA,MAAM;IACJ,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS,cAAc;GACzB;GACA,MAAM;IACJ,MAAM;IACN,aAAa;IACb,SAAS,cAAc;GACzB;GACA,eAAe;IACb,MAAM;IACN,aAAa;IACb,SAAS;GACX;GACA,aAAa;IACX,MAAM;IACN,aAAa;IACb,SAAS;GACX;EACF;EACA,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;GAE7B,MAAM,IAAI;IACR,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;IAChD,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB;GACF,CAAC;EACH;CACF,CCzCgBC,CAAY;AAC5B,CAAC"}
|
|
@@ -49,7 +49,6 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
49
49
|
reporter: {
|
|
50
50
|
type: "string",
|
|
51
51
|
description: "Reporters that render the run, comma-separated. Overrides config.reporters",
|
|
52
|
-
default: "cli",
|
|
53
52
|
hint: "cli|json|file",
|
|
54
53
|
enum: [
|
|
55
54
|
"cli",
|
|
@@ -60,8 +59,8 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
60
59
|
},
|
|
61
60
|
async run({ values, positionals }) {
|
|
62
61
|
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
63
|
-
const reporters = values.reporter
|
|
64
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
62
|
+
const reporters = values.reporter?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
63
|
+
const { run } = await Promise.resolve().then(() => require("./run-BFZtWpcW.cjs"));
|
|
65
64
|
await run({
|
|
66
65
|
input: positionals[0],
|
|
67
66
|
configPath: values.config,
|
|
@@ -74,4 +73,4 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
74
73
|
//#endregion
|
|
75
74
|
exports.command = command;
|
|
76
75
|
|
|
77
|
-
//# sourceMappingURL=generate-
|
|
76
|
+
//# sourceMappingURL=generate-Bgds6Zx3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-Bgds6Zx3.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport type { ReporterName } from '@kubb/core'\n\nexport const command = defineCommand({\n name: 'generate',\n description:\n 'Generate TypeScript types, API clients, React Query hooks, Zod schemas, and more from an OpenAPI specification. Reads kubb.config.ts by default. Pass an OpenAPI file path as the first argument to override the input without editing the config.',\n arguments: ['[input]'],\n examples: ['kubb generate', 'kubb generate ./openapi.yaml', 'kubb generate --config kubb.config.ts', 'kubb generate --watch'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n logLevel: {\n type: 'string',\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose',\n enum: ['silent', 'info', 'verbose'],\n },\n watch: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n short: 'v',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\n reporter: {\n type: 'string',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n hint: 'cli|json|file',\n enum: ['cli', 'json', 'file'],\n },\n },\n async run({ values, positionals }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const reporters = values.reporter\n ?.split(',')\n .map((name) => name.trim())\n .filter(Boolean) as Array<ReporterName> | undefined\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: positionals[0],\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters,\n })\n },\n})\n"],"mappings":";;AAGA,MAAa,yCAAUA,EAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,WAAW,CAAC,SAAS;CACrB,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB;CAC5H,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;GAAS;EACpC;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,MAAM;GACN,MAAM;IAAC;IAAO;IAAQ;GAAM;EAC9B;CACF;CACA,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,YAAY,OAAO,UACrB,MAAM,GAAG,EACV,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;EACjB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd;EACF,CAAC;CACH;AACF,CAAC"}
|
|
@@ -50,7 +50,6 @@ const command = defineCommand({
|
|
|
50
50
|
reporter: {
|
|
51
51
|
type: "string",
|
|
52
52
|
description: "Reporters that render the run, comma-separated. Overrides config.reporters",
|
|
53
|
-
default: "cli",
|
|
54
53
|
hint: "cli|json|file",
|
|
55
54
|
enum: [
|
|
56
55
|
"cli",
|
|
@@ -61,8 +60,8 @@ const command = defineCommand({
|
|
|
61
60
|
},
|
|
62
61
|
async run({ values, positionals }) {
|
|
63
62
|
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
64
|
-
const reporters = values.reporter
|
|
65
|
-
const { run } = await import("./run-
|
|
63
|
+
const reporters = values.reporter?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
64
|
+
const { run } = await import("./run-C752fag9.js");
|
|
66
65
|
await run({
|
|
67
66
|
input: positionals[0],
|
|
68
67
|
configPath: values.config,
|
|
@@ -75,4 +74,4 @@ const command = defineCommand({
|
|
|
75
74
|
//#endregion
|
|
76
75
|
export { command };
|
|
77
76
|
|
|
78
|
-
//# sourceMappingURL=generate-
|
|
77
|
+
//# sourceMappingURL=generate-CfxFqNeb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-CfxFqNeb.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport type { ReporterName } from '@kubb/core'\n\nexport const command = defineCommand({\n name: 'generate',\n description:\n 'Generate TypeScript types, API clients, React Query hooks, Zod schemas, and more from an OpenAPI specification. Reads kubb.config.ts by default. Pass an OpenAPI file path as the first argument to override the input without editing the config.',\n arguments: ['[input]'],\n examples: ['kubb generate', 'kubb generate ./openapi.yaml', 'kubb generate --config kubb.config.ts', 'kubb generate --watch'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n logLevel: {\n type: 'string',\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose',\n enum: ['silent', 'info', 'verbose'],\n },\n watch: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n short: 'v',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\n reporter: {\n type: 'string',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n hint: 'cli|json|file',\n enum: ['cli', 'json', 'file'],\n },\n },\n async run({ values, positionals }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const reporters = values.reporter\n ?.split(',')\n .map((name) => name.trim())\n .filter(Boolean) as Array<ReporterName> | undefined\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: positionals[0],\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters,\n })\n },\n})\n"],"mappings":";;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,WAAW,CAAC,SAAS;CACrB,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB;CAC5H,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;GAAS;EACpC;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,MAAM;GACN,MAAM;IAAC;IAAO;IAAQ;GAAM;EAC9B;CACF;CACA,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,YAAY,OAAO,UACrB,MAAM,GAAG,EACV,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;EACjB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd;EACF,CAAC;CACH;AACF,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
require("./chunk-Bx3C2hgW.cjs");
|
|
3
3
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
4
4
|
const require_telemetry = require("./telemetry-B80oJfxR.cjs");
|
|
5
|
-
const require_package = require("./package-
|
|
5
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
6
6
|
const require_constants = require("./constants-CAKUpLcQ.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
//#region ../../internals/utils/src/cli/schema.ts
|
|
@@ -254,11 +254,11 @@ function shouldShowTelemetryNotice(argv) {
|
|
|
254
254
|
}
|
|
255
255
|
async function run(argv = process.argv) {
|
|
256
256
|
if (shouldShowTelemetryNotice(argv)) console.log(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
257
|
-
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
258
|
-
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-
|
|
259
|
-
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-
|
|
260
|
-
const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-
|
|
261
|
-
const { command: initCommand } = await Promise.resolve().then(() => require("./init-
|
|
257
|
+
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-Bgds6Zx3.cjs"));
|
|
258
|
+
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-DMzjP-hd.cjs"));
|
|
259
|
+
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-Cr753GW1.cjs"));
|
|
260
|
+
const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-Bl8JwjMa.cjs"));
|
|
261
|
+
const { command: initCommand } = await Promise.resolve().then(() => require("./init-C5wnuzeK.cjs"));
|
|
262
262
|
await cli.run([
|
|
263
263
|
generateCommand,
|
|
264
264
|
validateCommand,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { t as defineCLIAdapter } from "./define-DNG1U8ha.js";
|
|
3
3
|
import { n as isTelemetryDisabled } from "./telemetry-ueaMzs_c.js";
|
|
4
|
-
import { t as version } from "./package-
|
|
4
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
5
5
|
import { r as QUIET_FLAGS } from "./constants-CYxk4aNm.js";
|
|
6
6
|
import { parseArgs, styleText } from "node:util";
|
|
7
7
|
//#region ../../internals/utils/src/cli/schema.ts
|
|
@@ -253,11 +253,11 @@ function shouldShowTelemetryNotice(argv) {
|
|
|
253
253
|
}
|
|
254
254
|
async function run(argv = process.argv) {
|
|
255
255
|
if (shouldShowTelemetryNotice(argv)) console.log(`${styleText("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
256
|
-
const { command: generateCommand } = await import("./generate-
|
|
257
|
-
const { command: validateCommand } = await import("./validate-
|
|
258
|
-
const { command: mcpCommand } = await import("./mcp-
|
|
259
|
-
const { command: agentCommand } = await import("./agent-
|
|
260
|
-
const { command: initCommand } = await import("./init-
|
|
256
|
+
const { command: generateCommand } = await import("./generate-CfxFqNeb.js");
|
|
257
|
+
const { command: validateCommand } = await import("./validate-CYTKdezO.js");
|
|
258
|
+
const { command: mcpCommand } = await import("./mcp-Damue5Mq.js");
|
|
259
|
+
const { command: agentCommand } = await import("./agent-CfZ_Uqde.js");
|
|
260
|
+
const { command: initCommand } = await import("./init-TIec3Dym.js");
|
|
261
261
|
await cli.run([
|
|
262
262
|
generateCommand,
|
|
263
263
|
validateCommand,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
const command = require_define.defineCommand({
|
|
6
6
|
name: "init",
|
|
@@ -50,4 +50,4 @@ const command = require_define.defineCommand({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
exports.command = command;
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=init-
|
|
53
|
+
//# sourceMappingURL=init-C5wnuzeK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-C5wnuzeK.cjs","names":["defineCommand"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description:\n 'Scaffold a kubb.config.ts and install plugins for code generation from an OpenAPI spec. Run without flags for interactive setup, or pass --input, --output, and --plugins to skip the prompts.',\n examples: [\n 'kubb init',\n 'kubb init --yes',\n 'kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod',\n 'kubb init --plugins plugin-ts,plugin-client,plugin-react-query',\n ],\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n input: {\n type: 'string',\n description: 'Path to the OpenAPI specification',\n short: 'i',\n hint: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n hint: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-client, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n hint: 'plugin-ts,plugin-zod,...',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/init/run.ts')\n\n await run({\n yes: values.yes,\n version,\n input: values.input,\n output: values.output,\n plugins: values.plugins,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF;CACA,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,KAAK,OAAO;GACZ,SAAA,gBAAA;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;EAClB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
const command = defineCommand({
|
|
6
6
|
name: "init",
|
|
@@ -50,4 +50,4 @@ const command = defineCommand({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { command };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=init-
|
|
53
|
+
//# sourceMappingURL=init-TIec3Dym.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-TIec3Dym.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description:\n 'Scaffold a kubb.config.ts and install plugins for code generation from an OpenAPI spec. Run without flags for interactive setup, or pass --input, --output, and --plugins to skip the prompts.',\n examples: [\n 'kubb init',\n 'kubb init --yes',\n 'kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod',\n 'kubb init --plugins plugin-ts,plugin-client,plugin-react-query',\n ],\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n input: {\n type: 'string',\n description: 'Path to the OpenAPI specification',\n short: 'i',\n hint: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n hint: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-client, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n hint: 'plugin-ts,plugin-zod,...',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/init/run.ts')\n\n await run({\n yes: values.yes,\n version,\n input: values.input,\n output: values.output,\n plugins: values.plugins,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF;CACA,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,KAAK,OAAO;GACZ;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;EAClB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
4
|
//#region src/commands/mcp.ts
|
|
5
5
|
const command = require_define.defineCommand({
|
|
6
6
|
name: "mcp",
|
|
@@ -36,4 +36,4 @@ const command = require_define.defineCommand({
|
|
|
36
36
|
//#endregion
|
|
37
37
|
exports.command = command;
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=mcp-
|
|
39
|
+
//# sourceMappingURL=mcp-Cr753GW1.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Cr753GW1.cjs","names":["defineCommand"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: [\n 'kubb mcp',\n 'kubb mcp --port 3001',\n '# Then add to your MCP client config:',\n '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }',\n ],\n options: {\n port: {\n type: 'string',\n short: 'p',\n description: 'Port for HTTP MCP server (omit for stdio)',\n hint: 'number',\n },\n host: {\n type: 'string',\n description: 'Hostname to bind to (HTTP mode only)',\n default: 'localhost',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({\n version,\n port: values.port,\n host: values.host,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF;CACA,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;EACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,SAAA,gBAAA;GACA,MAAM,OAAO;GACb,MAAM,OAAO;EACf,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
4
|
//#region src/commands/mcp.ts
|
|
5
5
|
const command = defineCommand({
|
|
6
6
|
name: "mcp",
|
|
@@ -36,4 +36,4 @@ const command = defineCommand({
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { command };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=mcp-
|
|
39
|
+
//# sourceMappingURL=mcp-Damue5Mq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Damue5Mq.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: [\n 'kubb mcp',\n 'kubb mcp --port 3001',\n '# Then add to your MCP client config:',\n '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }',\n ],\n options: {\n port: {\n type: 'string',\n short: 'p',\n description: 'Port for HTTP MCP server (omit for stdio)',\n hint: 'number',\n },\n host: {\n type: 'string',\n description: 'Hostname to bind to (HTTP mode only)',\n default: 'localhost',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({\n version,\n port: values.port,\n host: values.host,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF;CACA,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;EACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR;GACA,MAAM,OAAO;GACb,MAAM,OAAO;EACf,CAAC;CACH;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-Cnt1K03J.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "5.0.0-beta.
|
|
2
|
+
var version = "5.0.0-beta.38";
|
|
3
3
|
//#endregion
|
|
4
4
|
Object.defineProperty(exports, "version", {
|
|
5
5
|
enumerable: true,
|
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "version", {
|
|
|
8
8
|
}
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=package-
|
|
11
|
+
//# sourceMappingURL=package-guApEHiW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-guApEHiW.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -2,7 +2,7 @@ const require_chunk = require("./chunk-Bx3C2hgW.cjs");
|
|
|
2
2
|
const require_errors = require("./errors-DykI11xo.cjs");
|
|
3
3
|
const require_telemetry = require("./telemetry-B80oJfxR.cjs");
|
|
4
4
|
const require_shell = require("./shell-Lh-vLWwH.cjs");
|
|
5
|
-
const require_package = require("./package-
|
|
5
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
6
6
|
const require_constants = require("./constants-CAKUpLcQ.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
let node_events = require("node:events");
|
|
@@ -754,14 +754,19 @@ const fileReporter = (0, _kubb_core.createReporter)({
|
|
|
754
754
|
//#endregion
|
|
755
755
|
//#region src/reporters/jsonReporter.ts
|
|
756
756
|
/**
|
|
757
|
-
* The `json` reporter.
|
|
758
|
-
*
|
|
757
|
+
* The `json` reporter. `report` returns one config's {@link Report}, which {@link createReporter}
|
|
758
|
+
* buffers, and `flush` writes them as a single pretty-printed JSON array on `kubb:lifecycle:end`.
|
|
759
|
+
* Buffering keeps a multi-config run one valid JSON document on stdout instead of concatenated
|
|
760
|
+
* objects that would break `jq .`. The terminal reporter is suppressed while `json` is active so
|
|
761
|
+
* stdout stays valid JSON.
|
|
759
762
|
*/
|
|
760
763
|
const jsonReporter = (0, _kubb_core.createReporter)({
|
|
761
764
|
name: "json",
|
|
762
765
|
report(result) {
|
|
763
|
-
|
|
764
|
-
|
|
766
|
+
return buildReport(result);
|
|
767
|
+
},
|
|
768
|
+
flush(_context, reports) {
|
|
769
|
+
node_process.default.stdout.write(`${JSON.stringify(reports, null, 2)}\n`);
|
|
765
770
|
}
|
|
766
771
|
});
|
|
767
772
|
//#endregion
|
|
@@ -1493,6 +1498,7 @@ function installReporter(context, reporter, ctx) {
|
|
|
1493
1498
|
hrStart
|
|
1494
1499
|
}, ctx);
|
|
1495
1500
|
});
|
|
1501
|
+
if (reporter.flush) context.on("kubb:lifecycle:end", () => reporter.flush?.(ctx));
|
|
1496
1502
|
}
|
|
1497
1503
|
/**
|
|
1498
1504
|
* Installs the live logger (the TUI view) and the selected reporters (the output), returning the
|
|
@@ -1645,18 +1651,14 @@ async function runHook({ id, command, args, commandWithArgs, hooks, stream = fal
|
|
|
1645
1651
|
await emitEnd(true, null);
|
|
1646
1652
|
} catch (err) {
|
|
1647
1653
|
if (!(err instanceof tinyexec.NonZeroExitError)) {
|
|
1648
|
-
|
|
1649
|
-
await emitEnd(false, error);
|
|
1650
|
-
await hooks.emit("kubb:error", { error });
|
|
1654
|
+
await emitEnd(false, require_errors.toError(err));
|
|
1651
1655
|
return;
|
|
1652
1656
|
}
|
|
1653
1657
|
const stderr = err.output?.stderr ?? "";
|
|
1654
1658
|
const stdout = err.output?.stdout ?? "";
|
|
1655
1659
|
if (stderr) sink?.onStderr?.(stderr);
|
|
1656
1660
|
if (stdout) sink?.onStdout?.(stdout);
|
|
1657
|
-
|
|
1658
|
-
await emitEnd(false, error);
|
|
1659
|
-
await hooks.emit("kubb:error", { error });
|
|
1661
|
+
await emitEnd(false, /* @__PURE__ */ new Error(`Hook execute failed: ${commandWithArgs}`));
|
|
1660
1662
|
}
|
|
1661
1663
|
}
|
|
1662
1664
|
/**
|
|
@@ -1996,4 +1998,4 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
1996
1998
|
//#endregion
|
|
1997
1999
|
exports.run = run;
|
|
1998
2000
|
|
|
1999
|
-
//# sourceMappingURL=run-
|
|
2001
|
+
//# sourceMappingURL=run-BFZtWpcW.cjs.map
|