@kubb/cli 5.0.0-beta.7 → 5.0.0-beta.70
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/LICENSE +17 -10
- package/README.md +45 -77
- package/bin/kubb.js +9 -3
- package/dist/Telemetry-CfPP7MYq.cjs +321 -0
- package/dist/Telemetry-CfPP7MYq.cjs.map +1 -0
- package/dist/Telemetry-uAr3lK_-.js +284 -0
- package/dist/Telemetry-uAr3lK_-.js.map +1 -0
- package/dist/{define-Bdn8j5VM.cjs → defineCommand-Bo3yZTWI.cjs} +3 -21
- package/dist/defineCommand-Bo3yZTWI.cjs.map +1 -0
- package/dist/{define-m_fp-Aqm.js → defineCommand-DMEeqliP.js} +4 -16
- package/dist/defineCommand-DMEeqliP.js.map +1 -0
- package/dist/{errors-CINO1EIv.js → errors-Dc_d7BfX.js} +2 -2
- package/dist/{errors-CINO1EIv.js.map → errors-Dc_d7BfX.js.map} +1 -1
- package/dist/{errors-CLCjoSg0.cjs → errors-gxFK0vrp.cjs} +2 -2
- package/dist/{errors-CLCjoSg0.cjs.map → errors-gxFK0vrp.cjs.map} +1 -1
- package/dist/{generate-BY-juRdH.js → generate-BdxIouwm.js} +21 -16
- package/dist/generate-BdxIouwm.js.map +1 -0
- package/dist/{generate-Bod9YCbF.cjs → generate-tRupKbnI.cjs} +21 -16
- package/dist/generate-tRupKbnI.cjs.map +1 -0
- package/dist/index.cjs +34 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +34 -81
- package/dist/index.js.map +1 -1
- package/dist/{init-Cs3Fp6nN.js → init-D_9I495E.js} +5 -5
- package/dist/{init-Cs3Fp6nN.js.map → init-D_9I495E.js.map} +1 -1
- package/dist/{init-BIkZU6mB.cjs → init-XlS3aia7.cjs} +6 -6
- package/dist/{init-BIkZU6mB.cjs.map → init-XlS3aia7.cjs.map} +1 -1
- package/dist/mcp-BlKi3z04.js +21 -0
- package/dist/mcp-BlKi3z04.js.map +1 -0
- package/dist/mcp-DSo5Ccwz.cjs +21 -0
- package/dist/mcp-DSo5Ccwz.cjs.map +1 -0
- package/dist/package-CsDaFmfZ.js +6 -0
- package/dist/package-CsDaFmfZ.js.map +1 -0
- package/dist/{package-DrUndPET.cjs → package-HWZRLSO4.cjs} +2 -2
- package/dist/package-HWZRLSO4.cjs.map +1 -0
- package/dist/{chunk-BvFE5Tac.js → rolldown-runtime-C0LytTxp.js} +0 -1
- package/dist/{run-YsoCk5we.cjs → run-AYlRjIX5.cjs} +136 -98
- package/dist/run-AYlRjIX5.cjs.map +1 -0
- package/dist/run-BM1t8CSM.cjs +33 -0
- package/dist/run-BM1t8CSM.cjs.map +1 -0
- package/dist/run-BlFVmIJl.js +32 -0
- package/dist/run-BlFVmIJl.js.map +1 -0
- package/dist/{run-CQbj3ley.cjs → run-CBc896in.cjs} +6 -6
- package/dist/run-CBc896in.cjs.map +1 -0
- package/dist/{run-CF97BWVa.js → run-D9mQoQHA.js} +123 -85
- package/dist/run-D9mQoQHA.js.map +1 -0
- package/dist/{run-CCZ24VKk.js → run-D_dWNFhX.js} +5 -5
- package/dist/run-D_dWNFhX.js.map +1 -0
- package/dist/run-DwylXpzM.cjs +1380 -0
- package/dist/run-DwylXpzM.cjs.map +1 -0
- package/dist/run-KlHwxNTr.js +1377 -0
- package/dist/run-KlHwxNTr.js.map +1 -0
- package/dist/tools-CZT9wSA6.cjs +175 -0
- package/dist/tools-CZT9wSA6.cjs.map +1 -0
- package/dist/tools-D0UogMU3.js +152 -0
- package/dist/tools-D0UogMU3.js.map +1 -0
- package/dist/{validate-Bfpf_UIh.cjs → validate-3gu3yglv.cjs} +6 -6
- package/dist/{validate-Bfpf_UIh.cjs.map → validate-3gu3yglv.cjs.map} +1 -1
- package/dist/{validate-lbUkWQ5o.js → validate-DBqdV14W.js} +5 -5
- package/dist/{validate-lbUkWQ5o.js.map → validate-DBqdV14W.js.map} +1 -1
- package/package.json +13 -25
- package/dist/agent-DN7o8nlE.js +0 -68
- package/dist/agent-DN7o8nlE.js.map +0 -1
- package/dist/agent-Fm9_8BBH.cjs +0 -70
- package/dist/agent-Fm9_8BBH.cjs.map +0 -1
- package/dist/constants-B2JTeRBb.js +0 -42
- package/dist/constants-B2JTeRBb.js.map +0 -1
- package/dist/constants-BINTA5VZ.cjs +0 -77
- package/dist/constants-BINTA5VZ.cjs.map +0 -1
- package/dist/constants-BYGmiFs0.cjs +0 -139
- package/dist/constants-BYGmiFs0.cjs.map +0 -1
- package/dist/constants-DSJ-Xrbv.js +0 -116
- package/dist/constants-DSJ-Xrbv.js.map +0 -1
- package/dist/define-Bdn8j5VM.cjs.map +0 -1
- package/dist/define-m_fp-Aqm.js.map +0 -1
- package/dist/generate-BY-juRdH.js.map +0 -1
- package/dist/generate-Bod9YCbF.cjs.map +0 -1
- package/dist/mcp-BSNulBcC.js +0 -39
- package/dist/mcp-BSNulBcC.js.map +0 -1
- package/dist/mcp-DcSrFhhP.cjs +0 -39
- package/dist/mcp-DcSrFhhP.cjs.map +0 -1
- package/dist/package-D5wmvFl4.js +0 -6
- package/dist/package-D5wmvFl4.js.map +0 -1
- package/dist/package-DrUndPET.cjs.map +0 -1
- package/dist/run-BAJubgdA.js +0 -1735
- package/dist/run-BAJubgdA.js.map +0 -1
- package/dist/run-BzpYYOQs.js +0 -121
- package/dist/run-BzpYYOQs.js.map +0 -1
- package/dist/run-CCZ24VKk.js.map +0 -1
- package/dist/run-CF97BWVa.js.map +0 -1
- package/dist/run-CQbj3ley.cjs.map +0 -1
- package/dist/run-CqKd6JNc.cjs +0 -1738
- package/dist/run-CqKd6JNc.cjs.map +0 -1
- package/dist/run-D0hmRpHy.js +0 -49
- package/dist/run-D0hmRpHy.js.map +0 -1
- package/dist/run-DwdAwnLG.cjs +0 -125
- package/dist/run-DwdAwnLG.cjs.map +0 -1
- package/dist/run-Lr0Ctnu0.cjs +0 -50
- package/dist/run-Lr0Ctnu0.cjs.map +0 -1
- package/dist/run-YsoCk5we.cjs.map +0 -1
- package/dist/shell-475fQKaX.cjs +0 -62
- package/dist/shell-475fQKaX.cjs.map +0 -1
- package/dist/shell-CN6DNqeC.js +0 -51
- package/dist/shell-CN6DNqeC.js.map +0 -1
- package/dist/telemetry-B2iWkY5e.cjs +0 -280
- package/dist/telemetry-B2iWkY5e.cjs.map +0 -1
- package/dist/telemetry-BkektVz6.js +0 -243
- package/dist/telemetry-BkektVz6.js.map +0 -1
- package/src/commands/agent/start.ts +0 -50
- package/src/commands/agent.ts +0 -10
- package/src/commands/generate.ts +0 -59
- package/src/commands/init.ts +0 -51
- package/src/commands/mcp.ts +0 -36
- package/src/commands/validate.ts +0 -22
- package/src/constants.ts +0 -48
- package/src/index.ts +0 -45
- package/src/loggers/clackLogger.ts +0 -460
- package/src/loggers/fileSystemLogger.ts +0 -148
- package/src/loggers/githubActionsLogger.ts +0 -367
- package/src/loggers/plainLogger.ts +0 -243
- package/src/loggers/types.ts +0 -7
- package/src/loggers/utils.ts +0 -252
- package/src/runners/agent/run.ts +0 -113
- package/src/runners/agent/utils.ts +0 -98
- package/src/runners/generate/run.ts +0 -276
- package/src/runners/generate/utils.ts +0 -209
- package/src/runners/init/run.ts +0 -211
- package/src/runners/init/utils.ts +0 -33
- package/src/runners/mcp/run.ts +0 -55
- package/src/runners/validate/run.ts +0 -63
- package/src/telemetry.ts +0 -280
- /package/dist/{chunk-ByKO4r7w.cjs → rolldown-runtime-Bx3C2hgW.cjs} +0 -0
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
//#region ../../internals/shared/src/constants.ts
|
|
2
|
-
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
3
|
-
const initDefaults = {
|
|
4
|
-
inputPath: "./openapi.yaml",
|
|
5
|
-
outputPath: "./src/gen",
|
|
6
|
-
plugins: ["plugin-ts"]
|
|
7
|
-
};
|
|
8
|
-
const availablePlugins = [
|
|
9
|
-
{
|
|
10
|
-
value: "plugin-ts",
|
|
11
|
-
label: "TypeScript",
|
|
12
|
-
hint: "Recommended",
|
|
13
|
-
packageName: "@kubb/plugin-ts",
|
|
14
|
-
importName: "pluginTs",
|
|
15
|
-
category: "types"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: "plugin-client",
|
|
19
|
-
label: "Client (Fetch/Axios)",
|
|
20
|
-
packageName: "@kubb/plugin-client",
|
|
21
|
-
importName: "pluginClient",
|
|
22
|
-
category: "client"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: "plugin-react-query",
|
|
26
|
-
label: "React Query / TanStack Query",
|
|
27
|
-
packageName: "@kubb/plugin-react-query",
|
|
28
|
-
importName: "pluginReactQuery",
|
|
29
|
-
category: "framework"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: "plugin-vue-query",
|
|
33
|
-
label: "Vue Query",
|
|
34
|
-
packageName: "@kubb/plugin-vue-query",
|
|
35
|
-
importName: "pluginVueQuery",
|
|
36
|
-
category: "framework"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
value: "plugin-zod",
|
|
40
|
-
label: "Zod Schemas",
|
|
41
|
-
packageName: "@kubb/plugin-zod",
|
|
42
|
-
importName: "pluginZod",
|
|
43
|
-
category: "validation"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
value: "plugin-faker",
|
|
47
|
-
label: "Faker.js Mocks",
|
|
48
|
-
packageName: "@kubb/plugin-faker",
|
|
49
|
-
importName: "pluginFaker",
|
|
50
|
-
category: "mocks"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: "plugin-msw",
|
|
54
|
-
label: "MSW Handlers",
|
|
55
|
-
packageName: "@kubb/plugin-msw",
|
|
56
|
-
importName: "pluginMsw",
|
|
57
|
-
category: "mocks"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: "plugin-cypress",
|
|
61
|
-
label: "Cypress Tests",
|
|
62
|
-
packageName: "@kubb/plugin-cypress",
|
|
63
|
-
importName: "pluginCypress",
|
|
64
|
-
category: "testing"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
value: "plugin-mcp",
|
|
68
|
-
label: "MCP Server (AI / Model Context Protocol)",
|
|
69
|
-
packageName: "@kubb/plugin-mcp",
|
|
70
|
-
importName: "pluginMcp",
|
|
71
|
-
category: "ai"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
value: "plugin-redoc",
|
|
75
|
-
label: "ReDoc Documentation",
|
|
76
|
-
packageName: "@kubb/plugin-redoc",
|
|
77
|
-
importName: "pluginRedoc",
|
|
78
|
-
category: "documentation"
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
const pluginDefaultConfigs = {
|
|
82
|
-
"plugin-ts": `pluginTs({
|
|
83
|
-
output: { path: 'models' },
|
|
84
|
-
})`,
|
|
85
|
-
"plugin-client": `pluginClient({
|
|
86
|
-
output: { path: 'clients' },
|
|
87
|
-
})`,
|
|
88
|
-
"plugin-react-query": `pluginReactQuery({
|
|
89
|
-
output: { path: 'hooks' },
|
|
90
|
-
})`,
|
|
91
|
-
"plugin-vue-query": `pluginVueQuery({
|
|
92
|
-
output: { path: 'hooks' },
|
|
93
|
-
})`,
|
|
94
|
-
"plugin-zod": `pluginZod({
|
|
95
|
-
output: { path: 'zod' },
|
|
96
|
-
})`,
|
|
97
|
-
"plugin-faker": `pluginFaker({
|
|
98
|
-
output: { path: 'mocks' },
|
|
99
|
-
})`,
|
|
100
|
-
"plugin-msw": `pluginMsw({
|
|
101
|
-
output: { path: 'msw' },
|
|
102
|
-
})`,
|
|
103
|
-
"plugin-cypress": `pluginCypress({
|
|
104
|
-
output: { path: 'cypress' },
|
|
105
|
-
})`,
|
|
106
|
-
"plugin-mcp": `pluginMcp({
|
|
107
|
-
output: { path: 'mcp' },
|
|
108
|
-
})`,
|
|
109
|
-
"plugin-redoc": `pluginRedoc({
|
|
110
|
-
output: { path: 'redoc' },
|
|
111
|
-
})`
|
|
112
|
-
};
|
|
113
|
-
//#endregion
|
|
114
|
-
export { pluginDefaultConfigs as i, availablePlugins as n, initDefaults as r, KUBB_CONFIG_FILENAME as t };
|
|
115
|
-
|
|
116
|
-
//# sourceMappingURL=constants-DSJ-Xrbv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-DSJ-Xrbv.js","names":[],"sources":["../../../internals/shared/src/constants.ts"],"sourcesContent":["import type { PluginOption } from './types.ts'\n\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\nexport const availablePlugins: PluginOption[] = [\n {\n value: 'plugin-ts',\n label: 'TypeScript',\n hint: 'Recommended',\n packageName: '@kubb/plugin-ts',\n importName: 'pluginTs',\n category: 'types',\n },\n {\n value: 'plugin-client',\n label: 'Client (Fetch/Axios)',\n packageName: '@kubb/plugin-client',\n importName: 'pluginClient',\n category: 'client',\n },\n {\n value: 'plugin-react-query',\n label: 'React Query / TanStack Query',\n packageName: '@kubb/plugin-react-query',\n importName: 'pluginReactQuery',\n category: 'framework',\n },\n {\n value: 'plugin-vue-query',\n label: 'Vue Query',\n packageName: '@kubb/plugin-vue-query',\n importName: 'pluginVueQuery',\n category: 'framework',\n },\n {\n value: 'plugin-zod',\n label: 'Zod Schemas',\n packageName: '@kubb/plugin-zod',\n importName: 'pluginZod',\n category: 'validation',\n },\n {\n value: 'plugin-faker',\n label: 'Faker.js Mocks',\n packageName: '@kubb/plugin-faker',\n importName: 'pluginFaker',\n category: 'mocks',\n },\n {\n value: 'plugin-msw',\n label: 'MSW Handlers',\n packageName: '@kubb/plugin-msw',\n importName: 'pluginMsw',\n category: 'mocks',\n },\n {\n value: 'plugin-cypress',\n label: 'Cypress Tests',\n packageName: '@kubb/plugin-cypress',\n importName: 'pluginCypress',\n category: 'testing',\n },\n {\n value: 'plugin-mcp',\n label: 'MCP Server (AI / Model Context Protocol)',\n packageName: '@kubb/plugin-mcp',\n importName: 'pluginMcp',\n category: 'ai',\n },\n {\n value: 'plugin-redoc',\n label: 'ReDoc Documentation',\n packageName: '@kubb/plugin-redoc',\n importName: 'pluginRedoc',\n category: 'documentation',\n },\n]\n\nexport const pluginDefaultConfigs = {\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n 'plugin-cypress': `pluginCypress({\n output: { path: 'cypress' },\n })`,\n 'plugin-mcp': `pluginMcp({\n output: { path: 'mcp' },\n })`,\n 'plugin-redoc': `pluginRedoc({\n output: { path: 'redoc' },\n })`,\n} as const satisfies Record<string, string>\n"],"mappings":";AAEA,MAAa,uBAAuB;AAEpC,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,YAAY;CACvB;AAED,MAAa,mBAAmC;CAC9C;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACD;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;EACX;CACF;AAED,MAAa,uBAAuB;CAClC,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,oBAAoB;;;CAGpB,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGd,kBAAkB;;;CAGlB,cAAc;;;CAGd,gBAAgB;;;CAGjB"}
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-m_fp-Aqm.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-BY-juRdH.js","names":[],"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 { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: positionals[0],\n configPath: values.config,\n logLevel,\n watch: values.watch,\n })\n },\n})\n"],"mappings":";;;AAEA,MAAa,UAAU,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,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACf,CAAC;;CAEL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-Bod9YCbF.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 { run } = await import('../runners/generate/run.ts')\n\n await run({\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,QAAQ,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACf,CAAC;;CAEL,CAAC"}
|
package/dist/mcp-BSNulBcC.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import "./chunk-BvFE5Tac.js";
|
|
2
|
-
import { n as defineCommand } from "./define-m_fp-Aqm.js";
|
|
3
|
-
import { t as version } from "./package-D5wmvFl4.js";
|
|
4
|
-
//#region src/commands/mcp.ts
|
|
5
|
-
const command = defineCommand({
|
|
6
|
-
name: "mcp",
|
|
7
|
-
description: "Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.",
|
|
8
|
-
examples: [
|
|
9
|
-
"kubb mcp",
|
|
10
|
-
"kubb mcp --port 3001",
|
|
11
|
-
"# Then add to your MCP client config:",
|
|
12
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
13
|
-
],
|
|
14
|
-
options: {
|
|
15
|
-
port: {
|
|
16
|
-
type: "string",
|
|
17
|
-
short: "p",
|
|
18
|
-
description: "Port for HTTP MCP server (omit for stdio)",
|
|
19
|
-
hint: "number"
|
|
20
|
-
},
|
|
21
|
-
host: {
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Hostname to bind to (HTTP mode only)",
|
|
24
|
-
default: "localhost"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
async run({ values }) {
|
|
28
|
-
const { run } = await import("./run-D0hmRpHy.js");
|
|
29
|
-
await run({
|
|
30
|
-
version,
|
|
31
|
-
port: values.port,
|
|
32
|
-
host: values.host
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
//#endregion
|
|
37
|
-
export { command };
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=mcp-BSNulBcC.js.map
|
package/dist/mcp-BSNulBcC.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-BSNulBcC.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: [\n 'kubb mcp',\n 'kubb mcp --port 3001',\n '# Then add to your MCP client config:',\n '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }',\n ],\n options: {\n port: {\n type: 'string',\n short: 'p',\n description: 'Port for HTTP MCP server (omit for stdio)',\n hint: 'number',\n },\n host: {\n type: 'string',\n description: 'Hostname to bind to (HTTP mode only)',\n default: 'localhost',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({\n version,\n port: values.port,\n host: values.host,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACD;CACD,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;GACP;EACD,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;GACV;EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR;GACA,MAAM,OAAO;GACb,MAAM,OAAO;GACd,CAAC;;CAEL,CAAC"}
|
package/dist/mcp-DcSrFhhP.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
-
const require_define = require("./define-Bdn8j5VM.cjs");
|
|
3
|
-
const require_package = require("./package-DrUndPET.cjs");
|
|
4
|
-
//#region src/commands/mcp.ts
|
|
5
|
-
const command = require_define.defineCommand({
|
|
6
|
-
name: "mcp",
|
|
7
|
-
description: "Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.",
|
|
8
|
-
examples: [
|
|
9
|
-
"kubb mcp",
|
|
10
|
-
"kubb mcp --port 3001",
|
|
11
|
-
"# Then add to your MCP client config:",
|
|
12
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
13
|
-
],
|
|
14
|
-
options: {
|
|
15
|
-
port: {
|
|
16
|
-
type: "string",
|
|
17
|
-
short: "p",
|
|
18
|
-
description: "Port for HTTP MCP server (omit for stdio)",
|
|
19
|
-
hint: "number"
|
|
20
|
-
},
|
|
21
|
-
host: {
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Hostname to bind to (HTTP mode only)",
|
|
24
|
-
default: "localhost"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
async run({ values }) {
|
|
28
|
-
const { run } = await Promise.resolve().then(() => require("./run-Lr0Ctnu0.cjs"));
|
|
29
|
-
await run({
|
|
30
|
-
version: require_package.version,
|
|
31
|
-
port: values.port,
|
|
32
|
-
host: values.host
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
//#endregion
|
|
37
|
-
exports.command = command;
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=mcp-DcSrFhhP.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-DcSrFhhP.cjs","names":["defineCommand"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: [\n 'kubb mcp',\n 'kubb mcp --port 3001',\n '# Then add to your MCP client config:',\n '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }',\n ],\n options: {\n port: {\n type: 'string',\n short: 'p',\n description: 'Port for HTTP MCP server (omit for stdio)',\n hint: 'number',\n },\n host: {\n type: 'string',\n description: 'Hostname to bind to (HTTP mode only)',\n default: 'localhost',\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({\n version,\n port: values.port,\n host: values.host,\n })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACD;CACD,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;GACP;EACD,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;GACV;EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,SAAA,gBAAA;GACA,MAAM,OAAO;GACb,MAAM,OAAO;GACd,CAAC;;CAEL,CAAC"}
|
package/dist/package-D5wmvFl4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-D5wmvFl4.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-DrUndPET.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|