@kubb/cli 4.12.5 → 4.12.6
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-BGEmIdHW.cjs → generate-DrdKyOOH.cjs} +16 -16
- package/dist/{generate-BGEmIdHW.cjs.map → generate-DrdKyOOH.cjs.map} +1 -1
- package/dist/{generate-DKUIRxiL.js → generate-M-5j2zqa.js} +16 -16
- package/dist/{generate-DKUIRxiL.js.map → generate-M-5j2zqa.js.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/dist/{mcp-LLlOFV3c.js → mcp-B5FWDVjp.js} +3 -3
- package/dist/{mcp-LLlOFV3c.js.map → mcp-B5FWDVjp.js.map} +1 -1
- package/dist/{mcp-N1IVyiXf.cjs → mcp-D7d_8Bma.cjs} +3 -3
- package/dist/{mcp-N1IVyiXf.cjs.map → mcp-D7d_8Bma.cjs.map} +1 -1
- package/dist/{package-ChTBCRJt.cjs → package-4h1lfDoB.cjs} +2 -2
- package/dist/package-4h1lfDoB.cjs.map +1 -0
- package/dist/package-B857a-xb.js +6 -0
- package/dist/package-B857a-xb.js.map +1 -0
- package/dist/{validate-BptoQ-63.js → validate-Bt922JN-.js} +3 -3
- package/dist/{validate-BptoQ-63.js.map → validate-Bt922JN-.js.map} +1 -1
- package/dist/{validate-Dn6hZ7Z4.cjs → validate-D9LPzg3-.cjs} +3 -3
- package/dist/{validate-Dn6hZ7Z4.cjs.map → validate-D9LPzg3-.cjs.map} +1 -1
- package/package.json +4 -4
- package/src/commands/generate.ts +2 -2
- package/src/commands/mcp.ts +2 -2
- package/src/commands/validate.ts +2 -2
- package/src/runners/generate.ts +10 -10
- package/src/utils/getCosmiConfig.ts +2 -2
- package/dist/package-BqxUFXm-.js +0 -6
- package/dist/package-BqxUFXm-.js.map +0 -1
- package/dist/package-ChTBCRJt.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-
|
|
1
|
+
{"version":3,"file":"validate-D9LPzg3-.cjs","names":["jiti","mod: any"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import process from 'node:process'\nimport type { ArgsDef, ParsedArgs } from 'citty'\nimport { defineCommand, showUsage } from 'citty'\nimport { createJiti } from 'jiti'\n\nconst jiti = createJiti(import.meta.url, {\n sourceMaps: true,\n})\n\nconst args = {\n input: {\n type: 'string',\n description: 'Path to Swagger/OpenAPI file',\n alias: 'i',\n },\n help: {\n type: 'boolean',\n description: 'Show help',\n alias: 'h',\n default: false,\n },\n} as const satisfies ArgsDef\n\nexport type Args = ParsedArgs<typeof args>\n\nconst command = defineCommand({\n meta: {\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n },\n args,\n async run(commandContext) {\n const { args } = commandContext\n\n if (args.help) {\n return showUsage(command)\n }\n\n if (args.input) {\n let mod: any\n try {\n mod = await jiti.import('@kubb/oas', { default: true })\n } catch (_e) {\n console.error(`Import of '@kubb/oas' is required to do validation`)\n }\n\n const { parse } = mod\n try {\n const oas = await parse(args.input)\n await oas.valdiate()\n\n console.log('✅ Validation success')\n } catch (error) {\n console.error('❌ Validation failed')\n console.log((error as Error)?.message)\n process.exit(1)\n }\n }\n },\n})\n\nexport default command\n"],"mappings":";;;;;;;AAKA,MAAMA,6EAAmC,EACvC,YAAY,MACb,CAAC;AAkBF,MAAM,mCAAwB;CAC5B,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MArBW;EACX,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACR;EACD,MAAM;GACJ,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACF;CAUC,MAAM,IAAI,gBAAgB;EACxB,MAAM,EAAE,SAAS;AAEjB,MAAI,KAAK,KACP,6BAAiB,QAAQ;AAG3B,MAAI,KAAK,OAAO;GACd,IAAIC;AACJ,OAAI;AACF,UAAM,MAAMD,OAAK,OAAO,aAAa,EAAE,SAAS,MAAM,CAAC;YAChD,IAAI;AACX,YAAQ,MAAM,qDAAqD;;GAGrE,MAAM,EAAE,UAAU;AAClB,OAAI;AAEF,WADY,MAAM,MAAM,KAAK,MAAM,EACzB,UAAU;AAEpB,YAAQ,IAAI,uBAAuB;YAC5B,OAAO;AACd,YAAQ,MAAM,sBAAsB;AACpC,YAAQ,IAAK,OAAiB,QAAQ;AACtC,yBAAQ,KAAK,EAAE;;;;CAItB,CAAC;AAEF,uBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/cli",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.6",
|
|
4
4
|
"description": "Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"seedrandom": "^3.0.5",
|
|
63
63
|
"semver": "^7.7.3",
|
|
64
64
|
"string-argv": "^0.3.2",
|
|
65
|
-
"@kubb/core": "4.12.
|
|
65
|
+
"@kubb/core": "4.12.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/seedrandom": "^3.0.8",
|
|
69
69
|
"@types/semver": "^7.7.1",
|
|
70
70
|
"source-map-support": "^0.5.21",
|
|
71
|
-
"@kubb/mcp": "4.12.
|
|
72
|
-
"@kubb/oas": "4.12.
|
|
71
|
+
"@kubb/mcp": "4.12.6",
|
|
72
|
+
"@kubb/oas": "4.12.6"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=20"
|
package/src/commands/generate.ts
CHANGED
|
@@ -134,8 +134,8 @@ const command = defineCommand({
|
|
|
134
134
|
await promiseManager.run('seq', promises)
|
|
135
135
|
|
|
136
136
|
await events.emit('lifecycle:end')
|
|
137
|
-
} catch (
|
|
138
|
-
await events.emit('error',
|
|
137
|
+
} catch (error) {
|
|
138
|
+
await events.emit('error', error as Error)
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
})
|
package/src/commands/mcp.ts
CHANGED
|
@@ -43,8 +43,8 @@ const command = defineCommand({
|
|
|
43
43
|
console.log('⏳ Starting MCP server...')
|
|
44
44
|
console.warn(pc.yellow('This feature is still under development — use with caution'))
|
|
45
45
|
await startServer()
|
|
46
|
-
} catch (
|
|
47
|
-
console.error((
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error((error as Error)?.message)
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
})
|
package/src/commands/validate.ts
CHANGED
|
@@ -50,9 +50,9 @@ const command = defineCommand({
|
|
|
50
50
|
await oas.valdiate()
|
|
51
51
|
|
|
52
52
|
console.log('✅ Validation success')
|
|
53
|
-
} catch (
|
|
53
|
+
} catch (error) {
|
|
54
54
|
console.error('❌ Validation failed')
|
|
55
|
-
console.log((
|
|
55
|
+
console.log((error as Error)?.message)
|
|
56
56
|
process.exit(1)
|
|
57
57
|
}
|
|
58
58
|
}
|
package/src/runners/generate.ts
CHANGED
|
@@ -125,8 +125,8 @@ export async function generate({ input, config, events, logLevel }: GenerateProp
|
|
|
125
125
|
)
|
|
126
126
|
},
|
|
127
127
|
)
|
|
128
|
-
} catch (
|
|
129
|
-
await events.emit('error',
|
|
128
|
+
} catch (caughtError) {
|
|
129
|
+
await events.emit('error', caughtError as Error)
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
await events.emit('success', `Formatted with ${config.output.format}`)
|
|
@@ -153,9 +153,9 @@ export async function generate({ input, config, events, logLevel }: GenerateProp
|
|
|
153
153
|
)
|
|
154
154
|
},
|
|
155
155
|
)
|
|
156
|
-
} catch (
|
|
156
|
+
} catch (caughtError) {
|
|
157
157
|
const error = new Error('Biome not found')
|
|
158
|
-
error.cause =
|
|
158
|
+
error.cause = caughtError
|
|
159
159
|
await events.emit('error', error)
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -198,9 +198,9 @@ export async function generate({ input, config, events, logLevel }: GenerateProp
|
|
|
198
198
|
)
|
|
199
199
|
},
|
|
200
200
|
)
|
|
201
|
-
} catch (
|
|
201
|
+
} catch (caughtError) {
|
|
202
202
|
const error = new Error('Eslint not found')
|
|
203
|
-
error.cause =
|
|
203
|
+
error.cause = caughtError
|
|
204
204
|
await events.emit('error', error)
|
|
205
205
|
}
|
|
206
206
|
}
|
|
@@ -226,9 +226,9 @@ export async function generate({ input, config, events, logLevel }: GenerateProp
|
|
|
226
226
|
)
|
|
227
227
|
},
|
|
228
228
|
)
|
|
229
|
-
} catch (
|
|
229
|
+
} catch (caughtError) {
|
|
230
230
|
const error = new Error('Biome not found')
|
|
231
|
-
error.cause =
|
|
231
|
+
error.cause = caughtError
|
|
232
232
|
await events.emit('error', error)
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -254,9 +254,9 @@ export async function generate({ input, config, events, logLevel }: GenerateProp
|
|
|
254
254
|
)
|
|
255
255
|
},
|
|
256
256
|
)
|
|
257
|
-
} catch (
|
|
257
|
+
} catch (caughtError) {
|
|
258
258
|
const error = new Error('Oxlint not found')
|
|
259
|
-
error.cause =
|
|
259
|
+
error.cause = caughtError
|
|
260
260
|
await events.emit('error', error)
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -59,8 +59,8 @@ export async function getCosmiConfig(moduleName: string, config?: string): Promi
|
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
61
|
result = config ? ((await explorer.load(config)) as CosmiconfigResult) : ((await explorer.search()) as CosmiconfigResult)
|
|
62
|
-
} catch (
|
|
63
|
-
throw new Error('Config failed loading', { cause:
|
|
62
|
+
} catch (error) {
|
|
63
|
+
throw new Error('Config failed loading', { cause: error })
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
if (result?.isEmpty || !result || !result.config) {
|
package/dist/package-BqxUFXm-.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-BqxUFXm-.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-ChTBCRJt.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|