@kubb/cli 5.15.0 → 5.15.2
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-B3edcFoB.js → Telemetry-BLRICCFj.js} +2 -2
- package/dist/{Telemetry-B3edcFoB.js.map → Telemetry-BLRICCFj.js.map} +1 -1
- package/dist/{Telemetry-COWGqYmh.cjs → Telemetry-CSjCG8WO.cjs} +2 -2
- package/dist/{Telemetry-COWGqYmh.cjs.map → Telemetry-CSjCG8WO.cjs.map} +1 -1
- package/dist/{background-_dKcGjM7.js → background-BeEZZNGc.js} +2 -2
- package/dist/{background-_dKcGjM7.js.map → background-BeEZZNGc.js.map} +1 -1
- package/dist/{background-B24lIehn.cjs → background-BiyfuZFp.cjs} +2 -2
- package/dist/{background-B24lIehn.cjs.map → background-BiyfuZFp.cjs.map} +1 -1
- package/dist/{background-D-7OGjvg.js → background-QEuTfHev.js} +1 -1
- package/dist/{configFile-CoEpHdXG.cjs → configFile-CVfWdtKh.cjs} +4 -40
- package/dist/configFile-CVfWdtKh.cjs.map +1 -0
- package/dist/{configFile-C0DIXNMD.js → configFile-IHj8fRIw.js} +3 -39
- package/dist/configFile-IHj8fRIw.js.map +1 -0
- package/dist/{spinner-BZaln7O8.js → fs-Cf1FSRh9.js} +20 -41
- package/dist/fs-Cf1FSRh9.js.map +1 -0
- package/dist/index.cjs +14 -14
- package/dist/index.js +14 -14
- package/dist/{installWithSpinner-DpnpxHq5.js → installWithSpinner-BAlTSQlE.js} +3 -3
- package/dist/{installWithSpinner-DpnpxHq5.js.map → installWithSpinner-BAlTSQlE.js.map} +1 -1
- package/dist/{installWithSpinner-ONGfIVUJ.cjs → installWithSpinner-X9J7yxiR.cjs} +3 -3
- package/dist/{installWithSpinner-ONGfIVUJ.cjs.map → installWithSpinner-X9J7yxiR.cjs.map} +1 -1
- package/dist/intro-DRl-pwVs.js +72 -0
- package/dist/intro-DRl-pwVs.js.map +1 -0
- package/dist/intro-DuyzJ3Rb.cjs +102 -0
- package/dist/intro-DuyzJ3Rb.cjs.map +1 -0
- package/dist/{intro-9PB8sE8z.js → log-B-1vLxF1.js} +2 -66
- package/dist/log-B-1vLxF1.js.map +1 -0
- package/dist/{intro-YPaf1Imr.cjs → log-wv1OxLiq.cjs} +1 -95
- package/dist/log-wv1OxLiq.cjs.map +1 -0
- package/dist/{mascot-JSA0j3Q_.cjs → mascot-CC-D4ON2.cjs} +2 -2
- package/dist/{mascot-JSA0j3Q_.cjs.map → mascot-CC-D4ON2.cjs.map} +1 -1
- package/dist/{mascot--q1xjKw1.js → mascot-CmUUHLlx.js} +2 -2
- package/dist/{mascot--q1xjKw1.js.map → mascot-CmUUHLlx.js.map} +1 -1
- package/dist/{mcp-CYPOFKnP.cjs → mcp-Don4UqAB.cjs} +2 -2
- package/dist/{mcp-CYPOFKnP.cjs.map → mcp-Don4UqAB.cjs.map} +1 -1
- package/dist/{mcp-CxeZR5vb.js → mcp-Spp8N-xs.js} +2 -2
- package/dist/{mcp-CxeZR5vb.js.map → mcp-Spp8N-xs.js.map} +1 -1
- package/dist/package-Bf2T71nz.js +5 -0
- package/dist/package-Bf2T71nz.js.map +1 -0
- package/dist/{package-aX0q9SZr.cjs → package-CI_luotn.cjs} +2 -2
- package/dist/package-CI_luotn.cjs.map +1 -0
- package/dist/{registry-B3eYk4LN.js → registry-Cy48PGdh.js} +3 -2
- package/dist/registry-Cy48PGdh.js.map +1 -0
- package/dist/{registry-YE1pFWL-.cjs → registry-Q77p5TZp.cjs} +3 -2
- package/dist/registry-Q77p5TZp.cjs.map +1 -0
- package/dist/{reporters-BM430HdQ.js → reporters-D6w4huLl.js} +222 -11
- package/dist/reporters-D6w4huLl.js.map +1 -0
- package/dist/{reporters-2cgjvXwR.cjs → reporters-Dby6Kgdj.cjs} +255 -10
- package/dist/reporters-Dby6Kgdj.cjs.map +1 -0
- package/dist/reporters-GdWr95qd.js +1 -0
- package/dist/{run-C0KI-NE3.js → run-BEwA7UDN.js} +4 -4
- package/dist/{run-C0KI-NE3.js.map → run-BEwA7UDN.js.map} +1 -1
- package/dist/{run-RN_31Q4u.js → run-BGUSyeuP.js} +44 -38
- package/dist/run-BGUSyeuP.js.map +1 -0
- package/dist/{run-DFXhBS64.js → run-BY4KZsE3.js} +2 -2
- package/dist/{run-DFXhBS64.js.map → run-BY4KZsE3.js.map} +1 -1
- package/dist/{run-CbX6tpqB.js → run-B_XCebc9.js} +10 -10
- package/dist/{run-CbX6tpqB.js.map → run-B_XCebc9.js.map} +1 -1
- package/dist/{run-B4zvF9WY.cjs → run-CFw6-hm1.cjs} +48 -42
- package/dist/run-CFw6-hm1.cjs.map +1 -0
- package/dist/{run-DCqmf5W1.cjs → run-CGdXlXy-.cjs} +4 -4
- package/dist/{run-DCqmf5W1.cjs.map → run-CGdXlXy-.cjs.map} +1 -1
- package/dist/{run-CCLPt4hr.js → run-CYynQJRk.js} +1 -1
- package/dist/{run-CrM4jsix.cjs → run-CfumUZCl.cjs} +7 -6
- package/dist/{run-CrM4jsix.cjs.map → run-CfumUZCl.cjs.map} +1 -1
- package/dist/{run-D-nn9-Wq.js → run-Cgy4_JPy.js} +14 -18
- package/dist/run-Cgy4_JPy.js.map +1 -0
- package/dist/{run-1H9TGT8v.js → run-Ch7Uuu-u.js} +4 -3
- package/dist/{run-1H9TGT8v.js.map → run-Ch7Uuu-u.js.map} +1 -1
- package/dist/{run-BYP_t9dR.cjs → run-DCggecSY.cjs} +19 -24
- package/dist/run-DCggecSY.cjs.map +1 -0
- package/dist/{run-Bb19PlwV.cjs → run-DFIaAIjC.cjs} +13 -12
- package/dist/{run-Bb19PlwV.cjs.map → run-DFIaAIjC.cjs.map} +1 -1
- package/dist/{run-BrM7-NSV.js → run-DHfFHNfG.js} +13 -17
- package/dist/run-DHfFHNfG.js.map +1 -0
- package/dist/{run-CvFakE3B.cjs → run-DT4hTOR2.cjs} +16 -21
- package/dist/run-DT4hTOR2.cjs.map +1 -0
- package/dist/{run-DgGZOC_x.cjs → run-DfCka9wW.cjs} +47 -61
- package/dist/run-DfCka9wW.cjs.map +1 -0
- package/dist/{run-KqdudiWQ.js → run-DiCSiwh8.js} +10 -9
- package/dist/{run-KqdudiWQ.js.map → run-DiCSiwh8.js.map} +1 -1
- package/dist/{run-BoO7H8RA.cjs → run-FGwhN0Pi.cjs} +20 -20
- package/dist/{run-BoO7H8RA.cjs.map → run-FGwhN0Pi.cjs.map} +1 -1
- package/dist/{run-D5Z6nfzK.cjs → run-KePEAia2.cjs} +2 -2
- package/dist/{run-D5Z6nfzK.cjs.map → run-KePEAia2.cjs.map} +1 -1
- package/dist/{run-CCsdLz3X.js → run-OHr93Akz.js} +40 -53
- package/dist/run-OHr93Akz.js.map +1 -0
- package/dist/shared-DcDHRtZx.js +58 -0
- package/dist/shared-DcDHRtZx.js.map +1 -0
- package/dist/shared-KKRMm1xX.cjs +87 -0
- package/dist/shared-KKRMm1xX.cjs.map +1 -0
- package/dist/{snapshot-D7Ytw8S0.cjs → snapshot-ByWxzJIh.cjs} +7 -7
- package/dist/{snapshot-D7Ytw8S0.cjs.map → snapshot-ByWxzJIh.cjs.map} +1 -1
- package/dist/{snapshot-n7dJGCWv.js → snapshot-UAiT_UQa.js} +6 -6
- package/dist/{snapshot-n7dJGCWv.js.map → snapshot-UAiT_UQa.js.map} +1 -1
- package/dist/spinner-DxsAllRI.js +48 -0
- package/dist/spinner-DxsAllRI.js.map +1 -0
- package/dist/{spinner-CfB0sIPy.cjs → spinner-RfMb7fd6.cjs} +50 -21
- package/dist/spinner-RfMb7fd6.cjs.map +1 -0
- package/dist/{status-DxSkp1cH.js → status-CEZ3m06O.js} +3 -3
- package/dist/{status-DxSkp1cH.js.map → status-CEZ3m06O.js.map} +1 -1
- package/dist/{status-Bc0_4T41.cjs → status-iE6UADco.cjs} +3 -3
- package/dist/{status-Bc0_4T41.cjs.map → status-iE6UADco.cjs.map} +1 -1
- package/dist/{studio-BpYwgFb0.cjs → studio-BL3zpp5R.cjs} +12 -12
- package/dist/{studio-BpYwgFb0.cjs.map → studio-BL3zpp5R.cjs.map} +1 -1
- package/dist/{studio-mw6HaPkr.js → studio-D9WQb5vH.js} +12 -12
- package/dist/{studio-mw6HaPkr.js.map → studio-D9WQb5vH.js.map} +1 -1
- package/dist/studioWorker.js +2 -2
- package/dist/{summary-Clvl5Hxs.cjs → summary-B2Apv5KO.cjs} +17 -2
- package/dist/summary-B2Apv5KO.cjs.map +1 -0
- package/dist/{summary-CbmQKA8l.js → summary-BQWHL_Ca.js} +12 -3
- package/dist/summary-BQWHL_Ca.js.map +1 -0
- package/dist/{text-Ep3AulAS.cjs → text-DMiX2dcG.cjs} +10 -1
- package/dist/text-DMiX2dcG.cjs.map +1 -0
- package/dist/{text-BmiI4s6N.js → text-EoYn04SX.js} +5 -2
- package/dist/text-EoYn04SX.js.map +1 -0
- package/dist/{utils-CbJ6hS_t.js → utils-CeMUE4P0.js} +90 -70
- package/dist/utils-CeMUE4P0.js.map +1 -0
- package/dist/{utils-CO89mxRU.cjs → utils-uSJAZuvP.cjs} +101 -69
- package/dist/utils-uSJAZuvP.cjs.map +1 -0
- package/dist/{validate-CMSeDpGT.cjs → validate-B9Ctya2v.cjs} +3 -3
- package/dist/{validate-CMSeDpGT.cjs.map → validate-B9Ctya2v.cjs.map} +1 -1
- package/dist/{validate-8ZcWXfMt.js → validate-BGvFsCDL.js} +3 -3
- package/dist/{validate-8ZcWXfMt.js.map → validate-BGvFsCDL.js.map} +1 -1
- package/package.json +8 -7
- package/dist/configFile-C0DIXNMD.js.map +0 -1
- package/dist/configFile-CoEpHdXG.cjs.map +0 -1
- package/dist/intro-9PB8sE8z.js.map +0 -1
- package/dist/intro-YPaf1Imr.cjs.map +0 -1
- package/dist/package-D3Yss9Bb.js +0 -5
- package/dist/package-D3Yss9Bb.js.map +0 -1
- package/dist/package-aX0q9SZr.cjs.map +0 -1
- package/dist/registry-B3eYk4LN.js.map +0 -1
- package/dist/registry-YE1pFWL-.cjs.map +0 -1
- package/dist/reporters-2cgjvXwR.cjs.map +0 -1
- package/dist/reporters-BM430HdQ.js.map +0 -1
- package/dist/run-B4zvF9WY.cjs.map +0 -1
- package/dist/run-BYP_t9dR.cjs.map +0 -1
- package/dist/run-BrM7-NSV.js.map +0 -1
- package/dist/run-CCsdLz3X.js.map +0 -1
- package/dist/run-CvFakE3B.cjs.map +0 -1
- package/dist/run-D-nn9-Wq.js.map +0 -1
- package/dist/run-DgGZOC_x.cjs.map +0 -1
- package/dist/run-RN_31Q4u.js.map +0 -1
- package/dist/shared-C0EtrdUm.cjs +0 -123
- package/dist/shared-C0EtrdUm.cjs.map +0 -1
- package/dist/shared-Ct9stKpp.js +0 -94
- package/dist/shared-Ct9stKpp.js.map +0 -1
- package/dist/spinner-BZaln7O8.js.map +0 -1
- package/dist/spinner-CfB0sIPy.cjs.map +0 -1
- package/dist/summary-CbmQKA8l.js.map +0 -1
- package/dist/summary-Clvl5Hxs.cjs.map +0 -1
- package/dist/text-BmiI4s6N.js.map +0 -1
- package/dist/text-Ep3AulAS.cjs.map +0 -1
- package/dist/utils-BdibacYq.js +0 -244
- package/dist/utils-BdibacYq.js.map +0 -1
- package/dist/utils-CO89mxRU.cjs.map +0 -1
- package/dist/utils-CbJ6hS_t.js.map +0 -1
- package/dist/utils-CcARPB45.cjs +0 -286
- package/dist/utils-CcARPB45.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
-
import { a as studioPermissionArgs, i as studioConnectionArgs, r as logLevelArg, t as configArg } from "./shared-
|
|
2
|
+
import { a as studioPermissionArgs, i as studioConnectionArgs, r as logLevelArg, t as configArg } from "./shared-DcDHRtZx.js";
|
|
3
3
|
import { t as findConfigFile } from "./config-CQTxXvIG.js";
|
|
4
4
|
import { define } from "gunshi";
|
|
5
5
|
import process from "node:process";
|
|
@@ -14,7 +14,7 @@ function studioCommand({ action, block, ...definition }) {
|
|
|
14
14
|
...definition,
|
|
15
15
|
toKebab: true,
|
|
16
16
|
async run({ values }) {
|
|
17
|
-
const { runStudio } = await import("./run-
|
|
17
|
+
const { runStudio } = await import("./run-CYynQJRk.js");
|
|
18
18
|
await runStudio(values, action, { block });
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -43,7 +43,7 @@ const command$7 = studioCommand({
|
|
|
43
43
|
},
|
|
44
44
|
block: true,
|
|
45
45
|
async action(options) {
|
|
46
|
-
const { connect } = await import("./run-
|
|
46
|
+
const { connect } = await import("./run-CYynQJRk.js");
|
|
47
47
|
await connect(options);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
@@ -54,7 +54,7 @@ const command$6 = studioCommand({
|
|
|
54
54
|
examples: ["kubb studio login", "kubb studio login --url http://localhost:3000"].join("\n"),
|
|
55
55
|
args: command$7.args,
|
|
56
56
|
async action(options) {
|
|
57
|
-
const { login } = await import("./run-
|
|
57
|
+
const { login } = await import("./run-CYynQJRk.js");
|
|
58
58
|
await login(options);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -65,7 +65,7 @@ const command$5 = studioCommand({
|
|
|
65
65
|
examples: "kubb studio logout",
|
|
66
66
|
args: {},
|
|
67
67
|
async action() {
|
|
68
|
-
const { stopWorker } = await import("./background-
|
|
68
|
+
const { stopWorker } = await import("./background-QEuTfHev.js");
|
|
69
69
|
const { clearCredentials } = await import("./credentials-B77iJx9H.js");
|
|
70
70
|
await stopWorker();
|
|
71
71
|
await clearCredentials();
|
|
@@ -80,7 +80,7 @@ const command$4 = studioCommand({
|
|
|
80
80
|
args: {},
|
|
81
81
|
async action(options) {
|
|
82
82
|
const { readCredentials } = await import("./credentials-B77iJx9H.js");
|
|
83
|
-
const { resolvePermissions } = await import("./run-
|
|
83
|
+
const { resolvePermissions } = await import("./run-CYynQJRk.js");
|
|
84
84
|
const { canUseTTY } = await import("./env-C3xHRMez.js");
|
|
85
85
|
const credentials = await readCredentials();
|
|
86
86
|
if (!credentials) throw new Error("This project is not paired with Kubb Studio. Run `kubb studio` first.");
|
|
@@ -125,7 +125,7 @@ const command$3 = define({
|
|
|
125
125
|
...logLevelArg
|
|
126
126
|
},
|
|
127
127
|
async run(ctx) {
|
|
128
|
-
const { runner } = await import("./snapshot-
|
|
128
|
+
const { runner } = await import("./snapshot-UAiT_UQa.js");
|
|
129
129
|
await runner(ctx);
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -135,7 +135,7 @@ const command$2 = studioCommand({
|
|
|
135
135
|
description: "Keep this project connected to Kubb Studio in the background.",
|
|
136
136
|
args: command$7.args,
|
|
137
137
|
async action(options) {
|
|
138
|
-
const { startWorker } = await import("./background-
|
|
138
|
+
const { startWorker } = await import("./background-QEuTfHev.js");
|
|
139
139
|
await startWorker(options);
|
|
140
140
|
}
|
|
141
141
|
});
|
|
@@ -143,7 +143,7 @@ const stopCommand = define({
|
|
|
143
143
|
name: "stop",
|
|
144
144
|
description: "Stop this project's background connection and keep its pairing.",
|
|
145
145
|
async run() {
|
|
146
|
-
const { stopWorker } = await import("./background-
|
|
146
|
+
const { stopWorker } = await import("./background-QEuTfHev.js");
|
|
147
147
|
await stopWorker();
|
|
148
148
|
console.log("Background connection stopped.");
|
|
149
149
|
}
|
|
@@ -155,9 +155,9 @@ const command$1 = studioCommand({
|
|
|
155
155
|
examples: "kubb studio status",
|
|
156
156
|
args: { url: studioConnectionArgs.url },
|
|
157
157
|
async action(options) {
|
|
158
|
-
const { getWorkerLogPath, getWorkerStatus } = await import("./background-
|
|
158
|
+
const { getWorkerLogPath, getWorkerStatus } = await import("./background-QEuTfHev.js");
|
|
159
159
|
const { readCredentials } = await import("./credentials-B77iJx9H.js");
|
|
160
|
-
const { formatStatus } = await import("./status-
|
|
160
|
+
const { formatStatus } = await import("./status-CEZ3m06O.js");
|
|
161
161
|
const [worker, credentials] = await Promise.all([getWorkerStatus(), readCredentials()]);
|
|
162
162
|
console.log([
|
|
163
163
|
"",
|
|
@@ -212,4 +212,4 @@ function routeStudioFlags(args) {
|
|
|
212
212
|
}
|
|
213
213
|
export { command, routeStudioFlags };
|
|
214
214
|
|
|
215
|
-
//# sourceMappingURL=studio-
|
|
215
|
+
//# sourceMappingURL=studio-D9WQb5vH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studio-mw6HaPkr.js","names":["command","command","connectCommand","command","command","command","command","connectCommand","command","connectCommand","startCommand","loginCommand","logoutCommand","statusCommand","permissionsCommand","snapshotCommand"],"sources":["../src/commands/studio/studioCommand.ts","../src/commands/studio/connect.ts","../src/commands/studio/login.ts","../src/commands/studio/logout.ts","../src/commands/studio/permissions.ts","../src/commands/studio/snapshot.ts","../src/commands/studio/background.ts","../src/commands/studio/status.ts","../src/commands/studio/index.ts"],"sourcesContent":["import { type Args, define } from 'gunshi'\nimport type { StudioOptions, StudioValues } from '../../runners/studio/run.ts'\n\n/**\n * Defines a `kubb studio` subcommand. The runner, and with it `@kubb/studio`, loads only when the\n * command runs, so `kubb --help` never does.\n */\nexport function studioCommand({\n action,\n block,\n ...definition\n}: {\n name: string\n description: string\n examples?: string\n args?: Args\n /** Opens a block a later `logOutro` closes, for a command that keeps running. */\n block?: boolean\n /** The command body, given the options built from its flags. */\n action: (options: StudioOptions) => Promise<unknown>\n}) {\n return define({\n ...definition,\n toKebab: true,\n async run({ values }) {\n const { runStudio } = await import('../../runners/studio/run.ts')\n await runStudio(values as StudioValues, action, { block })\n },\n })\n}\n","import { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'connect',\n description: 'Connect this project to Kubb Studio and generate from the browser.',\n examples: [\n 'kubb studio connect',\n 'kubb studio connect --allow-read',\n 'kubb studio connect --allow-write --allow-exec',\n 'kubb studio connect --url http://localhost:3000',\n ].join('\\n'),\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n open: {\n type: 'boolean',\n description: 'Open the approval page in a browser while pairing',\n default: true,\n negatable: true,\n },\n ...logLevelArg,\n },\n block: true,\n async action(options) {\n const { connect } = await import('../../runners/studio/run.ts')\n await connect(options)\n },\n})\n","import { command as connectCommand } from './connect.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'login',\n description: 'Pair this machine with Kubb Studio without connecting.',\n examples: ['kubb studio login', 'kubb studio login --url http://localhost:3000'].join('\\n'),\n args: connectCommand.args,\n async action(options) {\n const { login } = await import('../../runners/studio/run.ts')\n await login(options)\n },\n})\n","import { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'logout',\n description: 'Forget the stored Kubb Studio token.',\n examples: 'kubb studio logout',\n args: {},\n async action() {\n const { stopWorker } = await import('../../runners/studio/background.ts')\n const { clearCredentials } = await import('../../runners/studio/credentials.ts')\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n },\n})\n","import path from 'node:path'\nimport process from 'node:process'\nimport { findConfigFile } from '@internals/shared'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'permissions',\n description: 'Change what Kubb Studio may do in this project.',\n examples: 'kubb studio permissions',\n args: {},\n async action(options) {\n const { readCredentials } = await import('../../runners/studio/credentials.ts')\n const { resolvePermissions } = await import('../../runners/studio/run.ts')\n const { canUseTTY } = await import('../../utils/env.ts')\n\n const credentials = await readCredentials()\n if (!credentials) throw new Error('This project is not paired with Kubb Studio. Run `kubb studio` first.')\n if (!canUseTTY()) throw new Error('Changing permissions needs an interactive terminal.')\n\n const configFile = findConfigFile()\n await resolvePermissions(options, credentials, configFile && path.relative(process.cwd(), configFile), { edit: true })\n console.log(\n 'Permissions saved. A running connection keeps the old ones until you restart it: press Ctrl+C and run `kubb studio` again, or run `kubb studio stop`, then `kubb studio start`. Keep `--url` and `--config`, and leave out the `--allow-*` flag of any permission you turned off, since a flag grants it anyway.',\n )\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'snapshot',\n description: 'Generate and publish a Kubb Studio snapshot from CI.',\n examples: ['kubb studio snapshot', 'kubb studio snapshot --json'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n id: {\n type: 'string',\n description: 'Stable identity for the CI agent, such as a pull request. Auto-detected on GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI',\n },\n baseId: {\n type: 'string',\n description:\n \"Identity of another CI agent, such as the base branch's, to also compare this snapshot with. Auto-detected on GitHub pull requests and GitLab merge requests\",\n toKebab: true,\n },\n name: {\n type: 'string',\n description: 'Package name for the generated tarball. Defaults to the name in package.json',\n },\n packageVersion: {\n type: 'string',\n description: 'Package version for the generated tarball. Defaults to the version in package.json',\n toKebab: true,\n },\n json: {\n type: 'boolean',\n description: 'Print the result as one JSON object instead of a summary',\n default: false,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { runner } = await import('../../runners/studio/snapshot.ts')\n await runner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'start',\n description: 'Keep this project connected to Kubb Studio in the background.',\n args: connectCommand.args,\n async action(options) {\n const { startWorker } = await import('../../runners/studio/background.ts')\n await startWorker(options)\n },\n})\n\nexport const stopCommand = define({\n name: 'stop',\n description: \"Stop this project's background connection and keep its pairing.\",\n async run() {\n const { stopWorker } = await import('../../runners/studio/background.ts')\n await stopWorker()\n console.log('Background connection stopped.')\n },\n})\n","import process from 'node:process'\nimport { studioConnectionArgs } from '../shared.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'status',\n description: 'Show the project worker, Kubb Studio pairing, and saved permissions.',\n examples: 'kubb studio status',\n args: { url: studioConnectionArgs.url },\n async action(options) {\n const { getWorkerLogPath, getWorkerStatus } = await import('../../runners/studio/background.ts')\n const { readCredentials } = await import('../../runners/studio/credentials.ts')\n const { formatStatus } = await import('../../runners/studio/status.ts')\n\n const [worker, credentials] = await Promise.all([getWorkerStatus(), readCredentials()])\n console.log(\n ['', ...formatStatus({ studioUrl: options.studioUrl, credentials, worker, project: process.cwd(), logPath: getWorkerLogPath() }), ''].join('\\n'),\n )\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { command as loginCommand } from './login.ts'\nimport { command as logoutCommand } from './logout.ts'\nimport { command as permissionsCommand } from './permissions.ts'\nimport { command as snapshotCommand } from './snapshot.ts'\nimport { command as startCommand, stopCommand } from './background.ts'\nimport { command as statusCommand } from './status.ts'\n\nexport const command = define({\n ...connectCommand,\n name: 'studio',\n description: 'Connect this project to Kubb Studio, or manage its pairing and snapshots.',\n examples: [\n 'kubb studio',\n 'kubb studio --allow-read',\n 'kubb studio login',\n 'kubb studio status',\n 'kubb studio permissions',\n 'kubb studio logout',\n 'kubb studio snapshot',\n ].join('\\n'),\n subCommands: {\n start: startCommand,\n stop: stopCommand,\n connect: connectCommand,\n login: loginCommand,\n logout: logoutCommand,\n status: statusCommand,\n permissions: permissionsCommand,\n snapshot: snapshotCommand,\n },\n})\n\n/**\n * Sends `kubb studio --flag value` to `kubb studio connect`, the same runner. gunshi picks a\n * subcommand from the first token that is not a flag, so `--url http://…` would read the URL as one.\n */\nexport function routeStudioFlags(args: Array<string>): Array<string> {\n const [name, next] = args\n if (name !== 'studio' || !next?.startsWith('-') || next === '--help' || next === '-h') return args\n\n return ['studio', 'connect', ...args.slice(1)]\n}\n"],"mappings":";;;;;;;;;;;AAOA,SAAgB,cAAc,EAC5B,QACA,OACA,GAAG,cAUF;CACD,OAAO,OAAO;EACZ,GAAG;EACH,SAAS;EACT,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,cAAc,MAAM,OAAO;GACnC,MAAM,UAAU,QAAwB,QAAQ,EAAE,MAAM,CAAC;EAC3D;CACF,CAAC;AACH;;AC1BA,MAAaA,YAAU,cAAc;CACnC,MAAM;CACN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,CAAC,CAAC;EACtF,QAAQ,IACN;GAAC;GAAI,GAAG,aAAa;IAAE,WAAW,QAAQ;IAAW;IAAa;IAAQ,SAAS,QAAQ,IAAI;IAAG,SAAS,iBAAiB;GAAE,CAAC;GAAG;EAAE,CAAC,CAAC,KAAK,IAAI,CACjJ;CACF;AACF,CAAC;;ACVD,MAAa,UAAU,OAAO;CAC5B,GAAGC;CACH,MAAM;CACN,aAAa;CACb,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,aAAa;EACX,OAAOC;EACP,MAAM;EACN,SAASD;EACT,OAAOE;EACP,QAAQC;EACR,QAAQC;EACR,aAAaC;EACb,UAAUC;CACZ;AACF,CAAC;;;;;AAMD,SAAgB,iBAAiB,MAAoC;CACnE,MAAM,CAAC,MAAM,QAAQ;CACrB,IAAI,SAAS,YAAY,CAAC,MAAM,WAAW,GAAG,KAAK,SAAS,YAAY,SAAS,MAAM,OAAO;CAE9F,OAAO;EAAC;EAAU;EAAW,GAAG,KAAK,MAAM,CAAC;CAAC;AAC/C"}
|
|
1
|
+
{"version":3,"file":"studio-D9WQb5vH.js","names":["command","command","connectCommand","command","command","command","command","connectCommand","command","connectCommand","startCommand","loginCommand","logoutCommand","statusCommand","permissionsCommand","snapshotCommand"],"sources":["../src/commands/studio/studioCommand.ts","../src/commands/studio/connect.ts","../src/commands/studio/login.ts","../src/commands/studio/logout.ts","../src/commands/studio/permissions.ts","../src/commands/studio/snapshot.ts","../src/commands/studio/background.ts","../src/commands/studio/status.ts","../src/commands/studio/index.ts"],"sourcesContent":["import { type Args, define } from 'gunshi'\nimport type { StudioOptions, StudioValues } from '../../runners/studio/run.ts'\n\n/**\n * Defines a `kubb studio` subcommand. The runner, and with it `@kubb/studio`, loads only when the\n * command runs, so `kubb --help` never does.\n */\nexport function studioCommand({\n action,\n block,\n ...definition\n}: {\n name: string\n description: string\n examples?: string\n args?: Args\n /** Opens a block a later `logOutro` closes, for a command that keeps running. */\n block?: boolean\n /** The command body, given the options built from its flags. */\n action: (options: StudioOptions) => Promise<unknown>\n}) {\n return define({\n ...definition,\n toKebab: true,\n async run({ values }) {\n const { runStudio } = await import('../../runners/studio/run.ts')\n await runStudio(values as StudioValues, action, { block })\n },\n })\n}\n","import { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'connect',\n description: 'Connect this project to Kubb Studio and generate from the browser.',\n examples: [\n 'kubb studio connect',\n 'kubb studio connect --allow-read',\n 'kubb studio connect --allow-write --allow-exec',\n 'kubb studio connect --url http://localhost:3000',\n ].join('\\n'),\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n open: {\n type: 'boolean',\n description: 'Open the approval page in a browser while pairing',\n default: true,\n negatable: true,\n },\n ...logLevelArg,\n },\n block: true,\n async action(options) {\n const { connect } = await import('../../runners/studio/run.ts')\n await connect(options)\n },\n})\n","import { command as connectCommand } from './connect.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'login',\n description: 'Pair this machine with Kubb Studio without connecting.',\n examples: ['kubb studio login', 'kubb studio login --url http://localhost:3000'].join('\\n'),\n args: connectCommand.args,\n async action(options) {\n const { login } = await import('../../runners/studio/run.ts')\n await login(options)\n },\n})\n","import { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'logout',\n description: 'Forget the stored Kubb Studio token.',\n examples: 'kubb studio logout',\n args: {},\n async action() {\n const { stopWorker } = await import('../../runners/studio/background.ts')\n const { clearCredentials } = await import('../../runners/studio/credentials.ts')\n await stopWorker()\n await clearCredentials()\n console.log('Signed out of Kubb Studio.')\n },\n})\n","import path from 'node:path'\nimport process from 'node:process'\nimport { findConfigFile } from '@internals/shared'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'permissions',\n description: 'Change what Kubb Studio may do in this project.',\n examples: 'kubb studio permissions',\n args: {},\n async action(options) {\n const { readCredentials } = await import('../../runners/studio/credentials.ts')\n const { resolvePermissions } = await import('../../runners/studio/run.ts')\n const { canUseTTY } = await import('../../utils/env.ts')\n\n const credentials = await readCredentials()\n if (!credentials) throw new Error('This project is not paired with Kubb Studio. Run `kubb studio` first.')\n if (!canUseTTY()) throw new Error('Changing permissions needs an interactive terminal.')\n\n const configFile = findConfigFile()\n await resolvePermissions(options, credentials, configFile && path.relative(process.cwd(), configFile), { edit: true })\n console.log(\n 'Permissions saved. A running connection keeps the old ones until you restart it: press Ctrl+C and run `kubb studio` again, or run `kubb studio stop`, then `kubb studio start`. Keep `--url` and `--config`, and leave out the `--allow-*` flag of any permission you turned off, since a flag grants it anyway.',\n )\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'snapshot',\n description: 'Generate and publish a Kubb Studio snapshot from CI.',\n examples: ['kubb studio snapshot', 'kubb studio snapshot --json'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n id: {\n type: 'string',\n description: 'Stable identity for the CI agent, such as a pull request. Auto-detected on GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI',\n },\n baseId: {\n type: 'string',\n description:\n \"Identity of another CI agent, such as the base branch's, to also compare this snapshot with. Auto-detected on GitHub pull requests and GitLab merge requests\",\n toKebab: true,\n },\n name: {\n type: 'string',\n description: 'Package name for the generated tarball. Defaults to the name in package.json',\n },\n packageVersion: {\n type: 'string',\n description: 'Package version for the generated tarball. Defaults to the version in package.json',\n toKebab: true,\n },\n json: {\n type: 'boolean',\n description: 'Print the result as one JSON object instead of a summary',\n default: false,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { runner } = await import('../../runners/studio/snapshot.ts')\n await runner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'start',\n description: 'Keep this project connected to Kubb Studio in the background.',\n args: connectCommand.args,\n async action(options) {\n const { startWorker } = await import('../../runners/studio/background.ts')\n await startWorker(options)\n },\n})\n\nexport const stopCommand = define({\n name: 'stop',\n description: \"Stop this project's background connection and keep its pairing.\",\n async run() {\n const { stopWorker } = await import('../../runners/studio/background.ts')\n await stopWorker()\n console.log('Background connection stopped.')\n },\n})\n","import process from 'node:process'\nimport { studioConnectionArgs } from '../shared.ts'\nimport { studioCommand } from './studioCommand.ts'\n\nexport const command = studioCommand({\n name: 'status',\n description: 'Show the project worker, Kubb Studio pairing, and saved permissions.',\n examples: 'kubb studio status',\n args: { url: studioConnectionArgs.url },\n async action(options) {\n const { getWorkerLogPath, getWorkerStatus } = await import('../../runners/studio/background.ts')\n const { readCredentials } = await import('../../runners/studio/credentials.ts')\n const { formatStatus } = await import('../../runners/studio/status.ts')\n\n const [worker, credentials] = await Promise.all([getWorkerStatus(), readCredentials()])\n console.log(\n ['', ...formatStatus({ studioUrl: options.studioUrl, credentials, worker, project: process.cwd(), logPath: getWorkerLogPath() }), ''].join('\\n'),\n )\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { command as loginCommand } from './login.ts'\nimport { command as logoutCommand } from './logout.ts'\nimport { command as permissionsCommand } from './permissions.ts'\nimport { command as snapshotCommand } from './snapshot.ts'\nimport { command as startCommand, stopCommand } from './background.ts'\nimport { command as statusCommand } from './status.ts'\n\nexport const command = define({\n ...connectCommand,\n name: 'studio',\n description: 'Connect this project to Kubb Studio, or manage its pairing and snapshots.',\n examples: [\n 'kubb studio',\n 'kubb studio --allow-read',\n 'kubb studio login',\n 'kubb studio status',\n 'kubb studio permissions',\n 'kubb studio logout',\n 'kubb studio snapshot',\n ].join('\\n'),\n subCommands: {\n start: startCommand,\n stop: stopCommand,\n connect: connectCommand,\n login: loginCommand,\n logout: logoutCommand,\n status: statusCommand,\n permissions: permissionsCommand,\n snapshot: snapshotCommand,\n },\n})\n\n/**\n * Sends `kubb studio --flag value` to `kubb studio connect`, the same runner. gunshi picks a\n * subcommand from the first token that is not a flag, so `--url http://…` would read the URL as one.\n */\nexport function routeStudioFlags(args: Array<string>): Array<string> {\n const [name, next] = args\n if (name !== 'studio' || !next?.startsWith('-') || next === '--help' || next === '-h') return args\n\n return ['studio', 'connect', ...args.slice(1)]\n}\n"],"mappings":";;;;;;;;;;;AAOA,SAAgB,cAAc,EAC5B,QACA,OACA,GAAG,cAUF;CACD,OAAO,OAAO;EACZ,GAAG;EACH,SAAS;EACT,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,cAAc,MAAM,OAAO;GACnC,MAAM,UAAU,QAAwB,QAAQ,EAAE,MAAM,CAAC;EAC3D;CACF,CAAC;AACH;;AC1BA,MAAaA,YAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,UAAU;EACR;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,MAAM;EACJ,GAAG;EACH,GAAG;EACH,GAAG;EACH,MAAM;GACJ,MAAM;GACN,aAAa;GACb,SAAS;GACT,WAAW;EACb;EACA,GAAG;CACL;CACA,OAAO;CACP,MAAM,OAAO,SAAS;EACpB,MAAM,EAAE,YAAY,MAAM,OAAO;EACjC,MAAM,QAAQ,OAAO;CACvB;AACF,CAAC;;AC1BD,MAAaC,YAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,UAAU,CAAC,qBAAqB,+CAA+C,CAAC,CAAC,KAAK,IAAI;CAC1F,MAAMC,UAAe;CACrB,MAAM,OAAO,SAAS;EACpB,MAAM,EAAE,UAAU,MAAM,OAAO;EAC/B,MAAM,MAAM,OAAO;CACrB;AACF,CAAC;;ACVD,MAAaC,YAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,UAAU;CACV,MAAM,CAAC;CACP,MAAM,SAAS;EACb,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,MAAM,EAAE,qBAAqB,MAAM,OAAO;EAC1C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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
-
import { t as connect } from "./run-
|
|
3
|
-
import { r as serveWorker, t as getWorkerLogPath } from "./background-
|
|
2
|
+
import { t as connect } from "./run-DiCSiwh8.js";
|
|
3
|
+
import { r as serveWorker, t as getWorkerLogPath } from "./background-BeEZZNGc.js";
|
|
4
4
|
import { format } from "node:util";
|
|
5
5
|
import { appendFileSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
// src/runners/studio/worker.ts
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
require("./rolldown-runtime-C3-Zg-KD.cjs");
|
|
2
2
|
const require_time = require("./time-3BKoci3G.cjs");
|
|
3
|
-
const require_intro = require("./intro-
|
|
3
|
+
const require_intro = require("./intro-DuyzJ3Rb.cjs");
|
|
4
4
|
let node_util = require("node:util");
|
|
5
5
|
// src/ui/summary.ts
|
|
6
|
+
function createSummary(hrStart) {
|
|
7
|
+
return (title, status, lines) => logCommandSummary({
|
|
8
|
+
title,
|
|
9
|
+
status,
|
|
10
|
+
hrStart,
|
|
11
|
+
block: true,
|
|
12
|
+
lines
|
|
13
|
+
});
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Finishes a command with its outcome and duration before the labeled details.
|
|
8
17
|
* A command with prompts closes its existing block; validation writes a standalone summary.
|
|
@@ -35,6 +44,12 @@ function logCommandSummary({ title, status, hrStart, lines, block = false }) {
|
|
|
35
44
|
}
|
|
36
45
|
console.log(summary);
|
|
37
46
|
}
|
|
47
|
+
Object.defineProperty(exports, "createSummary", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function() {
|
|
50
|
+
return createSummary;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
38
53
|
Object.defineProperty(exports, "logCommandSummary", {
|
|
39
54
|
enumerable: true,
|
|
40
55
|
get: function() {
|
|
@@ -42,4 +57,4 @@ Object.defineProperty(exports, "logCommandSummary", {
|
|
|
42
57
|
}
|
|
43
58
|
});
|
|
44
59
|
|
|
45
|
-
//# sourceMappingURL=summary-
|
|
60
|
+
//# sourceMappingURL=summary-B2Apv5KO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-B2Apv5KO.cjs","names":["styleText","formatMs","getElapsedMs"],"sources":["../src/ui/summary.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { logOutro } from './intro.ts'\n\ntype SummaryStatus = 'success' | 'failed' | 'warning' | 'planned' | 'canceled'\n\nexport function createSummary(hrStart: [number, number]): (title: string, status: SummaryStatus, lines: ReadonlyArray<string>) => void {\n return (title, status, lines) => logCommandSummary({ title, status, hrStart, block: true, lines })\n}\n\n/**\n * Finishes a command with its outcome and duration before the labeled details.\n * A command with prompts closes its existing block; validation writes a standalone summary.\n */\nexport function logCommandSummary({\n title,\n status,\n hrStart,\n lines,\n block = false,\n}: {\n title: string\n status: SummaryStatus\n hrStart: [number, number]\n lines: ReadonlyArray<string>\n block?: boolean\n}): void {\n const colors = { success: 'green', failed: 'red', warning: 'yellow', planned: 'cyan', canceled: 'dim' } as const\n const symbols = { success: '✓', failed: '✗', warning: '!', planned: '◇', canceled: '○' } as const\n const summary = [`${styleText(colors[status], `${symbols[status]} ${title}`)} ${styleText('dim', formatMs(getElapsedMs(hrStart)))}`, '', ...lines].join('\\n')\n if (block) {\n logOutro(summary)\n return\n }\n if (status === 'failed') {\n console.error(summary)\n return\n }\n console.log(summary)\n}\n"],"mappings":";;;;;AAMA,SAAgB,cAAc,SAAyG;CACrI,QAAQ,OAAO,QAAQ,UAAU,kBAAkB;EAAE;EAAO;EAAQ;EAAS,OAAO;EAAM;CAAM,CAAC;AACnG;;;;;AAMA,SAAgB,kBAAkB,EAChC,OACA,QACA,SACA,OACA,QAAQ,SAOD;CAGP,MAAM,UAAU;EAAC,IAAA,GAAGA,UAAAA,UAAAA,CAAU;GAFb,SAAS;GAAS,QAAQ;GAAO,SAAS;GAAU,SAAS;GAAQ,UAAU;EAE7D,EAAE,SAAS,GAAG;GAD/B,SAAS;GAAK,QAAQ;GAAK,SAAS;GAAK,SAAS;GAAK,UAAU;EAC5B,EAAE,QAAQ,GAAG,OAAO,EAAE,KAAA,GAAIA,UAAAA,UAAAA,CAAU,OAAOC,aAAAA,SAASC,aAAAA,aAAa,OAAO,CAAC,CAAC;EAAK;EAAI,GAAG;CAAK,CAAC,CAAC,KAAK,IAAI;CAC7J,IAAI,OAAO;EACT,cAAA,SAAS,OAAO;EAChB;CACF;CACA,IAAI,WAAW,UAAU;EACvB,QAAQ,MAAM,OAAO;EACrB;CACF;CACA,QAAQ,IAAI,OAAO;AACrB"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
2
|
import { n as getElapsedMs, t as formatMs } from "./time-C-wU7VhC.js";
|
|
3
|
-
import { r as logOutro } from "./intro-
|
|
3
|
+
import { r as logOutro } from "./intro-DRl-pwVs.js";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
// src/ui/summary.ts
|
|
6
|
+
function createSummary(hrStart) {
|
|
7
|
+
return (title, status, lines) => logCommandSummary({
|
|
8
|
+
title,
|
|
9
|
+
status,
|
|
10
|
+
hrStart,
|
|
11
|
+
block: true,
|
|
12
|
+
lines
|
|
13
|
+
});
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Finishes a command with its outcome and duration before the labeled details.
|
|
8
17
|
* A command with prompts closes its existing block; validation writes a standalone summary.
|
|
@@ -35,6 +44,6 @@ function logCommandSummary({ title, status, hrStart, lines, block = false }) {
|
|
|
35
44
|
}
|
|
36
45
|
console.log(summary);
|
|
37
46
|
}
|
|
38
|
-
export { logCommandSummary as t };
|
|
47
|
+
export { logCommandSummary as n, createSummary as t };
|
|
39
48
|
|
|
40
|
-
//# sourceMappingURL=summary-
|
|
49
|
+
//# sourceMappingURL=summary-BQWHL_Ca.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-BQWHL_Ca.js","names":[],"sources":["../src/ui/summary.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { logOutro } from './intro.ts'\n\ntype SummaryStatus = 'success' | 'failed' | 'warning' | 'planned' | 'canceled'\n\nexport function createSummary(hrStart: [number, number]): (title: string, status: SummaryStatus, lines: ReadonlyArray<string>) => void {\n return (title, status, lines) => logCommandSummary({ title, status, hrStart, block: true, lines })\n}\n\n/**\n * Finishes a command with its outcome and duration before the labeled details.\n * A command with prompts closes its existing block; validation writes a standalone summary.\n */\nexport function logCommandSummary({\n title,\n status,\n hrStart,\n lines,\n block = false,\n}: {\n title: string\n status: SummaryStatus\n hrStart: [number, number]\n lines: ReadonlyArray<string>\n block?: boolean\n}): void {\n const colors = { success: 'green', failed: 'red', warning: 'yellow', planned: 'cyan', canceled: 'dim' } as const\n const symbols = { success: '✓', failed: '✗', warning: '!', planned: '◇', canceled: '○' } as const\n const summary = [`${styleText(colors[status], `${symbols[status]} ${title}`)} ${styleText('dim', formatMs(getElapsedMs(hrStart)))}`, '', ...lines].join('\\n')\n if (block) {\n logOutro(summary)\n return\n }\n if (status === 'failed') {\n console.error(summary)\n return\n }\n console.log(summary)\n}\n"],"mappings":";;;;;AAMA,SAAgB,cAAc,SAAyG;CACrI,QAAQ,OAAO,QAAQ,UAAU,kBAAkB;EAAE;EAAO;EAAQ;EAAS,OAAO;EAAM;CAAM,CAAC;AACnG;;;;;AAMA,SAAgB,kBAAkB,EAChC,OACA,QACA,SACA,OACA,QAAQ,SAOD;CAGP,MAAM,UAAU;EAAC,GAAG,UAAU;GAFb,SAAS;GAAS,QAAQ;GAAO,SAAS;GAAU,SAAS;GAAQ,UAAU;EAE7D,EAAE,SAAS,GAAG;GAD/B,SAAS;GAAK,QAAQ;GAAK,SAAS;GAAK,SAAS;GAAK,UAAU;EAC5B,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,UAAU,OAAO,SAAS,aAAa,OAAO,CAAC,CAAC;EAAK;EAAI,GAAG;CAAK,CAAC,CAAC,KAAK,IAAI;CAC7J,IAAI,OAAO;EACT,SAAS,OAAO;EAChB;CACF;CACA,IAAI,WAAW,UAAU;EACvB,QAAQ,MAAM,OAAO;EACrB;CACF;CACA,QAAQ,IAAI,OAAO;AACrB"}
|
|
@@ -8,6 +8,15 @@ function pluralize(count, noun) {
|
|
|
8
8
|
function toPermissionFlag(key) {
|
|
9
9
|
return `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`;
|
|
10
10
|
}
|
|
11
|
+
function isHttpUrl(value) {
|
|
12
|
+
return /^https?:\/\//.test(value);
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(exports, "isHttpUrl", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return isHttpUrl;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
11
20
|
Object.defineProperty(exports, "pluralize", {
|
|
12
21
|
enumerable: true,
|
|
13
22
|
get: function() {
|
|
@@ -21,4 +30,4 @@ Object.defineProperty(exports, "toPermissionFlag", {
|
|
|
21
30
|
}
|
|
22
31
|
});
|
|
23
32
|
|
|
24
|
-
//# sourceMappingURL=text-
|
|
33
|
+
//# sourceMappingURL=text-DMiX2dcG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-DMiX2dcG.cjs","names":[],"sources":["../src/ui/text.ts"],"sourcesContent":["/** Counts a noun, so a message never reads `1 files`. */\nexport function pluralize(count: number, noun: string): string {\n return `${count} ${count === 1 ? noun : `${noun}s`}`\n}\n\n/** The flag that grants a permission, such as `--allow-read-ast`. */\nexport function toPermissionFlag(key: string): string {\n return `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`\n}\n\nexport function isHttpUrl(value: string): boolean {\n return /^https?:\\/\\//.test(value)\n}\n"],"mappings":";;;AACA,SAAgB,UAAU,OAAe,MAAsB;CAC7D,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,OAAO,GAAG,KAAK;AAClD;;AAGA,SAAgB,iBAAiB,KAAqB;CACpD,OAAO,KAAK,IAAI,QAAQ,WAAW,SAAS,IAAI,KAAK,YAAY,GAAG;AACtE;AAEA,SAAgB,UAAU,OAAwB;CAChD,OAAO,eAAe,KAAK,KAAK;AAClC"}
|
|
@@ -8,6 +8,9 @@ function pluralize(count, noun) {
|
|
|
8
8
|
function toPermissionFlag(key) {
|
|
9
9
|
return `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
function isHttpUrl(value) {
|
|
12
|
+
return /^https?:\/\//.test(value);
|
|
13
|
+
}
|
|
14
|
+
export { pluralize as n, toPermissionFlag as r, isHttpUrl as t };
|
|
12
15
|
|
|
13
|
-
//# sourceMappingURL=text-
|
|
16
|
+
//# sourceMappingURL=text-EoYn04SX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-EoYn04SX.js","names":[],"sources":["../src/ui/text.ts"],"sourcesContent":["/** Counts a noun, so a message never reads `1 files`. */\nexport function pluralize(count: number, noun: string): string {\n return `${count} ${count === 1 ? noun : `${noun}s`}`\n}\n\n/** The flag that grants a permission, such as `--allow-read-ast`. */\nexport function toPermissionFlag(key: string): string {\n return `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`\n}\n\nexport function isHttpUrl(value: string): boolean {\n return /^https?:\\/\\//.test(value)\n}\n"],"mappings":";;;AACA,SAAgB,UAAU,OAAe,MAAsB;CAC7D,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,OAAO,GAAG,KAAK;AAClD;;AAGA,SAAgB,iBAAiB,KAAqB;CACpD,OAAO,KAAK,IAAI,QAAQ,WAAW,SAAS,IAAI,KAAK,YAAY,GAAG;AACtE;AAEA,SAAgB,UAAU,OAAwB;CAChD,OAAO,eAAe,KAAK,KAAK;AAClC"}
|
|
@@ -1,64 +1,90 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as toPosixPath, i as read, o as write } from "./fs-Cf1FSRh9.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { x } from "tinyexec";
|
|
5
|
+
import { glob } from "node:fs/promises";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import fs from "node:fs";
|
|
7
8
|
import { Diagnostics } from "@kubb/core";
|
|
9
|
+
import { detect, resolveCommand } from "package-manager-detector";
|
|
10
|
+
// ../../internals/utils/src/casing.ts
|
|
11
|
+
/**
|
|
12
|
+
* Shared implementation for camelCase and PascalCase conversion.
|
|
13
|
+
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
14
|
+
* and capitalizes each word according to `pascal`.
|
|
15
|
+
*
|
|
16
|
+
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
17
|
+
*/
|
|
18
|
+
function convert(text, pascal) {
|
|
19
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
20
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
21
|
+
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
22
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
23
|
+
}
|
|
24
|
+
const cache = /* @__PURE__ */ new Map();
|
|
25
|
+
const cacheLimit = 1e5;
|
|
26
|
+
function toCamelOrPascal(text, pascal) {
|
|
27
|
+
const key = `${pascal ? "P" : "c"}${text}`;
|
|
28
|
+
const cached = cache.get(key);
|
|
29
|
+
if (cached !== void 0) return cached;
|
|
30
|
+
const result = convert(text, pascal);
|
|
31
|
+
if (cache.size >= cacheLimit) cache.clear();
|
|
32
|
+
cache.set(key, result);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts `text` to camelCase.
|
|
37
|
+
*
|
|
38
|
+
* @example Word boundaries
|
|
39
|
+
* `camelCase('hello-world') // 'helloWorld'`
|
|
40
|
+
*
|
|
41
|
+
* @example With a prefix
|
|
42
|
+
* `camelCase('tag', { prefix: 'create' }) // 'createTag'`
|
|
43
|
+
*/
|
|
44
|
+
function camelCase(text, { prefix = "", suffix = "" } = {}) {
|
|
45
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Converts `text` to PascalCase.
|
|
49
|
+
*
|
|
50
|
+
* @example Word boundaries
|
|
51
|
+
* `pascalCase('hello-world') // 'HelloWorld'`
|
|
52
|
+
*
|
|
53
|
+
* @example With a suffix
|
|
54
|
+
* `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`
|
|
55
|
+
*/
|
|
56
|
+
function pascalCase(text, { prefix = "", suffix = "" } = {}) {
|
|
57
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
|
|
58
|
+
}
|
|
8
59
|
// src/runners/init/utils.ts
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
runCommand: []
|
|
18
|
-
},
|
|
19
|
-
yarn: {
|
|
20
|
-
name: "yarn",
|
|
21
|
-
lockFiles: ["yarn.lock"],
|
|
22
|
-
initCommand: ["init", "-y"],
|
|
23
|
-
installCommand: ["add", "-D"],
|
|
24
|
-
removeCommand: ["remove"],
|
|
25
|
-
runCommand: []
|
|
26
|
-
},
|
|
27
|
-
bun: {
|
|
28
|
-
name: "bun",
|
|
29
|
-
lockFiles: ["bun.lock", "bun.lockb"],
|
|
30
|
-
initCommand: ["init", "-y"],
|
|
31
|
-
installCommand: ["add", "-d"],
|
|
32
|
-
removeCommand: ["remove"],
|
|
33
|
-
runCommand: ["run"]
|
|
34
|
-
},
|
|
35
|
-
npm: {
|
|
36
|
-
name: "npm",
|
|
37
|
-
lockFiles: ["package-lock.json"],
|
|
38
|
-
initCommand: ["init", "-y"],
|
|
39
|
-
installCommand: ["install", "--save-dev"],
|
|
40
|
-
removeCommand: ["uninstall"],
|
|
41
|
-
runCommand: ["run"]
|
|
42
|
-
}
|
|
60
|
+
/**
|
|
61
|
+
* Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.
|
|
62
|
+
*/
|
|
63
|
+
const initCommands = {
|
|
64
|
+
npm: ["init", "-y"],
|
|
65
|
+
pnpm: ["init"],
|
|
66
|
+
yarn: ["init", "-y"],
|
|
67
|
+
bun: ["init", "-y"]
|
|
43
68
|
};
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.
|
|
71
|
+
*/
|
|
72
|
+
async function detectPackageManager(cwd = process.cwd()) {
|
|
73
|
+
const found = await detect({
|
|
74
|
+
cwd,
|
|
75
|
+
stopDir: cwd,
|
|
76
|
+
strategies: ["packageManager-field", "lockfile"]
|
|
77
|
+
});
|
|
78
|
+
return found && found.name in initCommands ? found : {
|
|
79
|
+
name: "npm",
|
|
80
|
+
agent: "npm"
|
|
81
|
+
};
|
|
56
82
|
}
|
|
57
83
|
/**
|
|
58
84
|
* Initializes a new `package.json` at `cwd` using the detected package manager.
|
|
59
85
|
*/
|
|
60
86
|
async function initPackageJson(cwd, packageManager) {
|
|
61
|
-
await x(packageManager.name, [...packageManager.
|
|
87
|
+
await x(packageManager.name, [...initCommands[packageManager.name]], {
|
|
62
88
|
nodeOptions: {
|
|
63
89
|
cwd,
|
|
64
90
|
stdio: "inherit"
|
|
@@ -72,9 +98,9 @@ const INSTALL_TIMEOUT_MS = 3e5;
|
|
|
72
98
|
* to `onLine`, so the caller can show it while the install runs; a failed install also keeps the
|
|
73
99
|
* end of the output in the error.
|
|
74
100
|
*/
|
|
75
|
-
async function installPackages(packages, packageManager, cwd = process.cwd(), onLine, command =
|
|
76
|
-
const args =
|
|
77
|
-
const result = x(
|
|
101
|
+
async function installPackages(packages, packageManager, cwd = process.cwd(), onLine, command = "add") {
|
|
102
|
+
const { command: bin, args } = resolveCommand(packageManager.agent, command, command === "add" ? ["-D", ...packages] : packages);
|
|
103
|
+
const result = x(bin, args, {
|
|
78
104
|
nodeOptions: {
|
|
79
105
|
cwd,
|
|
80
106
|
stdio: [
|
|
@@ -92,15 +118,15 @@ async function installPackages(packages, packageManager, cwd = process.cwd(), on
|
|
|
92
118
|
onLine?.(line);
|
|
93
119
|
}
|
|
94
120
|
if (result.exitCode === 0) return;
|
|
95
|
-
if (result.exitCode === void 0) throw new Error(`\`${
|
|
121
|
+
if (result.exitCode === void 0) throw new Error(`\`${bin} ${args.join(" ")}\` timed out after ${INSTALL_TIMEOUT_MS / 6e4} minutes`);
|
|
96
122
|
const output = lines.slice(-20).join("\n");
|
|
97
|
-
throw new Error(`\`${
|
|
123
|
+
throw new Error(`\`${bin} ${args.join(" ")}\` failed with exit code ${result.exitCode}${output ? `:\n${output}` : ""}`);
|
|
98
124
|
}
|
|
99
125
|
/**
|
|
100
126
|
* Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.
|
|
101
127
|
*/
|
|
102
128
|
function uninstallPackages(packages, packageManager, cwd = process.cwd()) {
|
|
103
|
-
return installPackages(packages, packageManager, cwd, void 0,
|
|
129
|
+
return installPackages(packages, packageManager, cwd, void 0, "uninstall");
|
|
104
130
|
}
|
|
105
131
|
/**
|
|
106
132
|
* What the selected plugins' `manifests` say is missing from the selection: a `dependencies`
|
|
@@ -128,23 +154,17 @@ const SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
|
128
154
|
]);
|
|
129
155
|
/**
|
|
130
156
|
* Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative
|
|
131
|
-
* paths.
|
|
157
|
+
* paths. Skips hidden and build folders without walking them and returns at most `limit` files.
|
|
132
158
|
*/
|
|
133
159
|
async function findSpecFiles(cwd, { depth = 3, limit = 20 } = {}) {
|
|
134
160
|
const found = [];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
for (const { dir, entries } of listings) for (const entry of entries.toSorted((a, b) => a.name.localeCompare(b.name))) {
|
|
143
|
-
if (entry.isFile() && SPEC_FILE.test(entry.name)) found.push(`./${path.posix.join(dir, entry.name)}`);
|
|
144
|
-
if (entry.isDirectory() && !entry.name.startsWith(".") && !SKIPPED_DIRS.has(entry.name)) level.push(path.posix.join(dir, entry.name));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return found.slice(0, limit);
|
|
161
|
+
const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => "*/".repeat(level)).join(",")}}*`;
|
|
162
|
+
const files = glob(pattern, {
|
|
163
|
+
cwd,
|
|
164
|
+
exclude: (file) => file.split(path.sep).some((segment) => SKIPPED_DIRS.has(segment))
|
|
165
|
+
});
|
|
166
|
+
for await (const file of files) if (SPEC_FILE.test(path.basename(file))) found.push(toPosixPath(file));
|
|
167
|
+
return found.toSorted((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b)).slice(0, limit).map((file) => `./${file}`);
|
|
148
168
|
}
|
|
149
169
|
const SPEC_HEAD_BYTES = 262144;
|
|
150
170
|
const METHOD = "(?:get|put|post|delete|options|head|patch|trace)";
|
|
@@ -217,6 +237,6 @@ async function addGenerateScript(cwd) {
|
|
|
217
237
|
async function generateScript(cwd) {
|
|
218
238
|
return (await readPackageJson(cwd)).scripts?.generate;
|
|
219
239
|
}
|
|
220
|
-
export { generateScript as a, missingPluginDependencies as c, uninstallPackages as d, findSpecFiles as i, parsePluginsFlag as l, detectPackageManager as n, initPackageJson as o, findPlugin as r, installPackages as s, addGenerateScript as t, readSpecInfo as u };
|
|
240
|
+
export { generateScript as a, missingPluginDependencies as c, uninstallPackages as d, camelCase as f, findSpecFiles as i, parsePluginsFlag as l, detectPackageManager as n, initPackageJson as o, pascalCase as p, findPlugin as r, installPackages as s, addGenerateScript as t, readSpecInfo as u };
|
|
221
241
|
|
|
222
|
-
//# sourceMappingURL=utils-
|
|
242
|
+
//# sourceMappingURL=utils-CeMUE4P0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-CeMUE4P0.js","names":[],"sources":["../../../internals/utils/src/casing.ts","../src/runners/init/utils.ts"],"sourcesContent":["type Options = {\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction convert(text: string, pascal: boolean): string {\n return text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n .split(/[\\s\\-_./\\\\:]+/)\n .filter(Boolean)\n .map((word, i) => {\n if (word.length > 1 && word === word.toUpperCase()) return word\n const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n return head + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n// Plugins case the same names on every visit. Clearing at the limit bounds a long-running host.\nconst cache = new Map<string, string>()\nconst cacheLimit = 100_000\n\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const key = `${pascal ? 'P' : 'c'}${text}`\n const cached = cache.get(key)\n if (cached !== undefined) return cached\n\n const result = convert(text, pascal)\n if (cache.size >= cacheLimit) cache.clear()\n cache.set(key, result)\n return result\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n","import fs from 'node:fs'\nimport { glob } from 'node:fs/promises'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { read, toPosixPath, write } from '@internals/utils'\nimport { Diagnostics, type ExtensionManifest, type RegistryEntry } from '@kubb/core'\nimport { type Agent, type AgentName, detect, resolveCommand } from 'package-manager-detector'\nimport { x } from 'tinyexec'\n\nexport type PackageManagerName = Extract<AgentName, 'npm' | 'pnpm' | 'yarn' | 'bun'>\n\n/**\n * A project's package manager: `name` for messages, `agent` for `resolveCommand`.\n */\nexport type PackageManagerInfo = { name: PackageManagerName; agent: Agent }\n\n/**\n * Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.\n */\nconst initCommands: Record<PackageManagerName, ReadonlyArray<string>> = { npm: ['init', '-y'], pnpm: ['init'], yarn: ['init', '-y'], bun: ['init', '-y'] }\n\n/** Minimal shape of `package.json` fields read during detection. */\ntype PackageJson = {\n /** The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`). */\n packageManager?: string\n scripts?: Record<string, string>\n}\n\n/**\n * Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.\n */\nexport async function detectPackageManager(cwd: string = process.cwd()): Promise<PackageManagerInfo> {\n const found = await detect({ cwd, stopDir: cwd, strategies: ['packageManager-field', 'lockfile'] })\n return found && found.name in initCommands ? (found as PackageManagerInfo) : { name: 'npm', agent: 'npm' }\n}\n\n/**\n * Initializes a new `package.json` at `cwd` using the detected package manager.\n */\nexport async function initPackageJson(cwd: string, packageManager: PackageManagerInfo): Promise<void> {\n await x(packageManager.name, [...initCommands[packageManager.name]], {\n nodeOptions: { cwd, stdio: 'inherit' },\n throwOnError: true,\n })\n}\n\n/** How many trailing lines of a failed install's output the error keeps. */\nconst INSTALL_OUTPUT_LINES = 20\nconst INSTALL_TIMEOUT_MS = 5 * 60_000\n\n/**\n * Installs the given packages at `cwd` using the detected package manager. Each output line goes\n * to `onLine`, so the caller can show it while the install runs; a failed install also keeps the\n * end of the output in the error.\n */\nexport async function installPackages(\n packages: Array<string>,\n packageManager: PackageManagerInfo,\n cwd: string = process.cwd(),\n onLine?: (line: string) => void,\n command: 'add' | 'uninstall' = 'add',\n): Promise<void> {\n const { command: bin, args } = resolveCommand(packageManager.agent, command, command === 'add' ? ['-D', ...packages] : packages)!\n // No stdin, so a package manager that wants input fails instead of waiting. The timeout ends a stalled install.\n const result = x(bin, args, {\n nodeOptions: { cwd, stdio: ['ignore', 'pipe', 'pipe'] },\n timeout: INSTALL_TIMEOUT_MS,\n throwOnError: false,\n })\n const lines: Array<string> = []\n for await (const line of result) {\n lines.push(line)\n onLine?.(line)\n }\n if (result.exitCode === 0) return\n if (result.exitCode === undefined) throw new Error(`\\`${bin} ${args.join(' ')}\\` timed out after ${INSTALL_TIMEOUT_MS / 60_000} minutes`)\n\n const output = lines.slice(-INSTALL_OUTPUT_LINES).join('\\n')\n throw new Error(`\\`${bin} ${args.join(' ')}\\` failed with exit code ${result.exitCode}${output ? `:\\n${output}` : ''}`)\n}\n\n/**\n * Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.\n */\nexport function uninstallPackages(packages: Array<string>, packageManager: PackageManagerInfo, cwd: string = process.cwd()): Promise<void> {\n return installPackages(packages, packageManager, cwd, undefined, 'uninstall')\n}\n\n/**\n * What the selected plugins' `manifests` say is missing from the selection: a `dependencies`\n * entry, or a `client` plugin next to a `consumer`. Empty when nothing is missing.\n * `optionalDependencies` are skipped, since `kubb init` writes the default options.\n */\nexport function missingPluginDependencies(manifests: Array<ExtensionManifest>): Array<string> {\n const selected = manifests.map((manifest) => manifest.name)\n const hasClient = manifests.some((manifest) => manifest.role === 'client')\n return manifests.flatMap((manifest) => [\n ...(manifest.dependencies ?? []).filter((name) => !selected.includes(name)).map((name) => `${manifest.name} needs ${name}.`),\n ...(manifest.role === 'consumer' && !hasClient ? [`${manifest.name} needs a client plugin, such as plugin-axios or plugin-fetch.`] : []),\n ])\n}\n\nasync function readPackageJson(cwd: string): Promise<PackageJson> {\n try {\n return JSON.parse(await read(path.join(cwd, 'package.json'))) as PackageJson\n } catch {\n return {}\n }\n}\n\nconst SPEC_FILE = /^(openapi|swagger)[\\w.-]*\\.(ya?ml|json)$/i\nconst SKIPPED_DIRS = new Set(['node_modules', 'dist', 'build', 'coverage'])\n\n/**\n * Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative\n * paths. Skips hidden and build folders without walking them and returns at most `limit` files.\n */\nexport async function findSpecFiles(cwd: string, { depth = 3, limit = 20 }: { depth?: number; limit?: number } = {}): Promise<Array<string>> {\n const found: Array<string> = []\n const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => '*/'.repeat(level)).join(',')}}*`\n // The extension stays out of the pattern so SPEC_FILE matches it case-insensitively. Dot folders are skipped by default.\n const files = glob(pattern, { cwd, exclude: (file) => file.split(path.sep).some((segment) => SKIPPED_DIRS.has(segment)) })\n for await (const file of files) if (SPEC_FILE.test(path.basename(file))) found.push(toPosixPath(file))\n return found\n .toSorted((a, b) => a.split('/').length - b.split('/').length || a.localeCompare(b))\n .slice(0, limit)\n .map((file) => `./${file}`)\n}\n\n/** The spec version and operation count, when the file states them. */\nexport type SpecInfo = { version?: string; operations?: number }\n\nconst SPEC_HEAD_BYTES = 256 * 1024\nconst METHOD = '(?:get|put|post|delete|options|head|patch|trace)'\n\n/**\n * Reads the OpenAPI or Swagger version and counts the operations from the first 256 KB of the\n * file, so a large spec is never parsed. The count is left out when the file is longer.\n */\nexport async function readSpecInfo(file: string): Promise<SpecInfo> {\n const handle = await fs.promises.open(file)\n try {\n const buffer = Buffer.alloc(SPEC_HEAD_BYTES)\n const { bytesRead } = await handle.read(buffer, 0, SPEC_HEAD_BYTES, 0)\n const head = buffer.toString('utf-8', 0, bytesRead)\n const complete = bytesRead < SPEC_HEAD_BYTES\n const version = head.match(/^\\s*[\"']?(?:openapi|swagger)[\"']?\\s*:\\s*[\"']?(\\d[\\d.]*)/m)?.[1]\n // shortcut: counts method keys at any depth, so a schema property named `get` counts too; use the adapter when that matters.\n const methods = new RegExp(`^\\\\s*[\"']?${METHOD}[\"']?\\\\s*:\\\\s*(?:\\\\{|$)`, 'gm')\n return { version, operations: complete ? (head.match(methods)?.length ?? 0) : undefined }\n } finally {\n await handle.close()\n }\n}\n\n/** Finds a plugin by registry id, slug, or short name, so `ts`, `plugin-ts`, and `kubb-labs/plugin-ts` all match. */\nexport function findPlugin({ plugins, id }: { plugins: Array<RegistryEntry>; id: string }): RegistryEntry | undefined {\n const ids = id.includes('/') ? [id] : [`kubb-labs/${id}`, `kubb-labs/plugin-${id}`]\n return plugins.find((entry) => ids.includes(entry.id))\n}\n\n/**\n * Turns the comma-separated `--plugins` value into registry entries.\n *\n * @throws when an id is not in `plugins`.\n */\nexport function parsePluginsFlag({ plugins, value }: { plugins: Array<RegistryEntry>; value: string }): Array<RegistryEntry> {\n const ids = value\n .split(',')\n .map((id) => id.trim())\n .filter(Boolean)\n const unknown = ids.filter((id) => !findPlugin({ plugins, id }))\n if (unknown.length)\n throw new Diagnostics.Error({\n code: Diagnostics.code.pluginNotFound,\n severity: 'error',\n message: `Not in the Kubb registry: ${unknown.join(', ')}. Browse the plugins at https://kubb.dev/extensions.`,\n help: 'Use plugin ids from https://kubb.dev/extensions, such as plugin-ts or ts.',\n })\n return ids.map((id) => findPlugin({ plugins, id })!)\n}\n\n/** Adds `\"generate\": \"kubb generate\"` to the `package.json` scripts at `cwd`. Returns `false`, and changes nothing, when a `generate` script exists. */\nexport async function addGenerateScript(cwd: string): Promise<boolean> {\n const file = path.join(cwd, 'package.json')\n const source = await read(file)\n const packageJson = JSON.parse(source) as PackageJson\n if (packageJson.scripts?.generate !== undefined) return false\n const indent = source.match(/^[ \\t]+/m)?.[0] ?? ' '\n const updated = { ...packageJson, scripts: { ...packageJson.scripts, generate: 'kubb generate' } }\n await write(file, JSON.stringify(updated, null, indent))\n return true\n}\n\n/** Reads the `generate` script from the `package.json` at `cwd`. */\nexport async function generateScript(cwd: string): Promise<string | undefined> {\n return (await readPackageJson(cwd)).scripts?.generate\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAS,QAAQ,MAAc,QAAyB;CACtD,OAAO,KACJ,KAAK,CAAC,CACN,QAAQ,qBAAqB,OAAO,CAAC,CACrC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,gBAAgB,OAAO,CAAC,CAChC,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,MAAM,MAAM;EAChB,IAAI,KAAK,SAAS,KAAK,SAAS,KAAK,YAAY,GAAG,OAAO;EAE3D,QADa,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,KAC9E,KAAK,MAAM,CAAC;CAC5B,CAAC,CAAC,CACD,KAAK,EAAE,CAAC,CACR,QAAQ,iBAAiB,EAAE;AAChC;AAGA,MAAM,w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