@kubb/cli 5.0.0-beta.36 → 5.0.0-beta.38
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/README.md +14 -11
- package/dist/{agent-DajReUxm.cjs → agent-Bl8JwjMa.cjs} +4 -4
- package/dist/{agent-DajReUxm.cjs.map → agent-Bl8JwjMa.cjs.map} +1 -1
- package/dist/{agent-cAalLgeU.js → agent-CfZ_Uqde.js} +4 -4
- package/dist/{agent-cAalLgeU.js.map → agent-CfZ_Uqde.js.map} +1 -1
- package/dist/{constants-FhPsMOdo.cjs → constants-CAKUpLcQ.cjs} +3 -12
- package/dist/{constants-FhPsMOdo.cjs.map → constants-CAKUpLcQ.cjs.map} +1 -1
- package/dist/{constants-Co6NWt3U.js → constants-CYxk4aNm.js} +4 -7
- package/dist/{constants-Co6NWt3U.js.map → constants-CYxk4aNm.js.map} +1 -1
- package/dist/{generate-C6oskVzT.cjs → generate-Bgds6Zx3.cjs} +19 -14
- package/dist/generate-Bgds6Zx3.cjs.map +1 -0
- package/dist/{generate-DmYQJcBv.js → generate-CfxFqNeb.js} +19 -14
- package/dist/generate-CfxFqNeb.js.map +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.js +8 -8
- package/dist/{init-Dbb4U-Xs.cjs → init-C5wnuzeK.cjs} +2 -2
- package/dist/{init-Dbb4U-Xs.cjs.map → init-C5wnuzeK.cjs.map} +1 -1
- package/dist/{init-iOg_X-uh.js → init-TIec3Dym.js} +2 -2
- package/dist/{init-iOg_X-uh.js.map → init-TIec3Dym.js.map} +1 -1
- package/dist/{mcp-DxrSTT8i.cjs → mcp-Cr753GW1.cjs} +3 -3
- package/dist/{mcp-DxrSTT8i.cjs.map → mcp-Cr753GW1.cjs.map} +1 -1
- package/dist/{mcp-Ci2OkdBj.js → mcp-Damue5Mq.js} +3 -3
- package/dist/{mcp-Ci2OkdBj.js.map → mcp-Damue5Mq.js.map} +1 -1
- package/dist/package-Cnt1K03J.js +6 -0
- package/dist/package-Cnt1K03J.js.map +1 -0
- package/dist/{package-DbsOo2rT.cjs → package-guApEHiW.cjs} +2 -2
- package/dist/package-guApEHiW.cjs.map +1 -0
- package/dist/{run-v-75bcU1.js → run-BFEK9md9.js} +2 -2
- package/dist/{run-v-75bcU1.js.map → run-BFEK9md9.js.map} +1 -1
- package/dist/{run-GvXhj9XF.cjs → run-BFZtWpcW.cjs} +491 -314
- package/dist/run-BFZtWpcW.cjs.map +1 -0
- package/dist/{run-CCgNPz0F.cjs → run-BFv6avA_.cjs} +3 -3
- package/dist/{run-CCgNPz0F.cjs.map → run-BFv6avA_.cjs.map} +1 -1
- package/dist/{run-DpDKN_rb.cjs → run-BQZyg7If.cjs} +2 -2
- package/dist/{run-DpDKN_rb.cjs.map → run-BQZyg7If.cjs.map} +1 -1
- package/dist/{run-CPimpDgO.js → run-BvXxelGR.js} +2 -2
- package/dist/{run-CPimpDgO.js.map → run-BvXxelGR.js.map} +1 -1
- package/dist/{run-Lnupy7qb.cjs → run-Bz9IFMWg.cjs} +2 -2
- package/dist/{run-Lnupy7qb.cjs.map → run-Bz9IFMWg.cjs.map} +1 -1
- package/dist/{run-B9ZkldVt.js → run-C752fag9.js} +557 -380
- package/dist/run-C752fag9.js.map +1 -0
- package/dist/run-C_NMctua.cjs.map +1 -1
- package/dist/run-D8dCWepS.js.map +1 -1
- package/dist/{run-BRrNHp24.js → run-DJxYClJV.js} +3 -3
- package/dist/{run-BRrNHp24.js.map → run-DJxYClJV.js.map} +1 -1
- package/dist/{telemetry-DRhd3joO.cjs → telemetry-B80oJfxR.cjs} +2 -2
- package/dist/telemetry-B80oJfxR.cjs.map +1 -0
- package/dist/{telemetry-ne1IOrz1.js → telemetry-ueaMzs_c.js} +2 -2
- package/dist/telemetry-ueaMzs_c.js.map +1 -0
- package/dist/{validate-Bh7MgISX.js → validate-CYTKdezO.js} +3 -3
- package/dist/{validate-Bh7MgISX.js.map → validate-CYTKdezO.js.map} +1 -1
- package/dist/{validate-DVkJx4q8.cjs → validate-DMzjP-hd.cjs} +3 -3
- package/dist/{validate-DVkJx4q8.cjs.map → validate-DMzjP-hd.cjs.map} +1 -1
- package/package.json +6 -6
- package/src/commands/generate.ts +16 -10
- package/src/constants.ts +1 -1
- package/src/loggers/clackLogger.ts +68 -71
- package/src/loggers/diagnostics.ts +77 -0
- package/src/loggers/githubActionsLogger.ts +38 -31
- package/src/loggers/plainLogger.ts +10 -26
- package/src/loggers/types.ts +1 -1
- package/src/loggers/utils.ts +47 -94
- package/src/reporters/cliReporter.ts +89 -0
- package/src/reporters/fileReporter.ts +103 -0
- package/src/reporters/jsonReporter.ts +20 -0
- package/src/reporters/report.ts +84 -0
- package/src/runners/agent/run.ts +2 -2
- package/src/runners/generate/run.ts +130 -44
- package/src/runners/generate/utils.ts +8 -11
- package/src/runners/init/run.ts +1 -1
- package/src/telemetry.ts +2 -2
- package/dist/generate-C6oskVzT.cjs.map +0 -1
- package/dist/generate-DmYQJcBv.js.map +0 -1
- package/dist/package-DbsOo2rT.cjs.map +0 -1
- package/dist/package-_R15a7lY.js +0 -6
- package/dist/package-_R15a7lY.js.map +0 -1
- package/dist/run-B9ZkldVt.js.map +0 -1
- package/dist/run-GvXhj9XF.cjs.map +0 -1
- package/dist/telemetry-DRhd3joO.cjs.map +0 -1
- package/dist/telemetry-ne1IOrz1.js.map +0 -1
- package/src/loggers/fileSystemLogger.ts +0 -151
package/README.md
CHANGED
|
@@ -102,15 +102,15 @@ npx kubb generate
|
|
|
102
102
|
|
|
103
103
|
#### Options
|
|
104
104
|
|
|
105
|
-
| Flag | Short | Type | Default | Description
|
|
106
|
-
| -------------------- | ----- | ------- | ------- |
|
|
107
|
-
| `[input]` | | string | | OpenAPI file path — overrides `input.path` in the config
|
|
108
|
-
| `--config <path>` | `-c` | string | | Path to the Kubb config file
|
|
109
|
-
| `--logLevel <level>` | `-l` | string | `info` | Log level: `silent`, `info`,
|
|
110
|
-
| `--watch` | `-w` | boolean | `false` | Re-generate whenever the input file changes
|
|
111
|
-
| `--
|
|
112
|
-
| `--
|
|
113
|
-
| `--
|
|
105
|
+
| Flag | Short | Type | Default | Description |
|
|
106
|
+
| -------------------- | ----- | ------- | ------- | --------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| `[input]` | | string | | OpenAPI file path — overrides `input.path` in the config |
|
|
108
|
+
| `--config <path>` | `-c` | string | | Path to the Kubb config file |
|
|
109
|
+
| `--logLevel <level>` | `-l` | string | `info` | Log level: `silent`, `info`, or `verbose` |
|
|
110
|
+
| `--watch` | `-w` | boolean | `false` | Re-generate whenever the input file changes |
|
|
111
|
+
| `--verbose` | `-v` | boolean | `false` | Override log level to `verbose` |
|
|
112
|
+
| `--silent` | `-s` | boolean | `false` | Override log level to `silent` |
|
|
113
|
+
| `--reporter <names>` | | string | `cli` | Reporters that render the run, comma-separated: `cli`, `json`, `file`. Overrides `config.reporters` |
|
|
114
114
|
|
|
115
115
|
#### Examples
|
|
116
116
|
|
|
@@ -127,8 +127,11 @@ npx kubb generate --config ./configs/kubb.config.ts
|
|
|
127
127
|
# Watch for changes and regenerate automatically
|
|
128
128
|
npx kubb generate --watch
|
|
129
129
|
|
|
130
|
-
#
|
|
131
|
-
npx kubb generate --
|
|
130
|
+
# Verbose output
|
|
131
|
+
npx kubb generate --verbose
|
|
132
|
+
|
|
133
|
+
# Write a JSON run report alongside the CLI output
|
|
134
|
+
npx kubb generate --reporter cli,json
|
|
132
135
|
```
|
|
133
136
|
|
|
134
137
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
4
|
-
const require_constants = require("./constants-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
|
+
const require_constants = require("./constants-CAKUpLcQ.cjs");
|
|
5
5
|
//#region src/commands/agent/start.ts
|
|
6
6
|
const command$1 = require_define.defineCommand({
|
|
7
7
|
name: "start",
|
|
@@ -41,7 +41,7 @@ const command$1 = require_define.defineCommand({
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
async run({ values }) {
|
|
44
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
44
|
+
const { run } = await Promise.resolve().then(() => require("./run-BFv6avA_.cjs"));
|
|
45
45
|
await run({
|
|
46
46
|
port: values.port !== void 0 ? values.port : void 0,
|
|
47
47
|
host: values.host,
|
|
@@ -67,4 +67,4 @@ const command = require_define.defineCommand({
|
|
|
67
67
|
//#endregion
|
|
68
68
|
exports.command = command;
|
|
69
69
|
|
|
70
|
-
//# sourceMappingURL=agent-
|
|
70
|
+
//# sourceMappingURL=agent-Bl8JwjMa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-Bl8JwjMa.cjs","names":["command","defineCommand","agentDefaults","defineCommand","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description:\n 'Start the Kubb Agent HTTP server. Exposes a REST API that accepts a kubb.config.ts patch and returns generated code as a stream. Use --allow-write to also write files to disk.',\n examples: ['kubb agent start', 'kubb agent start --port 4000', 'kubb agent start --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config file',\n short: 'c',\n },\n port: {\n type: 'string',\n description: 'Port the HTTP server listens on',\n short: 'p',\n default: agentDefaults.port,\n },\n host: {\n type: 'string',\n description: 'Hostname the HTTP server binds to',\n default: agentDefaults.host,\n },\n 'allow-write': {\n type: 'boolean',\n description: 'Write generated files to the filesystem. When omitted, output is streamed only and no files are written.',\n default: false,\n },\n 'allow-all': {\n type: 'boolean',\n description: 'Grant all permissions (implies --allow-write).',\n default: false,\n },\n },\n async run({ values }) {\n const { run } = await import('../../runners/agent/run.ts')\n\n await run({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description:\n 'Manage the Kubb Agent — an HTTP server that lets AI agents trigger code generation programmatically via a REST API. Useful when an AI workflow needs to generate code without direct CLI access.',\n examples: ['kubb agent start', 'kubb agent start --port 4000 --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;AAIA,MAAaA,YAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAAgC;EAAkC;CAAwD;CACzJ,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAASC,kBAAAA,cAAc;EACzB;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAASA,kBAAAA,cAAc;EACzB;EACA,eAAe;GACb,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,aAAa;GACX,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;GAChD,MAAM,OAAO;GACb,YAAY,OAAO;GACnB,YAAY,OAAO;GACnB,UAAU,OAAO;GACjB,SAAA,gBAAA;EACF,CAAC;CACH;AACF,CAAC;;;AC9CD,MAAa,UAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAA8C;CAAwD;CACrI,aAAa,CAACC,SAAY;AAC5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
4
|
-
import {
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
|
+
import { a as agentDefaults } from "./constants-CYxk4aNm.js";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/commands/agent.ts
|
|
7
7
|
const command = defineCommand({
|
|
@@ -50,7 +50,7 @@ const command = defineCommand({
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
async run({ values }) {
|
|
53
|
-
const { run } = await import("./run-
|
|
53
|
+
const { run } = await import("./run-DJxYClJV.js");
|
|
54
54
|
await run({
|
|
55
55
|
port: values.port !== void 0 ? values.port : void 0,
|
|
56
56
|
host: values.host,
|
|
@@ -65,4 +65,4 @@ const command = defineCommand({
|
|
|
65
65
|
//#endregion
|
|
66
66
|
export { command };
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=agent-
|
|
68
|
+
//# sourceMappingURL=agent-CfZ_Uqde.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-CfZ_Uqde.js","names":["command","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description:\n 'Start the Kubb Agent HTTP server. Exposes a REST API that accepts a kubb.config.ts patch and returns generated code as a stream. Use --allow-write to also write files to disk.',\n examples: ['kubb agent start', 'kubb agent start --port 4000', 'kubb agent start --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n options: {\n config: {\n type: 'string',\n description: 'Path to the Kubb config file',\n short: 'c',\n },\n port: {\n type: 'string',\n description: 'Port the HTTP server listens on',\n short: 'p',\n default: agentDefaults.port,\n },\n host: {\n type: 'string',\n description: 'Hostname the HTTP server binds to',\n default: agentDefaults.host,\n },\n 'allow-write': {\n type: 'boolean',\n description: 'Write generated files to the filesystem. When omitted, output is streamed only and no files are written.',\n default: false,\n },\n 'allow-all': {\n type: 'boolean',\n description: 'Grant all permissions (implies --allow-write).',\n default: false,\n },\n },\n async run({ values }) {\n const { run } = await import('../../runners/agent/run.ts')\n\n await run({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description:\n 'Manage the Kubb Agent — an HTTP server that lets AI agents trigger code generation programmatically via a REST API. Useful when an AI workflow needs to generate code without direct CLI access.',\n examples: ['kubb agent start', 'kubb agent start --port 4000 --allow-write', 'kubb agent start --config ./kubb.config.ts --allow-all'],\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;;ACGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAoB;EAA8C;CAAwD;CACrI,aAAa,CDJQ,cAAc;EACnC,MAAM;EACN,aACE;EACF,UAAU;GAAC;GAAoB;GAAgC;GAAkC;EAAwD;EACzJ,SAAS;GACP,QAAQ;IACN,MAAM;IACN,aAAa;IACb,OAAO;GACT;GACA,MAAM;IACJ,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS,cAAc;GACzB;GACA,MAAM;IACJ,MAAM;IACN,aAAa;IACb,SAAS,cAAc;GACzB;GACA,eAAe;IACb,MAAM;IACN,aAAa;IACb,SAAS;GACX;GACA,aAAa;IACX,MAAM;IACN,aAAa;IACb,SAAS;GACX;EACF;EACA,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;GAE7B,MAAM,IAAI;IACR,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;IAChD,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB;GACF,CAAC;EACH;CACF,CCzCgBC,CAAY;AAC5B,CAAC"}
|
|
@@ -8,16 +8,13 @@ const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
|
8
8
|
* OpenTelemetry ingestion endpoint for anonymous usage telemetry.
|
|
9
9
|
*/
|
|
10
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);
|
|
11
|
+
"─".repeat(27);
|
|
15
12
|
/**
|
|
16
13
|
* Glob pattern for paths the file watcher ignores.
|
|
17
14
|
*/
|
|
18
15
|
const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
|
|
19
16
|
/**
|
|
20
|
-
* Flags that short-circuit execution (help/version)
|
|
17
|
+
* Flags that short-circuit execution (help/version), no telemetry notice is shown.
|
|
21
18
|
*/
|
|
22
19
|
const QUIET_FLAGS = new Set([
|
|
23
20
|
"--help",
|
|
@@ -55,12 +52,6 @@ Object.defineProperty(exports, "QUIET_FLAGS", {
|
|
|
55
52
|
return QUIET_FLAGS;
|
|
56
53
|
}
|
|
57
54
|
});
|
|
58
|
-
Object.defineProperty(exports, "SUMMARY_SEPARATOR", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function() {
|
|
61
|
-
return SUMMARY_SEPARATOR;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
55
|
Object.defineProperty(exports, "WATCHER_IGNORED_PATHS", {
|
|
65
56
|
enumerable: true,
|
|
66
57
|
get: function() {
|
|
@@ -74,4 +65,4 @@ Object.defineProperty(exports, "agentDefaults", {
|
|
|
74
65
|
}
|
|
75
66
|
});
|
|
76
67
|
|
|
77
|
-
//# sourceMappingURL=constants-
|
|
68
|
+
//# sourceMappingURL=constants-CAKUpLcQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-CAKUpLcQ.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"],"mappings":";;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;AAKI,IAAI,OAAO,EAAE;;;;AAe9C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;AAAI,CAAU;AAE/E,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAYA,kBAAAA;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;AACnB"}
|
|
@@ -8,16 +8,13 @@ const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
|
8
8
|
* OpenTelemetry ingestion endpoint for anonymous usage telemetry.
|
|
9
9
|
*/
|
|
10
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);
|
|
11
|
+
"─".repeat(27);
|
|
15
12
|
/**
|
|
16
13
|
* Glob pattern for paths the file watcher ignores.
|
|
17
14
|
*/
|
|
18
15
|
const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
|
|
19
16
|
/**
|
|
20
|
-
* Flags that short-circuit execution (help/version)
|
|
17
|
+
* Flags that short-circuit execution (help/version), no telemetry notice is shown.
|
|
21
18
|
*/
|
|
22
19
|
const QUIET_FLAGS = new Set([
|
|
23
20
|
"--help",
|
|
@@ -37,6 +34,6 @@ const agentDefaults = {
|
|
|
37
34
|
serverEntryPath: ".output/server/index.mjs"
|
|
38
35
|
};
|
|
39
36
|
//#endregion
|
|
40
|
-
export {
|
|
37
|
+
export { agentDefaults as a, WATCHER_IGNORED_PATHS as i, OTLP_ENDPOINT as n, QUIET_FLAGS as r, KUBB_NPM_PACKAGE_URL as t };
|
|
41
38
|
|
|
42
|
-
//# sourceMappingURL=constants-
|
|
39
|
+
//# sourceMappingURL=constants-CYxk4aNm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-CYxk4aNm.js","names":[],"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"],"mappings":";;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;AAKI,IAAI,OAAO,EAAE;;;;AAe9C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;AAAI,CAAU;AAE/E,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;AACnB"}
|
|
@@ -18,15 +18,14 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
18
18
|
},
|
|
19
19
|
logLevel: {
|
|
20
20
|
type: "string",
|
|
21
|
-
description: "Info, silent
|
|
21
|
+
description: "Info, silent or verbose",
|
|
22
22
|
short: "l",
|
|
23
23
|
default: "info",
|
|
24
|
-
hint: "silent|info|verbose
|
|
24
|
+
hint: "silent|info|verbose",
|
|
25
25
|
enum: [
|
|
26
26
|
"silent",
|
|
27
27
|
"info",
|
|
28
|
-
"verbose"
|
|
29
|
-
"debug"
|
|
28
|
+
"verbose"
|
|
30
29
|
]
|
|
31
30
|
},
|
|
32
31
|
watch: {
|
|
@@ -35,12 +34,6 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
35
34
|
short: "w",
|
|
36
35
|
default: false
|
|
37
36
|
},
|
|
38
|
-
debug: {
|
|
39
|
-
type: "boolean",
|
|
40
|
-
description: "Override logLevel to debug",
|
|
41
|
-
short: "d",
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
37
|
verbose: {
|
|
45
38
|
type: "boolean",
|
|
46
39
|
description: "Override logLevel to verbose",
|
|
@@ -52,20 +45,32 @@ const command = require("./define-C4AB3POr.cjs").defineCommand({
|
|
|
52
45
|
description: "Override logLevel to silent",
|
|
53
46
|
short: "s",
|
|
54
47
|
default: false
|
|
48
|
+
},
|
|
49
|
+
reporter: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Reporters that render the run, comma-separated. Overrides config.reporters",
|
|
52
|
+
hint: "cli|json|file",
|
|
53
|
+
enum: [
|
|
54
|
+
"cli",
|
|
55
|
+
"json",
|
|
56
|
+
"file"
|
|
57
|
+
]
|
|
55
58
|
}
|
|
56
59
|
},
|
|
57
60
|
async run({ values, positionals }) {
|
|
58
|
-
const logLevel = values.
|
|
59
|
-
const
|
|
61
|
+
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
62
|
+
const reporters = values.reporter?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
63
|
+
const { run } = await Promise.resolve().then(() => require("./run-BFZtWpcW.cjs"));
|
|
60
64
|
await run({
|
|
61
65
|
input: positionals[0],
|
|
62
66
|
configPath: values.config,
|
|
63
67
|
logLevel,
|
|
64
|
-
watch: values.watch
|
|
68
|
+
watch: values.watch,
|
|
69
|
+
reporters
|
|
65
70
|
});
|
|
66
71
|
}
|
|
67
72
|
});
|
|
68
73
|
//#endregion
|
|
69
74
|
exports.command = command;
|
|
70
75
|
|
|
71
|
-
//# sourceMappingURL=generate-
|
|
76
|
+
//# sourceMappingURL=generate-Bgds6Zx3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-Bgds6Zx3.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport type { ReporterName } from '@kubb/core'\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 or verbose',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose',\n enum: ['silent', 'info', 'verbose'],\n },\n watch: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\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 reporter: {\n type: 'string',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n hint: 'cli|json|file',\n enum: ['cli', 'json', 'file'],\n },\n },\n async run({ values, positionals }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const reporters = values.reporter\n ?.split(',')\n .map((name) => name.trim())\n .filter(Boolean) as Array<ReporterName> | undefined\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 reporters,\n })\n },\n})\n"],"mappings":";;AAGA,MAAa,yCAAUA,EAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,WAAW,CAAC,SAAS;CACrB,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB;CAC5H,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;GAAS;EACpC;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,MAAM;GACN,MAAM;IAAC;IAAO;IAAQ;GAAM;EAC9B;CACF;CACA,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,YAAY,OAAO,UACrB,MAAM,GAAG,EACV,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;EACjB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd;EACF,CAAC;CACH;AACF,CAAC"}
|
|
@@ -19,15 +19,14 @@ const command = defineCommand({
|
|
|
19
19
|
},
|
|
20
20
|
logLevel: {
|
|
21
21
|
type: "string",
|
|
22
|
-
description: "Info, silent
|
|
22
|
+
description: "Info, silent or verbose",
|
|
23
23
|
short: "l",
|
|
24
24
|
default: "info",
|
|
25
|
-
hint: "silent|info|verbose
|
|
25
|
+
hint: "silent|info|verbose",
|
|
26
26
|
enum: [
|
|
27
27
|
"silent",
|
|
28
28
|
"info",
|
|
29
|
-
"verbose"
|
|
30
|
-
"debug"
|
|
29
|
+
"verbose"
|
|
31
30
|
]
|
|
32
31
|
},
|
|
33
32
|
watch: {
|
|
@@ -36,12 +35,6 @@ const command = defineCommand({
|
|
|
36
35
|
short: "w",
|
|
37
36
|
default: false
|
|
38
37
|
},
|
|
39
|
-
debug: {
|
|
40
|
-
type: "boolean",
|
|
41
|
-
description: "Override logLevel to debug",
|
|
42
|
-
short: "d",
|
|
43
|
-
default: false
|
|
44
|
-
},
|
|
45
38
|
verbose: {
|
|
46
39
|
type: "boolean",
|
|
47
40
|
description: "Override logLevel to verbose",
|
|
@@ -53,20 +46,32 @@ const command = defineCommand({
|
|
|
53
46
|
description: "Override logLevel to silent",
|
|
54
47
|
short: "s",
|
|
55
48
|
default: false
|
|
49
|
+
},
|
|
50
|
+
reporter: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Reporters that render the run, comma-separated. Overrides config.reporters",
|
|
53
|
+
hint: "cli|json|file",
|
|
54
|
+
enum: [
|
|
55
|
+
"cli",
|
|
56
|
+
"json",
|
|
57
|
+
"file"
|
|
58
|
+
]
|
|
56
59
|
}
|
|
57
60
|
},
|
|
58
61
|
async run({ values, positionals }) {
|
|
59
|
-
const logLevel = values.
|
|
60
|
-
const
|
|
62
|
+
const logLevel = values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
63
|
+
const reporters = values.reporter?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
64
|
+
const { run } = await import("./run-C752fag9.js");
|
|
61
65
|
await run({
|
|
62
66
|
input: positionals[0],
|
|
63
67
|
configPath: values.config,
|
|
64
68
|
logLevel,
|
|
65
|
-
watch: values.watch
|
|
69
|
+
watch: values.watch,
|
|
70
|
+
reporters
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
73
|
});
|
|
69
74
|
//#endregion
|
|
70
75
|
export { command };
|
|
71
76
|
|
|
72
|
-
//# sourceMappingURL=generate-
|
|
77
|
+
//# sourceMappingURL=generate-CfxFqNeb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-CfxFqNeb.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport type { ReporterName } from '@kubb/core'\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 or verbose',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose',\n enum: ['silent', 'info', 'verbose'],\n },\n watch: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\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 reporter: {\n type: 'string',\n description: 'Reporters that render the run, comma-separated. Overrides config.reporters',\n hint: 'cli|json|file',\n enum: ['cli', 'json', 'file'],\n },\n },\n async run({ values, positionals }) {\n const logLevel = values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const reporters = values.reporter\n ?.split(',')\n .map((name) => name.trim())\n .filter(Boolean) as Array<ReporterName> | undefined\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 reporters,\n })\n },\n})\n"],"mappings":";;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,WAAW,CAAC,SAAS;CACrB,UAAU;EAAC;EAAiB;EAAgC;EAAyC;CAAuB;CAC5H,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;GAAS;EACpC;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,aAAa;GACb,MAAM;GACN,MAAM;IAAC;IAAO;IAAQ;GAAM;EAC9B;CACF;CACA,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EAChF,MAAM,YAAY,OAAO,UACrB,MAAM,GAAG,EACV,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;EACjB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACd;EACF,CAAC;CACH;AACF,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Bx3C2hgW.cjs");
|
|
3
3
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
4
|
-
const require_telemetry = require("./telemetry-
|
|
5
|
-
const require_package = require("./package-
|
|
6
|
-
const require_constants = require("./constants-
|
|
4
|
+
const require_telemetry = require("./telemetry-B80oJfxR.cjs");
|
|
5
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
6
|
+
const require_constants = require("./constants-CAKUpLcQ.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
//#region ../../internals/utils/src/cli/schema.ts
|
|
9
9
|
/**
|
|
@@ -254,11 +254,11 @@ function shouldShowTelemetryNotice(argv) {
|
|
|
254
254
|
}
|
|
255
255
|
async function run(argv = process.argv) {
|
|
256
256
|
if (shouldShowTelemetryNotice(argv)) console.log(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
257
|
-
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
258
|
-
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-
|
|
259
|
-
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-
|
|
260
|
-
const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-
|
|
261
|
-
const { command: initCommand } = await Promise.resolve().then(() => require("./init-
|
|
257
|
+
const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-Bgds6Zx3.cjs"));
|
|
258
|
+
const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-DMzjP-hd.cjs"));
|
|
259
|
+
const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-Cr753GW1.cjs"));
|
|
260
|
+
const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-Bl8JwjMa.cjs"));
|
|
261
|
+
const { command: initCommand } = await Promise.resolve().then(() => require("./init-C5wnuzeK.cjs"));
|
|
262
262
|
await cli.run([
|
|
263
263
|
generateCommand,
|
|
264
264
|
validateCommand,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { t as defineCLIAdapter } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { n as isTelemetryDisabled } from "./telemetry-
|
|
4
|
-
import { t as version } from "./package-
|
|
5
|
-
import { r as QUIET_FLAGS } from "./constants-
|
|
3
|
+
import { n as isTelemetryDisabled } from "./telemetry-ueaMzs_c.js";
|
|
4
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
5
|
+
import { r as QUIET_FLAGS } from "./constants-CYxk4aNm.js";
|
|
6
6
|
import { parseArgs, styleText } from "node:util";
|
|
7
7
|
//#region ../../internals/utils/src/cli/schema.ts
|
|
8
8
|
/**
|
|
@@ -253,11 +253,11 @@ function shouldShowTelemetryNotice(argv) {
|
|
|
253
253
|
}
|
|
254
254
|
async function run(argv = process.argv) {
|
|
255
255
|
if (shouldShowTelemetryNotice(argv)) console.log(`${styleText("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
256
|
-
const { command: generateCommand } = await import("./generate-
|
|
257
|
-
const { command: validateCommand } = await import("./validate-
|
|
258
|
-
const { command: mcpCommand } = await import("./mcp-
|
|
259
|
-
const { command: agentCommand } = await import("./agent-
|
|
260
|
-
const { command: initCommand } = await import("./init-
|
|
256
|
+
const { command: generateCommand } = await import("./generate-CfxFqNeb.js");
|
|
257
|
+
const { command: validateCommand } = await import("./validate-CYTKdezO.js");
|
|
258
|
+
const { command: mcpCommand } = await import("./mcp-Damue5Mq.js");
|
|
259
|
+
const { command: agentCommand } = await import("./agent-CfZ_Uqde.js");
|
|
260
|
+
const { command: initCommand } = await import("./init-TIec3Dym.js");
|
|
261
261
|
await cli.run([
|
|
262
262
|
generateCommand,
|
|
263
263
|
validateCommand,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
const command = require_define.defineCommand({
|
|
6
6
|
name: "init",
|
|
@@ -50,4 +50,4 @@ const command = require_define.defineCommand({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
exports.command = command;
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=init-
|
|
53
|
+
//# sourceMappingURL=init-C5wnuzeK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-C5wnuzeK.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;CACF;CACA,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,KAAK,OAAO;GACZ,SAAA,gBAAA;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;EAClB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
const command = defineCommand({
|
|
6
6
|
name: "init",
|
|
@@ -50,4 +50,4 @@ const command = defineCommand({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { command };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=init-
|
|
53
|
+
//# sourceMappingURL=init-TIec3Dym.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-TIec3Dym.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;CACF;CACA,SAAS;EACP,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;CACA,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;EAClB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-Bx3C2hgW.cjs");
|
|
2
2
|
const require_define = require("./define-C4AB3POr.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
3
|
+
const require_package = require("./package-guApEHiW.cjs");
|
|
4
4
|
//#region src/commands/mcp.ts
|
|
5
5
|
const command = require_define.defineCommand({
|
|
6
6
|
name: "mcp",
|
|
@@ -25,7 +25,7 @@ const command = require_define.defineCommand({
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
async run({ values }) {
|
|
28
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
28
|
+
const { run } = await Promise.resolve().then(() => require("./run-BQZyg7If.cjs"));
|
|
29
29
|
await run({
|
|
30
30
|
version: require_package.version,
|
|
31
31
|
port: values.port,
|
|
@@ -36,4 +36,4 @@ const command = require_define.defineCommand({
|
|
|
36
36
|
//#endregion
|
|
37
37
|
exports.command = command;
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=mcp-
|
|
39
|
+
//# sourceMappingURL=mcp-Cr753GW1.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Cr753GW1.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;CACF;CACA,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;EACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,SAAA,gBAAA;GACA,MAAM,OAAO;GACb,MAAM,OAAO;EACf,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { n as defineCommand } from "./define-DNG1U8ha.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
3
|
+
import { t as version } from "./package-Cnt1K03J.js";
|
|
4
4
|
//#region src/commands/mcp.ts
|
|
5
5
|
const command = defineCommand({
|
|
6
6
|
name: "mcp",
|
|
@@ -25,7 +25,7 @@ const command = defineCommand({
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
async run({ values }) {
|
|
28
|
-
const { run } = await import("./run-
|
|
28
|
+
const { run } = await import("./run-BvXxelGR.js");
|
|
29
29
|
await run({
|
|
30
30
|
version,
|
|
31
31
|
port: values.port,
|
|
@@ -36,4 +36,4 @@ const command = defineCommand({
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { command };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=mcp-
|
|
39
|
+
//# sourceMappingURL=mcp-Damue5Mq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Damue5Mq.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;CACF;CACA,SAAS;EACP,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACb,MAAM;EACR;EACA,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR;GACA,MAAM,OAAO;GACb,MAAM,OAAO;EACf,CAAC;CACH;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-Cnt1K03J.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "5.0.0-beta.
|
|
2
|
+
var version = "5.0.0-beta.38";
|
|
3
3
|
//#endregion
|
|
4
4
|
Object.defineProperty(exports, "version", {
|
|
5
5
|
enumerable: true,
|
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "version", {
|
|
|
8
8
|
}
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=package-
|
|
11
|
+
//# sourceMappingURL=package-guApEHiW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-guApEHiW.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CRm0XQPb.js";
|
|
2
2
|
import { t as getErrorMessage } from "./errors-CoxrNXaA.js";
|
|
3
|
-
import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-
|
|
3
|
+
import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-ueaMzs_c.js";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
//#region src/runners/validate/run.ts
|
|
@@ -48,4 +48,4 @@ async function run({ input, version }, dependencies = { loadValidateModule }) {
|
|
|
48
48
|
//#endregion
|
|
49
49
|
export { run };
|
|
50
50
|
|
|
51
|
-
//# sourceMappingURL=run-
|
|
51
|
+
//# sourceMappingURL=run-BFEK9md9.js.map
|