@kubb/cli 5.0.0-beta.5 → 5.0.0-beta.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/agent-BJEvbSiP.js +68 -0
- package/dist/agent-BJEvbSiP.js.map +1 -0
- package/dist/agent-CXNO6dgj.cjs +70 -0
- package/dist/agent-CXNO6dgj.cjs.map +1 -0
- package/dist/{agent-CS45W0kL.cjs → agent-D9CKYh4K.cjs} +3 -3
- package/dist/{agent-CS45W0kL.cjs.map → agent-D9CKYh4K.cjs.map} +1 -1
- package/dist/{agent-IP0eLV3C.js → agent-VXKxLCho.js} +3 -3
- package/dist/{agent-IP0eLV3C.js.map → agent-VXKxLCho.js.map} +1 -1
- package/dist/constants-BPJBMT_6.js +45 -0
- package/dist/constants-BPJBMT_6.js.map +1 -0
- package/dist/constants-BYGmiFs0.cjs +139 -0
- package/dist/constants-BYGmiFs0.cjs.map +1 -0
- package/dist/constants-DSJ-Xrbv.js +116 -0
- package/dist/constants-DSJ-Xrbv.js.map +1 -0
- package/dist/constants-Rcaqzyd-.cjs +80 -0
- package/dist/constants-Rcaqzyd-.cjs.map +1 -0
- package/dist/define-Bdn8j5VM.cjs.map +1 -1
- package/dist/define-Ctii4bel.js.map +1 -1
- package/dist/errors-CLCjoSg0.cjs.map +1 -1
- package/dist/errors-CjPmyZHy.js.map +1 -1
- package/dist/{generate-7td_hs73.cjs → generate-BB2Q7I9s.cjs} +9 -3
- package/dist/{generate-7td_hs73.cjs.map → generate-BB2Q7I9s.cjs.map} +1 -1
- package/dist/{generate-CUd1dUY5.cjs → generate-B_p5dl68.cjs} +4 -4
- package/dist/{generate-CUd1dUY5.cjs.map → generate-B_p5dl68.cjs.map} +1 -1
- package/dist/{generate-BqeFFQGD.js → generate-BmulGxIM.js} +9 -3
- package/dist/{generate-BqeFFQGD.js.map → generate-BmulGxIM.js.map} +1 -1
- package/dist/{generate-DVmGtwWe.js → generate-DAsdUw3z.js} +4 -4
- package/dist/{generate-DVmGtwWe.js.map → generate-DAsdUw3z.js.map} +1 -1
- package/dist/index.cjs +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/dist/init-BTp9if7K.js +53 -0
- package/dist/init-BTp9if7K.js.map +1 -0
- package/dist/{init-C5sZulT6.cjs → init-CJ80lKSP.cjs} +47 -101
- package/dist/init-CJ80lKSP.cjs.map +1 -0
- package/dist/{init-Cag3082g.js → init-DCqcEq86.js} +44 -98
- package/dist/init-DCqcEq86.js.map +1 -0
- package/dist/init-Dpg8e1HN.cjs +53 -0
- package/dist/init-Dpg8e1HN.cjs.map +1 -0
- package/dist/mcp-C9RoU-Dg.js +39 -0
- package/dist/mcp-C9RoU-Dg.js.map +1 -0
- package/dist/{mcp-BfORW-mY.cjs → mcp-D1llTaRM.cjs} +7 -4
- package/dist/mcp-D1llTaRM.cjs.map +1 -0
- package/dist/{mcp-DtQ5o0On.js → mcp-DNUw8nqb.js} +7 -4
- package/dist/mcp-DNUw8nqb.js.map +1 -0
- package/dist/mcp-wpl6sYYR.cjs +39 -0
- package/dist/mcp-wpl6sYYR.cjs.map +1 -0
- package/dist/{package-BmYRU2hz.cjs → package-iheSdfas.cjs} +2 -2
- package/dist/package-iheSdfas.cjs.map +1 -0
- package/dist/package-vLafMWCe.js +6 -0
- package/dist/package-vLafMWCe.js.map +1 -0
- package/dist/shell-475fQKaX.cjs.map +1 -1
- package/dist/shell-DLzN4fRo.js.map +1 -1
- package/dist/{telemetry-BU25EoI-.cjs → telemetry-BLX0NzRk.cjs} +2 -2
- package/dist/{telemetry-BU25EoI-.cjs.map → telemetry-BLX0NzRk.cjs.map} +1 -1
- package/dist/{telemetry-CaNU4-Bf.js → telemetry-juq4QBf7.js} +2 -2
- package/dist/{telemetry-CaNU4-Bf.js.map → telemetry-juq4QBf7.js.map} +1 -1
- package/dist/validate-BU4fPTMc.cjs +47 -0
- package/dist/validate-BU4fPTMc.cjs.map +1 -0
- package/dist/validate-BfJoCxrC.js +26 -0
- package/dist/validate-BfJoCxrC.js.map +1 -0
- package/dist/validate-DIDBROB2.cjs +26 -0
- package/dist/validate-DIDBROB2.cjs.map +1 -0
- package/dist/validate-k9s_hFah.js +46 -0
- package/dist/validate-k9s_hFah.js.map +1 -0
- package/package.json +11 -6
- package/src/commands/agent/start.ts +8 -5
- package/src/commands/agent.ts +3 -1
- package/src/commands/generate.ts +3 -1
- package/src/commands/init.ts +33 -2
- package/src/commands/mcp.ts +27 -3
- package/src/commands/validate.ts +4 -2
- package/src/constants.ts +1 -53
- package/src/runners/init.ts +29 -118
- package/src/runners/mcp.ts +7 -2
- package/src/runners/validate.ts +23 -4
- package/dist/agent-BcUEl9yB.js +0 -56
- package/dist/agent-BcUEl9yB.js.map +0 -1
- package/dist/agent-CsMvXeqI.cjs +0 -58
- package/dist/agent-CsMvXeqI.cjs.map +0 -1
- package/dist/constants-B4iBDvCe.cjs +0 -148
- package/dist/constants-B4iBDvCe.cjs.map +0 -1
- package/dist/constants-DmPrkaz8.js +0 -95
- package/dist/constants-DmPrkaz8.js.map +0 -1
- package/dist/init-C5sZulT6.cjs.map +0 -1
- package/dist/init-Cag3082g.js.map +0 -1
- package/dist/init-CfAn19gC.js +0 -25
- package/dist/init-CfAn19gC.js.map +0 -1
- package/dist/init-CfsYoyGe.cjs +0 -25
- package/dist/init-CfsYoyGe.cjs.map +0 -1
- package/dist/mcp-BfORW-mY.cjs.map +0 -1
- package/dist/mcp-BtOV6acy.js +0 -16
- package/dist/mcp-BtOV6acy.js.map +0 -1
- package/dist/mcp-CIbuLGMx.cjs +0 -16
- package/dist/mcp-CIbuLGMx.cjs.map +0 -1
- package/dist/mcp-DtQ5o0On.js.map +0 -1
- package/dist/package-BmYRU2hz.cjs.map +0 -1
- package/dist/package-DBU5ii-k.js +0 -6
- package/dist/package-DBU5ii-k.js.map +0 -1
- package/dist/validate-CQqM9siF.js +0 -25
- package/dist/validate-CQqM9siF.js.map +0 -1
- package/dist/validate-DBXLaLIn.cjs +0 -34
- package/dist/validate-DBXLaLIn.cjs.map +0 -1
- package/dist/validate-DI23zgmL.js +0 -33
- package/dist/validate-DI23zgmL.js.map +0 -1
- package/dist/validate-DwX4LzYq.cjs +0 -25
- package/dist/validate-DwX4LzYq.cjs.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const require_constants = require("./constants-BYGmiFs0.cjs");
|
|
2
|
+
//#region src/constants.ts
|
|
3
|
+
/**
|
|
4
|
+
* NPM registry endpoint used to check for @kubb/cli updates.
|
|
5
|
+
*/
|
|
6
|
+
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
7
|
+
/**
|
|
8
|
+
* OpenTelemetry ingestion endpoint for anonymous usage telemetry.
|
|
9
|
+
*/
|
|
10
|
+
const OTLP_ENDPOINT = "https://otlp.kubb.dev";
|
|
11
|
+
/**
|
|
12
|
+
* Horizontal rule rendered above/below the plain-logger generation summary.
|
|
13
|
+
*/
|
|
14
|
+
const SUMMARY_SEPARATOR = "─".repeat(27);
|
|
15
|
+
/**
|
|
16
|
+
* Glob pattern for paths the file watcher ignores.
|
|
17
|
+
*/
|
|
18
|
+
const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
|
|
19
|
+
/**
|
|
20
|
+
* Flags that short-circuit execution (help/version) — no telemetry notice is shown.
|
|
21
|
+
*/
|
|
22
|
+
const QUIET_FLAGS = new Set([
|
|
23
|
+
"--help",
|
|
24
|
+
"-h",
|
|
25
|
+
"--version",
|
|
26
|
+
"-v"
|
|
27
|
+
]);
|
|
28
|
+
const agentDefaults = {
|
|
29
|
+
port: "3000",
|
|
30
|
+
host: "localhost",
|
|
31
|
+
configFile: require_constants.KUBB_CONFIG_FILENAME,
|
|
32
|
+
retryTimeout: "30000",
|
|
33
|
+
studioUrl: "https://kubb.studio",
|
|
34
|
+
/**
|
|
35
|
+
* Relative path from the @kubb/agent package root to the server entry.
|
|
36
|
+
*/
|
|
37
|
+
serverEntryPath: ".output/server/index.mjs"
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Color palette used by randomCliColor() for deterministic plugin name coloring.
|
|
41
|
+
*/
|
|
42
|
+
//#endregion
|
|
43
|
+
Object.defineProperty(exports, "KUBB_NPM_PACKAGE_URL", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return KUBB_NPM_PACKAGE_URL;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "OTLP_ENDPOINT", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return OTLP_ENDPOINT;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "QUIET_FLAGS", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
return QUIET_FLAGS;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "SUMMARY_SEPARATOR", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function() {
|
|
64
|
+
return SUMMARY_SEPARATOR;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "WATCHER_IGNORED_PATHS", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function() {
|
|
70
|
+
return WATCHER_IGNORED_PATHS;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "agentDefaults", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function() {
|
|
76
|
+
return agentDefaults;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=constants-Rcaqzyd-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-Rcaqzyd-.cjs","names":["KUBB_CONFIG_FILENAME"],"sources":["../src/constants.ts"],"sourcesContent":["import { KUBB_CONFIG_FILENAME } from '@internals/shared'\n\n/**\n * NPM registry endpoint used to check for @kubb/cli updates.\n */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/**\n * OpenTelemetry ingestion endpoint for anonymous usage telemetry.\n */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/**\n * Horizontal rule rendered above/below the plain-logger generation summary.\n */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/**\n * Maximum number of █ characters in a plugin timing bar.\n */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/**\n * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).\n */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/**\n * Glob pattern for paths the file watcher ignores.\n */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/**\n * Flags that short-circuit execution (help/version) — no telemetry notice is shown.\n */\nexport const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: KUBB_CONFIG_FILENAME,\n retryTimeout: '30000',\n studioUrl: 'https://kubb.studio',\n /**\n * Relative path from the @kubb/agent package root to the server entry.\n */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/**\n * Color palette used by randomCliColor() for deterministic plugin name coloring.\n */\n"],"mappings":";;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;;;;AAK7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;;;AAe/C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;CAAK,CAAU;AAEhF,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAYA,kBAAAA;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-Bdn8j5VM.cjs","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;
|
|
1
|
+
{"version":3,"file":"define-Bdn8j5VM.cjs","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n examples?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;CAChE,OAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAQpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;CACzB,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-Ctii4bel.js","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;
|
|
1
|
+
{"version":3,"file":"define-Ctii4bel.js","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n examples?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;CAChE,OAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAQpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;CACzB,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-CLCjoSg0.cjs","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n *\n * @example\n * ```ts\n * throw new BuildError('Build failed', { errors: [err1, err2] })\n * ```\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new BuildError('Build failed', { cause: toError(err), errors: [] })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error`, or `undefined` when absent or not an `Error`.\n *\n * @example\n * ```ts\n * const cause = toCause(buildError) // Error | undefined\n * ```\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,QAAQ,OAAuB;
|
|
1
|
+
{"version":3,"file":"errors-CLCjoSg0.cjs","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n *\n * @example\n * ```ts\n * throw new BuildError('Build failed', { errors: [err1, err2] })\n * ```\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new BuildError('Build failed', { cause: toError(err), errors: [] })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error`, or `undefined` when absent or not an `Error`.\n *\n * @example\n * ```ts\n * const cause = toCause(buildError) // Error | undefined\n * ```\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;;;;;;;AAYlE,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;;;;;;;;;AAW/D,SAAgB,QAAQ,OAAiC;CACvD,OAAO,MAAM,iBAAiB,QAAQ,MAAM,QAAQ,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-CjPmyZHy.js","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n *\n * @example\n * ```ts\n * throw new BuildError('Build failed', { errors: [err1, err2] })\n * ```\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new BuildError('Build failed', { cause: toError(err), errors: [] })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error`, or `undefined` when absent or not an `Error`.\n *\n * @example\n * ```ts\n * const cause = toCause(buildError) // Error | undefined\n * ```\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,QAAQ,OAAuB;
|
|
1
|
+
{"version":3,"file":"errors-CjPmyZHy.js","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n *\n * @example\n * ```ts\n * throw new BuildError('Build failed', { errors: [err1, err2] })\n * ```\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new BuildError('Build failed', { cause: toError(err), errors: [] })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error`, or `undefined` when absent or not an `Error`.\n *\n * @example\n * ```ts\n * const cause = toCause(buildError) // Error | undefined\n * ```\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;;;;;;;AAYlE,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;;;;;;;;;AAW/D,SAAgB,QAAQ,OAAiC;CACvD,OAAO,MAAM,iBAAiB,QAAQ,MAAM,QAAQ,KAAA"}
|
|
@@ -2,8 +2,14 @@ require("./chunk-ByKO4r7w.cjs");
|
|
|
2
2
|
//#region src/commands/generate.ts
|
|
3
3
|
const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
4
4
|
name: "generate",
|
|
5
|
-
description: "
|
|
5
|
+
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.",
|
|
6
6
|
arguments: ["[input]"],
|
|
7
|
+
examples: [
|
|
8
|
+
"kubb generate",
|
|
9
|
+
"kubb generate ./openapi.yaml",
|
|
10
|
+
"kubb generate --config kubb.config.ts",
|
|
11
|
+
"kubb generate --watch"
|
|
12
|
+
],
|
|
7
13
|
options: {
|
|
8
14
|
config: {
|
|
9
15
|
type: "string",
|
|
@@ -50,7 +56,7 @@ const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
|
50
56
|
},
|
|
51
57
|
async run({ values, positionals }) {
|
|
52
58
|
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
53
|
-
const { runGenerateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
59
|
+
const { runGenerateCommand } = await Promise.resolve().then(() => require("./generate-B_p5dl68.cjs"));
|
|
54
60
|
await runGenerateCommand({
|
|
55
61
|
input: positionals[0],
|
|
56
62
|
configPath: values.config,
|
|
@@ -62,4 +68,4 @@ const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
|
62
68
|
//#endregion
|
|
63
69
|
exports.command = command;
|
|
64
70
|
|
|
65
|
-
//# sourceMappingURL=generate-
|
|
71
|
+
//# sourceMappingURL=generate-BB2Q7I9s.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-BB2Q7I9s.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\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 arguments: ['[input]'],\n examples: ['kubb generate', 'kubb generate ./openapi.yaml', 'kubb generate --config kubb.config.ts', 'kubb generate --watch'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\n default: false,\n },\n debug: {\n type: 'boolean',\n description: 'Override logLevel to debug',\n short: 'd',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n short: 'v',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({\n input: positionals[0],\n configPath: values.config,\n logLevel,\n watch: values.watch,\n })\n },\n})\n"],"mappings":";;AAEA,MAAa,0CAAUA,CAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,WAAW,CAAC,UAAU;CACtB,UAAU;EAAC;EAAiB;EAAgC;EAAyC;EAAwB;CAC7H,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACR;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACF;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;EAErC,MAAM,mBAAmB;GACvB,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACf,CAAC;;CAEL,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-ByKO4r7w.cjs");
|
|
2
2
|
const require_errors = require("./errors-CLCjoSg0.cjs");
|
|
3
|
-
const require_telemetry = require("./telemetry-
|
|
3
|
+
const require_telemetry = require("./telemetry-BLX0NzRk.cjs");
|
|
4
4
|
const require_shell = require("./shell-475fQKaX.cjs");
|
|
5
|
-
const require_package = require("./package-
|
|
6
|
-
const require_constants = require("./constants-
|
|
5
|
+
const require_package = require("./package-iheSdfas.cjs");
|
|
6
|
+
const require_constants = require("./constants-Rcaqzyd-.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
let node_events = require("node:events");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1752,4 +1752,4 @@ async function runGenerateCommand({ input, configPath, logLevel: logLevelKey, wa
|
|
|
1752
1752
|
//#endregion
|
|
1753
1753
|
exports.runGenerateCommand = runGenerateCommand;
|
|
1754
1754
|
|
|
1755
|
-
//# sourceMappingURL=generate-
|
|
1755
|
+
//# sourceMappingURL=generate-B_p5dl68.cjs.map
|