@kubb/cli 5.5.6 → 5.6.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/{Telemetry-DDHXBdEz.cjs → Telemetry-CDyZhMHb.cjs} +27 -89
- package/dist/Telemetry-CDyZhMHb.cjs.map +1 -0
- package/dist/{Telemetry-CMXOVUKB.js → Telemetry-WZD1Le7A.js} +18 -43
- package/dist/Telemetry-WZD1Le7A.js.map +1 -0
- package/dist/agent-BPIqnEl2.js +59 -0
- package/dist/agent-BPIqnEl2.js.map +1 -0
- package/dist/agent-DElUuYuy.cjs +120 -0
- package/dist/agent-DElUuYuy.cjs.map +1 -0
- package/dist/{background-DxlRE9O5.js → background-CQmrmXMz.js} +7 -10
- package/dist/background-CQmrmXMz.js.map +1 -0
- package/dist/{background-Bbcc2TdN.cjs → background-Ch3napsn.cjs} +8 -7
- package/dist/background-Ch3napsn.cjs.map +1 -0
- package/dist/background-D7IE4acj.js +2 -0
- package/dist/commands-CCMgXgwc.cjs +87 -0
- package/dist/commands-CCMgXgwc.cjs.map +1 -0
- package/dist/commands-ECaVqjMu.js +81 -0
- package/dist/commands-ECaVqjMu.js.map +1 -0
- package/dist/config-B2BlaYOU.cjs +164 -0
- package/dist/config-B2BlaYOU.cjs.map +1 -0
- package/dist/config-CCxOcwWu.js +146 -0
- package/dist/config-CCxOcwWu.js.map +1 -0
- package/dist/constants-CdxpgX3_.cjs.map +1 -1
- package/dist/constants-DHRspBTo.js.map +1 -1
- package/dist/{errors-C-wEou02.cjs → errors-CMbMAwyW.cjs} +2 -2
- package/dist/{errors-C-wEou02.cjs.map → errors-CMbMAwyW.cjs.map} +1 -1
- package/dist/index.cjs +425 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +423 -20
- package/dist/index.js.map +1 -1
- package/dist/output-CnSY0tCG.js +766 -0
- package/dist/output-CnSY0tCG.js.map +1 -0
- package/dist/output-gox62nKo.cjs +868 -0
- package/dist/output-gox62nKo.cjs.map +1 -0
- package/dist/{run-CZz_GbE4.cjs → run-3xcH2h63.cjs} +12 -26
- package/dist/run-3xcH2h63.cjs.map +1 -0
- package/dist/{run-y6LRyWdS.cjs → run-BIK3c6u-.cjs} +96 -186
- package/dist/run-BIK3c6u-.cjs.map +1 -0
- package/dist/run-BKHV1Apt.cjs +31 -0
- package/dist/run-BKHV1Apt.cjs.map +1 -0
- package/dist/{run-Dn8HVjnM.js → run-BP_Z7A4e.js} +23 -44
- package/dist/run-BP_Z7A4e.js.map +1 -0
- package/dist/{run-C-jBKNbI.cjs → run-BvKVx0qs.cjs} +22 -43
- package/dist/run-BvKVx0qs.cjs.map +1 -0
- package/dist/run-DAYWA84e.js +349 -0
- package/dist/run-DAYWA84e.js.map +1 -0
- package/dist/run-J7ekQ_kc.js +30 -0
- package/dist/run-J7ekQ_kc.js.map +1 -0
- package/dist/{run-BDaZPU-1.js → run-TsXMXWSj.js} +91 -174
- package/dist/run-TsXMXWSj.js.map +1 -0
- package/dist/run-UY0fzPon.cjs +351 -0
- package/dist/run-UY0fzPon.cjs.map +1 -0
- package/dist/{run-BdTwxLCW.js → run-sM7YjAc9.js} +9 -23
- package/dist/run-sM7YjAc9.js.map +1 -0
- package/dist/{snapshot-B5mc4gpC.js → snapshot-7yPYU6ol.js} +68 -136
- package/dist/snapshot-7yPYU6ol.js.map +1 -0
- package/dist/{snapshot-DnCxZfmM.cjs → snapshot-Bi1Jy0hs.cjs} +69 -137
- package/dist/snapshot-Bi1Jy0hs.cjs.map +1 -0
- package/dist/studioWorker.js +3 -9
- package/dist/studioWorker.js.map +1 -1
- package/package.json +8 -12
- package/dist/Telemetry-CMXOVUKB.js.map +0 -1
- package/dist/Telemetry-DDHXBdEz.cjs.map +0 -1
- package/dist/agent-DiB4CRre.cjs +0 -38
- package/dist/agent-DiB4CRre.cjs.map +0 -1
- package/dist/agent-yA5vrXJB.js +0 -26
- package/dist/agent-yA5vrXJB.js.map +0 -1
- package/dist/background-Bbcc2TdN.cjs.map +0 -1
- package/dist/background-CFNncNYT.js +0 -2
- package/dist/background-DxlRE9O5.js.map +0 -1
- package/dist/connect-C9tTngda.js +0 -11
- package/dist/connect-C9tTngda.js.map +0 -1
- package/dist/connect-CJ7BhOcs.cjs +0 -11
- package/dist/connect-CJ7BhOcs.cjs.map +0 -1
- package/dist/generate-BUqZ_7GB.cjs +0 -92
- package/dist/generate-BUqZ_7GB.cjs.map +0 -1
- package/dist/generate-q2m01zRd.js +0 -92
- package/dist/generate-q2m01zRd.js.map +0 -1
- package/dist/gunshiDryRun-DdKJuVn1.js +0 -2
- package/dist/init-Ckpwkfvz.cjs +0 -58
- package/dist/init-Ckpwkfvz.cjs.map +0 -1
- package/dist/init-DukE9Uw4.js +0 -58
- package/dist/init-DukE9Uw4.js.map +0 -1
- package/dist/login-Bc19oiFE.cjs +0 -11
- package/dist/login-Bc19oiFE.cjs.map +0 -1
- package/dist/login-Do3nns0B.js +0 -11
- package/dist/login-Do3nns0B.js.map +0 -1
- package/dist/logout-BvHFvCeI.cjs +0 -16
- package/dist/logout-BvHFvCeI.cjs.map +0 -1
- package/dist/logout-COxoIMum.js +0 -16
- package/dist/logout-COxoIMum.js.map +0 -1
- package/dist/mcp-B-GxGgVr.js +0 -19
- package/dist/mcp-B-GxGgVr.js.map +0 -1
- package/dist/mcp-B3B-rE7W.cjs +0 -18
- package/dist/mcp-B3B-rE7W.cjs.map +0 -1
- package/dist/output-CVLosNZq.cjs +0 -411
- package/dist/output-CVLosNZq.cjs.map +0 -1
- package/dist/output-FDo-db-w.js +0 -321
- package/dist/output-FDo-db-w.js.map +0 -1
- package/dist/package-Ci2fcoOV.js +0 -6
- package/dist/package-Ci2fcoOV.js.map +0 -1
- package/dist/package-Do9rJ7D3.cjs +0 -11
- package/dist/package-Do9rJ7D3.cjs.map +0 -1
- package/dist/rolldown-runtime-qbf5tadS.cjs +0 -38
- package/dist/run-BDaZPU-1.js.map +0 -1
- package/dist/run-BdTwxLCW.js.map +0 -1
- package/dist/run-C-jBKNbI.cjs.map +0 -1
- package/dist/run-CAcQlhub.js +0 -295
- package/dist/run-CAcQlhub.js.map +0 -1
- package/dist/run-CSoFhDyK.cjs +0 -297
- package/dist/run-CSoFhDyK.cjs.map +0 -1
- package/dist/run-CZz_GbE4.cjs.map +0 -1
- package/dist/run-CaEbo-te.js +0 -40
- package/dist/run-CaEbo-te.js.map +0 -1
- package/dist/run-CihzLZmR.cjs +0 -41
- package/dist/run-CihzLZmR.cjs.map +0 -1
- package/dist/run-Dn8HVjnM.js.map +0 -1
- package/dist/run-y6LRyWdS.cjs.map +0 -1
- package/dist/shared-Cl-OLpNh.cjs +0 -81
- package/dist/shared-Cl-OLpNh.cjs.map +0 -1
- package/dist/shared-DaHA7QFQ.js +0 -58
- package/dist/shared-DaHA7QFQ.js.map +0 -1
- package/dist/snapshot-B5mc4gpC.js.map +0 -1
- package/dist/snapshot-DnCxZfmM.cjs.map +0 -1
- package/dist/start-B-GXO8tS.cjs +0 -12
- package/dist/start-B-GXO8tS.cjs.map +0 -1
- package/dist/start-Dbfx_8zG.js +0 -12
- package/dist/start-Dbfx_8zG.js.map +0 -1
- package/dist/status-DDajNc8w.js +0 -17
- package/dist/status-DDajNc8w.js.map +0 -1
- package/dist/status-DusS7DfO.cjs +0 -17
- package/dist/status-DusS7DfO.cjs.map +0 -1
- package/dist/stop-C5t7Yx0t.js +0 -11
- package/dist/stop-C5t7Yx0t.js.map +0 -1
- package/dist/stop-zmM3A0Re.cjs +0 -11
- package/dist/stop-zmM3A0Re.cjs.map +0 -1
- package/dist/studio--IOOl_VB.js +0 -174
- package/dist/studio--IOOl_VB.js.map +0 -1
- package/dist/studio-CJ2XhtRd.cjs +0 -174
- package/dist/studio-CJ2XhtRd.cjs.map +0 -1
- package/dist/utils-C3HZOWL_.js +0 -1107
- package/dist/utils-C3HZOWL_.js.map +0 -1
- package/dist/utils-ClRbJfxu.cjs +0 -1210
- package/dist/utils-ClRbJfxu.cjs.map +0 -1
- package/dist/validate-BcB0tFQ6.cjs +0 -19
- package/dist/validate-BcB0tFQ6.cjs.map +0 -1
- package/dist/validate-QpkCbIFJ.js +0 -20
- package/dist/validate-QpkCbIFJ.js.map +0 -1
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { t as dryRunId } from "./gunshiDryRun-DdKJuVn1.js";
|
|
3
|
-
import { n as logLevelArg, t as configArg } from "./shared-DaHA7QFQ.js";
|
|
4
|
-
import { defineWithTypes } from "gunshi";
|
|
5
|
-
//#region src/commands/generate.ts
|
|
6
|
-
const REPORTER_NAMES = [
|
|
7
|
-
"cli",
|
|
8
|
-
"json",
|
|
9
|
-
"file",
|
|
10
|
-
"html"
|
|
11
|
-
];
|
|
12
|
-
/**
|
|
13
|
-
* Splits and validates the comma-separated `--reporter` value against the known reporter names.
|
|
14
|
-
*/
|
|
15
|
-
function parseReporters(value) {
|
|
16
|
-
const names = value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
17
|
-
for (const name of names) if (!REPORTER_NAMES.includes(name)) throw new Error(`must be one of cli, json, file, html (got "${name}")`);
|
|
18
|
-
return names;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--log-level`.
|
|
22
|
-
*/
|
|
23
|
-
function resolveLogLevel({ verbose, silent, logLevel }) {
|
|
24
|
-
if (verbose) return "verbose";
|
|
25
|
-
if (silent) return "silent";
|
|
26
|
-
return logLevel;
|
|
27
|
-
}
|
|
28
|
-
const command = defineWithTypes()({
|
|
29
|
-
name: "generate",
|
|
30
|
-
description: "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.",
|
|
31
|
-
examples: [
|
|
32
|
-
"kubb generate # generate from kubb.config.ts",
|
|
33
|
-
"kubb generate ./openapi.yaml # generate from this spec instead of the config input",
|
|
34
|
-
"kubb generate --config kubb.config.ts",
|
|
35
|
-
"kubb generate --watch # regenerate whenever the spec changes",
|
|
36
|
-
"kubb generate --dry-run # preview the run without writing files",
|
|
37
|
-
"kubb generate --reporter html # write an HTML run report",
|
|
38
|
-
"kubb studio # connect this project to Kubb Studio and generate from the browser",
|
|
39
|
-
"kubb studio --allow-write # let Studio write the generated files to disk",
|
|
40
|
-
"kubb studio login # pair this machine with Studio without connecting"
|
|
41
|
-
].join("\n"),
|
|
42
|
-
toKebab: true,
|
|
43
|
-
args: {
|
|
44
|
-
input: {
|
|
45
|
-
type: "positional",
|
|
46
|
-
required: false,
|
|
47
|
-
description: "Path to the OpenAPI specification, overriding the config"
|
|
48
|
-
},
|
|
49
|
-
...configArg,
|
|
50
|
-
...logLevelArg,
|
|
51
|
-
watch: {
|
|
52
|
-
type: "boolean",
|
|
53
|
-
description: "Watch mode: watches an input file for changes, or polls an input URL",
|
|
54
|
-
short: "w",
|
|
55
|
-
default: false
|
|
56
|
-
},
|
|
57
|
-
verbose: {
|
|
58
|
-
type: "boolean",
|
|
59
|
-
description: "Override logLevel to verbose",
|
|
60
|
-
default: false
|
|
61
|
-
},
|
|
62
|
-
silent: {
|
|
63
|
-
type: "boolean",
|
|
64
|
-
description: "Override logLevel to silent",
|
|
65
|
-
short: "s",
|
|
66
|
-
default: false
|
|
67
|
-
},
|
|
68
|
-
reporter: {
|
|
69
|
-
type: "custom",
|
|
70
|
-
description: "Reporters that render the run: cli, json, file, html. Comma-separated. Overrides config.reporters",
|
|
71
|
-
metavar: "cli|json|file|html",
|
|
72
|
-
parse: parseReporters
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
async run(ctx) {
|
|
76
|
-
const { values } = ctx;
|
|
77
|
-
const logLevel = resolveLogLevel(values);
|
|
78
|
-
const { run } = await import("./run-CAcQlhub.js");
|
|
79
|
-
await run({
|
|
80
|
-
input: values.input,
|
|
81
|
-
configPath: values.config,
|
|
82
|
-
logLevel,
|
|
83
|
-
watch: values.watch,
|
|
84
|
-
reporters: values.reporter,
|
|
85
|
-
dryRun: ctx.extensions[dryRunId].enabled
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
//#endregion
|
|
90
|
-
export { command };
|
|
91
|
-
|
|
92
|
-
//# sourceMappingURL=generate-q2m01zRd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-q2m01zRd.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineWithTypes } from 'gunshi'\nimport type { ReporterName } from '@kubb/core'\nimport { dryRunId } from '../gunshiDryRun.ts'\nimport type { DryRunExtensions } from '../gunshiDryRun.ts'\nimport { configArg, logLevelArg } from './shared.ts'\n\nconst REPORTER_NAMES: Array<ReporterName> = ['cli', 'json', 'file', 'html']\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, html (got \"${name}\")`)\n }\n }\n\n return names as Array<ReporterName>\n}\n\n/**\n * Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--log-level`.\n */\nfunction resolveLogLevel({ verbose, silent, logLevel }: { verbose: boolean; silent: boolean; logLevel: string }): string {\n if (verbose) return 'verbose'\n if (silent) return 'silent'\n return logLevel\n}\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\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: [\n 'kubb generate # generate from kubb.config.ts',\n 'kubb generate ./openapi.yaml # generate from this spec instead of the config input',\n 'kubb generate --config kubb.config.ts',\n 'kubb generate --watch # regenerate whenever the spec changes',\n 'kubb generate --dry-run # preview the run without writing files',\n 'kubb generate --reporter html # write an HTML run report',\n 'kubb studio # connect this project to Kubb Studio and generate from the browser',\n 'kubb studio --allow-write # let Studio write the generated files to disk',\n 'kubb studio login # pair this machine with Studio without connecting',\n ].join('\\n'),\n toKebab: true,\n args: {\n input: {\n type: 'positional',\n required: false,\n description: 'Path to the OpenAPI specification, overriding the config',\n },\n ...configArg,\n ...logLevelArg,\n watch: {\n type: 'boolean',\n description: 'Watch mode: watches an input file for changes, or polls an input URL',\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: cli, json, file, html. Comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file|html',\n parse: parseReporters,\n },\n },\n async run(ctx) {\n const { values } = ctx\n const logLevel = resolveLogLevel(values)\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 dryRun: ctx.extensions[dryRunId].enabled,\n })\n },\n})\n"],"mappings":";;;;;AAMA,MAAM,iBAAsC;CAAC;CAAO;CAAQ;CAAQ;AAAM;;;;AAK1E,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,8CAA8C,KAAK,GAAG;CAI1E,OAAO;AACT;;;;AAKA,SAAS,gBAAgB,EAAE,SAAS,QAAQ,YAA6E;CACvH,IAAI,SAAS,OAAO;CACpB,IAAI,QAAQ,OAAO;CACnB,OAAO;AACT;AAEA,MAAa,UAAU,gBAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,SAAS;CACT,MAAM;EACJ,OAAO;GACL,MAAM;GACN,UAAU;GACV,aAAa;EACf;EACA,GAAG;EACH,GAAG;EACH,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,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,MAAM,WAAW,gBAAgB,MAAM;EACvC,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,OAAO,OAAO;GACd,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd,WAAW,OAAO;GAClB,QAAQ,IAAI,WAAW,SAAS,CAAC;EACnC,CAAC;CACH;AACF,CAAC"}
|
package/dist/init-Ckpwkfvz.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_package = require("./package-Do9rJ7D3.cjs");
|
|
3
|
-
let gunshi = require("gunshi");
|
|
4
|
-
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
5
|
-
//#region src/commands/init.ts
|
|
6
|
-
const command = (0, gunshi.defineWithTypes)()({
|
|
7
|
-
name: "init",
|
|
8
|
-
description: "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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb init",
|
|
11
|
-
"kubb init --yes",
|
|
12
|
-
"kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod",
|
|
13
|
-
"kubb init --plugins plugin-ts,plugin-axios,plugin-react-query",
|
|
14
|
-
"kubb init --yes --dry-run"
|
|
15
|
-
].join("\n"),
|
|
16
|
-
toKebab: true,
|
|
17
|
-
args: {
|
|
18
|
-
yes: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
description: "Skip prompts and use default options",
|
|
21
|
-
short: "y",
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Path to the OpenAPI specification",
|
|
27
|
-
short: "i",
|
|
28
|
-
metavar: "path"
|
|
29
|
-
},
|
|
30
|
-
output: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Output directory for generated files",
|
|
33
|
-
short: "o",
|
|
34
|
-
metavar: "path"
|
|
35
|
-
},
|
|
36
|
-
plugins: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "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)",
|
|
39
|
-
metavar: "plugin-ts,plugin-zod,..."
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
async run(ctx) {
|
|
43
|
-
const { values } = ctx;
|
|
44
|
-
const { run } = await Promise.resolve().then(() => require("./run-C-jBKNbI.cjs"));
|
|
45
|
-
await run({
|
|
46
|
-
yes: values.yes,
|
|
47
|
-
version: require_package.version,
|
|
48
|
-
input: values.input,
|
|
49
|
-
output: values.output,
|
|
50
|
-
plugins: values.plugins,
|
|
51
|
-
dryRun: ctx.extensions[_gunshi_plugin_dryrun.pluginId]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.command = command;
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=init-Ckpwkfvz.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-Ckpwkfvz.cjs","names":["defineWithTypes","dryRunId"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineWithTypes } from 'gunshi'\nimport { dryRunId } from '../gunshiDryRun.ts'\nimport type { DryRunExtensions } from '../gunshiDryRun.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\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 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\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(ctx) {\n const { values } = ctx\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 dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n"],"mappings":";;;;;AAKA,MAAa,WAAA,GAAUA,OAAAA,gBAAAA,CAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,SAAS;CACT,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,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,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;GAChB,QAAQ,IAAI,WAAWC,sBAAAA;EACzB,CAAC;CACH;AACF,CAAC"}
|
package/dist/init-DukE9Uw4.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { t as version } from "./package-Ci2fcoOV.js";
|
|
3
|
-
import { t as dryRunId } from "./gunshiDryRun-DdKJuVn1.js";
|
|
4
|
-
import { defineWithTypes } from "gunshi";
|
|
5
|
-
//#region src/commands/init.ts
|
|
6
|
-
const command = defineWithTypes()({
|
|
7
|
-
name: "init",
|
|
8
|
-
description: "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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb init",
|
|
11
|
-
"kubb init --yes",
|
|
12
|
-
"kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod",
|
|
13
|
-
"kubb init --plugins plugin-ts,plugin-axios,plugin-react-query",
|
|
14
|
-
"kubb init --yes --dry-run"
|
|
15
|
-
].join("\n"),
|
|
16
|
-
toKebab: true,
|
|
17
|
-
args: {
|
|
18
|
-
yes: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
description: "Skip prompts and use default options",
|
|
21
|
-
short: "y",
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Path to the OpenAPI specification",
|
|
27
|
-
short: "i",
|
|
28
|
-
metavar: "path"
|
|
29
|
-
},
|
|
30
|
-
output: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Output directory for generated files",
|
|
33
|
-
short: "o",
|
|
34
|
-
metavar: "path"
|
|
35
|
-
},
|
|
36
|
-
plugins: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "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)",
|
|
39
|
-
metavar: "plugin-ts,plugin-zod,..."
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
async run(ctx) {
|
|
43
|
-
const { values } = ctx;
|
|
44
|
-
const { run } = await import("./run-Dn8HVjnM.js");
|
|
45
|
-
await run({
|
|
46
|
-
yes: values.yes,
|
|
47
|
-
version,
|
|
48
|
-
input: values.input,
|
|
49
|
-
output: values.output,
|
|
50
|
-
plugins: values.plugins,
|
|
51
|
-
dryRun: ctx.extensions[dryRunId]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
export { command };
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=init-DukE9Uw4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-DukE9Uw4.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineWithTypes } from 'gunshi'\nimport { dryRunId } from '../gunshiDryRun.ts'\nimport type { DryRunExtensions } from '../gunshiDryRun.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\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 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\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(ctx) {\n const { values } = ctx\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 dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n"],"mappings":";;;;;AAKA,MAAa,UAAU,gBAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,SAAS;CACT,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,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,KAAK,OAAO;GACZ;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;GAChB,QAAQ,IAAI,WAAW;EACzB,CAAC;CACH;AACF,CAAC"}
|
package/dist/login-Bc19oiFE.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_run = require("./run-y6LRyWdS.cjs");
|
|
3
|
-
//#region src/runners/studio/login.ts
|
|
4
|
-
const runner = async ({ values }) => {
|
|
5
|
-
const options = require_run.createStudioOptions(values);
|
|
6
|
-
await require_run.run(options, () => require_run.login(options));
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.runner = runner;
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=login-Bc19oiFE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-Bc19oiFE.cjs","names":["createStudioOptions","run","login"],"sources":["../src/runners/studio/login.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/login.ts'\nimport { createStudioOptions, login, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, () => login(options))\n}\n"],"mappings":";;;AAIA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAUA,YAAAA,oBAAoB,MAAM;CAC1C,MAAMC,YAAAA,IAAI,eAAeC,YAAAA,MAAM,OAAO,CAAC;AACzC"}
|
package/dist/login-Do3nns0B.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { i as login, n as createStudioOptions, o as run } from "./run-BDaZPU-1.js";
|
|
3
|
-
//#region src/runners/studio/login.ts
|
|
4
|
-
const runner = async ({ values }) => {
|
|
5
|
-
const options = createStudioOptions(values);
|
|
6
|
-
await run(options, () => login(options));
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { runner };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=login-Do3nns0B.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-Do3nns0B.js","names":[],"sources":["../src/runners/studio/login.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/login.ts'\nimport { createStudioOptions, login, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, () => login(options))\n}\n"],"mappings":";;;AAIA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAU,oBAAoB,MAAM;CAC1C,MAAM,IAAI,eAAe,MAAM,OAAO,CAAC;AACzC"}
|
package/dist/logout-BvHFvCeI.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_run = require("./run-y6LRyWdS.cjs");
|
|
3
|
-
const require_background = require("./background-Bbcc2TdN.cjs");
|
|
4
|
-
//#region src/runners/studio/logout.ts
|
|
5
|
-
const runner = async ({ values }) => {
|
|
6
|
-
const options = require_run.createStudioOptions(values);
|
|
7
|
-
await require_run.run(options, async () => {
|
|
8
|
-
await require_background.stopWorker();
|
|
9
|
-
await require_run.clearCredentials();
|
|
10
|
-
console.log("Signed out of Kubb Studio.");
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
exports.runner = runner;
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=logout-BvHFvCeI.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout-BvHFvCeI.cjs","names":["createStudioOptions","run","stopWorker","clearCredentials"],"sources":["../src/runners/studio/logout.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/logout.ts'\nimport { stopWorker } from './background.ts'\nimport { clearCredentials } from './credentials.ts'\nimport { createStudioOptions, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, async () => {\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n })\n}\n"],"mappings":";;;;AAMA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAUA,YAAAA,oBAAoB,MAAM;CAC1C,MAAMC,YAAAA,IAAI,SAAS,YAAY;EAC7B,MAAMC,mBAAAA,WAAW;EACjB,MAAMC,YAAAA,iBAAiB;EACvB,QAAQ,IAAI,4BAA4B;CAC1C,CAAC;AACH"}
|
package/dist/logout-COxoIMum.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { c as clearCredentials, n as createStudioOptions, o as run } from "./run-BDaZPU-1.js";
|
|
3
|
-
import { a as stopWorker } from "./background-DxlRE9O5.js";
|
|
4
|
-
//#region src/runners/studio/logout.ts
|
|
5
|
-
const runner = async ({ values }) => {
|
|
6
|
-
const options = createStudioOptions(values);
|
|
7
|
-
await run(options, async () => {
|
|
8
|
-
await stopWorker();
|
|
9
|
-
await clearCredentials();
|
|
10
|
-
console.log("Signed out of Kubb Studio.");
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { runner };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=logout-COxoIMum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout-COxoIMum.js","names":[],"sources":["../src/runners/studio/logout.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/logout.ts'\nimport { stopWorker } from './background.ts'\nimport { clearCredentials } from './credentials.ts'\nimport { createStudioOptions, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, async () => {\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n })\n}\n"],"mappings":";;;;AAMA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAU,oBAAoB,MAAM;CAC1C,MAAM,IAAI,SAAS,YAAY;EAC7B,MAAM,WAAW;EACjB,MAAM,iBAAiB;EACvB,QAAQ,IAAI,4BAA4B;CAC1C,CAAC;AACH"}
|
package/dist/mcp-B-GxGgVr.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { define } from "gunshi";
|
|
2
|
-
//#region src/commands/mcp.ts
|
|
3
|
-
/**
|
|
4
|
-
* Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this
|
|
5
|
-
* with the runner through gunshi's `lazy`.
|
|
6
|
-
*/
|
|
7
|
-
const definition = define({
|
|
8
|
-
name: "mcp",
|
|
9
|
-
description: "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.",
|
|
10
|
-
examples: [
|
|
11
|
-
"kubb mcp",
|
|
12
|
-
"# Then add to your MCP client config:",
|
|
13
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
14
|
-
].join("\n")
|
|
15
|
-
});
|
|
16
|
-
//#endregion
|
|
17
|
-
export { definition };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=mcp-B-GxGgVr.js.map
|
package/dist/mcp-B-GxGgVr.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-B-GxGgVr.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/**\n * Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this\n * with the runner through gunshi's `lazy`.\n */\nexport const definition = 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})\n"],"mappings":";;;;;;AAMA,MAAa,aAAa,OAAO;CAC/B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;AAC5J,CAAC"}
|
package/dist/mcp-B3B-rE7W.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/commands/mcp.ts
|
|
2
|
-
/**
|
|
3
|
-
* Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this
|
|
4
|
-
* with the runner through gunshi's `lazy`.
|
|
5
|
-
*/
|
|
6
|
-
const definition = (0, require("gunshi").define)({
|
|
7
|
-
name: "mcp",
|
|
8
|
-
description: "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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb mcp",
|
|
11
|
-
"# Then add to your MCP client config:",
|
|
12
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
13
|
-
].join("\n")
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
exports.definition = definition;
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=mcp-B3B-rE7W.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-B3B-rE7W.cjs","names":["define"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/**\n * Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this\n * with the runner through gunshi's `lazy`.\n */\nexport const definition = 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})\n"],"mappings":";;;;;AAMA,MAAa,cAAA,mBAAaA,CAAAA,CAAAA,OAAAA,CAAO;CAC/B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;AAC5J,CAAC"}
|