@kubb/cli 5.2.7 → 5.2.8
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-Rb7ZSrZM.cjs → generate-Bg8-2XSd.cjs} +2 -2
- package/dist/{generate-Rb7ZSrZM.cjs.map → generate-Bg8-2XSd.cjs.map} +1 -1
- package/dist/{generate-DAszcRsb.js → generate-CKsAI5H2.js} +2 -2
- package/dist/{generate-DAszcRsb.js.map → generate-CKsAI5H2.js.map} +1 -1
- package/dist/index.cjs +19 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/{init-B2x0IqYy.cjs → init-BPArhQCK.cjs} +2 -2
- package/dist/{init-B2x0IqYy.cjs.map → init-BPArhQCK.cjs.map} +1 -1
- package/dist/{init-D4ZkBmLw.js → init-DroN6dri.js} +2 -2
- package/dist/{init-D4ZkBmLw.js.map → init-DroN6dri.js.map} +1 -1
- package/dist/{package-ALlJ_R7l.cjs → package-BMZZ3mUo.cjs} +2 -2
- package/dist/package-BMZZ3mUo.cjs.map +1 -0
- package/dist/package-BXaDNEkt.js +6 -0
- package/dist/package-BXaDNEkt.js.map +1 -0
- package/dist/{run-DiZjX981.js → run-B6bZaLqK.js} +251 -8
- package/dist/run-B6bZaLqK.js.map +1 -0
- package/dist/{run-BxTAsxxj.cjs → run-BHMES-2P.cjs} +248 -5
- package/dist/run-BHMES-2P.cjs.map +1 -0
- package/dist/{run-oAiRfQ1w.js → run-BcEQGlz_.js} +2 -2
- package/dist/{run-oAiRfQ1w.js.map → run-BcEQGlz_.js.map} +1 -1
- package/dist/{run-Dp_cu_Sq.cjs → run-Cni7891O.cjs} +2 -2
- package/dist/{run-Dp_cu_Sq.cjs.map → run-Cni7891O.cjs.map} +1 -1
- package/dist/{run-BWdOuixw.js → run-CphhWHm6.js} +2 -2
- package/dist/{run-BWdOuixw.js.map → run-CphhWHm6.js.map} +1 -1
- package/dist/{run-DH7L-NJ7.cjs → run-DL1wCsGn.cjs} +2 -2
- package/dist/{run-DH7L-NJ7.cjs.map → run-DL1wCsGn.cjs.map} +1 -1
- package/dist/{run-BCsAD0fU.cjs → run-DoU73Qo5.cjs} +2 -2
- package/dist/{run-BCsAD0fU.cjs.map → run-DoU73Qo5.cjs.map} +1 -1
- package/dist/{run-YTMp0zre.js → run-SxqXLbrs.js} +2 -2
- package/dist/{run-YTMp0zre.js.map → run-SxqXLbrs.js.map} +1 -1
- package/dist/{studio-PDMxqFN0.cjs → studio-BQV9CeZK.cjs} +32 -4
- package/dist/studio-BQV9CeZK.cjs.map +1 -0
- package/dist/{studio-DKv2YLJZ.js → studio-DUNPmQ5V.js} +32 -4
- package/dist/studio-DUNPmQ5V.js.map +1 -0
- package/package.json +7 -7
- package/dist/package-ALlJ_R7l.cjs.map +0 -1
- package/dist/package-CqrP-sja.js +0 -6
- package/dist/package-CqrP-sja.js.map +0 -1
- package/dist/run-BxTAsxxj.cjs.map +0 -1
- package/dist/run-DiZjX981.js.map +0 -1
- package/dist/studio-DKv2YLJZ.js.map +0 -1
- package/dist/studio-PDMxqFN0.cjs.map +0 -1
|
@@ -85,7 +85,7 @@ const command = (0, gunshi.defineWithTypes)()({
|
|
|
85
85
|
async run(ctx) {
|
|
86
86
|
const { values } = ctx;
|
|
87
87
|
const logLevel = resolveLogLevel(values);
|
|
88
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
88
|
+
const { run } = await Promise.resolve().then(() => require("./run-DL1wCsGn.cjs"));
|
|
89
89
|
await run({
|
|
90
90
|
input: values.input,
|
|
91
91
|
configPath: values.config,
|
|
@@ -99,4 +99,4 @@ const command = (0, gunshi.defineWithTypes)()({
|
|
|
99
99
|
//#endregion
|
|
100
100
|
exports.command = command;
|
|
101
101
|
|
|
102
|
-
//# sourceMappingURL=generate-
|
|
102
|
+
//# sourceMappingURL=generate-Bg8-2XSd.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-Bg8-2XSd.cjs","names":["defineWithTypes","dryRunId"],"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'\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\n/**\n * Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--logLevel`.\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 --dryRun # preview the run without writing files',\n 'kubb studio # connect this project to Kubb Studio and generate from the browser',\n 'kubb studio --allowWrite # let Studio write the generated files to disk',\n 'kubb studio login # pair this machine with Studio without connecting',\n ].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: 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, comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file',\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":";;;;AAKA,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;;;;AAKA,SAAS,gBAAgB,EAAE,SAAS,QAAQ,YAA6E;CACvH,IAAI,SAAS,OAAO;CACpB,IAAI,QAAQ,OAAO;CACnB,OAAO;AACT;AAEA,MAAa,WAAA,GAAUA,OAAAA,gBAAAA,CAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,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,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,MAAM,WAAW,gBAAgB,MAAM;EACvC,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;GAClB,QAAQ,IAAI,WAAWC,sBAAAA,SAAS,CAAC;EACnC,CAAC;CACH;AACF,CAAC"}
|
|
@@ -85,7 +85,7 @@ const command = defineWithTypes()({
|
|
|
85
85
|
async run(ctx) {
|
|
86
86
|
const { values } = ctx;
|
|
87
87
|
const logLevel = resolveLogLevel(values);
|
|
88
|
-
const { run } = await import("./run-
|
|
88
|
+
const { run } = await import("./run-SxqXLbrs.js");
|
|
89
89
|
await run({
|
|
90
90
|
input: values.input,
|
|
91
91
|
configPath: values.config,
|
|
@@ -99,4 +99,4 @@ const command = defineWithTypes()({
|
|
|
99
99
|
//#endregion
|
|
100
100
|
export { command };
|
|
101
101
|
|
|
102
|
-
//# sourceMappingURL=generate-
|
|
102
|
+
//# sourceMappingURL=generate-CKsAI5H2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-CKsAI5H2.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'\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\n/**\n * Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--logLevel`.\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 --dryRun # preview the run without writing files',\n 'kubb studio # connect this project to Kubb Studio and generate from the browser',\n 'kubb studio --allowWrite # let Studio write the generated files to disk',\n 'kubb studio login # pair this machine with Studio without connecting',\n ].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: 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, comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file',\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":";;;;AAKA,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;;;;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;CACF,CAAC,CAAC,KAAK,IAAI;CACX,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,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/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-qbf5tadS.cjs");
|
|
3
3
|
const require_Telemetry = require("./Telemetry-C-y1OMHs.cjs");
|
|
4
|
-
const require_package = require("./package-
|
|
4
|
+
const require_package = require("./package-BMZZ3mUo.cjs");
|
|
5
5
|
let node_util = require("node:util");
|
|
6
6
|
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
7
7
|
_gunshi_plugin_dryrun = require_rolldown_runtime.__toESM(_gunshi_plugin_dryrun, 1);
|
|
@@ -17,22 +17,31 @@ function stripExecArgs(argv) {
|
|
|
17
17
|
return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
+
* Whether this run is `kubb studio snapshot --json`, which must print exactly one JSON object on
|
|
21
|
+
* stdout so a script can parse it. The telemetry notice and gunshi's own header both write to
|
|
22
|
+
* stdout by default, so both are suppressed for this one invocation shape.
|
|
23
|
+
*/
|
|
24
|
+
function isSnapshotJson(args) {
|
|
25
|
+
return args[0] === "studio" && args[1] === "snapshot" && args.includes("--json");
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
20
28
|
* Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a
|
|
21
29
|
* quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to
|
|
22
30
|
* `generate` when no command is given.
|
|
23
31
|
*/
|
|
24
32
|
async function run(argv = process.argv) {
|
|
25
|
-
const
|
|
33
|
+
const args = stripExecArgs(argv);
|
|
34
|
+
const isQuietFlag = args.some((arg) => require_Telemetry.QUIET_FLAGS.has(arg)) || isSnapshotJson(args);
|
|
26
35
|
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`);
|
|
27
|
-
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
28
|
-
const { command: initCommand } = await Promise.resolve().then(() => require("./init-
|
|
36
|
+
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-Bg8-2XSd.cjs"));
|
|
37
|
+
const { command: initCommand } = await Promise.resolve().then(() => require("./init-BPArhQCK.cjs"));
|
|
29
38
|
const { definition: validateDefinition } = await Promise.resolve().then(() => require("./validate-BcB0tFQ6.cjs"));
|
|
30
|
-
const validateCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-
|
|
39
|
+
const validateCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-DoU73Qo5.cjs"))).runner, validateDefinition);
|
|
31
40
|
const { definition: mcpDefinition } = await Promise.resolve().then(() => require("./mcp-B3B-rE7W.cjs"));
|
|
32
|
-
const mcpCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-
|
|
33
|
-
const { definition: studioDefinition } = await Promise.resolve().then(() => require("./studio-
|
|
34
|
-
const studioCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-
|
|
35
|
-
await (0, gunshi.cli)(
|
|
41
|
+
const mcpCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-Cni7891O.cjs"))).runner, mcpDefinition);
|
|
42
|
+
const { definition: studioDefinition } = await Promise.resolve().then(() => require("./studio-BQV9CeZK.cjs"));
|
|
43
|
+
const studioCommand = (0, gunshi.lazy)(async () => (await Promise.resolve().then(() => require("./run-BHMES-2P.cjs"))).runner, studioDefinition);
|
|
44
|
+
await (0, gunshi.cli)(args, generateCommand, {
|
|
36
45
|
name: "kubb",
|
|
37
46
|
version: require_package.version,
|
|
38
47
|
description: "Generate code from an OpenAPI specification, or connect the project to Kubb Studio.",
|
|
@@ -46,6 +55,7 @@ async function run(argv = process.argv) {
|
|
|
46
55
|
fallbackToEntry: true,
|
|
47
56
|
strict: true,
|
|
48
57
|
plugins: [(0, _gunshi_plugin_dryrun.default)()],
|
|
58
|
+
...isSnapshotJson(args) ? { renderHeader: null } : {},
|
|
49
59
|
onErrorCommand: async (_ctx, error) => {
|
|
50
60
|
process.exitCode = 1;
|
|
51
61
|
console.error(error);
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["QUIET_FLAGS","isTelemetryDisabled","styleText","lazy","cli","dryrun"],"sources":["../src/index.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli, lazy } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { QUIET_FLAGS } from './constants.ts'\n\n/**\n * Strips the leading executable + script entries when `process.argv` is passed directly.\n * Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime\n * executable paths contain a path separator; bare command names do not.\n */\nfunction stripExecArgs(argv: Array<string>): Array<string> {\n const firstArgIsExecutablePath = (argv[0]?.includes('/') || argv[0]?.includes('\\\\')) ?? false\n return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv\n}\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to\n * `generate` when no command is given.\n */\nexport async function run(argv: Array<string> = process.argv): Promise<void> {\n const isQuietFlag =
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["QUIET_FLAGS","isTelemetryDisabled","styleText","lazy","cli","dryrun"],"sources":["../src/index.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli, lazy } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { QUIET_FLAGS } from './constants.ts'\n\n/**\n * Strips the leading executable + script entries when `process.argv` is passed directly.\n * Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime\n * executable paths contain a path separator; bare command names do not.\n */\nfunction stripExecArgs(argv: Array<string>): Array<string> {\n const firstArgIsExecutablePath = (argv[0]?.includes('/') || argv[0]?.includes('\\\\')) ?? false\n return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv\n}\n\n/**\n * Whether this run is `kubb studio snapshot --json`, which must print exactly one JSON object on\n * stdout so a script can parse it. The telemetry notice and gunshi's own header both write to\n * stdout by default, so both are suppressed for this one invocation shape.\n */\nfunction isSnapshotJson(args: Array<string>): boolean {\n return args[0] === 'studio' && args[1] === 'snapshot' && args.includes('--json')\n}\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to\n * `generate` when no command is given.\n */\nexport async function run(argv: Array<string> = process.argv): Promise<void> {\n const args = stripExecArgs(argv)\n const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg)) || isSnapshotJson(args)\n\n if (!isTelemetryDisabled() && !isQuietFlag) {\n console.log(\n `${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`,\n )\n }\n\n const { command: generateCommand } = await import('./commands/generate.ts')\n const { command: initCommand } = await import('./commands/init.ts')\n // Each runner pulls in an optional peer (@kubb/adapter-oas, @kubb/mcp, @kubb/studio), so it\n // loads only when its command runs.\n const { definition: validateDefinition } = await import('./commands/validate.ts')\n const validateCommand = lazy(async () => (await import('./runners/validate/run.ts')).runner, validateDefinition)\n const { definition: mcpDefinition } = await import('./commands/mcp.ts')\n const mcpCommand = lazy(async () => (await import('./runners/mcp/run.ts')).runner, mcpDefinition)\n const { definition: studioDefinition } = await import('./commands/studio.ts')\n const studioCommand = lazy(async () => (await import('./runners/studio/run.ts')).runner, studioDefinition)\n\n await cli(args, generateCommand, {\n name: 'kubb',\n version,\n // Not `generateCommand.description`: gunshi prints this on every subcommand's help too, so\n // `kubb studio --help` would open with a paragraph about generating types.\n description: 'Generate code from an OpenAPI specification, or connect the project to Kubb Studio.',\n subCommands: {\n generate: generateCommand,\n init: initCommand,\n validate: validateCommand,\n mcp: mcpCommand,\n studio: studioCommand,\n },\n fallbackToEntry: true,\n strict: true,\n plugins: [dryrun()],\n // `snapshot --json` owns stdout: gunshi's default header would otherwise print ahead of it.\n ...(isSnapshotJson(args) ? { renderHeader: null } : {}),\n onErrorCommand: async (_ctx, error) => {\n process.exitCode = 1\n console.error(error)\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAS,cAAc,MAAoC;CACzD,MAAM,4BAA4B,KAAK,EAAE,EAAE,SAAS,GAAG,KAAK,KAAK,EAAE,EAAE,SAAS,IAAI,MAAM;CACxF,OAAO,KAAK,UAAU,KAAK,2BAA2B,KAAK,MAAM,CAAC,IAAI;AACxE;;;;;;AAOA,SAAS,eAAe,MAA8B;CACpD,OAAO,KAAK,OAAO,YAAY,KAAK,OAAO,cAAc,KAAK,SAAS,QAAQ;AACjF;;;;;;AAOA,eAAsB,IAAI,OAAsB,QAAQ,MAAqB;CAC3E,MAAM,OAAO,cAAc,IAAI;CAC/B,MAAM,cAAc,KAAK,MAAM,QAAQA,kBAAAA,YAAY,IAAI,GAAG,CAAC,KAAK,eAAe,IAAI;CAEnF,IAAI,CAACC,kBAAAA,WAAoB,KAAK,CAAC,aAC7B,QAAQ,IACN,IAAA,GAAGC,UAAAA,UAAAA,CAAU,UAAU,SAAS,EAAE,wIAAA,GAAuIA,UAAAA,UAAAA,CAAU,QAAQ,0BAA0B,EAAE,IACzN;CAGF,MAAM,EAAE,SAAS,oBAAoB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,yBAAA,CAAA;CAC3C,MAAM,EAAE,SAAS,gBAAgB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;CAGvC,MAAM,EAAE,YAAY,uBAAuB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,yBAAA,CAAA;CACjD,MAAM,mBAAA,GAAkBC,OAAAA,KAAAA,CAAK,aAAa,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA,EAAA,CAAqC,QAAQ,kBAAkB;CAC/G,MAAM,EAAE,YAAY,kBAAkB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;CAC5C,MAAM,cAAA,GAAaA,OAAAA,KAAAA,CAAK,aAAa,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA,EAAA,CAAgC,QAAQ,aAAa;CAChG,MAAM,EAAE,YAAY,qBAAqB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;CAC/C,MAAM,iBAAA,GAAgBA,OAAAA,KAAAA,CAAK,aAAa,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA,EAAA,CAAmC,QAAQ,gBAAgB;CAEzG,OAAA,GAAMC,OAAAA,IAAAA,CAAI,MAAM,iBAAiB;EAC/B,MAAM;EACN,SAAA,gBAAA;EAGA,aAAa;EACb,aAAa;GACX,UAAU;GACV,MAAM;GACN,UAAU;GACV,KAAK;GACL,QAAQ;EACV;EACA,iBAAiB;EACjB,QAAQ;EACR,SAAS,EAAA,GAACC,sBAAAA,QAAAA,CAAO,CAAC;EAElB,GAAI,eAAe,IAAI,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;EACrD,gBAAgB,OAAO,MAAM,UAAU;GACrC,QAAQ,WAAW;GACnB,QAAQ,MAAM,KAAK;EACrB;CACF,CAAC;AACH"}
|
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-DIDDCARm.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-BXaDNEkt.js";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import dryrun from "@gunshi/plugin-dryrun";
|
|
6
6
|
import { cli, lazy } from "gunshi";
|
|
@@ -15,22 +15,31 @@ function stripExecArgs(argv) {
|
|
|
15
15
|
return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
+
* Whether this run is `kubb studio snapshot --json`, which must print exactly one JSON object on
|
|
19
|
+
* stdout so a script can parse it. The telemetry notice and gunshi's own header both write to
|
|
20
|
+
* stdout by default, so both are suppressed for this one invocation shape.
|
|
21
|
+
*/
|
|
22
|
+
function isSnapshotJson(args) {
|
|
23
|
+
return args[0] === "studio" && args[1] === "snapshot" && args.includes("--json");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
18
26
|
* Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a
|
|
19
27
|
* quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to
|
|
20
28
|
* `generate` when no command is given.
|
|
21
29
|
*/
|
|
22
30
|
async function run(argv = process.argv) {
|
|
23
|
-
const
|
|
31
|
+
const args = stripExecArgs(argv);
|
|
32
|
+
const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg)) || isSnapshotJson(args);
|
|
24
33
|
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`);
|
|
25
|
-
const { command: generateCommand } = await import("./generate-
|
|
26
|
-
const { command: initCommand } = await import("./init-
|
|
34
|
+
const { command: generateCommand } = await import("./generate-CKsAI5H2.js");
|
|
35
|
+
const { command: initCommand } = await import("./init-DroN6dri.js");
|
|
27
36
|
const { definition: validateDefinition } = await import("./validate-QpkCbIFJ.js");
|
|
28
|
-
const validateCommand = lazy(async () => (await import("./run-
|
|
37
|
+
const validateCommand = lazy(async () => (await import("./run-CphhWHm6.js")).runner, validateDefinition);
|
|
29
38
|
const { definition: mcpDefinition } = await import("./mcp-B-GxGgVr.js");
|
|
30
|
-
const mcpCommand = lazy(async () => (await import("./run-
|
|
31
|
-
const { definition: studioDefinition } = await import("./studio-
|
|
32
|
-
const studioCommand = lazy(async () => (await import("./run-
|
|
33
|
-
await cli(
|
|
39
|
+
const mcpCommand = lazy(async () => (await import("./run-BcEQGlz_.js")).runner, mcpDefinition);
|
|
40
|
+
const { definition: studioDefinition } = await import("./studio-DUNPmQ5V.js");
|
|
41
|
+
const studioCommand = lazy(async () => (await import("./run-B6bZaLqK.js")).runner, studioDefinition);
|
|
42
|
+
await cli(args, generateCommand, {
|
|
34
43
|
name: "kubb",
|
|
35
44
|
version,
|
|
36
45
|
description: "Generate code from an OpenAPI specification, or connect the project to Kubb Studio.",
|
|
@@ -44,6 +53,7 @@ async function run(argv = process.argv) {
|
|
|
44
53
|
fallbackToEntry: true,
|
|
45
54
|
strict: true,
|
|
46
55
|
plugins: [dryrun()],
|
|
56
|
+
...isSnapshotJson(args) ? { renderHeader: null } : {},
|
|
47
57
|
onErrorCommand: async (_ctx, error) => {
|
|
48
58
|
process.exitCode = 1;
|
|
49
59
|
console.error(error);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isTelemetryDisabled"],"sources":["../src/index.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli, lazy } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { QUIET_FLAGS } from './constants.ts'\n\n/**\n * Strips the leading executable + script entries when `process.argv` is passed directly.\n * Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime\n * executable paths contain a path separator; bare command names do not.\n */\nfunction stripExecArgs(argv: Array<string>): Array<string> {\n const firstArgIsExecutablePath = (argv[0]?.includes('/') || argv[0]?.includes('\\\\')) ?? false\n return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv\n}\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to\n * `generate` when no command is given.\n */\nexport async function run(argv: Array<string> = process.argv): Promise<void> {\n const isQuietFlag =
|
|
1
|
+
{"version":3,"file":"index.js","names":["isTelemetryDisabled"],"sources":["../src/index.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli, lazy } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { QUIET_FLAGS } from './constants.ts'\n\n/**\n * Strips the leading executable + script entries when `process.argv` is passed directly.\n * Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime\n * executable paths contain a path separator; bare command names do not.\n */\nfunction stripExecArgs(argv: Array<string>): Array<string> {\n const firstArgIsExecutablePath = (argv[0]?.includes('/') || argv[0]?.includes('\\\\')) ?? false\n return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv\n}\n\n/**\n * Whether this run is `kubb studio snapshot --json`, which must print exactly one JSON object on\n * stdout so a script can parse it. The telemetry notice and gunshi's own header both write to\n * stdout by default, so both are suppressed for this one invocation shape.\n */\nfunction isSnapshotJson(args: Array<string>): boolean {\n return args[0] === 'studio' && args[1] === 'snapshot' && args.includes('--json')\n}\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the generate, validate, mcp, studio, and init commands. Defaults to\n * `generate` when no command is given.\n */\nexport async function run(argv: Array<string> = process.argv): Promise<void> {\n const args = stripExecArgs(argv)\n const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg)) || isSnapshotJson(args)\n\n if (!isTelemetryDisabled() && !isQuietFlag) {\n console.log(\n `${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`,\n )\n }\n\n const { command: generateCommand } = await import('./commands/generate.ts')\n const { command: initCommand } = await import('./commands/init.ts')\n // Each runner pulls in an optional peer (@kubb/adapter-oas, @kubb/mcp, @kubb/studio), so it\n // loads only when its command runs.\n const { definition: validateDefinition } = await import('./commands/validate.ts')\n const validateCommand = lazy(async () => (await import('./runners/validate/run.ts')).runner, validateDefinition)\n const { definition: mcpDefinition } = await import('./commands/mcp.ts')\n const mcpCommand = lazy(async () => (await import('./runners/mcp/run.ts')).runner, mcpDefinition)\n const { definition: studioDefinition } = await import('./commands/studio.ts')\n const studioCommand = lazy(async () => (await import('./runners/studio/run.ts')).runner, studioDefinition)\n\n await cli(args, generateCommand, {\n name: 'kubb',\n version,\n // Not `generateCommand.description`: gunshi prints this on every subcommand's help too, so\n // `kubb studio --help` would open with a paragraph about generating types.\n description: 'Generate code from an OpenAPI specification, or connect the project to Kubb Studio.',\n subCommands: {\n generate: generateCommand,\n init: initCommand,\n validate: validateCommand,\n mcp: mcpCommand,\n studio: studioCommand,\n },\n fallbackToEntry: true,\n strict: true,\n plugins: [dryrun()],\n // `snapshot --json` owns stdout: gunshi's default header would otherwise print ahead of it.\n ...(isSnapshotJson(args) ? { renderHeader: null } : {}),\n onErrorCommand: async (_ctx, error) => {\n process.exitCode = 1\n console.error(error)\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAS,cAAc,MAAoC;CACzD,MAAM,4BAA4B,KAAK,EAAE,EAAE,SAAS,GAAG,KAAK,KAAK,EAAE,EAAE,SAAS,IAAI,MAAM;CACxF,OAAO,KAAK,UAAU,KAAK,2BAA2B,KAAK,MAAM,CAAC,IAAI;AACxE;;;;;;AAOA,SAAS,eAAe,MAA8B;CACpD,OAAO,KAAK,OAAO,YAAY,KAAK,OAAO,cAAc,KAAK,SAAS,QAAQ;AACjF;;;;;;AAOA,eAAsB,IAAI,OAAsB,QAAQ,MAAqB;CAC3E,MAAM,OAAO,cAAc,IAAI;CAC/B,MAAM,cAAc,KAAK,MAAM,QAAQ,YAAY,IAAI,GAAG,CAAC,KAAK,eAAe,IAAI;CAEnF,IAAI,CAACA,WAAoB,KAAK,CAAC,aAC7B,QAAQ,IACN,GAAG,UAAU,UAAU,SAAS,EAAE,uIAAuI,UAAU,QAAQ,0BAA0B,EAAE,IACzN;CAGF,MAAM,EAAE,SAAS,oBAAoB,MAAM,OAAO;CAClD,MAAM,EAAE,SAAS,gBAAgB,MAAM,OAAO;CAG9C,MAAM,EAAE,YAAY,uBAAuB,MAAM,OAAO;CACxD,MAAM,kBAAkB,KAAK,aAAa,MAAM,OAAO,qBAAA,CAA8B,QAAQ,kBAAkB;CAC/G,MAAM,EAAE,YAAY,kBAAkB,MAAM,OAAO;CACnD,MAAM,aAAa,KAAK,aAAa,MAAM,OAAO,qBAAA,CAAyB,QAAQ,aAAa;CAChG,MAAM,EAAE,YAAY,qBAAqB,MAAM,OAAO;CACtD,MAAM,gBAAgB,KAAK,aAAa,MAAM,OAAO,qBAAA,CAA4B,QAAQ,gBAAgB;CAEzG,MAAM,IAAI,MAAM,iBAAiB;EAC/B,MAAM;EACN;EAGA,aAAa;EACb,aAAa;GACX,UAAU;GACV,MAAM;GACN,UAAU;GACV,KAAK;GACL,QAAQ;EACV;EACA,iBAAiB;EACjB,QAAQ;EACR,SAAS,CAAC,OAAO,CAAC;EAElB,GAAI,eAAe,IAAI,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;EACrD,gBAAgB,OAAO,MAAM,UAAU;GACrC,QAAQ,WAAW;GACnB,QAAQ,MAAM,KAAK;EACrB;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-BMZZ3mUo.cjs");
|
|
3
3
|
let gunshi = require("gunshi");
|
|
4
4
|
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
5
5
|
//#region src/commands/init.ts
|
|
@@ -54,4 +54,4 @@ const command = (0, gunshi.defineWithTypes)()({
|
|
|
54
54
|
//#endregion
|
|
55
55
|
exports.command = command;
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=init-
|
|
57
|
+
//# sourceMappingURL=init-BPArhQCK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-BPArhQCK.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 --dryRun',\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(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,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"}
|
|
@@ -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-BXaDNEkt.js";
|
|
3
3
|
import { t as dryRunId } from "./gunshiDryRun-DdKJuVn1.js";
|
|
4
4
|
import { defineWithTypes } from "gunshi";
|
|
5
5
|
//#region src/commands/init.ts
|
|
@@ -54,4 +54,4 @@ const command = defineWithTypes()({
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { command };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=init-
|
|
57
|
+
//# sourceMappingURL=init-DroN6dri.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-DroN6dri.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 --dryRun',\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(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,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "5.2.
|
|
2
|
+
var version = "5.2.8";
|
|
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-BMZZ3mUo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-BMZZ3mUo.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-BXaDNEkt.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|