@kubb/cli 5.0.0-beta.12 → 5.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-Cnierxlu.cjs → agent-BeYTwPeX.cjs} +2 -2
- package/dist/{agent-Cnierxlu.cjs.map → agent-BeYTwPeX.cjs.map} +1 -1
- package/dist/{agent-7Ofp95W1.js → agent-C75Hr-Ke.js} +2 -2
- package/dist/{agent-7Ofp95W1.js.map → agent-C75Hr-Ke.js.map} +1 -1
- package/dist/{generate-DDCifj6I.cjs → generate-BF3AjiUf.cjs} +2 -2
- package/dist/{generate-DDCifj6I.cjs.map → generate-BF3AjiUf.cjs.map} +1 -1
- package/dist/{generate-Dg2WIM_P.js → generate-CmWpaxKe.js} +2 -2
- package/dist/{generate-Dg2WIM_P.js.map → generate-CmWpaxKe.js.map} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +6 -6
- package/dist/{init-m6yfR6V3.cjs → init-0T26Xghs.cjs} +2 -2
- package/dist/{init-m6yfR6V3.cjs.map → init-0T26Xghs.cjs.map} +1 -1
- package/dist/{init-CY46yRCY.js → init-PsSoaB9c.js} +2 -2
- package/dist/{init-CY46yRCY.js.map → init-PsSoaB9c.js.map} +1 -1
- package/dist/{mcp-D03qyCSQ.js → mcp-Dfx8XKiP.js} +2 -2
- package/dist/{mcp-D03qyCSQ.js.map → mcp-Dfx8XKiP.js.map} +1 -1
- package/dist/{mcp-XtdQ_R_3.cjs → mcp-hqkY4lKq.cjs} +2 -2
- package/dist/{mcp-XtdQ_R_3.cjs.map → mcp-hqkY4lKq.cjs.map} +1 -1
- package/dist/{package-ztjDYoaO.cjs → package-Cljxf8a3.cjs} +2 -2
- package/dist/package-Cljxf8a3.cjs.map +1 -0
- package/dist/package-DTbBkfHc.js +6 -0
- package/dist/package-DTbBkfHc.js.map +1 -0
- package/dist/{run-D2-o4yxg.js → run-34ctJY6B.js} +18 -10
- package/dist/{run-D2-o4yxg.js.map → run-34ctJY6B.js.map} +1 -1
- package/dist/{run-oon9qHTC.cjs → run-N_c1Hr2j.cjs} +18 -10
- package/dist/{run-oon9qHTC.cjs.map → run-N_c1Hr2j.cjs.map} +1 -1
- package/dist/{validate-C3EcZ814.cjs → validate-Bbijcex8.cjs} +2 -2
- package/dist/{validate-C3EcZ814.cjs.map → validate-Bbijcex8.cjs.map} +1 -1
- package/dist/{validate-D2wZ7m5I.js → validate-DU_icVNM.js} +2 -2
- package/dist/{validate-D2wZ7m5I.js.map → validate-DU_icVNM.js.map} +1 -1
- package/package.json +6 -6
- package/src/runners/generate/run.ts +15 -3
- package/dist/package-s6dIgf99.js +0 -6
- package/dist/package-s6dIgf99.js.map +0 -1
- package/dist/package-ztjDYoaO.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-
|
|
1
|
+
{"version":3,"file":"validate-Bbijcex8.cjs","names":["defineCommand"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n\n await run({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU,CAAC,wCAAwC,yEAAyE;CAC5H,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAEtB,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;GAAS,CAAC;;CAE9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-BvFE5Tac.js";
|
|
2
2
|
import { n as defineCommand } from "./define-m_fp-Aqm.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-DTbBkfHc.js";
|
|
4
4
|
//#region src/commands/validate.ts
|
|
5
5
|
const command = defineCommand({
|
|
6
6
|
name: "validate",
|
|
@@ -23,4 +23,4 @@ const command = defineCommand({
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { command };
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=validate-
|
|
26
|
+
//# sourceMappingURL=validate-DU_icVNM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-
|
|
1
|
+
{"version":3,"file":"validate-DU_icVNM.js","names":[],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n\n await run({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU,CAAC,wCAAwC,yEAAyE;CAC5H,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO;GAAS,CAAC;;CAE9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/cli",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.13",
|
|
4
4
|
"description": "Official CLI for Kubb. Run kubb generate, kubb init, kubb validate, kubb mcp, and kubb agent to manage the full code generation lifecycle from OpenAPI/Swagger specs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"cosmiconfig": "^9.0.1",
|
|
53
53
|
"jiti": "^2.7.0",
|
|
54
54
|
"tinyexec": "^1.1.2",
|
|
55
|
-
"@kubb/core": "5.0.0-beta.
|
|
55
|
+
"@kubb/core": "5.0.0-beta.13"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@internals/shared": "0.0.0",
|
|
59
59
|
"@internals/utils": "0.0.0",
|
|
60
|
-
"@kubb/adapter-oas": "5.0.0-beta.
|
|
60
|
+
"@kubb/adapter-oas": "5.0.0-beta.13"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@kubb/adapter-oas": "5.0.0-beta.
|
|
64
|
-
"@kubb/agent": "5.0.0-beta.
|
|
65
|
-
"@kubb/mcp": "5.0.0-beta.
|
|
63
|
+
"@kubb/adapter-oas": "5.0.0-beta.13",
|
|
64
|
+
"@kubb/agent": "5.0.0-beta.13",
|
|
65
|
+
"@kubb/mcp": "5.0.0-beta.13"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@kubb/adapter-oas": {
|
|
@@ -117,7 +117,7 @@ async function runToolPass({
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
async function generate(options: GenerateProps): Promise<
|
|
120
|
+
async function generate(options: GenerateProps): Promise<boolean> {
|
|
121
121
|
const { input, hooks, logLevel, makeSink } = options
|
|
122
122
|
|
|
123
123
|
const hrStart = process.hrtime()
|
|
@@ -163,7 +163,7 @@ async function generate(options: GenerateProps): Promise<void> {
|
|
|
163
163
|
})
|
|
164
164
|
|
|
165
165
|
await reportTelemetry('failed')
|
|
166
|
-
|
|
166
|
+
return false
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
await hooks.emit('kubb:success', { message: 'Generation succeeded', info: inputPath })
|
|
@@ -207,6 +207,7 @@ async function generate(options: GenerateProps): Promise<void> {
|
|
|
207
207
|
await hooks.emit('kubb:generation:summary', { config, failedPlugins, filesCreated: files.length, status: 'success', hrStart, pluginTimings })
|
|
208
208
|
|
|
209
209
|
await reportTelemetry('success')
|
|
210
|
+
return true
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
type GenerateCommandOptions = {
|
|
@@ -252,6 +253,7 @@ export async function run({ input, configPath, logLevel: logLevelKey, watch }: G
|
|
|
252
253
|
await hooks.emit('kubb:config:end', { configs })
|
|
253
254
|
await hooks.emit('kubb:lifecycle:start', { version })
|
|
254
255
|
|
|
256
|
+
let anyFailed = false
|
|
255
257
|
for (const config of configs) {
|
|
256
258
|
if (isInputPath(config) && watch) {
|
|
257
259
|
await startWatcher(
|
|
@@ -264,11 +266,21 @@ export async function run({ input, configPath, logLevel: logLevelKey, watch }: G
|
|
|
264
266
|
{ info: (msg) => clack.log.info(msg), error: (msg) => clack.log.error(msg) },
|
|
265
267
|
)
|
|
266
268
|
} else {
|
|
267
|
-
|
|
269
|
+
try {
|
|
270
|
+
const succeeded = await generate({ input, config, logLevel, hooks, makeSink })
|
|
271
|
+
if (!succeeded) anyFailed = true
|
|
272
|
+
} catch (configError) {
|
|
273
|
+
await hooks.emit('kubb:error', { error: toError(configError) })
|
|
274
|
+
anyFailed = true
|
|
275
|
+
}
|
|
268
276
|
}
|
|
269
277
|
}
|
|
270
278
|
|
|
271
279
|
await hooks.emit('kubb:lifecycle:end')
|
|
280
|
+
|
|
281
|
+
if (anyFailed) {
|
|
282
|
+
process.exit(1)
|
|
283
|
+
}
|
|
272
284
|
} catch (error) {
|
|
273
285
|
await hooks.emit('kubb:error', { error: toError(error) })
|
|
274
286
|
process.exit(1)
|
package/dist/package-s6dIgf99.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-s6dIgf99.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-ztjDYoaO.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|