@kubb/cli 5.18.6 → 5.18.7
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-DQG_EpcV.js → Telemetry-Bf16psPO.js} +5 -5
- package/dist/{Telemetry-DQG_EpcV.js.map → Telemetry-Bf16psPO.js.map} +1 -1
- package/dist/{Telemetry-CZJ2Noi6.cjs → Telemetry-Cbt_dJE6.cjs} +5 -5
- package/dist/{Telemetry-CZJ2Noi6.cjs.map → Telemetry-Cbt_dJE6.cjs.map} +1 -1
- package/dist/{background-DIVc60mm.cjs → background-3TB5Cgkv.cjs} +4 -4
- package/dist/{background-DIVc60mm.cjs.map → background-3TB5Cgkv.cjs.map} +1 -1
- package/dist/{background-Z23KW1yA.js → background-Cvoxk_DQ.js} +4 -4
- package/dist/{background-Z23KW1yA.js.map → background-Cvoxk_DQ.js.map} +1 -1
- package/dist/{background-Dsy12RvL.js → background-JyYJdws1.js} +1 -1
- package/dist/{banner-BdTTDFkG.js → banner-BMIxunVW.js} +3 -3
- package/dist/{banner-BdTTDFkG.js.map → banner-BMIxunVW.js.map} +1 -1
- package/dist/{banner-wJFk-L-c.cjs → banner-GwQ2NFNI.cjs} +3 -3
- package/dist/{banner-wJFk-L-c.cjs.map → banner-GwQ2NFNI.cjs.map} +1 -1
- package/dist/{config-BWj9jBVj.cjs → config-BIv45u1Z.cjs} +7 -6
- package/dist/config-BIv45u1Z.cjs.map +1 -0
- package/dist/{config-Uk3rbZfb.js → config-BL4UlCHs.js} +7 -6
- package/dist/config-BL4UlCHs.js.map +1 -0
- package/dist/{config-CQTxXvIG.js → config-BqDpLCPu.js} +2 -2
- package/dist/{config-CQTxXvIG.js.map → config-BqDpLCPu.js.map} +1 -1
- package/dist/config-CGpzjjPV.js +1 -0
- package/dist/{config-CRrmj88c.cjs → config-DJtqFNG2.cjs} +2 -2
- package/dist/{config-CRrmj88c.cjs.map → config-DJtqFNG2.cjs.map} +1 -1
- package/dist/{configFile-L5i7gGUc.js → configFile-B2EIouxg.js} +5 -5
- package/dist/{configFile-L5i7gGUc.js.map → configFile-B2EIouxg.js.map} +1 -1
- package/dist/{configFile-BPHxtrEM.cjs → configFile-C_7uzuGV.cjs} +5 -5
- package/dist/{configFile-BPHxtrEM.cjs.map → configFile-C_7uzuGV.cjs.map} +1 -1
- package/dist/{credentials-DEsGwcGD.cjs → credentials-Cl3eOa8G.cjs} +3 -7
- package/dist/{credentials-DEsGwcGD.cjs.map → credentials-Cl3eOa8G.cjs.map} +1 -1
- package/dist/{credentials-B77iJx9H.js → credentials-DznluKkp.js} +1 -1
- package/dist/{credentials-osgjujE_.js → credentials-LPHovWZe.js} +2 -2
- package/dist/{credentials-osgjujE_.js.map → credentials-LPHovWZe.js.map} +1 -1
- package/dist/{env-rv-VgSGN.js → env-BYZIPHqz.js} +3 -3
- package/dist/{env-rv-VgSGN.js.map → env-BYZIPHqz.js.map} +1 -1
- package/dist/env-BgVegN_u.js +1 -0
- package/dist/{env-eu3XyKqJ.cjs → env-Bi4GXVdd.cjs} +4 -7
- package/dist/{env-eu3XyKqJ.cjs.map → env-Bi4GXVdd.cjs.map} +1 -1
- package/dist/{errors-BponpdjN.cjs → errors-Bewwe8mY.cjs} +2 -2
- package/dist/{errors-BponpdjN.cjs.map → errors-Bewwe8mY.cjs.map} +1 -1
- package/dist/{errors-wzqmMpMo.js → errors-CEzFbRvL.js} +2 -2
- package/dist/{errors-wzqmMpMo.js.map → errors-CEzFbRvL.js.map} +1 -1
- package/dist/{fs-Cf1FSRh9.js → fs-j84Tqpbx.js} +3 -3
- package/dist/{fs-Cf1FSRh9.js.map → fs-j84Tqpbx.js.map} +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +15 -15
- package/dist/{installWithSpinner-CNDzLZw-.js → installWithSpinner-C4gKZ7r5.js} +6 -6
- package/dist/{installWithSpinner-CNDzLZw-.js.map → installWithSpinner-C4gKZ7r5.js.map} +1 -1
- package/dist/{installWithSpinner-CnE4dIza.cjs → installWithSpinner-YEtb8cNf.cjs} +6 -6
- package/dist/{installWithSpinner-CnE4dIza.cjs.map → installWithSpinner-YEtb8cNf.cjs.map} +1 -1
- package/dist/{intro-DRl-pwVs.js → intro-Dun8Eqod.js} +4 -4
- package/dist/{intro-DRl-pwVs.js.map → intro-Dun8Eqod.js.map} +1 -1
- package/dist/{intro-DuyzJ3Rb.cjs → intro-PFXmY9bD.cjs} +4 -4
- package/dist/{intro-DuyzJ3Rb.cjs.map → intro-PFXmY9bD.cjs.map} +1 -1
- package/dist/{isCIEnvironment-D6xtAAZ2.js → isCIEnvironment-DAMZSlP2.js} +2 -2
- package/dist/{isCIEnvironment-D6xtAAZ2.js.map → isCIEnvironment-DAMZSlP2.js.map} +1 -1
- package/dist/{isCIEnvironment-DiVOMI5Q.cjs → isCIEnvironment-jzKqdVwJ.cjs} +2 -2
- package/dist/{isCIEnvironment-DiVOMI5Q.cjs.map → isCIEnvironment-jzKqdVwJ.cjs.map} +1 -1
- package/dist/{log-B-1vLxF1.js → log-B_uVM704.js} +3 -3
- package/dist/{log-B-1vLxF1.js.map → log-B_uVM704.js.map} +1 -1
- package/dist/{log-wv1OxLiq.cjs → log-BzmBldY6.cjs} +3 -3
- package/dist/{log-wv1OxLiq.cjs.map → log-BzmBldY6.cjs.map} +1 -1
- package/dist/{mascot-CC-D4ON2.cjs → mascot-ZEiXQ_LT.cjs} +5 -5
- package/dist/{mascot-CC-D4ON2.cjs.map → mascot-ZEiXQ_LT.cjs.map} +1 -1
- package/dist/{mascot-CmUUHLlx.js → mascot-kx6WDntR.js} +5 -5
- package/dist/{mascot-CmUUHLlx.js.map → mascot-kx6WDntR.js.map} +1 -1
- package/dist/{mcp-D60W6v_6.cjs → mcp-CIMQ8g_J.cjs} +3 -3
- package/dist/{mcp-D60W6v_6.cjs.map → mcp-CIMQ8g_J.cjs.map} +1 -1
- package/dist/{mcp-D63ugfbT.js → mcp-DFPXRd6M.js} +3 -3
- package/dist/{mcp-D63ugfbT.js.map → mcp-DFPXRd6M.js.map} +1 -1
- package/dist/{package-B8KmMINL.cjs → package-C482iN7Y.cjs} +2 -2
- package/dist/package-C482iN7Y.cjs.map +1 -0
- package/dist/package-DqSfSjr4.js +5 -0
- package/dist/package-DqSfSjr4.js.map +1 -0
- package/dist/{registry-Cy48PGdh.js → registry-BBJpMlM9.js} +4 -4
- package/dist/{registry-Cy48PGdh.js.map → registry-BBJpMlM9.js.map} +1 -1
- package/dist/{registry-Q77p5TZp.cjs → registry-CTVAqQFn.cjs} +4 -4
- package/dist/{registry-Q77p5TZp.cjs.map → registry-CTVAqQFn.cjs.map} +1 -1
- package/dist/{reporters-9MqdcKPp.js → reporters-DJPMb1-j.js} +1 -1
- package/dist/{reporters-B_USHwD6.js → reporters-De3ynr5a.js} +7 -7
- package/dist/{reporters-B_USHwD6.js.map → reporters-De3ynr5a.js.map} +1 -1
- package/dist/{reporters-DyjE3BzZ.cjs → reporters-yVmLpEoU.cjs} +7 -7
- package/dist/{reporters-DyjE3BzZ.cjs.map → reporters-yVmLpEoU.cjs.map} +1 -1
- package/dist/{rolldown-runtime-C3-Zg-KD.cjs → rolldown-runtime-BV8xUvPy.cjs} +4 -4
- package/dist/{rolldown-runtime-xo6NMXYd.js → rolldown-runtime-BowF1xt-.js} +0 -1
- package/dist/{run-DHdlUkYt.js → run-B-PAQSVx.js} +19 -19
- package/dist/run-B-PAQSVx.js.map +1 -0
- package/dist/{run-DMvX80Mi.cjs → run-BGkdpZwR.cjs} +4 -4
- package/dist/{run-DMvX80Mi.cjs.map → run-BGkdpZwR.cjs.map} +1 -1
- package/dist/{run-5u7cHD85.js → run-BVz9vmbt.js} +43 -23
- package/dist/run-BVz9vmbt.js.map +1 -0
- package/dist/{run-BD6A0HGa.js → run-Bc34cwzh.js} +17 -17
- package/dist/{run-BD6A0HGa.js.map → run-Bc34cwzh.js.map} +1 -1
- package/dist/{run-Do24e475.js → run-BjWqOCAj.js} +4 -4
- package/dist/{run-Do24e475.js.map → run-BjWqOCAj.js.map} +1 -1
- package/dist/{run-Ch7Uuu-u.js → run-C4fd98gp.js} +7 -7
- package/dist/{run-Ch7Uuu-u.js.map → run-C4fd98gp.js.map} +1 -1
- package/dist/{run-83Aaa6qM.cjs → run-D-3F2mhJ.cjs} +8 -8
- package/dist/{run-83Aaa6qM.cjs.map → run-D-3F2mhJ.cjs.map} +1 -1
- package/dist/{run-CfumUZCl.cjs → run-D15oxCOd.cjs} +7 -7
- package/dist/{run-CfumUZCl.cjs.map → run-D15oxCOd.cjs.map} +1 -1
- package/dist/{run-DKqUfsTv.js → run-D1hHaTDJ.js} +8 -8
- package/dist/{run-DKqUfsTv.js.map → run-D1hHaTDJ.js.map} +1 -1
- package/dist/{run-D-FHx4uQ.cjs → run-D7AQwBWZ.cjs} +42 -21
- package/dist/run-D7AQwBWZ.cjs.map +1 -0
- package/dist/{run-9mcw0FWy.cjs → run-DD1VdcpX.cjs} +19 -19
- package/dist/run-DD1VdcpX.cjs.map +1 -0
- package/dist/{run-m5ZAeYLj.js → run-DVbHd7qm.js} +126 -112
- package/dist/run-DVbHd7qm.js.map +1 -0
- package/dist/{run-D_tbKvAc.js → run-DYr--XFw.js} +1 -1
- package/dist/{run-BxNbFsmc.cjs → run-DwPkySke.cjs} +30 -19
- package/dist/run-DwPkySke.cjs.map +1 -0
- package/dist/{run-BA5vGtx3.cjs → run-hqWFyi0N.cjs} +14 -14
- package/dist/{run-BA5vGtx3.cjs.map → run-hqWFyi0N.cjs.map} +1 -1
- package/dist/{run-Dx8QpT_k.js → run-jGpJxxmr.js} +31 -21
- package/dist/run-jGpJxxmr.js.map +1 -0
- package/dist/{run-CgXrvsL9.js → run-nSTiS72Z.js} +16 -16
- package/dist/{run-CgXrvsL9.js.map → run-nSTiS72Z.js.map} +1 -1
- package/dist/{run-CXYwjh9u.cjs → run-puNdxNuf.cjs} +125 -111
- package/dist/run-puNdxNuf.cjs.map +1 -0
- package/dist/{run-DhlC3it5.cjs → run-w0kr76jl.cjs} +17 -17
- package/dist/{run-DhlC3it5.cjs.map → run-w0kr76jl.cjs.map} +1 -1
- package/dist/{shared-KKRMm1xX.cjs → shared-DoD3p_X8.cjs} +2 -2
- package/dist/{shared-KKRMm1xX.cjs.map → shared-DoD3p_X8.cjs.map} +1 -1
- package/dist/{shared-DcDHRtZx.js → shared-SrKde4x4.js} +2 -2
- package/dist/{shared-DcDHRtZx.js.map → shared-SrKde4x4.js.map} +1 -1
- package/dist/{snapshot-C_11eUdT.cjs → snapshot-DRyGykFq.cjs} +11 -11
- package/dist/snapshot-DRyGykFq.cjs.map +1 -0
- package/dist/{snapshot-CbajkXfi.js → snapshot-eO0_VdUy.js} +11 -11
- package/dist/snapshot-eO0_VdUy.js.map +1 -0
- package/dist/{spinner-RfMb7fd6.cjs → spinner-CdX9Noe9.cjs} +4 -4
- package/dist/{spinner-RfMb7fd6.cjs.map → spinner-CdX9Noe9.cjs.map} +1 -1
- package/dist/{spinner-DxsAllRI.js → spinner-D5DgYSS5.js} +3 -3
- package/dist/{spinner-DxsAllRI.js.map → spinner-D5DgYSS5.js.map} +1 -1
- package/dist/{status-CgVRLP9A.cjs → status-DICY3TJQ.cjs} +4 -4
- package/dist/{status-CgVRLP9A.cjs.map → status-DICY3TJQ.cjs.map} +1 -1
- package/dist/{status-CaEQY12V.js → status-NqYVjTY8.js} +4 -4
- package/dist/{status-CaEQY12V.js.map → status-NqYVjTY8.js.map} +1 -1
- package/dist/{studio-CENejJka.cjs → studio-BfR2KY0b.cjs} +18 -18
- package/dist/{studio-CENejJka.cjs.map → studio-BfR2KY0b.cjs.map} +1 -1
- package/dist/{studio-1Otb3b_g.js → studio-gu56JqH0.js} +18 -18
- package/dist/{studio-1Otb3b_g.js.map → studio-gu56JqH0.js.map} +1 -1
- package/dist/studioWorker.js +3 -3
- package/dist/{summary-BQWHL_Ca.js → summary-BS-iWuye.js} +4 -4
- package/dist/{summary-BQWHL_Ca.js.map → summary-BS-iWuye.js.map} +1 -1
- package/dist/{summary-B2Apv5KO.cjs → summary-n4osDoch.cjs} +4 -4
- package/dist/{summary-B2Apv5KO.cjs.map → summary-n4osDoch.cjs.map} +1 -1
- package/dist/{table-CR7iZJGo.js → table-BKkctGHD.js} +2 -2
- package/dist/{table-CR7iZJGo.js.map → table-BKkctGHD.js.map} +1 -1
- package/dist/{table-BlRe9YTZ.cjs → table-_fOF5WNI.cjs} +2 -2
- package/dist/{table-BlRe9YTZ.cjs.map → table-_fOF5WNI.cjs.map} +1 -1
- package/dist/{text-DMiX2dcG.cjs → text-CkCtm5VP.cjs} +2 -2
- package/dist/{text-DMiX2dcG.cjs.map → text-CkCtm5VP.cjs.map} +1 -1
- package/dist/{text-EoYn04SX.js → text-HYWAcipy.js} +2 -2
- package/dist/{text-EoYn04SX.js.map → text-HYWAcipy.js.map} +1 -1
- package/dist/{time-3BKoci3G.cjs → time-D4xUq6tx.cjs} +2 -2
- package/dist/{time-3BKoci3G.cjs.map → time-D4xUq6tx.cjs.map} +1 -1
- package/dist/{time-C-wU7VhC.js → time-D7ONPPZf.js} +2 -2
- package/dist/{time-C-wU7VhC.js.map → time-D7ONPPZf.js.map} +1 -1
- package/dist/{utils-DeXBGzGJ.cjs → utils-D19HX-lE.cjs} +3 -3
- package/dist/{utils-DeXBGzGJ.cjs.map → utils-D19HX-lE.cjs.map} +1 -1
- package/dist/{utils-f1C7RiEI.js → utils-DGopc0Bo.js} +3 -3
- package/dist/{utils-f1C7RiEI.js.map → utils-DGopc0Bo.js.map} +1 -1
- package/dist/{validate-BPYNc8h8.cjs → validate-BXSS6BSO.cjs} +4 -4
- package/dist/{validate-BPYNc8h8.cjs.map → validate-BXSS6BSO.cjs.map} +1 -1
- package/dist/{validate-cBMe2ndk.js → validate-DoSQad-i.js} +4 -4
- package/dist/{validate-cBMe2ndk.js.map → validate-DoSQad-i.js.map} +1 -1
- package/package.json +8 -8
- package/dist/config-BL3HnFhb.js +0 -1
- package/dist/config-BWj9jBVj.cjs.map +0 -1
- package/dist/config-Uk3rbZfb.js.map +0 -1
- package/dist/env-C3xHRMez.js +0 -1
- package/dist/package-B8KmMINL.cjs.map +0 -1
- package/dist/package-Cjh6pjp9.js +0 -5
- package/dist/package-Cjh6pjp9.js.map +0 -1
- package/dist/run-5u7cHD85.js.map +0 -1
- package/dist/run-9mcw0FWy.cjs.map +0 -1
- package/dist/run-BxNbFsmc.cjs.map +0 -1
- package/dist/run-CXYwjh9u.cjs.map +0 -1
- package/dist/run-D-FHx4uQ.cjs.map +0 -1
- package/dist/run-DHdlUkYt.js.map +0 -1
- package/dist/run-Dx8QpT_k.js.map +0 -1
- package/dist/run-m5ZAeYLj.js.map +0 -1
- package/dist/snapshot-C_11eUdT.cjs.map +0 -1
- package/dist/snapshot-CbajkXfi.js.map +0 -1
|
@@ -1,52 +1,64 @@
|
|
|
1
|
-
import "./rolldown-runtime-
|
|
2
|
-
import { n as getElapsedMs, t as formatMs } from "./time-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { a as
|
|
7
|
-
import { a as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import { t as createSpinner } from "./spinner-
|
|
11
|
-
import { t as getConfigs } from "./config-
|
|
12
|
-
import { o as isOutdated } from "./registry-
|
|
1
|
+
import "./rolldown-runtime-BowF1xt-.js";
|
|
2
|
+
import { n as getElapsedMs, t as formatMs } from "./time-D7ONPPZf.js";
|
|
3
|
+
import { t as version } from "./package-DqSfSjr4.js";
|
|
4
|
+
import { n as trackRun } from "./Telemetry-Bf16psPO.js";
|
|
5
|
+
import { n as pluralize } from "./text-HYWAcipy.js";
|
|
6
|
+
import { a as startWatcher, i as listenForKeys, n as setupReporters, o as trackBuild, r as diffBuilds, t as selectReporters } from "./reporters-De3ynr5a.js";
|
|
7
|
+
import { a as logWarn, i as logStep, n as logError, r as logInfo, s as createPlainWriter } from "./log-B_uVM704.js";
|
|
8
|
+
import { a as logTip, i as logSpacer, n as logIntro, r as logOutro } from "./intro-Dun8Eqod.js";
|
|
9
|
+
import { n as logBanner } from "./mascot-kx6WDntR.js";
|
|
10
|
+
import { t as createSpinner } from "./spinner-D5DgYSS5.js";
|
|
11
|
+
import { t as getConfigs } from "./config-BL4UlCHs.js";
|
|
12
|
+
import { o as isOutdated } from "./registry-BBJpMlM9.js";
|
|
13
13
|
import { styleText } from "node:util";
|
|
14
14
|
import process from "node:process";
|
|
15
15
|
import path from "node:path";
|
|
16
|
-
import { Diagnostics, Hookable,
|
|
16
|
+
import { Diagnostics, Hookable, Kubb, cliReporter, fileReporter, getInputKind, htmlReporter, jsonReporter, logLevel, memoryStorage } from "@kubb/core";
|
|
17
17
|
// src/runners/generate/run.ts
|
|
18
18
|
/** NPM registry endpoint used to check for @kubb/cli updates. */
|
|
19
19
|
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
20
20
|
/** Upper bound in milliseconds for the npm update check, so a slow registry never stalls a run. */
|
|
21
21
|
const UPDATE_CHECK_TIMEOUT_MS = 3e3;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
const config = {
|
|
29
|
-
...options.config,
|
|
30
|
-
input: input ?? options.config.input,
|
|
31
|
-
storage: dryRun ? memoryStorage() : options.config.storage,
|
|
22
|
+
function toRunConfig({ config, input, dryRun }) {
|
|
23
|
+
return {
|
|
24
|
+
...config,
|
|
25
|
+
input: input ?? config.input,
|
|
26
|
+
storage: dryRun ? memoryStorage() : config.storage,
|
|
32
27
|
output: dryRun ? {
|
|
33
|
-
...
|
|
28
|
+
...config.output,
|
|
34
29
|
format: false,
|
|
35
30
|
lint: false,
|
|
36
31
|
postGenerate: []
|
|
37
|
-
} :
|
|
32
|
+
} : config.output
|
|
38
33
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generates the configs and returns whether every build succeeded.
|
|
37
|
+
*/
|
|
38
|
+
async function generate({ configs, hooks }) {
|
|
39
|
+
const untrack = hooks.hook("kubb:generation:end", ({ config, filesCreated = 0, status = "success", hrStart = process.hrtime() }) => {
|
|
40
|
+
trackRun({
|
|
41
|
+
command: "generate",
|
|
42
|
+
hrStart
|
|
43
|
+
})({
|
|
44
|
+
plugins: config.plugins.flatMap((p) => p && typeof p === "object" ? [{
|
|
45
|
+
name: p.meta?.name ?? p.name ?? "",
|
|
46
|
+
options: p.options ?? {}
|
|
47
|
+
}] : []),
|
|
48
|
+
filesCreated,
|
|
49
|
+
status
|
|
50
|
+
});
|
|
48
51
|
});
|
|
49
|
-
|
|
52
|
+
let succeeded = true;
|
|
53
|
+
try {
|
|
54
|
+
for await (const { success, error } of Kubb.generate(configs, { hooks })) {
|
|
55
|
+
if (error) await Diagnostics.emit(hooks, error);
|
|
56
|
+
succeeded &&= success;
|
|
57
|
+
}
|
|
58
|
+
} finally {
|
|
59
|
+
untrack();
|
|
60
|
+
}
|
|
61
|
+
return succeeded;
|
|
50
62
|
}
|
|
51
63
|
/** The latest published version, `undefined` when the registry does not answer in time or `signal` aborts. Never rejects. */
|
|
52
64
|
async function fetchLatestVersion(signal) {
|
|
@@ -76,11 +88,67 @@ function logRebuild({ diff: { schemas, operations }, durationMs }) {
|
|
|
76
88
|
logStep([`Rebuilt in ${formatMs(durationMs)}`, specChange].filter(Boolean).join(styleText("dim", " · ")));
|
|
77
89
|
}
|
|
78
90
|
/**
|
|
91
|
+
* Generates the configs, then again whenever a local `input` file changes. Returns whether the build succeeded when there is no file to watch.
|
|
92
|
+
*/
|
|
93
|
+
async function watch({ configs, hooks, quiet }) {
|
|
94
|
+
const watchPaths = [...new Set(configs.flatMap(({ input }) => typeof input === "string" && getInputKind(input) === "file" ? [input] : []))];
|
|
95
|
+
if (!watchPaths.length) {
|
|
96
|
+
if (!quiet) logWarn("Watch mode only follows a local `input` file, so the configs are generated once.");
|
|
97
|
+
return generate({
|
|
98
|
+
configs,
|
|
99
|
+
hooks
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const label = styleText("yellow", `Watching ${watchPaths.map((watchPath) => path.relative(process.cwd(), watchPath)).join(", ")}`);
|
|
103
|
+
const tracker = trackBuild(hooks);
|
|
104
|
+
let previous;
|
|
105
|
+
const build = async () => {
|
|
106
|
+
const hrStart = process.hrtime();
|
|
107
|
+
const succeeded = await generate({
|
|
108
|
+
configs,
|
|
109
|
+
hooks
|
|
110
|
+
});
|
|
111
|
+
const snapshot = tracker.take();
|
|
112
|
+
if (previous) logRebuild({
|
|
113
|
+
diff: diffBuilds(previous, snapshot),
|
|
114
|
+
durationMs: getElapsedMs(hrStart)
|
|
115
|
+
});
|
|
116
|
+
previous = snapshot;
|
|
117
|
+
logStep(armKeys ? `${label} ${styleText("dim", "r rebuild · q quit")}` : label);
|
|
118
|
+
armKeys?.();
|
|
119
|
+
if (succeeded) {
|
|
120
|
+
logSpacer();
|
|
121
|
+
logTip();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
let queue = Promise.resolve();
|
|
125
|
+
let pending = false;
|
|
126
|
+
const rebuild = () => {
|
|
127
|
+
if (pending) return queue;
|
|
128
|
+
pending = true;
|
|
129
|
+
queue = queue.then(() => {
|
|
130
|
+
pending = false;
|
|
131
|
+
return build();
|
|
132
|
+
}).catch((error) => void Diagnostics.emit(hooks, error));
|
|
133
|
+
return queue;
|
|
134
|
+
};
|
|
135
|
+
const armKeys = quiet ? void 0 : listenForKeys({
|
|
136
|
+
rebuild: () => void rebuild(),
|
|
137
|
+
quit: (code) => void Promise.resolve(hooks.callHook("kubb:lifecycle:end")).finally(() => process.exit(code))
|
|
138
|
+
});
|
|
139
|
+
await rebuild();
|
|
140
|
+
await startWatcher(watchPaths, rebuild, {
|
|
141
|
+
info: logInfo,
|
|
142
|
+
error: logError
|
|
143
|
+
});
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
79
147
|
* Runs the full Kubb generation lifecycle for the given CLI options.
|
|
80
148
|
* Loads configs, sets up the reporters (CLI `--reporter` picks which of `config.reporters` to trigger),
|
|
81
149
|
* calls `generate` for each config entry, and prints an update notice when the registry answered in time.
|
|
82
150
|
*/
|
|
83
|
-
async function run({ input, configPath, logLevel: logLevelKey, watch, reporters: cliReporters, dryRun }) {
|
|
151
|
+
async function run({ input, configPath, logLevel: logLevelKey, watch: watchMode, reporters: cliReporters, dryRun }) {
|
|
84
152
|
const updateCheck = new AbortController();
|
|
85
153
|
let latestVersion;
|
|
86
154
|
fetchLatestVersion(updateCheck.signal).then((value) => {
|
|
@@ -91,8 +159,7 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
91
159
|
const requestedNames = cliReporters?.length ? cliReporters : ["cli"];
|
|
92
160
|
const json = requestedNames.includes("json");
|
|
93
161
|
const quiet = logLevel$1 <= logLevel.silent || json;
|
|
94
|
-
|
|
95
|
-
if (json) setupReporters(errorHooks, {
|
|
162
|
+
if (json) setupReporters(hooks, {
|
|
96
163
|
logLevel: logLevel$1,
|
|
97
164
|
reporters: [cliReporter],
|
|
98
165
|
writer: createPlainWriter(console.error)
|
|
@@ -101,8 +168,9 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
101
168
|
const loading = getConfigs({
|
|
102
169
|
configPath,
|
|
103
170
|
input,
|
|
104
|
-
watch,
|
|
105
|
-
logLevel: logLevelKey
|
|
171
|
+
watch: watchMode,
|
|
172
|
+
logLevel: logLevelKey,
|
|
173
|
+
reporters: cliReporters
|
|
106
174
|
});
|
|
107
175
|
loading.catch(() => void 0);
|
|
108
176
|
await banner;
|
|
@@ -122,7 +190,7 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
122
190
|
logLevel: logLevel$1,
|
|
123
191
|
reporters: [cliReporter]
|
|
124
192
|
});
|
|
125
|
-
await Diagnostics.emit(
|
|
193
|
+
await Diagnostics.emit(hooks, error);
|
|
126
194
|
if (!quiet) logOutro(styleText("red", "✗ Configuration failed"));
|
|
127
195
|
process.exit(1);
|
|
128
196
|
}
|
|
@@ -139,88 +207,34 @@ async function run({ input, configPath, logLevel: logLevelKey, watch, reporters:
|
|
|
139
207
|
dryRun
|
|
140
208
|
});
|
|
141
209
|
await hooks.callHook("kubb:lifecycle:start", { version });
|
|
210
|
+
const runConfigs = configs.map((config) => toRunConfig({
|
|
211
|
+
config,
|
|
212
|
+
input,
|
|
213
|
+
dryRun: dryRun ?? false
|
|
214
|
+
}));
|
|
142
215
|
if (!quiet) logOutro(`${pluralize(configs.length, "config")} ready`);
|
|
143
216
|
try {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (watchPath && tracker) {
|
|
153
|
-
const label = styleText("yellow", `Watching ${path.relative(process.cwd(), watchPath)}`);
|
|
154
|
-
let previous;
|
|
155
|
-
const build = async () => {
|
|
156
|
-
const hrStart = process.hrtime();
|
|
157
|
-
const succeeded = await generate({
|
|
158
|
-
input,
|
|
159
|
-
config,
|
|
160
|
-
hooks,
|
|
161
|
-
dryRun
|
|
162
|
-
});
|
|
163
|
-
const snapshot = tracker.take();
|
|
164
|
-
if (previous) logRebuild({
|
|
165
|
-
diff: diffBuilds(previous, snapshot),
|
|
166
|
-
durationMs: getElapsedMs(hrStart)
|
|
167
|
-
});
|
|
168
|
-
previous = snapshot;
|
|
169
|
-
logStep(armKeys ? `${label} ${styleText("dim", "r rebuild · q quit")}` : label);
|
|
170
|
-
armKeys?.();
|
|
171
|
-
if (succeeded) {
|
|
172
|
-
logSpacer();
|
|
173
|
-
logTip();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
let pending = false;
|
|
177
|
-
const rebuild = () => {
|
|
178
|
-
if (pending) return queue;
|
|
179
|
-
pending = true;
|
|
180
|
-
queue = queue.then(() => {
|
|
181
|
-
pending = false;
|
|
182
|
-
return build();
|
|
183
|
-
}).catch((error) => void Diagnostics.emit(errorHooks, error));
|
|
184
|
-
return queue;
|
|
185
|
-
};
|
|
186
|
-
rebuilds.push(rebuild);
|
|
187
|
-
if (!quiet) armKeys ??= listenForKeys({
|
|
188
|
-
rebuild: () => rebuilds.forEach((trigger) => void trigger()),
|
|
189
|
-
quit: (code) => void Promise.resolve(hooks.callHook("kubb:lifecycle:end")).finally(() => process.exit(code))
|
|
190
|
-
});
|
|
191
|
-
await rebuild();
|
|
192
|
-
await startWatcher([watchPath], rebuild, {
|
|
193
|
-
info: logInfo,
|
|
194
|
-
error: logError
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
if (tracker && !quiet) logWarn("Watch mode only follows a local `input` file, so this config is generated once.");
|
|
198
|
-
try {
|
|
199
|
-
if (!await generate({
|
|
200
|
-
input,
|
|
201
|
-
config,
|
|
202
|
-
hooks,
|
|
203
|
-
dryRun
|
|
204
|
-
})) anyFailed = true;
|
|
205
|
-
} catch (configError) {
|
|
206
|
-
await Diagnostics.emit(errorHooks, configError);
|
|
207
|
-
anyFailed = true;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
217
|
+
const succeeded = await (watchMode ? watch({
|
|
218
|
+
configs: runConfigs,
|
|
219
|
+
hooks,
|
|
220
|
+
quiet
|
|
221
|
+
}) : generate({
|
|
222
|
+
configs: runConfigs,
|
|
223
|
+
hooks
|
|
224
|
+
}));
|
|
211
225
|
updateCheck.abort();
|
|
212
226
|
await checkForUpdate({
|
|
213
227
|
hooks,
|
|
214
228
|
latestVersion
|
|
215
229
|
});
|
|
216
230
|
await hooks.callHook("kubb:lifecycle:end");
|
|
217
|
-
if (!quiet && !
|
|
218
|
-
if (
|
|
231
|
+
if (!quiet && !watchMode && succeeded) logTip();
|
|
232
|
+
if (!succeeded) process.exitCode = 1;
|
|
219
233
|
} catch (error) {
|
|
220
|
-
await Diagnostics.emit(
|
|
234
|
+
await Diagnostics.emit(hooks, error);
|
|
221
235
|
process.exit(1);
|
|
222
236
|
}
|
|
223
237
|
}
|
|
224
238
|
export { generate, run };
|
|
225
239
|
|
|
226
|
-
//# sourceMappingURL=run-
|
|
240
|
+
//# sourceMappingURL=run-DVbHd7qm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-DVbHd7qm.js","names":["logLevel","logLevelMap"],"sources":["../src/runners/generate/run.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\nimport { styleText } from 'node:util'\nimport { formatMs, formatters, getElapsedMs, linters } from '@internals/utils'\nimport {\n Hookable,\n type CLIOptions,\n cliReporter,\n type Config,\n Diagnostics,\n fileReporter,\n getInputKind,\n htmlReporter,\n jsonReporter,\n Kubb,\n type KubbHooks,\n logLevel as logLevelMap,\n memoryStorage,\n type ReporterName,\n} from '@kubb/core'\nimport { version } from '../../../package.json'\nimport { trackRun } from '../../Telemetry.ts'\nimport { pluralize } from '../../ui/text.ts'\nimport setupReporters, { selectReporters } from '../../loggers/reporters.ts'\nimport { createPlainWriter } from '../../loggers/plainWriter.ts'\nimport { logIntro, logOutro, logSpacer, logTip } from '../../ui/intro.ts'\nimport { logError, logInfo, logStep, logWarn } from '../../ui/log.ts'\nimport { logBanner } from '../../ui/mascot.ts'\nimport { createSpinner } from '../../ui/spinner.ts'\nimport { getConfigs } from '../../config.ts'\nimport { isOutdated } from '../../utils/registry.ts'\nimport { type BuildDiff, type BuildSnapshot, diffBuilds, listenForKeys, startWatcher, trackBuild } from './utils.ts'\n\n/** NPM registry endpoint used to check for @kubb/cli updates. */\nconst KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/** Upper bound in milliseconds for the npm update check, so a slow registry never stalls a run. */\nconst UPDATE_CHECK_TIMEOUT_MS = 3_000\n\n/** The formatter names from `Config['output'].format`, without `'auto'` (detection, not a tool) and `false` (skip). */\ntype FormatterName = Exclude<NonNullable<Config['output']['format']>, 'auto' | false>\ntype LinterName = Exclude<NonNullable<Config['output']['lint']>, 'auto' | false>\n\n// Pinned here, not in `@internals/utils` (which must not import `@kubb/core`): a tool added to the union without a descriptor fails to compile.\nformatters satisfies Record<FormatterName, unknown>\nlinters satisfies Record<LinterName, unknown>\n\nfunction toRunConfig({ config, input, dryRun }: { config: Config; input?: string; dryRun: boolean }): Config {\n return {\n ...config,\n input: input ?? config.input,\n // Dry-run never touches disk, regardless of the config's own storage driver.\n storage: dryRun ? memoryStorage() : config.storage,\n // Also keeps core's `hasOutputPasses` false, so dry-run skips the output manifest write too.\n output: dryRun ? { ...config.output, format: false, lint: false, postGenerate: [] } : config.output,\n }\n}\n\ntype GenerateProps = {\n configs: Array<Config>\n hooks: Hookable<KubbHooks>\n}\n\n/**\n * Generates the configs and returns whether every build succeeded.\n */\nexport async function generate({ configs, hooks }: GenerateProps): Promise<boolean> {\n // Not awaited: each request finishes in the background, capped by its timeout, so it never delays the summary.\n const untrack = hooks.hook('kubb:generation:end', ({ config, filesCreated = 0, status = 'success', hrStart = process.hrtime() }) => {\n void trackRun({ command: 'generate', hrStart })({\n plugins: config.plugins.flatMap((p) =>\n p && typeof p === 'object' ? [{ name: p.meta?.name ?? p.name ?? '', options: (p.options ?? {}) as Record<string, unknown> }] : [],\n ),\n filesCreated,\n status,\n })\n })\n let succeeded = true\n try {\n for await (const { success, error } of Kubb.generate(configs, { hooks })) {\n if (error) await Diagnostics.emit(hooks, error)\n succeeded &&= success\n }\n } finally {\n untrack()\n }\n return succeeded\n}\n\ntype GenerateCommandOptions = {\n input?: string\n configPath?: string\n logLevel: string\n watch: boolean\n reporters?: Array<ReporterName>\n dryRun?: boolean\n}\n\n/** The latest published version, `undefined` when the registry does not answer in time or `signal` aborts. Never rejects. */\nasync function fetchLatestVersion(signal: AbortSignal): Promise<string | undefined> {\n try {\n const res = await fetch(KUBB_NPM_PACKAGE_URL, { signal: AbortSignal.any([signal, AbortSignal.timeout(UPDATE_CHECK_TIMEOUT_MS)]) })\n const data = (await res.json()) as { version: string }\n return data.version\n } catch {\n // Ignore network errors\n return undefined\n }\n}\n\nasync function checkForUpdate({ hooks, latestVersion }: { hooks: Hookable<KubbHooks>; latestVersion: string | undefined }): Promise<void> {\n if (latestVersion && isOutdated({ installed: version, latest: latestVersion })) {\n await Diagnostics.emit(hooks, Diagnostics.update({ currentVersion: version, latestVersion }))\n }\n}\n\n/** Prints `Rebuilt in 1.2s · +1 schema -2 operations`, without the names part when the spec kept the same names. */\nfunction logRebuild({ diff: { schemas, operations }, durationMs }: { diff: BuildDiff; durationMs: number }): void {\n const specChange = [\n schemas.added && styleText('green', `+${pluralize(schemas.added, 'schema')}`),\n schemas.removed && styleText('red', `-${pluralize(schemas.removed, 'schema')}`),\n operations.added && styleText('green', `+${pluralize(operations.added, 'operation')}`),\n operations.removed && styleText('red', `-${pluralize(operations.removed, 'operation')}`),\n ]\n .filter(Boolean)\n .join(' ')\n logStep([`Rebuilt in ${formatMs(durationMs)}`, specChange].filter(Boolean).join(styleText('dim', ' · ')))\n}\n\n/**\n * Generates the configs, then again whenever a local `input` file changes. Returns whether the build succeeded when there is no file to watch.\n */\nasync function watch({ configs, hooks, quiet }: GenerateProps & { quiet: boolean }): Promise<boolean> {\n const watchPaths = [...new Set(configs.flatMap(({ input }) => (typeof input === 'string' && getInputKind(input) === 'file' ? [input] : [])))]\n if (!watchPaths.length) {\n if (!quiet) logWarn('Watch mode only follows a local `input` file, so the configs are generated once.')\n return generate({ configs, hooks })\n }\n\n const label = styleText('yellow', `Watching ${watchPaths.map((watchPath) => path.relative(process.cwd(), watchPath)).join(', ')}`)\n const tracker = trackBuild(hooks)\n let previous: BuildSnapshot | undefined\n // Don't removeAll() between builds, that would also drop logger and lifecycle\n // listeners. Plugin listeners are already disposed by safeBuild's dispose()\n // in its finally block, so re-running generate() on the same hooks emitter is safe.\n const build = async () => {\n const hrStart = process.hrtime()\n // Every config builds again, since an edited spec can change what the configs share.\n const succeeded = await generate({ configs, hooks })\n const snapshot = tracker.take()\n if (previous) logRebuild({ diff: diffBuilds(previous, snapshot), durationMs: getElapsedMs(hrStart) })\n previous = snapshot\n\n logStep(armKeys ? `${label} ${styleText('dim', 'r rebuild · q quit')}` : label)\n armKeys?.()\n if (succeeded) {\n logSpacer()\n logTip()\n }\n }\n // A trigger that lands while a build is queued joins it. One that lands during the build queues one more. Never rejects.\n let queue = Promise.resolve()\n let pending = false\n const rebuild = (): Promise<void> => {\n if (pending) return queue\n pending = true\n queue = queue\n .then(() => {\n pending = false\n return build()\n })\n .catch((error) => void Diagnostics.emit(hooks, error))\n return queue\n }\n const armKeys = quiet\n ? undefined\n : listenForKeys({\n rebuild: () => void rebuild(),\n quit: (code) => void Promise.resolve(hooks.callHook('kubb:lifecycle:end')).finally(() => process.exit(code)),\n })\n\n // The watcher ignores its startup state, so run the first build here. A failing one keeps watching so the user can fix the input.\n await rebuild()\n await startWatcher(watchPaths, rebuild, { info: logInfo, error: logError })\n return true\n}\n\n/**\n * Runs the full Kubb generation lifecycle for the given CLI options.\n * Loads configs, sets up the reporters (CLI `--reporter` picks which of `config.reporters` to trigger),\n * calls `generate` for each config entry, and prints an update notice when the registry answered in time.\n */\nexport async function run({\n input,\n configPath,\n logLevel: logLevelKey,\n watch: watchMode,\n reporters: cliReporters,\n dryRun,\n}: GenerateCommandOptions): Promise<void> {\n // Started first and never awaited: the notice prints at the end only when the registry has answered by then.\n const updateCheck = new AbortController()\n let latestVersion: string | undefined\n void fetchLatestVersion(updateCheck.signal).then((value) => {\n latestVersion = value\n })\n const logLevel = logLevelMap[logLevelKey as keyof typeof logLevelMap] ?? logLevelMap.info\n const hooks = new Hookable<KubbHooks>()\n\n // CLI `--reporter` selects which reporters to trigger by name, defaulting to `cli`. `defineConfig`\n // registers the built-in reporters on the config; a config exported without it falls back to them below.\n const requestedNames: Array<ReporterName> = cliReporters?.length ? cliReporters : ['cli']\n\n // The `json` reporter owns stdout, so the command writes nothing of its own around it.\n const json = requestedNames.includes('json')\n const quiet = logLevel <= logLevelMap.silent || json\n\n // The run log goes to stderr in `json` mode, so an error with no report entry is never silent and stdout stays one JSON document.\n if (json) setupReporters(hooks, { logLevel, reporters: [cliReporter], writer: createPlainWriter(console.error) })\n\n // The config loads while the banner plays; the output still prints in order once the banner is done.\n const banner = quiet ? undefined : logBanner(version)\n const loading = getConfigs({\n configPath,\n input,\n watch: watchMode,\n logLevel: logLevelKey as CLIOptions['logLevel'],\n reporters: cliReporters,\n })\n // Handled below; this keeps a rejection during the banner from counting as unhandled.\n loading.catch(() => undefined)\n await banner\n\n if (!quiet) {\n logIntro({ title: 'Configuration' })\n }\n\n // Load the config first so `config.reporters` can pick the reporters. A failure here has no\n // reporter installed yet, so fall back to the default `cli` reporter to surface it.\n const configSpinner = createSpinner()\n let configs: Array<Config>\n let resolvedConfigPath: string\n try {\n if (!quiet) configSpinner.start('Loading config')\n\n const loaded = await loading\n configs = loaded.configs\n resolvedConfigPath = loaded.configPath\n\n if (!quiet) configSpinner.stop(`Loaded ${styleText('dim', path.relative(process.cwd(), resolvedConfigPath))}`)\n } catch (error) {\n if (!quiet) configSpinner.error('Config failed loading')\n\n if (!json) setupReporters(hooks, { logLevel, reporters: [cliReporter] })\n // A diagnostic thrown while the config file runs, such as invalid extension options, sits in the cause chain.\n await Diagnostics.emit(hooks, error)\n\n if (!quiet) logOutro(styleText('red', '✗ Configuration failed'))\n process.exit(1)\n }\n\n // Without a reporter nothing is printed, not even an error, so a config written without\n // `defineConfig` gets the same built-ins it would have registered.\n const available = configs[0]?.reporters?.length ? configs[0].reporters : [cliReporter, jsonReporter, fileReporter, htmlReporter]\n const reporters = selectReporters(available, requestedNames)\n setupReporters(hooks, { logLevel, reporters, dryRun })\n\n await hooks.callHook('kubb:lifecycle:start', { version })\n\n const runConfigs = configs.map((config) => toRunConfig({ config, input, dryRun: dryRun ?? false }))\n\n if (!quiet) logOutro(`${pluralize(configs.length, 'config')} ready`)\n\n try {\n // One config that fails does not stop the others.\n const succeeded = await (watchMode ? watch({ configs: runConfigs, hooks, quiet }) : generate({ configs: runConfigs, hooks }))\n\n // A request still in flight would keep the process alive until its timeout.\n updateCheck.abort()\n await checkForUpdate({ hooks, latestVersion })\n\n await hooks.callHook('kubb:lifecycle:end')\n\n // Watch mode prints a tip after each successful build. Regular generate commands need to\n // print one explicitly after the lifecycle group has closed so it stays outside the group.\n if (!quiet && !watchMode && succeeded) {\n logTip()\n }\n\n // `exitCode`, not `exit()`, so a telemetry request still in flight can finish within its timeout.\n if (!succeeded) {\n process.exitCode = 1\n }\n } catch (error) {\n await Diagnostics.emit(hooks, error)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,uBAAuB;;AAG7B,MAAM,0BAA0B;AAUhC,SAAS,YAAY,EAAE,QAAQ,OAAO,UAAuE;CAC3G,OAAO;EACL,GAAG;EACH,OAAO,SAAS,OAAO;EAEvB,SAAS,SAAS,cAAc,IAAI,OAAO;EAE3C,QAAQ,SAAS;GAAE,GAAG,OAAO;GAAQ,QAAQ;GAAO,MAAM;GAAO,cAAc,CAAC;EAAE,IAAI,OAAO;CAC/F;AACF;;;;AAUA,eAAsB,SAAS,EAAE,SAAS,SAA0C;CAElF,MAAM,UAAU,MAAM,KAAK,wBAAwB,EAAE,QAAQ,eAAe,GAAG,SAAS,WAAW,UAAU,QAAQ,OAAO,QAAQ;EAClI,SAAc;GAAE,SAAS;GAAY;EAAQ,CAAC,CAAC,CAAC;GAC9C,SAAS,OAAO,QAAQ,SAAS,MAC/B,KAAK,OAAO,MAAM,WAAW,CAAC;IAAE,MAAM,EAAE,MAAM,QAAQ,EAAE,QAAQ;IAAI,SAAU,EAAE,WAAW,CAAC;GAA8B,CAAC,IAAI,CAAC,CAClI;GACA;GACA;EACF,CAAC;CACH,CAAC;CACD,IAAI,YAAY;CAChB,IAAI;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CAAC;EAEvE,MAAM,YAAY,KAAK,OAAO,KAAK;EAEnC,IAAI,CAAC,OAAO,SAAS,UAAU,OAAO,wBAAwB,CAAC;EAC/D,QAAQ,KAAK,CAAC;CAChB;CAIA,MAAM,YAAY,QAAQ,EAAE,EAAE,WAAW,SAAS,QAAQ,EAAE,CAAC,YAAY;EAAC;EAAa;EAAc;EAAc;CAAY;CAC/H,MAAM,YAAY,gBAAgB,WAAW,cAAc;CAC3D,eAAe,OAAO;EAAE,UAAA;EAAU;EAAW;CAAO,CAAC;CAErD,MAAM,MAAM,SAAS,wBAAwB,EAAE,QAAQ,CAAC;CAExD,MAAM,aAAa,QAAQ,KAAK,WAAW,YAAY;EAAE;EAAQ;EAAO,QAAQ,UAAU;CAAM,CAAC,CAAC;CAElG,IAAI,CAAC,OAAO,SAAS,GAAG,UAAU,QAAQ,QAAQ,QAAQ,EAAE,OAAO;CAEnE,IAAI;EAEF,MAAM,YAAY,OAAO,YAAY,MAAM;GAAE,SAAS;GAAY;GAAO;EAAM,CAAC,IAAI,SAAS;GAAE,SAAS;GAAY;EAAM,CAAC;EAG3H,YAAY,MAAM;EAClB,MAAM,eAAe;GAAE;GAAO;EAAc,CAAC;EAE7C,MAAM,MAAM,SAAS,oBAAoB;EAIzC,IAAI,CAAC,SAAS,CAAC,aAAa,WAC1B,OAAO;EAIT,IAAI,CAAC,WACH,QAAQ,WAAW;CAEvB,SAAS,OAAO;EACd,MAAM,YAAY,KAAK,OAAO,KAAK;EACnC,QAAQ,KAAK,CAAC;CAChB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as connect, a as login, s as resolvePermissions, c as runStudio } from "./run-
|
|
1
|
+
export { t as connect, a as login, s as resolvePermissions, c as runStudio } from "./run-Bc34cwzh.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const require_shared = require("./shared-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const require_summary = require("./summary-
|
|
11
|
-
const require_registry = require("./registry-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
|
+
const require_config = require("./config-DJtqFNG2.cjs");
|
|
3
|
+
const require_configFile = require("./configFile-C_7uzuGV.cjs");
|
|
4
|
+
const require_errors = require("./errors-Bewwe8mY.cjs");
|
|
5
|
+
const require_utils = require("./utils-D19HX-lE.cjs");
|
|
6
|
+
const require_spinner = require("./spinner-CdX9Noe9.cjs");
|
|
7
|
+
const require_shared = require("./shared-DoD3p_X8.cjs");
|
|
8
|
+
const require_intro = require("./intro-PFXmY9bD.cjs");
|
|
9
|
+
const require_log = require("./log-BzmBldY6.cjs");
|
|
10
|
+
const require_summary = require("./summary-n4osDoch.cjs");
|
|
11
|
+
const require_registry = require("./registry-CTVAqQFn.cjs");
|
|
12
12
|
let node_util = require("node:util");
|
|
13
13
|
let gunshi = require("gunshi");
|
|
14
14
|
let node_process = require("node:process");
|
|
@@ -18,6 +18,7 @@ node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
|
18
18
|
let _clack_prompts = require("@clack/prompts");
|
|
19
19
|
_clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
|
|
20
20
|
let _kubb_core = require("@kubb/core");
|
|
21
|
+
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
21
22
|
// src/runners/remove/run.ts
|
|
22
23
|
/** The lines of `before` that `after` no longer has, trimmed. */
|
|
23
24
|
function removedLines({ before, after }) {
|
|
@@ -31,9 +32,10 @@ function removedLines({ before, after }) {
|
|
|
31
32
|
/**
|
|
32
33
|
* Removes a plugin or parser from `kubb.config.ts` and uninstalls its package. Refuses the adapter,
|
|
33
34
|
* which the config needs, and an extension another one in the config depends on. Previews the
|
|
34
|
-
* change before asking.
|
|
35
|
+
* change before asking. With `dryRun`, stops after the preview: uninstalls nothing and leaves the
|
|
36
|
+
* config as it is.
|
|
35
37
|
*/
|
|
36
|
-
async function run({ id: input, configPath, yes, uninstall }) {
|
|
38
|
+
async function run({ id: input, configPath, yes, uninstall, dryRun = false }) {
|
|
37
39
|
const cwd = node_process.default.cwd();
|
|
38
40
|
const hrStart = node_process.default.hrtime();
|
|
39
41
|
const summary = require_summary.createSummary(hrStart);
|
|
@@ -41,7 +43,10 @@ async function run({ id: input, configPath, yes, uninstall }) {
|
|
|
41
43
|
summary(title, "failed", lines);
|
|
42
44
|
node_process.default.exitCode = 1;
|
|
43
45
|
};
|
|
44
|
-
require_intro.logIntro({ title: require_intro.isInteractiveRun({
|
|
46
|
+
require_intro.logIntro({ title: require_intro.isInteractiveRun({
|
|
47
|
+
yes,
|
|
48
|
+
dryRun
|
|
49
|
+
}) ? void 0 : (0, node_util.styleText)("bgCyan", (0, node_util.styleText)("black", " Kubb Remove ")) });
|
|
45
50
|
try {
|
|
46
51
|
const id = require_registry.toRegistryId(input);
|
|
47
52
|
const configFile = configPath ? node_path.default.resolve(configPath) : require_config.findConfigFile(cwd);
|
|
@@ -112,6 +117,10 @@ async function run({ id: input, configPath, yes, uninstall }) {
|
|
|
112
117
|
}).map((line) => (0, node_util.styleText)("red", ` - ${line}`)),
|
|
113
118
|
packageLine
|
|
114
119
|
]);
|
|
120
|
+
if (dryRun) {
|
|
121
|
+
summary(`${kind} not removed`, "planned", ["Dry run: nothing was uninstalled or written. Run the same command without --dry-run to remove it."]);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
115
124
|
const confirmed = yes || await _clack_prompts.confirm({
|
|
116
125
|
message: "Remove it?",
|
|
117
126
|
initialValue: true
|
|
@@ -143,13 +152,14 @@ async function run({ id: input, configPath, yes, uninstall }) {
|
|
|
143
152
|
fail("Remove failed", [" See the error above"]);
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
|
-
const command = (0, gunshi.
|
|
155
|
+
const command = (0, gunshi.defineWithTypes)()({
|
|
147
156
|
name: "remove",
|
|
148
157
|
description: "Remove a plugin or parser from kubb.config.ts and uninstall its package.",
|
|
149
158
|
examples: [
|
|
150
159
|
"kubb remove plugin-zod",
|
|
151
160
|
"kubb remove acme/plugin-x --yes",
|
|
152
|
-
"kubb remove plugin-zod --no-uninstall"
|
|
161
|
+
"kubb remove plugin-zod --no-uninstall",
|
|
162
|
+
"kubb remove plugin-zod --dry-run"
|
|
153
163
|
].join("\n"),
|
|
154
164
|
toKebab: true,
|
|
155
165
|
args: {
|
|
@@ -167,14 +177,15 @@ const command = (0, gunshi.define)({
|
|
|
167
177
|
default: true
|
|
168
178
|
}
|
|
169
179
|
},
|
|
170
|
-
run: ({ values }) => run({
|
|
180
|
+
run: ({ values, extensions }) => run({
|
|
171
181
|
id: values.id,
|
|
172
182
|
configPath: values.config,
|
|
173
183
|
yes: values.yes,
|
|
174
|
-
uninstall: values.uninstall
|
|
184
|
+
uninstall: values.uninstall,
|
|
185
|
+
dryRun: extensions[_gunshi_plugin_dryrun.pluginId].enabled
|
|
175
186
|
})
|
|
176
187
|
});
|
|
177
188
|
exports.command = command;
|
|
178
189
|
exports.run = run;
|
|
179
190
|
|
|
180
|
-
//# sourceMappingURL=run-
|
|
191
|
+
//# sourceMappingURL=run-DwPkySke.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-DwPkySke.cjs","names":["process","createSummary","isInteractiveRun","styleText","toRegistryId","path","findConfigFile","Diagnostics","withSpinner","fetchRegistryIndex","registryUrl","readInstalledPackages","read","closestIds","toShortId","pascalCase","extensionKinds","readConfig","ConfigEditOperation","editConfig","BUNDLED_PACKAGES","readImports","clack","editConfigFile","detectPackageManager","uninstallPackages","getErrorMessage","defineWithTypes","configArg","yesArg","dryRunId"],"sources":["../src/runners/remove/run.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { defineWithTypes } from 'gunshi'\nimport { BUNDLED_PACKAGES, ConfigEditOperation, extensionKinds, editConfig, editConfigFile, findConfigFile, readConfig, readImports } from '@internals/shared'\nimport { getErrorMessage, pascalCase, read } from '@internals/utils'\nimport { Diagnostics, readInstalledPackages } from '@kubb/core'\nimport { configArg, dryRunId, type DryRunExtensions, yesArg } from '../../commands/shared.ts'\nimport { isInteractiveRun, logIntro } from '../../ui/intro.ts'\nimport { logBlock, logError, logStep } from '../../ui/log.ts'\nimport { withSpinner } from '../../ui/spinner.ts'\nimport { createSummary } from '../../ui/summary.ts'\nimport { closestIds, fetchRegistryIndex, registryUrl, toRegistryId, toShortId } from '../../utils/registry.ts'\nimport { detectPackageManager, uninstallPackages } from '../init/utils.ts'\n\nexport type RemoveOptions = {\n /**\n * `owner/slug`, or a bare `slug` for an official extension.\n */\n id: string\n configPath?: string\n yes: boolean\n uninstall: boolean\n dryRun?: boolean\n}\n\n/** The lines of `before` that `after` no longer has, trimmed. */\nfunction removedLines({ before, after }: { before: string; after: string }): Array<string> {\n const remaining = after.split('\\n')\n return before\n .split('\\n')\n .filter((line) => {\n const index = remaining.indexOf(line)\n if (index !== -1) remaining.splice(index, 1)\n return index === -1 && line.trim() !== ''\n })\n .map((line) => line.trim())\n}\n\n/**\n * Removes a plugin or parser from `kubb.config.ts` and uninstalls its package. Refuses the adapter,\n * which the config needs, and an extension another one in the config depends on. Previews the\n * change before asking. With `dryRun`, stops after the preview: uninstalls nothing and leaves the\n * config as it is.\n */\nexport async function run({ id: input, configPath, yes, uninstall, dryRun = false }: RemoveOptions): Promise<void> {\n const cwd = process.cwd()\n const hrStart = process.hrtime()\n const summary = createSummary(hrStart)\n const fail = (title: string, lines: ReadonlyArray<string>) => {\n summary(title, 'failed', lines)\n process.exitCode = 1\n }\n logIntro({ title: isInteractiveRun({ yes, dryRun }) ? undefined : styleText('bgCyan', styleText('black', ' Kubb Remove ')) })\n\n try {\n const id = toRegistryId(input)\n const configFile = configPath ? path.resolve(configPath) : findConfigFile(cwd)\n if (!configFile)\n throw new Diagnostics.Error({\n code: Diagnostics.code.unknown,\n severity: 'error',\n message: 'No kubb.config.ts found. Pass its path with --config.',\n help: 'Run `kubb remove <id> --config <path>`.',\n })\n const configName = path.relative(cwd, configFile) || configFile\n const [entries, installed, source] = await withSpinner({\n message: 'Reading the registry',\n promise: Promise.all([fetchRegistryIndex({ registry: registryUrl() }), readInstalledPackages({ root: cwd }), read(configFile)]),\n })\n const versions = new Map(installed.map((item) => [item.package, item.version]))\n\n const entry = entries.find((candidate) => candidate.id === id)\n if (!entry) {\n const suggestions = closestIds({ input: id, ids: entries.map((candidate) => candidate.id) }).map(toShortId)\n return fail(\n `No extension named ${input}`,\n suggestions.map((suggestion) => ` kubb remove ${suggestion}`),\n )\n }\n const { artifact, manifest } = entry\n const kind = pascalCase(manifest.kind)\n if (manifest.kind === extensionKinds.adapter)\n return fail('The adapter cannot be removed', [` A config needs one adapter. Change it in ${configName} by hand.`])\n\n // Only calls that run count: a plugin Studio switched off is a comment, as in Studio's own check.\n const view = readConfig(source)\n const running = new Set(\n view.managed\n ? view.configs.flatMap((config) => [...config.plugins, ...(config.parsers ?? [])].filter((call) => !call.disabled).map((call) => call.packageName))\n : [],\n )\n const dependents = entries.filter(\n (other) => other.id !== entry.id && other.manifest.dependencies?.includes(manifest.name) && running.has(other.artifact.package),\n )\n if (dependents.length) {\n const names = dependents.map((other) => other.manifest.name).join(', ')\n return fail(`${names} ${dependents.length === 1 ? 'needs' : 'need'} ${manifest.name}`, [` Remove ${names} first.`])\n }\n\n const edits = [\n {\n operation: ConfigEditOperation.REMOVE_EXTENSION,\n ...(manifest.kind === extensionKinds.parser ? { kind: extensionKinds.parser } : {}),\n plugin: artifact.package,\n },\n ]\n const preview = editConfig({ source, edits })\n const outcome = preview.outcomes[0]\n if (!outcome?.applied) return fail(`Could not edit ${configName}`, [` ${outcome?.reason ?? 'the config file was not changed'}`])\n\n // Bundled extensions leave the config but stay installed.\n const bundled = BUNDLED_PACKAGES.includes(artifact.package)\n // Another `defineConfig` entry can still import it, and uninstalling it then breaks the config.\n const stillImported = readImports(preview.source).includes(artifact.package)\n const uninstalls = uninstall && !bundled && !stillImported && versions.has(artifact.package)\n if (!preview.changed && !uninstalls) {\n summary(`${manifest.name} is not in the project`, 'success', [' No changes made'])\n return\n }\n\n const packageLine = (() => {\n if (uninstalls) return `Uninstalls ${artifact.package}`\n if (bundled) return `Keeps ${artifact.package}, which ships with kubb`\n if (stillImported) return `Keeps ${artifact.package}, which another config entry still imports`\n return 'Uninstalls nothing'\n })()\n logStep(`${kind} ${styleText('cyan', manifest.name)} v${versions.get(artifact.package) ?? artifact.version}`)\n logBlock([\n `Config ${configName}`,\n ...removedLines({ before: source, after: preview.source }).map((line) => styleText('red', ` - ${line}`)),\n packageLine,\n ])\n\n if (dryRun) {\n summary(`${kind} not removed`, 'planned', ['Dry run: nothing was uninstalled or written. Run the same command without --dry-run to remove it.'])\n return\n }\n\n const confirmed = yes || (await clack.confirm({ message: 'Remove it?', initialValue: true }))\n if (clack.isCancel(confirmed) || !confirmed) {\n summary('Remove canceled', 'canceled', [` ${kind} ${manifest.name}`, ' No changes made'])\n return\n }\n\n if (preview.changed) {\n const written = await editConfigFile({ filePath: configFile, edits })\n if (!written.outcomes[0]?.applied) return fail(`Could not edit ${configName}`, [` ${written.outcomes[0]?.reason ?? 'the config file was not changed'}`])\n logStep(`${manifest.export}() removed from ${configName}`)\n }\n const packageManager = await detectPackageManager(cwd)\n if (uninstalls)\n await withSpinner({\n message: `Uninstalling ${artifact.package} with ${packageManager.name}`,\n promise: uninstallPackages([artifact.package], packageManager, cwd),\n })\n\n summary(`${kind} removed`, 'success', [\n ` Packages ${uninstalls ? `${artifact.package} uninstalled with ${packageManager.name}` : 'none uninstalled'}`,\n '',\n 'Next kubb generate',\n ])\n } catch (error) {\n logError(getErrorMessage(error))\n fail('Remove failed', [' See the error above'])\n }\n}\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\n name: 'remove',\n description: 'Remove a plugin or parser from kubb.config.ts and uninstall its package.',\n examples: ['kubb remove plugin-zod', 'kubb remove acme/plugin-x --yes', 'kubb remove plugin-zod --no-uninstall', 'kubb remove plugin-zod --dry-run'].join(\n '\\n',\n ),\n toKebab: true,\n args: {\n id: {\n type: 'positional',\n description: 'Registry id: owner/slug, or a slug for an official extension',\n required: true,\n },\n ...configArg,\n ...yesArg,\n uninstall: {\n type: 'boolean',\n description: 'Uninstall the package. Pass --no-uninstall to only edit the config',\n negatable: true,\n default: true,\n },\n },\n run: ({ values, extensions }) =>\n run({ id: values.id, configPath: values.config, yes: values.yes, uninstall: values.uninstall, dryRun: extensions[dryRunId].enabled }),\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,aAAa,EAAE,QAAQ,SAA2D;CACzF,MAAM,YAAY,MAAM,MAAM,IAAI;CAClC,OAAO,OACJ,MAAM,IAAI,CAAC,CACX,QAAQ,SAAS;EAChB,MAAM,QAAQ,UAAU,QAAQ,IAAI;EACpC,IAAI,UAAU,IAAI,UAAU,OAAO,OAAO,CAAC;EAC3C,OAAO,UAAU,MAAM,KAAK,KAAK,MAAM;CACzC,CAAC,CAAC,CACD,KAAK,SAAS,KAAK,KAAK,CAAC;AAC9B;;;;;;;AAQA,eAAsB,IAAI,EAAE,IAAI,OAAO,YAAY,KAAK,WAAW,SAAS,SAAuC;CACjH,MAAM,MAAMA,aAAAA,QAAQ,IAAI;CACxB,MAAM,UAAUA,aAAAA,QAAQ,OAAO;CAC/B,MAAM,UAAUC,gBAAAA,cAAc,OAAO;CACrC,MAAM,QAAQ,OAAe,UAAiC;EAC5D,QAAQ,OAAO,UAAU,KAAK;EAC9B,aAAA,QAAA,WAAmB;CACrB;CACA,cAAA,SAAS,EAAE,OAAOC,cAAAA,iBAAiB;EAAE;EAAK;CAAO,CAAC,IAAI,KAAA,KAAA,GAAYC,UAAAA,UAAAA,CAAU,WAAA,GAAUA,UAAAA,UAAAA,CAAU,SAAS,eAA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,SAAS,QAAQ,QAAQ,eAAe;GACjE,SAASiB,cAAAA,kBAAkB,CAAC,SAAS,OAAO,GAAG,gBAAgB,GAAG;EACpE,CAAC;EAEH,QAAQ,GAAG,KAAK,WAAW,WAAW;GACpC,eAAe,aAAa,GAAG,SAAS,QAAQ,oBAAoB,eAAe,SAAS;GAC5F;GACA;EACF,CAAC;CACH,SAAS,OAAO;EACd,YAAA,SAASC,eAAAA,gBAAgB,KAAK,CAAC;EAC/B,KAAK,iBAAiB,CAAC,uBAAuB,CAAC;CACjD;AACF;AAEA,MAAa,WAAA,GAAUC,OAAAA,gBAAAA,CAAkD,CAAC,CAAC;CACzE,MAAM;CACN,aAAa;CACb,UAAU;EAAC;EAA0B;EAAmC;EAAyC;CAAkC,CAAC,CAAC,KACnJ,IACF;CACA,SAAS;CACT,MAAM;EACJ,IAAI;GACF,MAAM;GACN,aAAa;GACb,UAAU;EACZ;EACA,GAAGC,eAAAA;EACH,GAAGC,eAAAA;EACH,WAAW;GACT,MAAM;GACN,aAAa;GACb,WAAW;GACX,SAAS;EACX;CACF;CACA,MAAM,EAAE,QAAQ,iBACd,IAAI;EAAE,IAAI,OAAO;EAAI,YAAY,OAAO;EAAQ,KAAK,OAAO;EAAK,WAAW,OAAO;EAAW,QAAQ,WAAWC,sBAAAA,SAAS,CAAC;CAAQ,CAAC;AACxI,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_spinner = require("./spinner-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
|
+
const require_configFile = require("./configFile-C_7uzuGV.cjs");
|
|
3
|
+
const require_config = require("./config-DJtqFNG2.cjs");
|
|
4
|
+
const require_spinner = require("./spinner-CdX9Noe9.cjs");
|
|
5
|
+
const require_time = require("./time-D4xUq6tx.cjs");
|
|
6
|
+
const require_config$1 = require("./config-BIv45u1Z.cjs");
|
|
7
|
+
const require_text = require("./text-CkCtm5VP.cjs");
|
|
8
|
+
const require_intro = require("./intro-PFXmY9bD.cjs");
|
|
9
|
+
const require_log = require("./log-BzmBldY6.cjs");
|
|
10
|
+
const require_registry = require("./registry-CTVAqQFn.cjs");
|
|
11
|
+
const require_installWithSpinner = require("./installWithSpinner-YEtb8cNf.cjs");
|
|
12
|
+
const require_utils = require("./utils-D19HX-lE.cjs");
|
|
13
|
+
const require_package = require("./package-C482iN7Y.cjs");
|
|
14
14
|
let node_util = require("node:util");
|
|
15
15
|
let gunshi = require("gunshi");
|
|
16
16
|
let node_process = require("node:process");
|
|
@@ -372,4 +372,4 @@ const command = (0, gunshi.defineWithTypes)()({
|
|
|
372
372
|
exports.command = command;
|
|
373
373
|
exports.run = run;
|
|
374
374
|
|
|
375
|
-
//# sourceMappingURL=run-
|
|
375
|
+
//# sourceMappingURL=run-hqWFyi0N.cjs.map
|