@kubb/cli 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/{generate-C9fJvlhv.js → generate-Cc9j2-lg.js} +2 -2
- package/dist/{generate-C9fJvlhv.js.map → generate-Cc9j2-lg.js.map} +1 -1
- package/dist/{generate-CIVRaeeA.cjs → generate-DwTTaSpB.cjs} +2 -2
- package/dist/{generate-CIVRaeeA.cjs.map → generate-DwTTaSpB.cjs.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/dist/{init-DXjubhO6.js → init-BlTepVY_.js} +2 -2
- package/dist/{init-DXjubhO6.js.map → init-BlTepVY_.js.map} +1 -1
- package/dist/{init-BBmle7Oc.cjs → init-CvVRvhfJ.cjs} +2 -2
- package/dist/{init-BBmle7Oc.cjs.map → init-CvVRvhfJ.cjs.map} +1 -1
- package/dist/{mcp-DLKKD_8s.js → mcp-CTs7ogBF.js} +2 -2
- package/dist/{mcp-DLKKD_8s.js.map → mcp-CTs7ogBF.js.map} +1 -1
- package/dist/{mcp-Dzgpeor_.cjs → mcp-szP8HzB7.cjs} +2 -2
- package/dist/{mcp-Dzgpeor_.cjs.map → mcp-szP8HzB7.cjs.map} +1 -1
- package/dist/package-CfWW74Ug.js +6 -0
- package/dist/package-CfWW74Ug.js.map +1 -0
- package/dist/{package-Bsc6NeTU.cjs → package-DPdskCYh.cjs} +2 -2
- package/dist/package-DPdskCYh.cjs.map +1 -0
- package/dist/{run-BBS4Sc38.js → run-B8sdHsE4.js} +31 -25
- package/dist/run-B8sdHsE4.js.map +1 -0
- package/dist/{run-Bgn3IPJt.cjs → run-DFXppyRD.cjs} +31 -25
- package/dist/run-DFXppyRD.cjs.map +1 -0
- package/dist/{validate-DaxZu9c3.cjs → validate-BhSbvuiq.cjs} +2 -2
- package/dist/{validate-DaxZu9c3.cjs.map → validate-BhSbvuiq.cjs.map} +1 -1
- package/dist/{validate-ugxFStuH.js → validate-Cfi4pIS0.js} +2 -2
- package/dist/{validate-ugxFStuH.js.map → validate-Cfi4pIS0.js.map} +1 -1
- package/package.json +6 -6
- package/dist/package-Bsc6NeTU.cjs.map +0 -1
- package/dist/package-CaBsNdoM.js +0 -6
- package/dist/package-CaBsNdoM.js.map +0 -1
- package/dist/run-BBS4Sc38.js.map +0 -1
- package/dist/run-Bgn3IPJt.cjs.map +0 -1
|
@@ -71,7 +71,7 @@ const command = define({
|
|
|
71
71
|
},
|
|
72
72
|
async run({ values }) {
|
|
73
73
|
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
74
|
-
const { run } = await import("./run-
|
|
74
|
+
const { run } = await import("./run-B8sdHsE4.js");
|
|
75
75
|
await run({
|
|
76
76
|
input: values.input,
|
|
77
77
|
configPath: values.config,
|
|
@@ -84,4 +84,4 @@ const command = define({
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { command };
|
|
86
86
|
|
|
87
|
-
//# sourceMappingURL=generate-
|
|
87
|
+
//# sourceMappingURL=generate-Cc9j2-lg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-Cc9j2-lg.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport type { ReporterName } from '@kubb/core'\n\nconst REPORTER_NAMES: Array<ReporterName> = ['cli', 'json', 'file']\n\n/**\n * Splits and validates the comma-separated `--reporter` value against the known reporter names.\n */\nfunction parseReporters(value: string): Array<ReporterName> {\n const names = value\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean)\n\n for (const name of names) {\n if (!REPORTER_NAMES.includes(name as ReporterName)) {\n throw new Error(`must be one of cli, json, file (got \"${name}\")`)\n }\n }\n\n return names as Array<ReporterName>\n}\n\nexport const command = define({\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 examples: ['kubb generate', 'kubb generate ./openapi.yaml', 'kubb generate --config kubb.config.ts', 'kubb generate --watch'].join('\\n'),\n args: {\n input: {\n type: 'positional',\n required: false,\n description: 'Path to the OpenAPI specification, overriding the config',\n },\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n logLevel: {\n type: 'enum',\n choices: ['silent', 'info', 'verbose'] as const,\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\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 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: 'custom',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file',\n parse: parseReporters,\n },\n },\n async run({ values }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: values.input,\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters: values.reporter,\n })\n },\n})\n"],"mappings":";;;AAGA,MAAM,iBAAsC;CAAC;CAAO;CAAQ;AAAM;;;;AAKlE,SAAS,eAAe,OAAoC;CAC1D,MAAM,QAAQ,MACX,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,OAAO,OAAO;CAEjB,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,eAAe,SAAS,IAAoB,GAC/C,MAAM,IAAI,MAAM,wCAAwC,KAAK,GAAG;CAIpE,OAAO;AACT;AAEA,MAAa,UAAU,OAAO;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB,CAAC,CAAC,KAAK,IAAI;CACvI,MAAM;EACJ,OAAO;GACL,MAAM;GACN,UAAU;GACV,aAAa;EACf;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,SAAS;IAAC;IAAU;IAAQ;GAAS;GACrC,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,SAAS;GACT,OAAO;EACT;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,OAAO,OAAO;GACd,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd,WAAW,OAAO;EACpB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -71,7 +71,7 @@ const command = (0, gunshi.define)({
|
|
|
71
71
|
},
|
|
72
72
|
async run({ values }) {
|
|
73
73
|
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
74
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
74
|
+
const { run } = await Promise.resolve().then(() => require("./run-DFXppyRD.cjs"));
|
|
75
75
|
await run({
|
|
76
76
|
input: values.input,
|
|
77
77
|
configPath: values.config,
|
|
@@ -84,4 +84,4 @@ const command = (0, gunshi.define)({
|
|
|
84
84
|
//#endregion
|
|
85
85
|
exports.command = command;
|
|
86
86
|
|
|
87
|
-
//# sourceMappingURL=generate-
|
|
87
|
+
//# sourceMappingURL=generate-DwTTaSpB.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-DwTTaSpB.cjs","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport type { ReporterName } from '@kubb/core'\n\nconst REPORTER_NAMES: Array<ReporterName> = ['cli', 'json', 'file']\n\n/**\n * Splits and validates the comma-separated `--reporter` value against the known reporter names.\n */\nfunction parseReporters(value: string): Array<ReporterName> {\n const names = value\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean)\n\n for (const name of names) {\n if (!REPORTER_NAMES.includes(name as ReporterName)) {\n throw new Error(`must be one of cli, json, file (got \"${name}\")`)\n }\n }\n\n return names as Array<ReporterName>\n}\n\nexport const command = define({\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 examples: ['kubb generate', 'kubb generate ./openapi.yaml', 'kubb generate --config kubb.config.ts', 'kubb generate --watch'].join('\\n'),\n args: {\n input: {\n type: 'positional',\n required: false,\n description: 'Path to the OpenAPI specification, overriding the config',\n },\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n logLevel: {\n type: 'enum',\n choices: ['silent', 'info', 'verbose'] as const,\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\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 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: 'custom',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file',\n parse: parseReporters,\n },\n },\n async run({ values }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: values.input,\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters: values.reporter,\n })\n },\n})\n"],"mappings":";;;AAGA,MAAM,iBAAsC;CAAC;CAAO;CAAQ;AAAM;;;;AAKlE,SAAS,eAAe,OAAoC;CAC1D,MAAM,QAAQ,MACX,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,OAAO,OAAO;CAEjB,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,eAAe,SAAS,IAAoB,GAC/C,MAAM,IAAI,MAAM,wCAAwC,KAAK,GAAG;CAIpE,OAAO;AACT;AAEA,MAAa,WAAA,GAAA,OAAA,OAAA,CAAiB;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB,CAAC,CAAC,KAAK,IAAI;CACvI,MAAM;EACJ,OAAO;GACL,MAAM;GACN,UAAU;GACV,aAAa;EACf;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,SAAS;IAAC;IAAU;IAAQ;GAAS;GACrC,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,SAAS;GACT,OAAO;EACT;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,OAAO,OAAO;GACd,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd,WAAW,OAAO;EACpB,CAAC;CACH;AACF,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./rolldown-runtime-Bx3C2hgW.cjs");
|
|
3
3
|
const require_Telemetry = require("./Telemetry-xcWb-UWT.cjs");
|
|
4
|
-
const require_package = require("./package-
|
|
4
|
+
const require_package = require("./package-DPdskCYh.cjs");
|
|
5
5
|
let node_util = require("node:util");
|
|
6
6
|
let gunshi = require("gunshi");
|
|
7
7
|
//#region src/index.ts
|
|
@@ -22,10 +22,10 @@ function stripExecArgs(argv) {
|
|
|
22
22
|
async function run(argv = process.argv) {
|
|
23
23
|
const isQuietFlag = argv.some((arg) => require_Telemetry.QUIET_FLAGS.has(arg));
|
|
24
24
|
if (!require_Telemetry.isDisabled() && !isQuietFlag) 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`);
|
|
25
|
-
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
26
|
-
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-
|
|
27
|
-
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-
|
|
28
|
-
const { command: initCommand } = await Promise.resolve().then(() => require("./init-
|
|
25
|
+
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-DwTTaSpB.cjs"));
|
|
26
|
+
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-BhSbvuiq.cjs"));
|
|
27
|
+
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-szP8HzB7.cjs"));
|
|
28
|
+
const { command: initCommand } = await Promise.resolve().then(() => require("./init-CvVRvhfJ.cjs"));
|
|
29
29
|
try {
|
|
30
30
|
await (0, gunshi.cli)(stripExecArgs(argv), generateCommand, {
|
|
31
31
|
name: "kubb",
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { a as QUIET_FLAGS, n as isDisabled } from "./Telemetry-7z2tIqPm.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-CfWW74Ug.js";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { cli } from "gunshi";
|
|
6
6
|
//#region src/index.ts
|
|
@@ -21,10 +21,10 @@ function stripExecArgs(argv) {
|
|
|
21
21
|
async function run(argv = process.argv) {
|
|
22
22
|
const isQuietFlag = argv.some((arg) => QUIET_FLAGS.has(arg));
|
|
23
23
|
if (!isDisabled() && !isQuietFlag) 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`);
|
|
24
|
-
const { command: generateCommand } = await import("./generate-
|
|
25
|
-
const { command: validateCommand } = await import("./validate-
|
|
26
|
-
const { command: mcpCommand } = await import("./mcp-
|
|
27
|
-
const { command: initCommand } = await import("./init-
|
|
24
|
+
const { command: generateCommand } = await import("./generate-Cc9j2-lg.js");
|
|
25
|
+
const { command: validateCommand } = await import("./validate-Cfi4pIS0.js");
|
|
26
|
+
const { command: mcpCommand } = await import("./mcp-CTs7ogBF.js");
|
|
27
|
+
const { command: initCommand } = await import("./init-BlTepVY_.js");
|
|
28
28
|
try {
|
|
29
29
|
await cli(stripExecArgs(argv), generateCommand, {
|
|
30
30
|
name: "kubb",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-CfWW74Ug.js";
|
|
3
3
|
import { define } from "gunshi";
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
const command = define({
|
|
@@ -50,4 +50,4 @@ const command = define({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { command };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=init-
|
|
53
|
+
//# sourceMappingURL=init-BlTepVY_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-BlTepVY_.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { version } from '../../package.json'\n\nexport const command = define({\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-axios,plugin-react-query',\n ].join('\\n'),\n args: {\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 metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n metavar: '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,OAAO;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,MAAM;EACJ,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,SAAS;EACX;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,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-Bx3C2hgW.cjs");
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-DPdskCYh.cjs");
|
|
3
3
|
//#region src/commands/init.ts
|
|
4
4
|
const command = (0, require("gunshi").define)({
|
|
5
5
|
name: "init",
|
|
@@ -49,4 +49,4 @@ const command = (0, require("gunshi").define)({
|
|
|
49
49
|
//#endregion
|
|
50
50
|
exports.command = command;
|
|
51
51
|
|
|
52
|
-
//# sourceMappingURL=init-
|
|
52
|
+
//# sourceMappingURL=init-CvVRvhfJ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-CvVRvhfJ.cjs","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { version } from '../../package.json'\n\nexport const command = define({\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-axios,plugin-react-query',\n ].join('\\n'),\n args: {\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 metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n metavar: '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,WAAA,mBAAA,CAAA,CAAA,OAAA,CAAiB;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,MAAM;EACJ,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,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,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-CfWW74Ug.js";
|
|
3
3
|
import { define } from "gunshi";
|
|
4
4
|
//#region src/commands/mcp.ts
|
|
5
5
|
const command = define({
|
|
@@ -18,4 +18,4 @@ const command = define({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { command };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=mcp-
|
|
21
|
+
//# sourceMappingURL=mcp-CTs7ogBF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-CTs7ogBF.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { version } from '../../package.json'\n\nexport const command = define({\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: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,OAAO;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;CAC1J,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI,EAAE,QAAQ,CAAC;CACvB;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-Bx3C2hgW.cjs");
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-DPdskCYh.cjs");
|
|
3
3
|
//#region src/commands/mcp.ts
|
|
4
4
|
const command = (0, require("gunshi").define)({
|
|
5
5
|
name: "mcp",
|
|
@@ -17,4 +17,4 @@ const command = (0, require("gunshi").define)({
|
|
|
17
17
|
//#endregion
|
|
18
18
|
exports.command = command;
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=mcp-
|
|
20
|
+
//# sourceMappingURL=mcp-szP8HzB7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-szP8HzB7.cjs","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { version } from '../../package.json'\n\nexport const command = define({\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: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({ version })\n },\n})\n"],"mappings":";;;AAGA,MAAa,WAAA,mBAAA,CAAA,CAAA,OAAA,CAAiB;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;CAC1J,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI,EAAE,SAAA,gBAAA,QAAQ,CAAC;CACvB;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-CfWW74Ug.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.93";
|
|
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-DPdskCYh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-DPdskCYh.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { c as canUseTTY, i as KUBB_NPM_PACKAGE_URL, o as UPDATE_CHECK_TIMEOUT_MS, r as sendTelemetry, s as WATCHER_IGNORED_PATHS, t as buildTelemetryEvent } from "./Telemetry-7z2tIqPm.js";
|
|
3
3
|
import { n as toError, t as toCause } from "./errors-CMvLO2NE.js";
|
|
4
|
-
import { t as version } from "./package-
|
|
4
|
+
import { t as version } from "./package-CfWW74Ug.js";
|
|
5
5
|
import { i as linters, n as detectTool, r as formatters } from "./tools-B23ltmWP.js";
|
|
6
6
|
import { styleText } from "node:util";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
@@ -410,10 +410,11 @@ Run \`npm install -g @kubb/cli\` to update`, "Update available for `Kubb`", {
|
|
|
410
410
|
onStep("kubb:format:start", "Formatting");
|
|
411
411
|
onStep("kubb:lint:start", "Linting");
|
|
412
412
|
onStep("kubb:hooks:start", "Running hooks");
|
|
413
|
-
context.hook("kubb:hook:start", ({ id, command, args }) => {
|
|
413
|
+
context.hook("kubb:hook:start", ({ id, command, name, args }) => {
|
|
414
414
|
if (logLevel$5 <= logLevel.silent || !id) return;
|
|
415
415
|
stopSpinner();
|
|
416
|
-
const
|
|
416
|
+
const commandWithArgs = formatCommandWithArgs(command, args);
|
|
417
|
+
const title = getMessage(`Running ${styleText("dim", name ?? commandWithArgs)}`);
|
|
417
418
|
const taskLog = clack.taskLog({ title });
|
|
418
419
|
state.activeHookLogs.set(id, {
|
|
419
420
|
taskLog,
|
|
@@ -423,7 +424,7 @@ Run \`npm install -g @kubb/cli\` to update`, "Update available for `Kubb`", {
|
|
|
423
424
|
if (logLevel$5 > logLevel.silent) context.hook("kubb:hook:line", ({ id, line }) => {
|
|
424
425
|
state.activeHookLogs.get(id)?.taskLog.message(styleText("dim", line));
|
|
425
426
|
});
|
|
426
|
-
context.hook("kubb:hook:end", ({ id, command, args, success, error, stdout, stderr }) => {
|
|
427
|
+
context.hook("kubb:hook:end", ({ id, command, name, args, success, error, stdout, stderr }) => {
|
|
427
428
|
if (!id) return;
|
|
428
429
|
if (logLevel$5 <= logLevel.silent) {
|
|
429
430
|
if (!success) {
|
|
@@ -437,10 +438,10 @@ Run \`npm install -g @kubb/cli\` to update`, "Update available for `Kubb`", {
|
|
|
437
438
|
state.activeHookLogs.delete(id);
|
|
438
439
|
const commandWithArgs = formatCommandWithArgs(command, args);
|
|
439
440
|
const duration = formatMsWithColor(getElapsedMs(active.hrStart));
|
|
440
|
-
if (success) active.taskLog.success(getMessage(`${styleText("dim", commandWithArgs)} completed in ${duration}`));
|
|
441
|
+
if (success) active.taskLog.success(getMessage(`${styleText("dim", name ?? commandWithArgs)} completed in ${duration}`));
|
|
441
442
|
else {
|
|
442
443
|
const reason = error?.message ? ` (${error.message})` : "";
|
|
443
|
-
active.taskLog.error(getMessage(`${styleText("dim", commandWithArgs)} failed${reason}`), { showLog: true });
|
|
444
|
+
active.taskLog.error(getMessage(`${styleText("dim", name ?? commandWithArgs)} failed${reason}`), { showLog: true });
|
|
444
445
|
}
|
|
445
446
|
});
|
|
446
447
|
context.hook("kubb:lifecycle:end", () => {
|
|
@@ -552,23 +553,23 @@ const plainLogger = {
|
|
|
552
553
|
onStep("kubb:lint:end", "Lint completed");
|
|
553
554
|
onStep("kubb:hooks:start", "Hooks started");
|
|
554
555
|
onStep("kubb:hooks:end", "Hooks completed");
|
|
555
|
-
context.hook("kubb:hook:start", ({ id, command, args }) => {
|
|
556
|
+
context.hook("kubb:hook:start", ({ id, command, name, args }) => {
|
|
556
557
|
if (logLevel$4 <= logLevel.silent) return;
|
|
557
558
|
if (id) hookTimer.start(id);
|
|
558
559
|
const commandWithArgs = formatCommandWithArgs(command, args);
|
|
559
|
-
console.log(getMessage(`Hook ${commandWithArgs} started`));
|
|
560
|
+
console.log(getMessage(`Hook ${name ?? commandWithArgs} started`));
|
|
560
561
|
});
|
|
561
|
-
context.hook("kubb:hook:end", ({ id, command, args, success, error, stdout, stderr }) => {
|
|
562
|
+
context.hook("kubb:hook:end", ({ id, command, name, args, success, error, stdout, stderr }) => {
|
|
562
563
|
if (logLevel$4 <= logLevel.silent) return;
|
|
563
564
|
const ms = id ? hookTimer.end(id) : void 0;
|
|
564
565
|
const durationStr = ms !== void 0 ? ` in ${formatMs(ms)}` : "";
|
|
565
566
|
const commandWithArgs = formatCommandWithArgs(command, args);
|
|
566
|
-
if (success) console.log(getMessage(`✓ Hook ${commandWithArgs} completed${durationStr}`));
|
|
567
|
+
if (success) console.log(getMessage(`✓ Hook ${name ?? commandWithArgs} completed${durationStr}`));
|
|
567
568
|
else {
|
|
568
569
|
if (stdout) console.log(stdout);
|
|
569
570
|
if (stderr) console.error(stderr);
|
|
570
571
|
const reason = error?.message ? ` (${error.message})` : "";
|
|
571
|
-
console.log(getMessage(`✗ Hook ${commandWithArgs} failed${durationStr}${reason}`));
|
|
572
|
+
console.log(getMessage(`✗ Hook ${name ?? commandWithArgs} failed${durationStr}${reason}`));
|
|
572
573
|
}
|
|
573
574
|
});
|
|
574
575
|
}
|
|
@@ -853,13 +854,16 @@ function tokenize(command) {
|
|
|
853
854
|
return (command.match(/[^\s"']+|"([^"]*)"|'([^']*)'/g) ?? []).map((token) => token.replace(/^["']|["']$/g, ""));
|
|
854
855
|
}
|
|
855
856
|
/**
|
|
856
|
-
* Runs the `
|
|
857
|
-
* so the caller can turn failures into diagnostics.
|
|
857
|
+
* Runs the `output.postGenerate` commands of a Kubb config in sequence and returns each command's
|
|
858
|
+
* outcome, so the caller can turn failures into diagnostics.
|
|
858
859
|
*/
|
|
859
|
-
async function
|
|
860
|
-
const commands = Array.isArray(configHooks.done) ? configHooks.done : [configHooks.done].filter(Boolean);
|
|
860
|
+
async function runPostGenerate({ commands, hooks }) {
|
|
861
861
|
const results = [];
|
|
862
|
-
for (const
|
|
862
|
+
for (const entry of commands) {
|
|
863
|
+
const { command, name } = typeof entry === "string" ? {
|
|
864
|
+
command: entry,
|
|
865
|
+
name: void 0
|
|
866
|
+
} : entry;
|
|
863
867
|
const [cmd, ...args] = tokenize(command);
|
|
864
868
|
if (!cmd) continue;
|
|
865
869
|
const hookId = randomUUID();
|
|
@@ -867,11 +871,13 @@ async function executeHooks({ configHooks, hooks }) {
|
|
|
867
871
|
await hooks.callHook("kubb:hook:start", {
|
|
868
872
|
id: hookId,
|
|
869
873
|
command: cmd,
|
|
874
|
+
name,
|
|
870
875
|
args
|
|
871
876
|
});
|
|
872
877
|
results.push(await runHook({
|
|
873
878
|
id: hookId,
|
|
874
879
|
command: cmd,
|
|
880
|
+
name,
|
|
875
881
|
args,
|
|
876
882
|
commandWithArgs,
|
|
877
883
|
hooks
|
|
@@ -885,10 +891,11 @@ async function executeHooks({ configHooks, hooks }) {
|
|
|
885
891
|
* it into a diagnostic. Other spawn errors do the same. Output is streamed through `kubb:hook:line`
|
|
886
892
|
* only while a listener is attached.
|
|
887
893
|
*/
|
|
888
|
-
async function runHook({ id, command, args, commandWithArgs, hooks }) {
|
|
894
|
+
async function runHook({ id, command, name, args, commandWithArgs, hooks }) {
|
|
889
895
|
const emitEnd = async (result) => {
|
|
890
896
|
await hooks.callHook("kubb:hook:end", {
|
|
891
897
|
command,
|
|
898
|
+
name,
|
|
892
899
|
args,
|
|
893
900
|
id,
|
|
894
901
|
...result
|
|
@@ -906,7 +913,7 @@ async function runHook({ id, command, args, commandWithArgs, hooks }) {
|
|
|
906
913
|
line
|
|
907
914
|
});
|
|
908
915
|
await proc;
|
|
909
|
-
await hooks.callHook("kubb:success", { message: `${styleText("dim", commandWithArgs)} successfully executed` });
|
|
916
|
+
await hooks.callHook("kubb:success", { message: `${styleText("dim", name ?? commandWithArgs)} successfully executed` });
|
|
910
917
|
return emitEnd({
|
|
911
918
|
success: true,
|
|
912
919
|
error: null
|
|
@@ -1048,8 +1055,7 @@ async function generate(options) {
|
|
|
1048
1055
|
}));
|
|
1049
1056
|
for (const diagnostic of diagnostics) {
|
|
1050
1057
|
if (!Diagnostics.isProblem(diagnostic)) continue;
|
|
1051
|
-
|
|
1052
|
-
if (unknown) await hooks.callHook("kubb:error", { error: unknown.cause ?? new Error(unknown.message) });
|
|
1058
|
+
if (diagnostic.code === Diagnostics.code.unknown) await hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
|
|
1053
1059
|
else await Diagnostics.emit(hooks, diagnostic);
|
|
1054
1060
|
}
|
|
1055
1061
|
if (Diagnostics.hasError(diagnostics)) {
|
|
@@ -1111,15 +1117,15 @@ async function generate(options) {
|
|
|
1111
1117
|
});
|
|
1112
1118
|
if (error) await reportOutputFailure(Diagnostics.code.lintFailed, "linter", error);
|
|
1113
1119
|
}
|
|
1114
|
-
if (config.
|
|
1120
|
+
if (config.output.postGenerate?.length) {
|
|
1115
1121
|
await hooks.callHook("kubb:hooks:start");
|
|
1116
|
-
const hookResults = await
|
|
1117
|
-
|
|
1122
|
+
const hookResults = await runPostGenerate({
|
|
1123
|
+
commands: config.output.postGenerate,
|
|
1118
1124
|
hooks
|
|
1119
1125
|
});
|
|
1120
1126
|
for (const result of hookResults) {
|
|
1121
1127
|
if (result.success) continue;
|
|
1122
|
-
await reportOutputFailure(Diagnostics.code.
|
|
1128
|
+
await reportOutputFailure(Diagnostics.code.postGenerateFailed, "Post-generate command", result.error ?? /* @__PURE__ */ new Error("Post-generate command failed"));
|
|
1123
1129
|
}
|
|
1124
1130
|
await hooks.callHook("kubb:hooks:end");
|
|
1125
1131
|
}
|
|
@@ -1253,4 +1259,4 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
1253
1259
|
//#endregion
|
|
1254
1260
|
export { run };
|
|
1255
1261
|
|
|
1256
|
-
//# sourceMappingURL=run-
|
|
1262
|
+
//# sourceMappingURL=run-B8sdHsE4.js.map
|