@kubb/cli 5.0.0-beta.9 → 5.0.0-beta.93
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 +48 -79
- package/bin/kubb.js +9 -3
- package/dist/Telemetry-7z2tIqPm.js +282 -0
- package/dist/Telemetry-7z2tIqPm.js.map +1 -0
- package/dist/{telemetry-B2iWkY5e.cjs → Telemetry-xcWb-UWT.cjs} +167 -116
- package/dist/Telemetry-xcWb-UWT.cjs.map +1 -0
- package/dist/{errors-CINO1EIv.js → errors-CMvLO2NE.js} +3 -15
- package/dist/{errors-CINO1EIv.js.map → errors-CMvLO2NE.js.map} +1 -1
- package/dist/{errors-CLCjoSg0.cjs → errors-DNxBUo3k.cjs} +2 -20
- package/dist/{errors-CLCjoSg0.cjs.map → errors-DNxBUo3k.cjs.map} +1 -1
- package/dist/generate-Cc9j2-lg.js +87 -0
- package/dist/generate-Cc9j2-lg.js.map +1 -0
- package/dist/generate-DwTTaSpB.cjs +87 -0
- package/dist/generate-DwTTaSpB.cjs.map +1 -0
- package/dist/index.cjs +33 -261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +34 -262
- package/dist/index.js.map +1 -1
- package/dist/{init-DOSXtcyb.js → init-BlTepVY_.js} +13 -13
- package/dist/init-BlTepVY_.js.map +1 -0
- package/dist/{init-bKtEOvhK.cjs → init-CvVRvhfJ.cjs} +12 -13
- package/dist/init-CvVRvhfJ.cjs.map +1 -0
- package/dist/mcp-CTs7ogBF.js +21 -0
- package/dist/mcp-CTs7ogBF.js.map +1 -0
- package/dist/mcp-szP8HzB7.cjs +20 -0
- package/dist/mcp-szP8HzB7.cjs.map +1 -0
- package/dist/package-CfWW74Ug.js +6 -0
- package/dist/package-CfWW74Ug.js.map +1 -0
- package/dist/{package-DHGhrRW-.cjs → package-DPdskCYh.cjs} +2 -2
- package/dist/package-DPdskCYh.cjs.map +1 -0
- package/dist/{chunk-BvFE5Tac.js → rolldown-runtime-C0LytTxp.js} +0 -1
- package/dist/run-B8sdHsE4.js +1262 -0
- package/dist/run-B8sdHsE4.js.map +1 -0
- package/dist/{run-YsoCk5we.cjs → run-BNOCBw2y.cjs} +152 -98
- package/dist/run-BNOCBw2y.cjs.map +1 -0
- package/dist/{run-CQbj3ley.cjs → run-BdtVrLKu.cjs} +9 -15
- package/dist/run-BdtVrLKu.cjs.map +1 -0
- package/dist/{run-CF97BWVa.js → run-CINOocLR.js} +138 -84
- package/dist/run-CINOocLR.js.map +1 -0
- package/dist/{run-CCZ24VKk.js → run-CaOjZRiQ.js} +7 -13
- package/dist/run-CaOjZRiQ.js.map +1 -0
- package/dist/run-D2vd34xp.cjs +33 -0
- package/dist/run-D2vd34xp.cjs.map +1 -0
- package/dist/run-DFXppyRD.cjs +1265 -0
- package/dist/run-DFXppyRD.cjs.map +1 -0
- package/dist/run-lgrTO14E.js +32 -0
- package/dist/run-lgrTO14E.js.map +1 -0
- package/dist/tools-B23ltmWP.js +152 -0
- package/dist/tools-B23ltmWP.js.map +1 -0
- package/dist/tools-CeIABV0T.cjs +175 -0
- package/dist/tools-CeIABV0T.cjs.map +1 -0
- package/dist/{validate-Bj8vbvPt.cjs → validate-BhSbvuiq.cjs} +9 -10
- package/dist/validate-BhSbvuiq.cjs.map +1 -0
- package/dist/{validate-bHUrnYBv.js → validate-Cfi4pIS0.js} +10 -10
- package/dist/validate-Cfi4pIS0.js.map +1 -0
- package/package.json +14 -28
- package/dist/agent-C5F4itrc.js +0 -68
- package/dist/agent-C5F4itrc.js.map +0 -1
- package/dist/agent-d-lmeOr1.cjs +0 -70
- package/dist/agent-d-lmeOr1.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 +0 -54
- package/dist/define-Bdn8j5VM.cjs.map +0 -1
- package/dist/define-m_fp-Aqm.js +0 -43
- package/dist/define-m_fp-Aqm.js.map +0 -1
- package/dist/generate-BhfRufgh.js +0 -72
- package/dist/generate-BhfRufgh.js.map +0 -1
- package/dist/generate-BvuSxNYj.cjs +0 -71
- package/dist/generate-BvuSxNYj.cjs.map +0 -1
- package/dist/init-DOSXtcyb.js.map +0 -1
- package/dist/init-bKtEOvhK.cjs.map +0 -1
- package/dist/mcp-CKkbG0kp.cjs +0 -39
- package/dist/mcp-CKkbG0kp.cjs.map +0 -1
- package/dist/mcp-DzOfqX_j.js +0 -39
- package/dist/mcp-DzOfqX_j.js.map +0 -1
- package/dist/package-BgAYWN7y.js +0 -6
- package/dist/package-BgAYWN7y.js.map +0 -1
- package/dist/package-DHGhrRW-.cjs.map +0 -1
- package/dist/run-BObDb2qe.cjs +0 -1741
- package/dist/run-BObDb2qe.cjs.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-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-P6D8TnXf.js +0 -1738
- package/dist/run-P6D8TnXf.js.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.map +0 -1
- package/dist/telemetry-BkektVz6.js +0 -243
- package/dist/telemetry-BkektVz6.js.map +0 -1
- package/dist/validate-Bj8vbvPt.cjs.map +0 -1
- package/dist/validate-bHUrnYBv.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 -151
- 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"}
|
package/dist/define-Bdn8j5VM.cjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
-
//#region ../../internals/utils/src/cli/define.ts
|
|
3
|
-
/**
|
|
4
|
-
* Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })
|
|
9
|
-
* createCLI({ adapter }).run(commands, argv, opts)
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
function defineCLIAdapter(adapter) {
|
|
13
|
-
return adapter;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns a `CommandDefinition` with typed `values` in `run()`.
|
|
17
|
-
* The callback receives `values` inferred from the declared options — no casts needed.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* const generate = defineCommand({
|
|
22
|
-
* name: 'generate',
|
|
23
|
-
* description: 'Generate client code',
|
|
24
|
-
* options: { config: { type: 'string', description: 'Config path' } },
|
|
25
|
-
* async run({ values }) { console.log(values.config) },
|
|
26
|
-
* })
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
function defineCommand(def) {
|
|
30
|
-
const { run, ...rest } = def;
|
|
31
|
-
if (!run) return rest;
|
|
32
|
-
return {
|
|
33
|
-
...rest,
|
|
34
|
-
run: (args) => run({
|
|
35
|
-
values: args.values,
|
|
36
|
-
positionals: args.positionals
|
|
37
|
-
})
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
Object.defineProperty(exports, "defineCLIAdapter", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function() {
|
|
44
|
-
return defineCLIAdapter;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "defineCommand", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function() {
|
|
50
|
-
return defineCommand;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=define-Bdn8j5VM.cjs.map
|
|
@@ -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"}
|
package/dist/define-m_fp-Aqm.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import "./chunk-BvFE5Tac.js";
|
|
2
|
-
//#region ../../internals/utils/src/cli/define.ts
|
|
3
|
-
/**
|
|
4
|
-
* Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })
|
|
9
|
-
* createCLI({ adapter }).run(commands, argv, opts)
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
function defineCLIAdapter(adapter) {
|
|
13
|
-
return adapter;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns a `CommandDefinition` with typed `values` in `run()`.
|
|
17
|
-
* The callback receives `values` inferred from the declared options — no casts needed.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* const generate = defineCommand({
|
|
22
|
-
* name: 'generate',
|
|
23
|
-
* description: 'Generate client code',
|
|
24
|
-
* options: { config: { type: 'string', description: 'Config path' } },
|
|
25
|
-
* async run({ values }) { console.log(values.config) },
|
|
26
|
-
* })
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
function defineCommand(def) {
|
|
30
|
-
const { run, ...rest } = def;
|
|
31
|
-
if (!run) return rest;
|
|
32
|
-
return {
|
|
33
|
-
...rest,
|
|
34
|
-
run: (args) => run({
|
|
35
|
-
values: args.values,
|
|
36
|
-
positionals: args.positionals
|
|
37
|
-
})
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { defineCommand as n, defineCLIAdapter as t };
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=define-m_fp-Aqm.js.map
|
|
@@ -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,72 +0,0 @@
|
|
|
1
|
-
import "./chunk-BvFE5Tac.js";
|
|
2
|
-
import { n as defineCommand } from "./define-m_fp-Aqm.js";
|
|
3
|
-
//#region src/commands/generate.ts
|
|
4
|
-
const command = defineCommand({
|
|
5
|
-
name: "generate",
|
|
6
|
-
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.",
|
|
7
|
-
arguments: ["[input]"],
|
|
8
|
-
examples: [
|
|
9
|
-
"kubb generate",
|
|
10
|
-
"kubb generate ./openapi.yaml",
|
|
11
|
-
"kubb generate --config kubb.config.ts",
|
|
12
|
-
"kubb generate --watch"
|
|
13
|
-
],
|
|
14
|
-
options: {
|
|
15
|
-
config: {
|
|
16
|
-
type: "string",
|
|
17
|
-
description: "Path to the Kubb config",
|
|
18
|
-
short: "c"
|
|
19
|
-
},
|
|
20
|
-
logLevel: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "Info, silent, verbose or debug",
|
|
23
|
-
short: "l",
|
|
24
|
-
default: "info",
|
|
25
|
-
hint: "silent|info|verbose|debug",
|
|
26
|
-
enum: [
|
|
27
|
-
"silent",
|
|
28
|
-
"info",
|
|
29
|
-
"verbose",
|
|
30
|
-
"debug"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
watch: {
|
|
34
|
-
type: "boolean",
|
|
35
|
-
description: "Watch mode based on the input file",
|
|
36
|
-
short: "w",
|
|
37
|
-
default: false
|
|
38
|
-
},
|
|
39
|
-
debug: {
|
|
40
|
-
type: "boolean",
|
|
41
|
-
description: "Override logLevel to debug",
|
|
42
|
-
short: "d",
|
|
43
|
-
default: false
|
|
44
|
-
},
|
|
45
|
-
verbose: {
|
|
46
|
-
type: "boolean",
|
|
47
|
-
description: "Override logLevel to verbose",
|
|
48
|
-
short: "v",
|
|
49
|
-
default: false
|
|
50
|
-
},
|
|
51
|
-
silent: {
|
|
52
|
-
type: "boolean",
|
|
53
|
-
description: "Override logLevel to silent",
|
|
54
|
-
short: "s",
|
|
55
|
-
default: false
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
async run({ values, positionals }) {
|
|
59
|
-
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
60
|
-
const { run } = await import("./run-P6D8TnXf.js");
|
|
61
|
-
await run({
|
|
62
|
-
input: positionals[0],
|
|
63
|
-
configPath: values.config,
|
|
64
|
-
logLevel,
|
|
65
|
-
watch: values.watch
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
//#endregion
|
|
70
|
-
export { command };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=generate-BhfRufgh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-BhfRufgh.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,71 +0,0 @@
|
|
|
1
|
-
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
-
//#region src/commands/generate.ts
|
|
3
|
-
const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
4
|
-
name: "generate",
|
|
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
|
-
arguments: ["[input]"],
|
|
7
|
-
examples: [
|
|
8
|
-
"kubb generate",
|
|
9
|
-
"kubb generate ./openapi.yaml",
|
|
10
|
-
"kubb generate --config kubb.config.ts",
|
|
11
|
-
"kubb generate --watch"
|
|
12
|
-
],
|
|
13
|
-
options: {
|
|
14
|
-
config: {
|
|
15
|
-
type: "string",
|
|
16
|
-
description: "Path to the Kubb config",
|
|
17
|
-
short: "c"
|
|
18
|
-
},
|
|
19
|
-
logLevel: {
|
|
20
|
-
type: "string",
|
|
21
|
-
description: "Info, silent, verbose or debug",
|
|
22
|
-
short: "l",
|
|
23
|
-
default: "info",
|
|
24
|
-
hint: "silent|info|verbose|debug",
|
|
25
|
-
enum: [
|
|
26
|
-
"silent",
|
|
27
|
-
"info",
|
|
28
|
-
"verbose",
|
|
29
|
-
"debug"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
watch: {
|
|
33
|
-
type: "boolean",
|
|
34
|
-
description: "Watch mode based on the input file",
|
|
35
|
-
short: "w",
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
debug: {
|
|
39
|
-
type: "boolean",
|
|
40
|
-
description: "Override logLevel to debug",
|
|
41
|
-
short: "d",
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
verbose: {
|
|
45
|
-
type: "boolean",
|
|
46
|
-
description: "Override logLevel to verbose",
|
|
47
|
-
short: "v",
|
|
48
|
-
default: false
|
|
49
|
-
},
|
|
50
|
-
silent: {
|
|
51
|
-
type: "boolean",
|
|
52
|
-
description: "Override logLevel to silent",
|
|
53
|
-
short: "s",
|
|
54
|
-
default: false
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
async run({ values, positionals }) {
|
|
58
|
-
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
59
|
-
const { run } = await Promise.resolve().then(() => require("./run-BObDb2qe.cjs"));
|
|
60
|
-
await run({
|
|
61
|
-
input: positionals[0],
|
|
62
|
-
configPath: values.config,
|
|
63
|
-
logLevel,
|
|
64
|
-
watch: values.watch
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
//#endregion
|
|
69
|
-
exports.command = command;
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=generate-BvuSxNYj.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-BvuSxNYj.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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-DOSXtcyb.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\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-client,plugin-react-query',\n ],\n options: {\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 hint: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n hint: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-client, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n hint: 'plugin-ts,plugin-zod,...',\n },\n },\n async run({ values }) {\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 })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACD;CACD,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;GACP;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;GACP;EACD,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;GACP;EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,KAAK,OAAO;GACZ;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;GACjB,CAAC;;CAEL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-bKtEOvhK.cjs","names":["defineCommand"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\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-client,plugin-react-query',\n ],\n options: {\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 hint: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n hint: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-client, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n hint: 'plugin-ts,plugin-zod,...',\n },\n },\n async run({ values }) {\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 })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACD;CACD,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;GACP;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;GACP;EACD,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;GACP;EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,KAAK,OAAO;GACZ,SAAA,gBAAA;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;GACjB,CAAC;;CAEL,CAAC"}
|
package/dist/mcp-CKkbG0kp.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-DHGhrRW-.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-CKkbG0kp.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-CKkbG0kp.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/mcp-DzOfqX_j.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-BgAYWN7y.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-DzOfqX_j.js.map
|
package/dist/mcp-DzOfqX_j.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-DzOfqX_j.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/package-BgAYWN7y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-BgAYWN7y.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-DHGhrRW-.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|