@kubb/cli 5.5.6 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Telemetry-CMXOVUKB.js → Telemetry-RBcAjNxj.js} +18 -43
- package/dist/Telemetry-RBcAjNxj.js.map +1 -0
- package/dist/{Telemetry-DDHXBdEz.cjs → Telemetry-bGdFBaGt.cjs} +27 -89
- package/dist/Telemetry-bGdFBaGt.cjs.map +1 -0
- package/dist/agent-BPIqnEl2.js +59 -0
- package/dist/agent-BPIqnEl2.js.map +1 -0
- package/dist/agent-DElUuYuy.cjs +120 -0
- package/dist/agent-DElUuYuy.cjs.map +1 -0
- package/dist/{background-DxlRE9O5.js → background-0PMj56FJ.js} +6 -5
- package/dist/background-0PMj56FJ.js.map +1 -0
- package/dist/background-BqS01QDb.js +2 -0
- package/dist/{background-Bbcc2TdN.cjs → background-R0T_7Szu.cjs} +8 -7
- package/dist/background-R0T_7Szu.cjs.map +1 -0
- package/dist/commands-BAgGrcvc.js +65 -0
- package/dist/commands-BAgGrcvc.js.map +1 -0
- package/dist/commands-Si-RFAS6.cjs +71 -0
- package/dist/commands-Si-RFAS6.cjs.map +1 -0
- package/dist/config-8Xl4yZmw.js +146 -0
- package/dist/config-8Xl4yZmw.js.map +1 -0
- package/dist/config-ByfJSj3q.cjs +164 -0
- package/dist/config-ByfJSj3q.cjs.map +1 -0
- package/dist/constants-CdxpgX3_.cjs.map +1 -1
- package/dist/constants-DHRspBTo.js.map +1 -1
- package/dist/{errors-C-wEou02.cjs → errors-CMbMAwyW.cjs} +2 -2
- package/dist/{errors-C-wEou02.cjs.map → errors-CMbMAwyW.cjs.map} +1 -1
- package/dist/index.cjs +431 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +429 -20
- package/dist/index.js.map +1 -1
- package/dist/output-B6Ondw0g.js +776 -0
- package/dist/output-B6Ondw0g.js.map +1 -0
- package/dist/output-i3s5c4Xu.cjs +878 -0
- package/dist/output-i3s5c4Xu.cjs.map +1 -0
- package/dist/run-3I2NPeXG.cjs +31 -0
- package/dist/run-3I2NPeXG.cjs.map +1 -0
- package/dist/{run-C-jBKNbI.cjs → run-BkLJ5mXn.cjs} +22 -43
- package/dist/run-BkLJ5mXn.cjs.map +1 -0
- package/dist/run-CZlkqkDc.js +30 -0
- package/dist/run-CZlkqkDc.js.map +1 -0
- package/dist/run-CmNDNEjR.js +346 -0
- package/dist/run-CmNDNEjR.js.map +1 -0
- package/dist/{run-BdTwxLCW.js → run-D5AeacqK.js} +9 -23
- package/dist/run-D5AeacqK.js.map +1 -0
- package/dist/{run-y6LRyWdS.cjs → run-D8Wz_17X.cjs} +41 -60
- package/dist/run-D8Wz_17X.cjs.map +1 -0
- package/dist/{run-Dn8HVjnM.js → run-DQoKTiGk.js} +23 -44
- package/dist/run-DQoKTiGk.js.map +1 -0
- package/dist/{run-BDaZPU-1.js → run-Dgph0WYk.js} +25 -49
- package/dist/run-Dgph0WYk.js.map +1 -0
- package/dist/run-t8nm7zcT.cjs +348 -0
- package/dist/run-t8nm7zcT.cjs.map +1 -0
- package/dist/{run-CZz_GbE4.cjs → run-yvuot2N9.cjs} +12 -26
- package/dist/run-yvuot2N9.cjs.map +1 -0
- package/dist/{snapshot-B5mc4gpC.js → snapshot-CkHXR0Nl.js} +5 -5
- package/dist/snapshot-CkHXR0Nl.js.map +1 -0
- package/dist/{snapshot-DnCxZfmM.cjs → snapshot-D4nKbwkw.cjs} +9 -9
- package/dist/snapshot-D4nKbwkw.cjs.map +1 -0
- package/dist/studioWorker.js +2 -2
- package/package.json +7 -7
- package/dist/Telemetry-CMXOVUKB.js.map +0 -1
- package/dist/Telemetry-DDHXBdEz.cjs.map +0 -1
- package/dist/agent-DiB4CRre.cjs +0 -38
- package/dist/agent-DiB4CRre.cjs.map +0 -1
- package/dist/agent-yA5vrXJB.js +0 -26
- package/dist/agent-yA5vrXJB.js.map +0 -1
- package/dist/background-Bbcc2TdN.cjs.map +0 -1
- package/dist/background-CFNncNYT.js +0 -2
- package/dist/background-DxlRE9O5.js.map +0 -1
- package/dist/connect-C9tTngda.js +0 -11
- package/dist/connect-C9tTngda.js.map +0 -1
- package/dist/connect-CJ7BhOcs.cjs +0 -11
- package/dist/connect-CJ7BhOcs.cjs.map +0 -1
- package/dist/generate-BUqZ_7GB.cjs +0 -92
- package/dist/generate-BUqZ_7GB.cjs.map +0 -1
- package/dist/generate-q2m01zRd.js +0 -92
- package/dist/generate-q2m01zRd.js.map +0 -1
- package/dist/gunshiDryRun-DdKJuVn1.js +0 -2
- package/dist/init-Ckpwkfvz.cjs +0 -58
- package/dist/init-Ckpwkfvz.cjs.map +0 -1
- package/dist/init-DukE9Uw4.js +0 -58
- package/dist/init-DukE9Uw4.js.map +0 -1
- package/dist/login-Bc19oiFE.cjs +0 -11
- package/dist/login-Bc19oiFE.cjs.map +0 -1
- package/dist/login-Do3nns0B.js +0 -11
- package/dist/login-Do3nns0B.js.map +0 -1
- package/dist/logout-BvHFvCeI.cjs +0 -16
- package/dist/logout-BvHFvCeI.cjs.map +0 -1
- package/dist/logout-COxoIMum.js +0 -16
- package/dist/logout-COxoIMum.js.map +0 -1
- package/dist/mcp-B-GxGgVr.js +0 -19
- package/dist/mcp-B-GxGgVr.js.map +0 -1
- package/dist/mcp-B3B-rE7W.cjs +0 -18
- package/dist/mcp-B3B-rE7W.cjs.map +0 -1
- package/dist/output-CVLosNZq.cjs +0 -411
- package/dist/output-CVLosNZq.cjs.map +0 -1
- package/dist/output-FDo-db-w.js +0 -321
- package/dist/output-FDo-db-w.js.map +0 -1
- package/dist/package-Ci2fcoOV.js +0 -6
- package/dist/package-Ci2fcoOV.js.map +0 -1
- package/dist/package-Do9rJ7D3.cjs +0 -11
- package/dist/package-Do9rJ7D3.cjs.map +0 -1
- package/dist/rolldown-runtime-qbf5tadS.cjs +0 -38
- package/dist/run-BDaZPU-1.js.map +0 -1
- package/dist/run-BdTwxLCW.js.map +0 -1
- package/dist/run-C-jBKNbI.cjs.map +0 -1
- package/dist/run-CAcQlhub.js +0 -295
- package/dist/run-CAcQlhub.js.map +0 -1
- package/dist/run-CSoFhDyK.cjs +0 -297
- package/dist/run-CSoFhDyK.cjs.map +0 -1
- package/dist/run-CZz_GbE4.cjs.map +0 -1
- package/dist/run-CaEbo-te.js +0 -40
- package/dist/run-CaEbo-te.js.map +0 -1
- package/dist/run-CihzLZmR.cjs +0 -41
- package/dist/run-CihzLZmR.cjs.map +0 -1
- package/dist/run-Dn8HVjnM.js.map +0 -1
- package/dist/run-y6LRyWdS.cjs.map +0 -1
- package/dist/shared-Cl-OLpNh.cjs +0 -81
- package/dist/shared-Cl-OLpNh.cjs.map +0 -1
- package/dist/shared-DaHA7QFQ.js +0 -58
- package/dist/shared-DaHA7QFQ.js.map +0 -1
- package/dist/snapshot-B5mc4gpC.js.map +0 -1
- package/dist/snapshot-DnCxZfmM.cjs.map +0 -1
- package/dist/start-B-GXO8tS.cjs +0 -12
- package/dist/start-B-GXO8tS.cjs.map +0 -1
- package/dist/start-Dbfx_8zG.js +0 -12
- package/dist/start-Dbfx_8zG.js.map +0 -1
- package/dist/status-DDajNc8w.js +0 -17
- package/dist/status-DDajNc8w.js.map +0 -1
- package/dist/status-DusS7DfO.cjs +0 -17
- package/dist/status-DusS7DfO.cjs.map +0 -1
- package/dist/stop-C5t7Yx0t.js +0 -11
- package/dist/stop-C5t7Yx0t.js.map +0 -1
- package/dist/stop-zmM3A0Re.cjs +0 -11
- package/dist/stop-zmM3A0Re.cjs.map +0 -1
- package/dist/studio--IOOl_VB.js +0 -174
- package/dist/studio--IOOl_VB.js.map +0 -1
- package/dist/studio-CJ2XhtRd.cjs +0 -174
- package/dist/studio-CJ2XhtRd.cjs.map +0 -1
- package/dist/utils-C3HZOWL_.js +0 -1107
- package/dist/utils-C3HZOWL_.js.map +0 -1
- package/dist/utils-ClRbJfxu.cjs +0 -1210
- package/dist/utils-ClRbJfxu.cjs.map +0 -1
- package/dist/validate-BcB0tFQ6.cjs +0 -19
- package/dist/validate-BcB0tFQ6.cjs.map +0 -1
- package/dist/validate-QpkCbIFJ.js +0 -20
- package/dist/validate-QpkCbIFJ.js.map +0 -1
package/dist/init-Ckpwkfvz.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_package = require("./package-Do9rJ7D3.cjs");
|
|
3
|
-
let gunshi = require("gunshi");
|
|
4
|
-
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
5
|
-
//#region src/commands/init.ts
|
|
6
|
-
const command = (0, gunshi.defineWithTypes)()({
|
|
7
|
-
name: "init",
|
|
8
|
-
description: "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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb init",
|
|
11
|
-
"kubb init --yes",
|
|
12
|
-
"kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod",
|
|
13
|
-
"kubb init --plugins plugin-ts,plugin-axios,plugin-react-query",
|
|
14
|
-
"kubb init --yes --dry-run"
|
|
15
|
-
].join("\n"),
|
|
16
|
-
toKebab: true,
|
|
17
|
-
args: {
|
|
18
|
-
yes: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
description: "Skip prompts and use default options",
|
|
21
|
-
short: "y",
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Path to the OpenAPI specification",
|
|
27
|
-
short: "i",
|
|
28
|
-
metavar: "path"
|
|
29
|
-
},
|
|
30
|
-
output: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Output directory for generated files",
|
|
33
|
-
short: "o",
|
|
34
|
-
metavar: "path"
|
|
35
|
-
},
|
|
36
|
-
plugins: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)",
|
|
39
|
-
metavar: "plugin-ts,plugin-zod,..."
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
async run(ctx) {
|
|
43
|
-
const { values } = ctx;
|
|
44
|
-
const { run } = await Promise.resolve().then(() => require("./run-C-jBKNbI.cjs"));
|
|
45
|
-
await run({
|
|
46
|
-
yes: values.yes,
|
|
47
|
-
version: require_package.version,
|
|
48
|
-
input: values.input,
|
|
49
|
-
output: values.output,
|
|
50
|
-
plugins: values.plugins,
|
|
51
|
-
dryRun: ctx.extensions[_gunshi_plugin_dryrun.pluginId]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.command = command;
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=init-Ckpwkfvz.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-Ckpwkfvz.cjs","names":["defineWithTypes","dryRunId"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineWithTypes } from 'gunshi'\nimport { dryRunId } from '../gunshiDryRun.ts'\nimport type { DryRunExtensions } from '../gunshiDryRun.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\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-axios,plugin-react-query',\n 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\n args: {\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 metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n metavar: 'plugin-ts,plugin-zod,...',\n },\n },\n async run(ctx) {\n const { values } = ctx\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 dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n"],"mappings":";;;;;AAKA,MAAa,WAAA,GAAUA,OAAAA,gBAAAA,CAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,SAAS;CACT,MAAM;EACJ,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,SAAS;EACX;CACF;CACA,MAAM,IAAI,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GACR,KAAK,OAAO;GACZ,SAAA,gBAAA;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;GAChB,QAAQ,IAAI,WAAWC,sBAAAA;EACzB,CAAC;CACH;AACF,CAAC"}
|
package/dist/init-DukE9Uw4.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { t as version } from "./package-Ci2fcoOV.js";
|
|
3
|
-
import { t as dryRunId } from "./gunshiDryRun-DdKJuVn1.js";
|
|
4
|
-
import { defineWithTypes } from "gunshi";
|
|
5
|
-
//#region src/commands/init.ts
|
|
6
|
-
const command = defineWithTypes()({
|
|
7
|
-
name: "init",
|
|
8
|
-
description: "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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb init",
|
|
11
|
-
"kubb init --yes",
|
|
12
|
-
"kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod",
|
|
13
|
-
"kubb init --plugins plugin-ts,plugin-axios,plugin-react-query",
|
|
14
|
-
"kubb init --yes --dry-run"
|
|
15
|
-
].join("\n"),
|
|
16
|
-
toKebab: true,
|
|
17
|
-
args: {
|
|
18
|
-
yes: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
description: "Skip prompts and use default options",
|
|
21
|
-
short: "y",
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Path to the OpenAPI specification",
|
|
27
|
-
short: "i",
|
|
28
|
-
metavar: "path"
|
|
29
|
-
},
|
|
30
|
-
output: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Output directory for generated files",
|
|
33
|
-
short: "o",
|
|
34
|
-
metavar: "path"
|
|
35
|
-
},
|
|
36
|
-
plugins: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)",
|
|
39
|
-
metavar: "plugin-ts,plugin-zod,..."
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
async run(ctx) {
|
|
43
|
-
const { values } = ctx;
|
|
44
|
-
const { run } = await import("./run-Dn8HVjnM.js");
|
|
45
|
-
await run({
|
|
46
|
-
yes: values.yes,
|
|
47
|
-
version,
|
|
48
|
-
input: values.input,
|
|
49
|
-
output: values.output,
|
|
50
|
-
plugins: values.plugins,
|
|
51
|
-
dryRun: ctx.extensions[dryRunId]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
export { command };
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=init-DukE9Uw4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-DukE9Uw4.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineWithTypes } from 'gunshi'\nimport { dryRunId } from '../gunshiDryRun.ts'\nimport type { DryRunExtensions } from '../gunshiDryRun.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\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-axios,plugin-react-query',\n 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\n args: {\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 metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n metavar: 'plugin-ts,plugin-zod,...',\n },\n },\n async run(ctx) {\n const { values } = ctx\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 dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n"],"mappings":";;;;;AAKA,MAAa,UAAU,gBAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aACE;CACF,UAAU;EACR;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,SAAS;CACT,MAAM;EACJ,KAAK;GACH,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,aACE;GACF,SAAS;EACX;CACF;CACA,MAAM,IAAI,KAAK;EACb,MAAM,EAAE,WAAW;EACnB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GACR,KAAK,OAAO;GACZ;GACA,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,SAAS,OAAO;GAChB,QAAQ,IAAI,WAAW;EACzB,CAAC;CACH;AACF,CAAC"}
|
package/dist/login-Bc19oiFE.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_run = require("./run-y6LRyWdS.cjs");
|
|
3
|
-
//#region src/runners/studio/login.ts
|
|
4
|
-
const runner = async ({ values }) => {
|
|
5
|
-
const options = require_run.createStudioOptions(values);
|
|
6
|
-
await require_run.run(options, () => require_run.login(options));
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.runner = runner;
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=login-Bc19oiFE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-Bc19oiFE.cjs","names":["createStudioOptions","run","login"],"sources":["../src/runners/studio/login.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/login.ts'\nimport { createStudioOptions, login, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, () => login(options))\n}\n"],"mappings":";;;AAIA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAUA,YAAAA,oBAAoB,MAAM;CAC1C,MAAMC,YAAAA,IAAI,eAAeC,YAAAA,MAAM,OAAO,CAAC;AACzC"}
|
package/dist/login-Do3nns0B.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { i as login, n as createStudioOptions, o as run } from "./run-BDaZPU-1.js";
|
|
3
|
-
//#region src/runners/studio/login.ts
|
|
4
|
-
const runner = async ({ values }) => {
|
|
5
|
-
const options = createStudioOptions(values);
|
|
6
|
-
await run(options, () => login(options));
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { runner };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=login-Do3nns0B.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-Do3nns0B.js","names":[],"sources":["../src/runners/studio/login.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/login.ts'\nimport { createStudioOptions, login, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, () => login(options))\n}\n"],"mappings":";;;AAIA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAU,oBAAoB,MAAM;CAC1C,MAAM,IAAI,eAAe,MAAM,OAAO,CAAC;AACzC"}
|
package/dist/logout-BvHFvCeI.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_run = require("./run-y6LRyWdS.cjs");
|
|
3
|
-
const require_background = require("./background-Bbcc2TdN.cjs");
|
|
4
|
-
//#region src/runners/studio/logout.ts
|
|
5
|
-
const runner = async ({ values }) => {
|
|
6
|
-
const options = require_run.createStudioOptions(values);
|
|
7
|
-
await require_run.run(options, async () => {
|
|
8
|
-
await require_background.stopWorker();
|
|
9
|
-
await require_run.clearCredentials();
|
|
10
|
-
console.log("Signed out of Kubb Studio.");
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
exports.runner = runner;
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=logout-BvHFvCeI.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout-BvHFvCeI.cjs","names":["createStudioOptions","run","stopWorker","clearCredentials"],"sources":["../src/runners/studio/logout.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/logout.ts'\nimport { stopWorker } from './background.ts'\nimport { clearCredentials } from './credentials.ts'\nimport { createStudioOptions, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, async () => {\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n })\n}\n"],"mappings":";;;;AAMA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAUA,YAAAA,oBAAoB,MAAM;CAC1C,MAAMC,YAAAA,IAAI,SAAS,YAAY;EAC7B,MAAMC,mBAAAA,WAAW;EACjB,MAAMC,YAAAA,iBAAiB;EACvB,QAAQ,IAAI,4BAA4B;CAC1C,CAAC;AACH"}
|
package/dist/logout-COxoIMum.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { c as clearCredentials, n as createStudioOptions, o as run } from "./run-BDaZPU-1.js";
|
|
3
|
-
import { a as stopWorker } from "./background-DxlRE9O5.js";
|
|
4
|
-
//#region src/runners/studio/logout.ts
|
|
5
|
-
const runner = async ({ values }) => {
|
|
6
|
-
const options = createStudioOptions(values);
|
|
7
|
-
await run(options, async () => {
|
|
8
|
-
await stopWorker();
|
|
9
|
-
await clearCredentials();
|
|
10
|
-
console.log("Signed out of Kubb Studio.");
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { runner };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=logout-COxoIMum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout-COxoIMum.js","names":[],"sources":["../src/runners/studio/logout.ts"],"sourcesContent":["import type { CommandRunner } from 'gunshi'\nimport type { definition } from '../../commands/studio/logout.ts'\nimport { stopWorker } from './background.ts'\nimport { clearCredentials } from './credentials.ts'\nimport { createStudioOptions, run } from './run.ts'\n\nexport const runner: CommandRunner<{ args: typeof definition.args; extensions: {} }> = async ({ values }) => {\n const options = createStudioOptions(values)\n await run(options, async () => {\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n })\n}\n"],"mappings":";;;;AAMA,MAAa,SAA0E,OAAO,EAAE,aAAa;CAC3G,MAAM,UAAU,oBAAoB,MAAM;CAC1C,MAAM,IAAI,SAAS,YAAY;EAC7B,MAAM,WAAW;EACjB,MAAM,iBAAiB;EACvB,QAAQ,IAAI,4BAA4B;CAC1C,CAAC;AACH"}
|
package/dist/mcp-B-GxGgVr.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { define } from "gunshi";
|
|
2
|
-
//#region src/commands/mcp.ts
|
|
3
|
-
/**
|
|
4
|
-
* Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this
|
|
5
|
-
* with the runner through gunshi's `lazy`.
|
|
6
|
-
*/
|
|
7
|
-
const definition = define({
|
|
8
|
-
name: "mcp",
|
|
9
|
-
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.",
|
|
10
|
-
examples: [
|
|
11
|
-
"kubb mcp",
|
|
12
|
-
"# Then add to your MCP client config:",
|
|
13
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
14
|
-
].join("\n")
|
|
15
|
-
});
|
|
16
|
-
//#endregion
|
|
17
|
-
export { definition };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=mcp-B-GxGgVr.js.map
|
package/dist/mcp-B-GxGgVr.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-B-GxGgVr.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/**\n * Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this\n * with the runner through gunshi's `lazy`.\n */\nexport const definition = define({\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: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n})\n"],"mappings":";;;;;;AAMA,MAAa,aAAa,OAAO;CAC/B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;AAC5J,CAAC"}
|
package/dist/mcp-B3B-rE7W.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/commands/mcp.ts
|
|
2
|
-
/**
|
|
3
|
-
* Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this
|
|
4
|
-
* with the runner through gunshi's `lazy`.
|
|
5
|
-
*/
|
|
6
|
-
const definition = (0, require("gunshi").define)({
|
|
7
|
-
name: "mcp",
|
|
8
|
-
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.",
|
|
9
|
-
examples: [
|
|
10
|
-
"kubb mcp",
|
|
11
|
-
"# Then add to your MCP client config:",
|
|
12
|
-
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
13
|
-
].join("\n")
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
exports.definition = definition;
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=mcp-B3B-rE7W.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-B3B-rE7W.cjs","names":["define"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/**\n * Declaration only, so listing `kubb --help` never loads `@kubb/mcp`. `index.ts` pairs this\n * with the runner through gunshi's `lazy`.\n */\nexport const definition = define({\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: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n})\n"],"mappings":";;;;;AAMA,MAAa,cAAA,mBAAaA,CAAAA,CAAAA,OAAAA,CAAO;CAC/B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;AAC5J,CAAC"}
|
package/dist/output-CVLosNZq.cjs
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-qbf5tadS.cjs");
|
|
2
|
-
const require_agent = require("./agent-DiB4CRre.cjs");
|
|
3
|
-
let node_util = require("node:util");
|
|
4
|
-
let _clack_prompts = require("@clack/prompts");
|
|
5
|
-
_clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
|
|
6
|
-
//#region ../../internals/utils/src/time.ts
|
|
7
|
-
/**
|
|
8
|
-
* Calculates elapsed time in milliseconds from a high-resolution `process.hrtime` start time.
|
|
9
|
-
* Rounds to 2 decimal places for sub-millisecond precision without noise.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const start = process.hrtime()
|
|
14
|
-
* doWork()
|
|
15
|
-
* getElapsedMs(start) // 42.35
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function getElapsedMs(hrStart) {
|
|
19
|
-
const [seconds, nanoseconds] = process.hrtime(hrStart);
|
|
20
|
-
const ms = seconds * 1e3 + nanoseconds / 1e6;
|
|
21
|
-
return Math.round(ms * 100) / 100;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Converts a millisecond duration into a human-readable string (`ms`, `s`, or `m s`).
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* formatMs(250) // '250ms'
|
|
29
|
-
* formatMs(1500) // '1.50s'
|
|
30
|
-
* formatMs(90000) // '1m 30.0s'
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
function formatMs(ms) {
|
|
34
|
-
if (ms >= 6e4) return `${Math.floor(ms / 6e4)}m ${(ms % 6e4 / 1e3).toFixed(1)}s`;
|
|
35
|
-
if (ms >= 1e3) return `${(ms / 1e3).toFixed(2)}s`;
|
|
36
|
-
return `${Math.round(ms)}ms`;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/utils/env.ts
|
|
40
|
-
/**
|
|
41
|
-
* Returns `true` when the process has an interactive TTY with a valid terminal
|
|
42
|
-
* width and is not running in CI.
|
|
43
|
-
*
|
|
44
|
-
* Some IDE-embedded terminals report `isTTY = true` but set `columns` to `0`,
|
|
45
|
-
* which breaks clack's box-drawing helpers (they call `String.prototype.repeat`
|
|
46
|
-
* with a negative count and throw a `RangeError`). A positive column count is
|
|
47
|
-
* required before the TTY counts as usable.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* if (canUseTTY()) {
|
|
52
|
-
* renderProgressBar()
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
function canUseTTY() {
|
|
57
|
-
return process.stdout.isTTY && (process.stdout.columns ?? 0) > 0 && !require_agent.isCIEnvironment();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Returns `true` when output can carry spinners and clack's gutter: an interactive TTY that no AI
|
|
61
|
-
* coding agent is reading. Cursor-movement escapes are hard for an agent to parse even over a
|
|
62
|
-
* pseudo-TTY, so it gets the plain writer.
|
|
63
|
-
*/
|
|
64
|
-
function isRichOutput() {
|
|
65
|
-
return canUseTTY() && !require_agent.getAgentName();
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/loggers/banner.ts
|
|
69
|
-
/**
|
|
70
|
-
* Parses a CSS hex color string (`#RGB`) into its RGB channels.
|
|
71
|
-
* Falls back to `255` for any channel that cannot be parsed.
|
|
72
|
-
*/
|
|
73
|
-
function parseHex(color) {
|
|
74
|
-
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
75
|
-
return Number.isNaN(int) ? {
|
|
76
|
-
r: 255,
|
|
77
|
-
g: 255,
|
|
78
|
-
b: 255
|
|
79
|
-
} : {
|
|
80
|
-
r: int >> 16 & 255,
|
|
81
|
-
g: int >> 8 & 255,
|
|
82
|
-
b: int & 255
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Returns a function that wraps a string in a 24-bit ANSI true-color escape sequence
|
|
87
|
-
* for the given hex color.
|
|
88
|
-
*/
|
|
89
|
-
function hex(color) {
|
|
90
|
-
const { r, g, b } = parseHex(color);
|
|
91
|
-
return (text) => `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m`;
|
|
92
|
-
}
|
|
93
|
-
function gradient(colorStops, text) {
|
|
94
|
-
const chars = text.split("");
|
|
95
|
-
return chars.map((char, i) => {
|
|
96
|
-
const t = chars.length <= 1 ? 0 : i / (chars.length - 1);
|
|
97
|
-
const seg = Math.min(Math.floor(t * (colorStops.length - 1)), colorStops.length - 2);
|
|
98
|
-
const lt = t * (colorStops.length - 1) - seg;
|
|
99
|
-
const from = parseHex(colorStops[seg]);
|
|
100
|
-
const to = parseHex(colorStops[seg + 1]);
|
|
101
|
-
return `\x1b[38;2;${Math.round(from.r + (to.r - from.r) * lt)};${Math.round(from.g + (to.g - from.g) * lt)};${Math.round(from.b + (to.b - from.b) * lt)}m${char}\x1b[0m`;
|
|
102
|
-
}).join("");
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* ANSI color functions for each part of the Kubb mascot illustration.
|
|
106
|
-
*/
|
|
107
|
-
const palette = {
|
|
108
|
-
/**
|
|
109
|
-
* Top cap of the skittle.
|
|
110
|
-
*/
|
|
111
|
-
lid: hex("#F55A17"),
|
|
112
|
-
/**
|
|
113
|
-
* Upper wood body.
|
|
114
|
-
*/
|
|
115
|
-
woodTop: hex("#F5A217"),
|
|
116
|
-
/**
|
|
117
|
-
* Middle wood body.
|
|
118
|
-
*/
|
|
119
|
-
woodMid: hex("#F58517"),
|
|
120
|
-
/**
|
|
121
|
-
* Base wood body.
|
|
122
|
-
*/
|
|
123
|
-
woodBase: hex("#B45309"),
|
|
124
|
-
/**
|
|
125
|
-
* Eye whites.
|
|
126
|
-
*/
|
|
127
|
-
eye: hex("#FFFFFF"),
|
|
128
|
-
/**
|
|
129
|
-
* Highlight accent.
|
|
130
|
-
*/
|
|
131
|
-
highlight: hex("#adadc6"),
|
|
132
|
-
/**
|
|
133
|
-
* Cheek blush.
|
|
134
|
-
*/
|
|
135
|
-
blush: hex("#FDA4AF")
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Generates the Kubb mascot welcome banner as an ANSI-colored string.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```ts
|
|
142
|
-
* console.log(getIntro({ title: 'kubb.config.ts', description: 'generating…', version: '5.0.0', areEyesOpen: true }))
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
function getIntro({ title, description, version, areEyesOpen }) {
|
|
146
|
-
const kubbVersion = gradient([
|
|
147
|
-
"#F58517",
|
|
148
|
-
"#F5A217",
|
|
149
|
-
"#F55A17"
|
|
150
|
-
], `KUBB v${version}`);
|
|
151
|
-
const eyeTop = areEyesOpen ? palette.eye("█▀█") : palette.eye("───");
|
|
152
|
-
const eyeBottom = areEyesOpen ? palette.eye("▀▀▀") : palette.eye("───");
|
|
153
|
-
return [
|
|
154
|
-
` ${palette.lid("▄▄▄▄▄▄▄▄▄▄▄▄▄")}`,
|
|
155
|
-
` ${palette.woodTop("█ ")}${palette.highlight("▄▄")}${palette.woodTop(" ")}${palette.highlight("▄▄")}${palette.woodTop(" █")} ${kubbVersion}`,
|
|
156
|
-
` ${palette.woodMid("█ ")}${eyeTop}${palette.woodMid(" ")}${eyeTop}${palette.woodMid(" █")} ${(0, node_util.styleText)("gray", title)}`,
|
|
157
|
-
` ${palette.woodMid("█ ")}${eyeBottom}${palette.woodMid(" ")}${palette.blush("◡")}${palette.woodMid(" ")}${eyeBottom}${palette.woodMid(" █")} ${(0, node_util.styleText)("yellow", "➜")} ${(0, node_util.styleText)("white", description)}`,
|
|
158
|
-
` ${palette.woodBase("▀▀▀▀▀▀▀▀▀▀▀▀▀")}`
|
|
159
|
-
].join("\n");
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Formats a millisecond duration with a threshold-based ANSI color.
|
|
163
|
-
* `≤ 500 ms` → green · `≤ 1 000 ms` → yellow · `> 1 000 ms` → red.
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```ts
|
|
167
|
-
* formatMsWithColor(200) // '\x1b[32m200ms\x1b[39m'
|
|
168
|
-
* formatMsWithColor(800) // '\x1b[33m800ms\x1b[39m'
|
|
169
|
-
* formatMsWithColor(1500) // '\x1b[31m1.50s\x1b[39m'
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
function formatMsWithColor(ms) {
|
|
173
|
-
const formatted = formatMs(ms);
|
|
174
|
-
if (ms <= 500) return (0, node_util.styleText)("green", formatted);
|
|
175
|
-
if (ms <= 1e3) return (0, node_util.styleText)("yellow", formatted);
|
|
176
|
-
return (0, node_util.styleText)("red", formatted);
|
|
177
|
-
}
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/loggers/output.ts
|
|
180
|
-
/**
|
|
181
|
-
* Prefixes the plain writers use, the same ones `plainLogger` prints, so a command's own output
|
|
182
|
-
* and the hook output around it read as one stream.
|
|
183
|
-
*/
|
|
184
|
-
const SYMBOLS = {
|
|
185
|
-
info: "ℹ",
|
|
186
|
-
warn: "⚠",
|
|
187
|
-
error: "✗",
|
|
188
|
-
step: "◇"
|
|
189
|
-
};
|
|
190
|
-
const SPONSOR_TIPS = [
|
|
191
|
-
"Your sponsorship keeps Kubb codegen, plugins, and docs maintained",
|
|
192
|
-
"Sponsor faster generators and better Kubb Studio workflows",
|
|
193
|
-
"Help keep Kubb free for TypeScript teams building APIs",
|
|
194
|
-
"Support React Query, Zod, Faker, and MSW integrations",
|
|
195
|
-
"Back open-source tools that turn OpenAPI into TypeScript",
|
|
196
|
-
"Sponsor fixes, releases, and new plugins for your API workflow",
|
|
197
|
-
"Help Kubb stay independent and focused on developer tools"
|
|
198
|
-
];
|
|
199
|
-
const SPONSOR_LINKS = [
|
|
200
|
-
"https://github.com/sponsors/stijnvanhulle",
|
|
201
|
-
"https://opencollective.com/kubb",
|
|
202
|
-
"https://kubb.dev/sponsors"
|
|
203
|
-
];
|
|
204
|
-
function nextTip() {
|
|
205
|
-
return `${SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]}: ${SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]}`;
|
|
206
|
-
}
|
|
207
|
-
function formatTip(tip) {
|
|
208
|
-
return (0, node_util.styleText)("magenta", " Tip ") + (0, node_util.styleText)("yellow", tip);
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Prints one random tip outside every group. Rich terminals get the styled variant;
|
|
212
|
-
* plain/CI output gets a stable text-only line so the tip is still visible as final output.
|
|
213
|
-
*/
|
|
214
|
-
function logTip() {
|
|
215
|
-
const tip = nextTip();
|
|
216
|
-
if (!isRichOutput()) {
|
|
217
|
-
console.log(`Tip: ${tip}`);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
console.log(`${(0, node_util.styleText)("magenta", "✦")}${formatTip(tip)}`);
|
|
221
|
-
}
|
|
222
|
-
function write(level, message) {
|
|
223
|
-
if (isRichOutput()) {
|
|
224
|
-
_clack_prompts.log[level](message);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
console.log(`${SYMBOLS[level]} ${message}`);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Opens a command's output with its title.
|
|
231
|
-
*/
|
|
232
|
-
function logIntro({ title, warning, block = true }) {
|
|
233
|
-
if (block && isRichOutput()) {
|
|
234
|
-
if (title) _clack_prompts.intro(title);
|
|
235
|
-
if (warning) _clack_prompts.log.warn(warning);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (title) console.log(title);
|
|
239
|
-
if (warning) console.warn(warning);
|
|
240
|
-
if (title || warning) console.log();
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain
|
|
244
|
-
* output prints the text on its own.
|
|
245
|
-
*/
|
|
246
|
-
function logOutro(text) {
|
|
247
|
-
if (isRichOutput()) {
|
|
248
|
-
_clack_prompts.outro(text);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
console.log(text);
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a
|
|
255
|
-
* group and a spacer sits outside every one.
|
|
256
|
-
*/
|
|
257
|
-
function logSpacer() {
|
|
258
|
-
console.log("");
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Opens the command with the Kubb mascot and version, or a single version line where the terminal
|
|
262
|
-
* cannot draw it.
|
|
263
|
-
*/
|
|
264
|
-
function logBanner(version) {
|
|
265
|
-
if (isRichOutput()) {
|
|
266
|
-
console.log(`\n${getIntro({
|
|
267
|
-
title: "Turn your API spec into type-safe code",
|
|
268
|
-
description: "Ready to start",
|
|
269
|
-
version,
|
|
270
|
-
areEyesOpen: true
|
|
271
|
-
})}\n`);
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
console.log(`Kubb CLI v${version}`);
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Prints lines as one block, without a symbol in front of them.
|
|
278
|
-
*/
|
|
279
|
-
function logBlock(lines) {
|
|
280
|
-
if (isRichOutput()) {
|
|
281
|
-
_clack_prompts.log.message(lines);
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
console.log([lines].flat().join("\n"));
|
|
285
|
-
}
|
|
286
|
-
function logInfo(message) {
|
|
287
|
-
write("info", message);
|
|
288
|
-
}
|
|
289
|
-
function logWarn(message) {
|
|
290
|
-
write("warn", message);
|
|
291
|
-
}
|
|
292
|
-
function logError(message) {
|
|
293
|
-
write("error", message);
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Reports a step the command is taking, rather than something it found.
|
|
297
|
-
*/
|
|
298
|
-
function logStep(message) {
|
|
299
|
-
write("step", message);
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* A progress spinner, or a writer that prints each message it is given when the terminal cannot
|
|
303
|
-
* animate one. Callers drive both the same way, including the failure state.
|
|
304
|
-
*/
|
|
305
|
-
function createSpinner() {
|
|
306
|
-
if (isRichOutput()) return _clack_prompts.spinner();
|
|
307
|
-
const print = (message) => {
|
|
308
|
-
if (message) console.log(message);
|
|
309
|
-
};
|
|
310
|
-
return {
|
|
311
|
-
start: print,
|
|
312
|
-
stop: print,
|
|
313
|
-
error: (message) => {
|
|
314
|
-
if (message) console.log(`${SYMBOLS.error} ${message}`);
|
|
315
|
-
},
|
|
316
|
-
message: print
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
//#endregion
|
|
320
|
-
Object.defineProperty(exports, "canUseTTY", {
|
|
321
|
-
enumerable: true,
|
|
322
|
-
get: function() {
|
|
323
|
-
return canUseTTY;
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
Object.defineProperty(exports, "createSpinner", {
|
|
327
|
-
enumerable: true,
|
|
328
|
-
get: function() {
|
|
329
|
-
return createSpinner;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
Object.defineProperty(exports, "formatMs", {
|
|
333
|
-
enumerable: true,
|
|
334
|
-
get: function() {
|
|
335
|
-
return formatMs;
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
Object.defineProperty(exports, "formatMsWithColor", {
|
|
339
|
-
enumerable: true,
|
|
340
|
-
get: function() {
|
|
341
|
-
return formatMsWithColor;
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
Object.defineProperty(exports, "getElapsedMs", {
|
|
345
|
-
enumerable: true,
|
|
346
|
-
get: function() {
|
|
347
|
-
return getElapsedMs;
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
Object.defineProperty(exports, "logBanner", {
|
|
351
|
-
enumerable: true,
|
|
352
|
-
get: function() {
|
|
353
|
-
return logBanner;
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
Object.defineProperty(exports, "logBlock", {
|
|
357
|
-
enumerable: true,
|
|
358
|
-
get: function() {
|
|
359
|
-
return logBlock;
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
Object.defineProperty(exports, "logError", {
|
|
363
|
-
enumerable: true,
|
|
364
|
-
get: function() {
|
|
365
|
-
return logError;
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
Object.defineProperty(exports, "logInfo", {
|
|
369
|
-
enumerable: true,
|
|
370
|
-
get: function() {
|
|
371
|
-
return logInfo;
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
Object.defineProperty(exports, "logIntro", {
|
|
375
|
-
enumerable: true,
|
|
376
|
-
get: function() {
|
|
377
|
-
return logIntro;
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
Object.defineProperty(exports, "logOutro", {
|
|
381
|
-
enumerable: true,
|
|
382
|
-
get: function() {
|
|
383
|
-
return logOutro;
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
Object.defineProperty(exports, "logSpacer", {
|
|
387
|
-
enumerable: true,
|
|
388
|
-
get: function() {
|
|
389
|
-
return logSpacer;
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
Object.defineProperty(exports, "logStep", {
|
|
393
|
-
enumerable: true,
|
|
394
|
-
get: function() {
|
|
395
|
-
return logStep;
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
Object.defineProperty(exports, "logTip", {
|
|
399
|
-
enumerable: true,
|
|
400
|
-
get: function() {
|
|
401
|
-
return logTip;
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
Object.defineProperty(exports, "logWarn", {
|
|
405
|
-
enumerable: true,
|
|
406
|
-
get: function() {
|
|
407
|
-
return logWarn;
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
//# sourceMappingURL=output-CVLosNZq.cjs.map
|