@kubb/cli 5.8.0 → 5.8.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.
Files changed (84) hide show
  1. package/dist/{Telemetry-C2052gYB.cjs → Telemetry-D6v6WUtX.cjs} +2 -2
  2. package/dist/{Telemetry-C2052gYB.cjs.map → Telemetry-D6v6WUtX.cjs.map} +1 -1
  3. package/dist/{Telemetry-A_TdzcbF.js → Telemetry-DMMnTu4n.js} +2 -2
  4. package/dist/{Telemetry-A_TdzcbF.js.map → Telemetry-DMMnTu4n.js.map} +1 -1
  5. package/dist/{background-DFGFUYGe.cjs → background-B-5uPpUT.cjs} +2 -2
  6. package/dist/{background-DFGFUYGe.cjs.map → background-B-5uPpUT.cjs.map} +1 -1
  7. package/dist/{background-BHIwU4gp.js → background-CV1vB9ys.js} +2 -2
  8. package/dist/{background-BHIwU4gp.js.map → background-CV1vB9ys.js.map} +1 -1
  9. package/dist/background-CuIy_K8c.js +1 -0
  10. package/dist/{commands-Uc-5l9O0.cjs → commands-CBibFu1T.cjs} +3 -3
  11. package/dist/{commands-Uc-5l9O0.cjs.map → commands-CBibFu1T.cjs.map} +1 -1
  12. package/dist/{commands-Hx6XpJx7.js → commands-DZgyEg0r.js} +3 -3
  13. package/dist/{commands-Hx6XpJx7.js.map → commands-DZgyEg0r.js.map} +1 -1
  14. package/dist/{config-DX176_YM.cjs → config-CRBZcWwg.cjs} +16 -61
  15. package/dist/config-CRBZcWwg.cjs.map +1 -0
  16. package/dist/{config-Czvfdmb6.js → config-DAdYwK_D.js} +14 -53
  17. package/dist/config-DAdYwK_D.js.map +1 -0
  18. package/dist/{errors-CMbMAwyW.cjs → errors-BdA8M78q.cjs} +19 -1
  19. package/dist/{errors-CMbMAwyW.cjs.map → errors-BdA8M78q.cjs.map} +1 -1
  20. package/dist/{errors-BQJzaUwP.js → errors-DmC83ALX.js} +14 -2
  21. package/dist/{errors-BQJzaUwP.js.map → errors-DmC83ALX.js.map} +1 -1
  22. package/dist/index.cjs +128 -40
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.ts +1 -2
  25. package/dist/index.js +128 -40
  26. package/dist/index.js.map +1 -1
  27. package/dist/{output-DekB5lg3.cjs → output-CWupdozw.cjs} +31 -31
  28. package/dist/output-CWupdozw.cjs.map +1 -0
  29. package/dist/registry-CCKUL3ps.cjs +113 -0
  30. package/dist/registry-CCKUL3ps.cjs.map +1 -0
  31. package/dist/registry-DjGepXb0.js +77 -0
  32. package/dist/registry-DjGepXb0.js.map +1 -0
  33. package/dist/reporters-C5HAypFq.cjs +67 -0
  34. package/dist/reporters-C5HAypFq.cjs.map +1 -0
  35. package/dist/reporters-CNZQUlXY.js +55 -0
  36. package/dist/reporters-CNZQUlXY.js.map +1 -0
  37. package/dist/run-B9wWJSSx.js +65 -0
  38. package/dist/run-B9wWJSSx.js.map +1 -0
  39. package/dist/{run-BaErHa3l.cjs → run-BNfemif8.cjs} +3 -3
  40. package/dist/{run-BaErHa3l.cjs.map → run-BNfemif8.cjs.map} +1 -1
  41. package/dist/run-BURZ4hDs.js +106 -0
  42. package/dist/run-BURZ4hDs.js.map +1 -0
  43. package/dist/run-BaFyksnF.cjs +72 -0
  44. package/dist/run-BaFyksnF.cjs.map +1 -0
  45. package/dist/{run-BSPA8JKH.cjs → run-BbSYIW7v.cjs} +9 -8
  46. package/dist/{run-BSPA8JKH.cjs.map → run-BbSYIW7v.cjs.map} +1 -1
  47. package/dist/run-C4IHvWT_.cjs +109 -0
  48. package/dist/run-C4IHvWT_.cjs.map +1 -0
  49. package/dist/run-CDS3EWEN.js +71 -0
  50. package/dist/run-CDS3EWEN.js.map +1 -0
  51. package/dist/{run-CN5DJ5XC.js → run-CGqjX3nk.js} +3 -3
  52. package/dist/{run-CN5DJ5XC.js.map → run-CGqjX3nk.js.map} +1 -1
  53. package/dist/{run-BWjtN8Gs.cjs → run-D87cI2Vc.cjs} +3 -3
  54. package/dist/{run-BWjtN8Gs.cjs.map → run-D87cI2Vc.cjs.map} +1 -1
  55. package/dist/{run-BeptvKTj.js → run-D9QTeOsm.js} +3 -3
  56. package/dist/{run-BeptvKTj.js.map → run-D9QTeOsm.js.map} +1 -1
  57. package/dist/{run-DuD68jDf.cjs → run-DSpOqqKI.cjs} +9 -8
  58. package/dist/{run-DuD68jDf.cjs.map → run-DSpOqqKI.cjs.map} +1 -1
  59. package/dist/run-DVIqUt1x.cjs +67 -0
  60. package/dist/run-DVIqUt1x.cjs.map +1 -0
  61. package/dist/{run-s3XYpkCe.cjs → run-E11sqsk0.cjs} +9 -81
  62. package/dist/run-E11sqsk0.cjs.map +1 -0
  63. package/dist/{run-BNEll0r7.js → run-Myj1dJrW.js} +5 -4
  64. package/dist/{run-BNEll0r7.js.map → run-Myj1dJrW.js.map} +1 -1
  65. package/dist/{run-BTU318R1.js → run-USNnlQcA.js} +2 -74
  66. package/dist/run-USNnlQcA.js.map +1 -0
  67. package/dist/{run-CIVIeuAh.js → run-W-tLF6Qs.js} +6 -5
  68. package/dist/{run-CIVIeuAh.js.map → run-W-tLF6Qs.js.map} +1 -1
  69. package/dist/{snapshot-GiKqhTTe.cjs → snapshot-9BhLfZLz.cjs} +7 -7
  70. package/dist/{snapshot-GiKqhTTe.cjs.map → snapshot-9BhLfZLz.cjs.map} +1 -1
  71. package/dist/{snapshot-B0piE_yD.js → snapshot-BdP6LpUP.js} +4 -4
  72. package/dist/{snapshot-B0piE_yD.js.map → snapshot-BdP6LpUP.js.map} +1 -1
  73. package/dist/studioWorker.js +2 -2
  74. package/dist/utils-Dhx5PMpD.js +80 -0
  75. package/dist/utils-Dhx5PMpD.js.map +1 -0
  76. package/dist/utils-ZcCFqERz.cjs +106 -0
  77. package/dist/utils-ZcCFqERz.cjs.map +1 -0
  78. package/package.json +7 -7
  79. package/dist/background-BpMcA026.js +0 -1
  80. package/dist/config-Czvfdmb6.js.map +0 -1
  81. package/dist/config-DX176_YM.cjs.map +0 -1
  82. package/dist/output-DekB5lg3.cjs.map +0 -1
  83. package/dist/run-BTU318R1.js.map +0 -1
  84. package/dist/run-s3XYpkCe.cjs.map +0 -1
@@ -0,0 +1,67 @@
1
+ const require_agent = require("./agent-DElUuYuy.cjs");
2
+ const require_output = require("./output-CWupdozw.cjs");
3
+ let node_process = require("node:process");
4
+ node_process = require_agent.__toESM(node_process, 1);
5
+ let _kubb_core = require("@kubb/core");
6
+ //#region src/loggers/reporters.ts
7
+ /** Bridges a {@link Reporter} onto the hook emitter: calls `report` with each config's {@link GenerationResult} on `kubb:generation:end`. */
8
+ function installReporter(context, reporter, ctx) {
9
+ const pluginFiles = reporter.needsPluginFiles ? /* @__PURE__ */ new Map() : void 0;
10
+ if (pluginFiles) context.hook("kubb:plugin:end", ({ config, plugin, files }) => {
11
+ const filesByPlugin = pluginFiles.get(config) ?? /* @__PURE__ */ new Map();
12
+ const seen = new Set([...filesByPlugin.values()].flatMap((paths) => [...paths]));
13
+ const added = files.filter((file) => !seen.has(file.path)).map((file) => file.path);
14
+ if (added.length) filesByPlugin.set(plugin.name, /* @__PURE__ */ new Set([...filesByPlugin.get(plugin.name) ?? [], ...added]));
15
+ pluginFiles.set(config, filesByPlugin);
16
+ });
17
+ context.hook("kubb:generation:end", async ({ config, diagnostics = [], filesCreated = 0, status = "success", hrStart = node_process.default.hrtime() }) => {
18
+ const files = pluginFiles?.get(config);
19
+ const grouped = files && [...files].map(([plugin, paths]) => ({
20
+ plugin,
21
+ files: [...paths]
22
+ }));
23
+ await reporter.report({
24
+ config,
25
+ diagnostics,
26
+ filesCreated,
27
+ status,
28
+ hrStart,
29
+ pluginFiles: grouped
30
+ }, ctx);
31
+ pluginFiles?.delete(config);
32
+ });
33
+ if (reporter.drain) context.hook("kubb:lifecycle:end", () => reporter.drain?.(ctx));
34
+ }
35
+ /** Installs the live logger and wires the selected reporters. `cli` renders its summary through the logger, and is skipped when `json` owns stdout. */
36
+ function setupReporters(context, { logLevel, reporters, logger: forcedLogger }) {
37
+ const hasJson = reporters.some((reporter) => reporter.name === "json");
38
+ const ctx = { logLevel };
39
+ for (const reporter of reporters) {
40
+ if (reporter.name !== "cli") {
41
+ installReporter(context, reporter, ctx);
42
+ continue;
43
+ }
44
+ if (hasJson) continue;
45
+ const handle = (forcedLogger ?? (require_output.isRichOutput() ? require_output.clackLogger : require_output.plainLogger))(context, { logLevel });
46
+ installReporter(context, (0, _kubb_core.createCliReporter)({ render: handle?.renderSummary }), ctx);
47
+ }
48
+ }
49
+ /** Picks the reporters whose `name` is in `names`, in the given order (the CLI maps `--reporter` to this); duplicates and unknown names are skipped. */
50
+ function selectReporters(reporters, names) {
51
+ return [...new Set(names)].flatMap((name) => reporters.find((reporter) => reporter.name === name) ?? []);
52
+ }
53
+ //#endregion
54
+ Object.defineProperty(exports, "selectReporters", {
55
+ enumerable: true,
56
+ get: function() {
57
+ return selectReporters;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "setupReporters", {
61
+ enumerable: true,
62
+ get: function() {
63
+ return setupReporters;
64
+ }
65
+ });
66
+
67
+ //# sourceMappingURL=reporters-C5HAypFq.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporters-C5HAypFq.cjs","names":["process","isRichOutput","clackLogger","plainLogger","createCliReporter"],"sources":["../src/loggers/reporters.ts"],"sourcesContent":["import process from 'node:process'\nimport type { Config, Hookable, KubbHooks, Reporter, ReporterContext, ReporterPluginFiles } from '@kubb/core'\nimport { createCliReporter } from '@kubb/core'\nimport { isRichOutput } from '../utils/env.ts'\nimport type { Logger, LoggerOptions } from './defineLogger.ts'\nimport { clackLogger } from './clackLogger.ts'\nimport { plainLogger } from './plainLogger.ts'\n\n/** Bridges a {@link Reporter} onto the hook emitter: calls `report` with each config's {@link GenerationResult} on `kubb:generation:end`. */\nfunction installReporter(context: Hookable<KubbHooks>, reporter: Reporter, ctx: ReporterContext): void {\n const pluginFiles = reporter.needsPluginFiles ? new Map<Config, Map<string, Set<string>>>() : undefined\n\n if (pluginFiles) {\n context.hook('kubb:plugin:end', ({ config, plugin, files }) => {\n const filesByPlugin = pluginFiles.get(config) ?? new Map<string, Set<string>>()\n const seen = new Set([...filesByPlugin.values()].flatMap((paths) => [...paths]))\n const added = files.filter((file) => !seen.has(file.path)).map((file) => file.path)\n\n if (added.length) filesByPlugin.set(plugin.name, new Set([...(filesByPlugin.get(plugin.name) ?? []), ...added]))\n\n pluginFiles.set(config, filesByPlugin)\n })\n }\n\n context.hook('kubb:generation:end', async ({ config, diagnostics = [], filesCreated = 0, status = 'success', hrStart = process.hrtime() }) => {\n const files = pluginFiles?.get(config)\n const grouped: ReporterPluginFiles | undefined = files && [...files].map(([plugin, paths]) => ({ plugin, files: [...paths] }))\n\n await reporter.report({ config, diagnostics, filesCreated, status, hrStart, pluginFiles: grouped }, ctx)\n\n pluginFiles?.delete(config)\n })\n\n if (reporter.drain) {\n context.hook('kubb:lifecycle:end', () => reporter.drain?.(ctx))\n }\n}\n\n/** Installs the live logger and wires the selected reporters. `cli` renders its summary through the logger, and is skipped when `json` owns stdout. */\nfunction setupReporters(\n context: Hookable<KubbHooks>,\n {\n logLevel,\n reporters,\n logger: forcedLogger,\n }: LoggerOptions & {\n reporters: ReadonlyArray<Reporter>\n /** Overrides the terminal-based pick, e.g. the plain logger for `kubb studio snapshot`. */\n logger?: Logger\n },\n): void {\n const hasJson = reporters.some((reporter) => reporter.name === 'json')\n const ctx: ReporterContext = { logLevel }\n\n for (const reporter of reporters) {\n if (reporter.name !== 'cli') {\n installReporter(context, reporter, ctx)\n continue\n }\n\n if (hasJson) {\n continue\n }\n\n const logger = forcedLogger ?? (isRichOutput() ? clackLogger : plainLogger)\n const handle = logger(context, { logLevel })\n\n // The summary belongs inside the group the logger opened for this config, so the logger writes it.\n installReporter(context, createCliReporter({ render: handle?.renderSummary }), ctx)\n }\n}\n\nexport default setupReporters\n\n/** Picks the reporters whose `name` is in `names`, in the given order (the CLI maps `--reporter` to this); duplicates and unknown names are skipped. */\nexport function selectReporters(reporters: ReadonlyArray<Reporter>, names: ReadonlyArray<string>): Array<Reporter> {\n return [...new Set(names)].flatMap((name) => reporters.find((reporter) => reporter.name === name) ?? [])\n}\n"],"mappings":";;;;;;;AASA,SAAS,gBAAgB,SAA8B,UAAoB,KAA4B;CACrG,MAAM,cAAc,SAAS,mCAAmB,IAAI,IAAsC,IAAI,KAAA;CAE9F,IAAI,aACF,QAAQ,KAAK,oBAAoB,EAAE,QAAQ,QAAQ,YAAY;EAC7D,MAAM,gBAAgB,YAAY,IAAI,MAAM,qBAAK,IAAI,IAAyB;EAC9E,MAAM,OAAO,IAAI,IAAI,CAAC,GAAG,cAAc,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC;EAC/E,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,KAAK,IAAI;EAElF,IAAI,MAAM,QAAQ,cAAc,IAAI,OAAO,sBAAM,IAAI,IAAI,CAAC,GAAI,cAAc,IAAI,OAAO,IAAI,KAAK,CAAC,GAAI,GAAG,KAAK,CAAC,CAAC;EAE/G,YAAY,IAAI,QAAQ,aAAa;CACvC,CAAC;CAGH,QAAQ,KAAK,uBAAuB,OAAO,EAAE,QAAQ,cAAc,CAAC,GAAG,eAAe,GAAG,SAAS,WAAW,UAAUA,aAAAA,QAAQ,OAAO,QAAQ;EAC5I,MAAM,QAAQ,aAAa,IAAI,MAAM;EACrC,MAAM,UAA2C,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,QAAQ,YAAY;GAAE;GAAQ,OAAO,CAAC,GAAG,KAAK;EAAE,EAAE;EAE7H,MAAM,SAAS,OAAO;GAAE;GAAQ;GAAa;GAAc;GAAQ;GAAS,aAAa;EAAQ,GAAG,GAAG;EAEvG,aAAa,OAAO,MAAM;CAC5B,CAAC;CAED,IAAI,SAAS,OACX,QAAQ,KAAK,4BAA4B,SAAS,QAAQ,GAAG,CAAC;AAElE;;AAGA,SAAS,eACP,SACA,EACE,UACA,WACA,QAAQ,gBAMJ;CACN,MAAM,UAAU,UAAU,MAAM,aAAa,SAAS,SAAS,MAAM;CACrE,MAAM,MAAuB,EAAE,SAAS;CAExC,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,SAAS,SAAS,OAAO;GAC3B,gBAAgB,SAAS,UAAU,GAAG;GACtC;EACF;EAEA,IAAI,SACF;EAIF,MAAM,UADS,iBAAiBC,eAAAA,aAAa,IAAIC,eAAAA,cAAcC,eAAAA,aAAAA,CACzC,SAAS,EAAE,SAAS,CAAC;EAG3C,gBAAgB,UAAA,GAASC,WAAAA,kBAAAA,CAAkB,EAAE,QAAQ,QAAQ,cAAc,CAAC,GAAG,GAAG;CACpF;AACF;;AAKA,SAAgB,gBAAgB,WAAoC,OAA+C;CACjH,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,SAAS,SAAS,UAAU,MAAM,aAAa,SAAS,SAAS,IAAI,KAAK,CAAC,CAAC;AACzG"}
@@ -0,0 +1,55 @@
1
+ import "./rolldown-runtime-CRm0XQPb.js";
2
+ import { f as clackLogger, g as plainLogger, m as isRichOutput } from "./output-B9Yw7vL0.js";
3
+ import process from "node:process";
4
+ import { createCliReporter } from "@kubb/core";
5
+ //#region src/loggers/reporters.ts
6
+ /** Bridges a {@link Reporter} onto the hook emitter: calls `report` with each config's {@link GenerationResult} on `kubb:generation:end`. */
7
+ function installReporter(context, reporter, ctx) {
8
+ const pluginFiles = reporter.needsPluginFiles ? /* @__PURE__ */ new Map() : void 0;
9
+ if (pluginFiles) context.hook("kubb:plugin:end", ({ config, plugin, files }) => {
10
+ const filesByPlugin = pluginFiles.get(config) ?? /* @__PURE__ */ new Map();
11
+ const seen = new Set([...filesByPlugin.values()].flatMap((paths) => [...paths]));
12
+ const added = files.filter((file) => !seen.has(file.path)).map((file) => file.path);
13
+ if (added.length) filesByPlugin.set(plugin.name, /* @__PURE__ */ new Set([...filesByPlugin.get(plugin.name) ?? [], ...added]));
14
+ pluginFiles.set(config, filesByPlugin);
15
+ });
16
+ context.hook("kubb:generation:end", async ({ config, diagnostics = [], filesCreated = 0, status = "success", hrStart = process.hrtime() }) => {
17
+ const files = pluginFiles?.get(config);
18
+ const grouped = files && [...files].map(([plugin, paths]) => ({
19
+ plugin,
20
+ files: [...paths]
21
+ }));
22
+ await reporter.report({
23
+ config,
24
+ diagnostics,
25
+ filesCreated,
26
+ status,
27
+ hrStart,
28
+ pluginFiles: grouped
29
+ }, ctx);
30
+ pluginFiles?.delete(config);
31
+ });
32
+ if (reporter.drain) context.hook("kubb:lifecycle:end", () => reporter.drain?.(ctx));
33
+ }
34
+ /** Installs the live logger and wires the selected reporters. `cli` renders its summary through the logger, and is skipped when `json` owns stdout. */
35
+ function setupReporters(context, { logLevel, reporters, logger: forcedLogger }) {
36
+ const hasJson = reporters.some((reporter) => reporter.name === "json");
37
+ const ctx = { logLevel };
38
+ for (const reporter of reporters) {
39
+ if (reporter.name !== "cli") {
40
+ installReporter(context, reporter, ctx);
41
+ continue;
42
+ }
43
+ if (hasJson) continue;
44
+ const handle = (forcedLogger ?? (isRichOutput() ? clackLogger : plainLogger))(context, { logLevel });
45
+ installReporter(context, createCliReporter({ render: handle?.renderSummary }), ctx);
46
+ }
47
+ }
48
+ /** Picks the reporters whose `name` is in `names`, in the given order (the CLI maps `--reporter` to this); duplicates and unknown names are skipped. */
49
+ function selectReporters(reporters, names) {
50
+ return [...new Set(names)].flatMap((name) => reporters.find((reporter) => reporter.name === name) ?? []);
51
+ }
52
+ //#endregion
53
+ export { setupReporters as n, selectReporters as t };
54
+
55
+ //# sourceMappingURL=reporters-CNZQUlXY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporters-CNZQUlXY.js","names":[],"sources":["../src/loggers/reporters.ts"],"sourcesContent":["import process from 'node:process'\nimport type { Config, Hookable, KubbHooks, Reporter, ReporterContext, ReporterPluginFiles } from '@kubb/core'\nimport { createCliReporter } from '@kubb/core'\nimport { isRichOutput } from '../utils/env.ts'\nimport type { Logger, LoggerOptions } from './defineLogger.ts'\nimport { clackLogger } from './clackLogger.ts'\nimport { plainLogger } from './plainLogger.ts'\n\n/** Bridges a {@link Reporter} onto the hook emitter: calls `report` with each config's {@link GenerationResult} on `kubb:generation:end`. */\nfunction installReporter(context: Hookable<KubbHooks>, reporter: Reporter, ctx: ReporterContext): void {\n const pluginFiles = reporter.needsPluginFiles ? new Map<Config, Map<string, Set<string>>>() : undefined\n\n if (pluginFiles) {\n context.hook('kubb:plugin:end', ({ config, plugin, files }) => {\n const filesByPlugin = pluginFiles.get(config) ?? new Map<string, Set<string>>()\n const seen = new Set([...filesByPlugin.values()].flatMap((paths) => [...paths]))\n const added = files.filter((file) => !seen.has(file.path)).map((file) => file.path)\n\n if (added.length) filesByPlugin.set(plugin.name, new Set([...(filesByPlugin.get(plugin.name) ?? []), ...added]))\n\n pluginFiles.set(config, filesByPlugin)\n })\n }\n\n context.hook('kubb:generation:end', async ({ config, diagnostics = [], filesCreated = 0, status = 'success', hrStart = process.hrtime() }) => {\n const files = pluginFiles?.get(config)\n const grouped: ReporterPluginFiles | undefined = files && [...files].map(([plugin, paths]) => ({ plugin, files: [...paths] }))\n\n await reporter.report({ config, diagnostics, filesCreated, status, hrStart, pluginFiles: grouped }, ctx)\n\n pluginFiles?.delete(config)\n })\n\n if (reporter.drain) {\n context.hook('kubb:lifecycle:end', () => reporter.drain?.(ctx))\n }\n}\n\n/** Installs the live logger and wires the selected reporters. `cli` renders its summary through the logger, and is skipped when `json` owns stdout. */\nfunction setupReporters(\n context: Hookable<KubbHooks>,\n {\n logLevel,\n reporters,\n logger: forcedLogger,\n }: LoggerOptions & {\n reporters: ReadonlyArray<Reporter>\n /** Overrides the terminal-based pick, e.g. the plain logger for `kubb studio snapshot`. */\n logger?: Logger\n },\n): void {\n const hasJson = reporters.some((reporter) => reporter.name === 'json')\n const ctx: ReporterContext = { logLevel }\n\n for (const reporter of reporters) {\n if (reporter.name !== 'cli') {\n installReporter(context, reporter, ctx)\n continue\n }\n\n if (hasJson) {\n continue\n }\n\n const logger = forcedLogger ?? (isRichOutput() ? clackLogger : plainLogger)\n const handle = logger(context, { logLevel })\n\n // The summary belongs inside the group the logger opened for this config, so the logger writes it.\n installReporter(context, createCliReporter({ render: handle?.renderSummary }), ctx)\n }\n}\n\nexport default setupReporters\n\n/** Picks the reporters whose `name` is in `names`, in the given order (the CLI maps `--reporter` to this); duplicates and unknown names are skipped. */\nexport function selectReporters(reporters: ReadonlyArray<Reporter>, names: ReadonlyArray<string>): Array<Reporter> {\n return [...new Set(names)].flatMap((name) => reporters.find((reporter) => reporter.name === name) ?? [])\n}\n"],"mappings":";;;;;;AASA,SAAS,gBAAgB,SAA8B,UAAoB,KAA4B;CACrG,MAAM,cAAc,SAAS,mCAAmB,IAAI,IAAsC,IAAI,KAAA;CAE9F,IAAI,aACF,QAAQ,KAAK,oBAAoB,EAAE,QAAQ,QAAQ,YAAY;EAC7D,MAAM,gBAAgB,YAAY,IAAI,MAAM,qBAAK,IAAI,IAAyB;EAC9E,MAAM,OAAO,IAAI,IAAI,CAAC,GAAG,cAAc,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC;EAC/E,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,KAAK,IAAI;EAElF,IAAI,MAAM,QAAQ,cAAc,IAAI,OAAO,sBAAM,IAAI,IAAI,CAAC,GAAI,cAAc,IAAI,OAAO,IAAI,KAAK,CAAC,GAAI,GAAG,KAAK,CAAC,CAAC;EAE/G,YAAY,IAAI,QAAQ,aAAa;CACvC,CAAC;CAGH,QAAQ,KAAK,uBAAuB,OAAO,EAAE,QAAQ,cAAc,CAAC,GAAG,eAAe,GAAG,SAAS,WAAW,UAAU,QAAQ,OAAO,QAAQ;EAC5I,MAAM,QAAQ,aAAa,IAAI,MAAM;EACrC,MAAM,UAA2C,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,QAAQ,YAAY;GAAE;GAAQ,OAAO,CAAC,GAAG,KAAK;EAAE,EAAE;EAE7H,MAAM,SAAS,OAAO;GAAE;GAAQ;GAAa;GAAc;GAAQ;GAAS,aAAa;EAAQ,GAAG,GAAG;EAEvG,aAAa,OAAO,MAAM;CAC5B,CAAC;CAED,IAAI,SAAS,OACX,QAAQ,KAAK,4BAA4B,SAAS,QAAQ,GAAG,CAAC;AAElE;;AAGA,SAAS,eACP,SACA,EACE,UACA,WACA,QAAQ,gBAMJ;CACN,MAAM,UAAU,UAAU,MAAM,aAAa,SAAS,SAAS,MAAM;CACrE,MAAM,MAAuB,EAAE,SAAS;CAExC,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,SAAS,SAAS,OAAO;GAC3B,gBAAgB,SAAS,UAAU,GAAG;GACtC;EACF;EAEA,IAAI,SACF;EAIF,MAAM,UADS,iBAAiB,aAAa,IAAI,cAAc,aAAA,CACzC,SAAS,EAAE,SAAS,CAAC;EAG3C,gBAAgB,SAAS,kBAAkB,EAAE,QAAQ,QAAQ,cAAc,CAAC,GAAG,GAAG;CACpF;AACF;;AAKA,SAAgB,gBAAgB,WAAoC,OAA+C;CACjH,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,SAAS,SAAS,UAAU,MAAM,aAAa,SAAS,SAAS,IAAI,KAAK,CAAC,CAAC;AACzG"}
@@ -0,0 +1,65 @@
1
+ import "./rolldown-runtime-CRm0XQPb.js";
2
+ import { t as getErrorMessage } from "./errors-DmC83ALX.js";
3
+ import { a as logInfo, d as logWarn, i as logError, l as logStep, o as logIntro, r as logBlock, s as logOutro } from "./output-B9Yw7vL0.js";
4
+ import { a as registryUrl, i as isOutdated, n as fetchRegistryIndex, o as toRegistryId, r as incompatibility } from "./registry-DjGepXb0.js";
5
+ import { i as installPackages, t as detectPackageManager } from "./utils-Dhx5PMpD.js";
6
+ import { styleText } from "node:util";
7
+ import process from "node:process";
8
+ import { readInstalledPackages } from "@kubb/core";
9
+ import * as clack from "@clack/prompts";
10
+ //#region src/runners/update/run.ts
11
+ /**
12
+ * Moves installed extensions to the version the registry pins. Lists the proposals, asks, then
13
+ * installs them. With `check`, only lists them.
14
+ */
15
+ async function run({ ids, check, yes }) {
16
+ const cwd = process.cwd();
17
+ logIntro({ title: styleText("bgCyan", styleText("black", " Kubb Update ")) });
18
+ try {
19
+ const wanted = new Set(ids.map(toRegistryId));
20
+ const [entries, installed] = await Promise.all([fetchRegistryIndex({ registry: registryUrl() }), readInstalledPackages({ root: cwd })]);
21
+ const versions = new Map(installed.map((item) => [item.package, item.version]));
22
+ const tracked = entries.filter((entry) => versions.has(entry.artifact.package) && (!wanted.size || wanted.has(entry.id)));
23
+ for (const id of wanted) if (!tracked.some((entry) => entry.id === id)) logWarn(`${id} is not installed, or not in the registry.`);
24
+ const proposals = tracked.filter((entry) => {
25
+ if (!isOutdated({
26
+ installed: versions.get(entry.artifact.package),
27
+ latest: entry.artifact.version
28
+ })) return false;
29
+ const problem = incompatibility(entry.manifest);
30
+ if (problem) logWarn(`Skipped ${entry.id}: ${problem}`);
31
+ return !problem;
32
+ });
33
+ if (!proposals.length) {
34
+ logOutro(ids.length ? `No updates for ${ids.join(", ")}.` : "Every installed extension is up to date.");
35
+ return;
36
+ }
37
+ const plural = proposals.length === 1 ? "" : "s";
38
+ logBlock(proposals.map(({ artifact }) => `${artifact.package} ${versions.get(artifact.package) ?? "not installed"} -> ${styleText("green", artifact.version)}`));
39
+ if (check) {
40
+ logOutro(`${proposals.length} update${plural} available. Run \`kubb update\` to install.`);
41
+ return;
42
+ }
43
+ const confirmed = yes || await clack.confirm({
44
+ message: `Install ${proposals.length} update${plural}?`,
45
+ initialValue: true
46
+ });
47
+ if (clack.isCancel(confirmed) || !confirmed) {
48
+ clack.cancel("Operation canceled.");
49
+ return;
50
+ }
51
+ const packageManager = detectPackageManager(cwd);
52
+ const specs = proposals.map(({ artifact }) => `${artifact.package}@${artifact.version}`);
53
+ logStep(`Installing ${specs.join(", ")} with ${packageManager.name}`);
54
+ await installPackages(specs, packageManager, cwd);
55
+ logInfo(`Updated ${specs.length} extension${plural}`);
56
+ logOutro(styleText("green", "Done"));
57
+ } catch (error) {
58
+ logError(getErrorMessage(error));
59
+ process.exitCode = 1;
60
+ }
61
+ }
62
+ //#endregion
63
+ export { run };
64
+
65
+ //# sourceMappingURL=run-B9wWJSSx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-B9wWJSSx.js","names":[],"sources":["../src/runners/update/run.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { getErrorMessage } from '@internals/utils'\nimport { readInstalledPackages } from '@kubb/core'\nimport { logBlock, logError, logInfo, logIntro, logOutro, logStep, logWarn } from '../../loggers/output.ts'\nimport { fetchRegistryIndex, incompatibility, isOutdated, registryUrl, toRegistryId } from '../../utils/registry.ts'\nimport { detectPackageManager, installPackages } from '../init/utils.ts'\n\nexport type UpdateOptions = {\n /**\n * Registry ids to update. Empty updates every installed extension the registry lists.\n */\n ids: Array<string>\n check: boolean\n yes: boolean\n}\n\n/**\n * Moves installed extensions to the version the registry pins. Lists the proposals, asks, then\n * installs them. With `check`, only lists them.\n */\nexport async function run({ ids, check, yes }: UpdateOptions): Promise<void> {\n const cwd = process.cwd()\n logIntro({ title: styleText('bgCyan', styleText('black', ' Kubb Update ')) })\n\n try {\n const wanted = new Set(ids.map(toRegistryId))\n const [entries, installed] = await Promise.all([fetchRegistryIndex({ registry: registryUrl() }), readInstalledPackages({ root: cwd })])\n const versions = new Map(installed.map((item) => [item.package, item.version]))\n\n const tracked = entries.filter((entry) => versions.has(entry.artifact.package) && (!wanted.size || wanted.has(entry.id)))\n for (const id of wanted) {\n if (!tracked.some((entry) => entry.id === id)) logWarn(`${id} is not installed, or not in the registry.`)\n }\n\n const proposals = tracked.filter((entry) => {\n if (!isOutdated({ installed: versions.get(entry.artifact.package), latest: entry.artifact.version })) return false\n const problem = incompatibility(entry.manifest)\n if (problem) logWarn(`Skipped ${entry.id}: ${problem}`)\n return !problem\n })\n\n if (!proposals.length) {\n logOutro(ids.length ? `No updates for ${ids.join(', ')}.` : 'Every installed extension is up to date.')\n return\n }\n\n const plural = proposals.length === 1 ? '' : 's'\n logBlock(\n proposals.map(({ artifact }) => `${artifact.package} ${versions.get(artifact.package) ?? 'not installed'} -> ${styleText('green', artifact.version)}`),\n )\n\n if (check) {\n logOutro(`${proposals.length} update${plural} available. Run \\`kubb update\\` to install.`)\n return\n }\n\n const confirmed = yes || (await clack.confirm({ message: `Install ${proposals.length} update${plural}?`, initialValue: true }))\n if (clack.isCancel(confirmed) || !confirmed) {\n clack.cancel('Operation canceled.')\n return\n }\n\n const packageManager = detectPackageManager(cwd)\n const specs = proposals.map(({ artifact }) => `${artifact.package}@${artifact.version}`)\n logStep(`Installing ${specs.join(', ')} with ${packageManager.name}`)\n await installPackages(specs, packageManager, cwd)\n\n logInfo(`Updated ${specs.length} extension${plural}`)\n logOutro(styleText('green', 'Done'))\n } catch (error) {\n logError(getErrorMessage(error))\n process.exitCode = 1\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,eAAsB,IAAI,EAAE,KAAK,OAAO,OAAqC;CAC3E,MAAM,MAAM,QAAQ,IAAI;CACxB,SAAS,EAAE,OAAO,UAAU,UAAU,UAAU,SAAS,eAAe,CAAC,EAAE,CAAC;CAE5E,IAAI;EACF,MAAM,SAAS,IAAI,IAAI,IAAI,IAAI,YAAY,CAAC;EAC5C,MAAM,CAAC,SAAS,aAAa,MAAM,QAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,YAAY,EAAE,CAAC,GAAG,sBAAsB,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;EACtI,MAAM,WAAW,IAAI,IAAI,UAAU,KAAK,SAAS,CAAC,KAAK,SAAS,KAAK,OAAO,CAAC,CAAC;EAE9E,MAAM,UAAU,QAAQ,QAAQ,UAAU,SAAS,IAAI,MAAM,SAAS,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,IAAI,MAAM,EAAE,EAAE;EACxH,KAAK,MAAM,MAAM,QACf,IAAI,CAAC,QAAQ,MAAM,UAAU,MAAM,OAAO,EAAE,GAAG,QAAQ,GAAG,GAAG,2CAA2C;EAG1G,MAAM,YAAY,QAAQ,QAAQ,UAAU;GAC1C,IAAI,CAAC,WAAW;IAAE,WAAW,SAAS,IAAI,MAAM,SAAS,OAAO;IAAG,QAAQ,MAAM,SAAS;GAAQ,CAAC,GAAG,OAAO;GAC7G,MAAM,UAAU,gBAAgB,MAAM,QAAQ;GAC9C,IAAI,SAAS,QAAQ,WAAW,MAAM,GAAG,IAAI,SAAS;GACtD,OAAO,CAAC;EACV,CAAC;EAED,IAAI,CAAC,UAAU,QAAQ;GACrB,SAAS,IAAI,SAAS,kBAAkB,IAAI,KAAK,IAAI,EAAE,KAAK,0CAA0C;GACtG;EACF;EAEA,MAAM,SAAS,UAAU,WAAW,IAAI,KAAK;EAC7C,SACE,UAAU,KAAK,EAAE,eAAe,GAAG,SAAS,QAAQ,IAAI,SAAS,IAAI,SAAS,OAAO,KAAK,gBAAgB,MAAM,UAAU,SAAS,SAAS,OAAO,GAAG,CACxJ;EAEA,IAAI,OAAO;GACT,SAAS,GAAG,UAAU,OAAO,SAAS,OAAO,4CAA4C;GACzF;EACF;EAEA,MAAM,YAAY,OAAQ,MAAM,MAAM,QAAQ;GAAE,SAAS,WAAW,UAAU,OAAO,SAAS,OAAO;GAAI,cAAc;EAAK,CAAC;EAC7H,IAAI,MAAM,SAAS,SAAS,KAAK,CAAC,WAAW;GAC3C,MAAM,OAAO,qBAAqB;GAClC;EACF;EAEA,MAAM,iBAAiB,qBAAqB,GAAG;EAC/C,MAAM,QAAQ,UAAU,KAAK,EAAE,eAAe,GAAG,SAAS,QAAQ,GAAG,SAAS,SAAS;EACvF,QAAQ,cAAc,MAAM,KAAK,IAAI,EAAE,QAAQ,eAAe,MAAM;EACpE,MAAM,gBAAgB,OAAO,gBAAgB,GAAG;EAEhD,QAAQ,WAAW,MAAM,OAAO,YAAY,QAAQ;EACpD,SAAS,UAAU,SAAS,MAAM,CAAC;CACrC,SAAS,OAAO;EACd,SAAS,gBAAgB,KAAK,CAAC;EAC/B,QAAQ,WAAW;CACrB;AACF"}
@@ -1,6 +1,6 @@
1
1
  const require_agent = require("./agent-DElUuYuy.cjs");
2
- const require_errors = require("./errors-CMbMAwyW.cjs");
3
- const require_Telemetry = require("./Telemetry-C2052gYB.cjs");
2
+ const require_errors = require("./errors-BdA8M78q.cjs");
3
+ const require_Telemetry = require("./Telemetry-D6v6WUtX.cjs");
4
4
  let node_util = require("node:util");
5
5
  let node_process = require("node:process");
6
6
  node_process = require_agent.__toESM(node_process, 1);
@@ -40,4 +40,4 @@ async function run({ input }) {
40
40
  //#endregion
41
41
  exports.run = run;
42
42
 
43
- //# sourceMappingURL=run-BaErHa3l.cjs.map
43
+ //# sourceMappingURL=run-BNfemif8.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-BaErHa3l.cjs","names":["trackRun","process","styleText","toError"],"sources":["../src/runners/validate/run.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { toError } from '@internals/utils'\nimport { trackRun } from '../../Telemetry.ts'\n\ntype ValidateOptions = {\n /**\n * Path or URL to the OpenAPI/Swagger file to validate.\n */\n input: string\n}\n\n/**\n * Validates an OpenAPI/Swagger file at `input` using `@kubb/adapter-oas`.\n * Exits the process with code 1 on validation failure or missing dependency.\n */\nexport async function run({ input }: ValidateOptions): Promise<void> {\n const report = trackRun({ command: 'validate', hrStart: process.hrtime() })\n\n try {\n const { adapterOas } = await import('@kubb/adapter-oas')\n\n const adapter = adapterOas()\n if (!adapter.validate) {\n throw new Error('The loaded adapter does not support validation.')\n }\n\n await adapter.validate(input, { throwOnError: true })\n await report({ status: 'success' })\n\n console.log('✅ Validation success')\n } catch (error) {\n await report({ status: 'failed' })\n if (error instanceof Error && /@kubb\\/adapter-oas/.test(error.message)) {\n console.error(styleText('red', 'The @kubb/adapter-oas package is not installed.'))\n console.error('')\n console.error('Install it with:')\n console.error(styleText('cyan', ' npm install @kubb/adapter-oas'))\n console.error(styleText('cyan', ' # or'))\n console.error(styleText('cyan', ' pnpm install @kubb/adapter-oas'))\n console.error('')\n }\n console.error('❌ Validation failed')\n console.error(toError(error).message)\n\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAsB,IAAI,EAAE,SAAyC;CACnE,MAAM,SAASA,kBAAAA,SAAS;EAAE,SAAS;EAAY,SAASC,aAAAA,QAAQ,OAAO;CAAE,CAAC;CAE1E,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EAEpC,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,QAAQ,UACX,MAAM,IAAI,MAAM,iDAAiD;EAGnE,MAAM,QAAQ,SAAS,OAAO,EAAE,cAAc,KAAK,CAAC;EACpD,MAAM,OAAO,EAAE,QAAQ,UAAU,CAAC;EAElC,QAAQ,IAAI,sBAAsB;CACpC,SAAS,OAAO;EACd,MAAM,OAAO,EAAE,QAAQ,SAAS,CAAC;EACjC,IAAI,iBAAiB,SAAS,qBAAqB,KAAK,MAAM,OAAO,GAAG;GACtE,QAAQ,OAAA,GAAMC,UAAAA,UAAAA,CAAU,OAAO,iDAAiD,CAAC;GACjF,QAAQ,MAAM,EAAE;GAChB,QAAQ,MAAM,kBAAkB;GAChC,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,iCAAiC,CAAC;GAClE,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,QAAQ,CAAC;GACzC,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,kCAAkC,CAAC;GACnE,QAAQ,MAAM,EAAE;EAClB;EACA,QAAQ,MAAM,qBAAqB;EACnC,QAAQ,MAAMC,eAAAA,QAAQ,KAAK,CAAC,CAAC,OAAO;EAEpC,aAAA,QAAQ,KAAK,CAAC;CAChB;AACF"}
1
+ {"version":3,"file":"run-BNfemif8.cjs","names":["trackRun","process","styleText","toError"],"sources":["../src/runners/validate/run.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { toError } from '@internals/utils'\nimport { trackRun } from '../../Telemetry.ts'\n\ntype ValidateOptions = {\n /**\n * Path or URL to the OpenAPI/Swagger file to validate.\n */\n input: string\n}\n\n/**\n * Validates an OpenAPI/Swagger file at `input` using `@kubb/adapter-oas`.\n * Exits the process with code 1 on validation failure or missing dependency.\n */\nexport async function run({ input }: ValidateOptions): Promise<void> {\n const report = trackRun({ command: 'validate', hrStart: process.hrtime() })\n\n try {\n const { adapterOas } = await import('@kubb/adapter-oas')\n\n const adapter = adapterOas()\n if (!adapter.validate) {\n throw new Error('The loaded adapter does not support validation.')\n }\n\n await adapter.validate(input, { throwOnError: true })\n await report({ status: 'success' })\n\n console.log('✅ Validation success')\n } catch (error) {\n await report({ status: 'failed' })\n if (error instanceof Error && /@kubb\\/adapter-oas/.test(error.message)) {\n console.error(styleText('red', 'The @kubb/adapter-oas package is not installed.'))\n console.error('')\n console.error('Install it with:')\n console.error(styleText('cyan', ' npm install @kubb/adapter-oas'))\n console.error(styleText('cyan', ' # or'))\n console.error(styleText('cyan', ' pnpm install @kubb/adapter-oas'))\n console.error('')\n }\n console.error('❌ Validation failed')\n console.error(toError(error).message)\n\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAsB,IAAI,EAAE,SAAyC;CACnE,MAAM,SAASA,kBAAAA,SAAS;EAAE,SAAS;EAAY,SAASC,aAAAA,QAAQ,OAAO;CAAE,CAAC;CAE1E,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EAEpC,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,QAAQ,UACX,MAAM,IAAI,MAAM,iDAAiD;EAGnE,MAAM,QAAQ,SAAS,OAAO,EAAE,cAAc,KAAK,CAAC;EACpD,MAAM,OAAO,EAAE,QAAQ,UAAU,CAAC;EAElC,QAAQ,IAAI,sBAAsB;CACpC,SAAS,OAAO;EACd,MAAM,OAAO,EAAE,QAAQ,SAAS,CAAC;EACjC,IAAI,iBAAiB,SAAS,qBAAqB,KAAK,MAAM,OAAO,GAAG;GACtE,QAAQ,OAAA,GAAMC,UAAAA,UAAAA,CAAU,OAAO,iDAAiD,CAAC;GACjF,QAAQ,MAAM,EAAE;GAChB,QAAQ,MAAM,kBAAkB;GAChC,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,iCAAiC,CAAC;GAClE,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,QAAQ,CAAC;GACzC,QAAQ,OAAA,GAAMA,UAAAA,UAAAA,CAAU,QAAQ,kCAAkC,CAAC;GACnE,QAAQ,MAAM,EAAE;EAClB;EACA,QAAQ,MAAM,qBAAqB;EACnC,QAAQ,MAAMC,eAAAA,QAAQ,KAAK,CAAC,CAAC,OAAO;EAEpC,aAAA,QAAQ,KAAK,CAAC;CAChB;AACF"}
@@ -0,0 +1,106 @@
1
+ import "./rolldown-runtime-CRm0XQPb.js";
2
+ import { t as getErrorMessage } from "./errors-DmC83ALX.js";
3
+ import { t as findConfigFile } from "./config-DAdYwK_D.js";
4
+ import { a as logInfo, d as logWarn, i as logError, l as logStep, o as logIntro, r as logBlock, s as logOutro } from "./output-B9Yw7vL0.js";
5
+ import { a as registryUrl, o as toRegistryId, r as incompatibility, t as fetchRegistryDetail } from "./registry-DjGepXb0.js";
6
+ import { i as installPackages, t as detectPackageManager } from "./utils-Dhx5PMpD.js";
7
+ import { styleText } from "node:util";
8
+ import process from "node:process";
9
+ import path from "node:path";
10
+ import * as clack from "@clack/prompts";
11
+ //#region src/runners/add/run.ts
12
+ /** The import and the `defineConfig` property to merge into `kubb.config.ts` by hand. */
13
+ function toSnippet({ artifact, manifest }) {
14
+ const call = `${manifest.export}()`;
15
+ const property = {
16
+ plugin: `plugins: [..., ${call}],`,
17
+ adapter: `adapter: ${call},`,
18
+ parser: `parsers: [..., ${call}],`
19
+ };
20
+ return [
21
+ `import { ${manifest.export} } from '${artifact.package}'`,
22
+ "",
23
+ property[manifest.kind]
24
+ ].join("\n");
25
+ }
26
+ /** Adds the plugin call and its import to the config file. Returns why it could not, or `undefined`. */
27
+ async function addToConfig({ detail, configFile }) {
28
+ const { artifact, manifest } = detail;
29
+ try {
30
+ const { writeConfigEdits } = await import("@kubb/studio");
31
+ const { outcomes } = await writeConfigEdits({
32
+ filePath: configFile,
33
+ edits: [{
34
+ operation: "add-plugin",
35
+ plugin: artifact.package,
36
+ importName: manifest.export
37
+ }],
38
+ extensions: /* @__PURE__ */ new Map([[artifact.package, {
39
+ package: artifact.package,
40
+ version: artifact.version,
41
+ manifest
42
+ }]])
43
+ });
44
+ return outcomes[0]?.applied ? void 0 : outcomes[0]?.reason ?? "the config file was not changed";
45
+ } catch (error) {
46
+ return getErrorMessage(error);
47
+ }
48
+ }
49
+ /**
50
+ * Installs an extension from the Kubb registry at its reviewed version and, for a plugin, adds it to
51
+ * `kubb.config.ts`. Refuses when the running Kubb or Node.js version is outside its compatibility.
52
+ */
53
+ async function run({ id: input, configPath, yes, install }) {
54
+ const cwd = process.cwd();
55
+ logIntro({ title: styleText("bgCyan", styleText("black", " Kubb Add ")) });
56
+ try {
57
+ const registry = registryUrl();
58
+ const detail = await fetchRegistryDetail({
59
+ id: toRegistryId(input),
60
+ registry
61
+ });
62
+ const { artifact, manifest } = detail;
63
+ const problem = incompatibility(manifest);
64
+ if (problem) throw new Error(problem);
65
+ const spec = `${artifact.package}@${artifact.version}`;
66
+ const configFile = manifest.kind === "plugin" ? configPath ? path.resolve(configPath) : findConfigFile(cwd) : void 0;
67
+ if (manifest.kind === "plugin" && !configFile) throw new Error("No kubb.config.ts found. Run `kubb init` first, or pass --config.");
68
+ logInfo(`${styleText("cyan", manifest.displayName)} (${manifest.kind}): ${manifest.description}`);
69
+ logBlock([install ? `Install ${styleText("cyan", spec)} as a dev dependency` : `Skip installing ${spec}`, configFile ? `Add ${styleText("cyan", `${manifest.export}()`)} to ${path.relative(cwd, configFile) || configFile}` : `Print the ${manifest.kind} snippet to add`]);
70
+ const confirmed = yes || await clack.confirm({
71
+ message: "Continue?",
72
+ initialValue: true
73
+ });
74
+ if (clack.isCancel(confirmed) || !confirmed) {
75
+ clack.cancel("Operation canceled.");
76
+ return;
77
+ }
78
+ if (install) {
79
+ const packageManager = detectPackageManager(cwd);
80
+ logStep(`Installing ${spec} with ${packageManager.name}`);
81
+ await installPackages([spec], packageManager, cwd);
82
+ }
83
+ const reason = configFile ? await addToConfig({
84
+ detail,
85
+ configFile
86
+ }) : `add the ${manifest.kind} to your config`;
87
+ if (!reason) {
88
+ logOutro(styleText("green", install ? `Added ${spec}` : `Added ${manifest.export}() to the config. Install ${spec} to use it.`));
89
+ return;
90
+ }
91
+ if (configFile) logWarn(`Could not edit ${configFile}: ${reason}`);
92
+ logBlock([
93
+ "Add the import to your Kubb config and merge the property into its defineConfig call:",
94
+ "",
95
+ toSnippet(detail)
96
+ ]);
97
+ logOutro(styleText("green", install ? `Installed ${spec}. Add it with the snippet above.` : `Install ${spec} and add the snippet above.`));
98
+ } catch (error) {
99
+ logError(getErrorMessage(error));
100
+ process.exitCode = 1;
101
+ }
102
+ }
103
+ //#endregion
104
+ export { run };
105
+
106
+ //# sourceMappingURL=run-BURZ4hDs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-BURZ4hDs.js","names":[],"sources":["../src/runners/add/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 { getErrorMessage } from '@internals/utils'\nimport type { ExtensionManifest, RegistryDetail } from '@kubb/core'\nimport { findConfigFile } from '../../config.ts'\nimport { logBlock, logError, logInfo, logIntro, logOutro, logStep, logWarn } from '../../loggers/output.ts'\nimport { fetchRegistryDetail, incompatibility, registryUrl, toRegistryId } from '../../utils/registry.ts'\nimport { detectPackageManager, installPackages } from '../init/utils.ts'\n\nexport type AddOptions = {\n /**\n * `owner/slug`, or a bare `slug` for an official extension.\n */\n id: string\n configPath?: string\n yes: boolean\n install: boolean\n}\n\n/** The import and the `defineConfig` property to merge into `kubb.config.ts` by hand. */\nexport function toSnippet({ artifact, manifest }: Pick<RegistryDetail, 'artifact' | 'manifest'>): string {\n const call = `${manifest.export}()`\n const property: Record<ExtensionManifest['kind'], string> = {\n plugin: `plugins: [..., ${call}],`,\n adapter: `adapter: ${call},`,\n parser: `parsers: [..., ${call}],`,\n }\n return [`import { ${manifest.export} } from '${artifact.package}'`, '', property[manifest.kind]].join('\\n')\n}\n\n/** Adds the plugin call and its import to the config file. Returns why it could not, or `undefined`. */\nasync function addToConfig({ detail, configFile }: { detail: RegistryDetail; configFile: string }): Promise<string | undefined> {\n const { artifact, manifest } = detail\n try {\n const { writeConfigEdits } = await import('@kubb/studio')\n const { outcomes } = await writeConfigEdits({\n filePath: configFile,\n edits: [{ operation: 'add-plugin', plugin: artifact.package, importName: manifest.export }],\n extensions: new Map([[artifact.package, { package: artifact.package, version: artifact.version, manifest }]]),\n })\n return outcomes[0]?.applied ? undefined : (outcomes[0]?.reason ?? 'the config file was not changed')\n } catch (error) {\n return getErrorMessage(error)\n }\n}\n\n/**\n * Installs an extension from the Kubb registry at its reviewed version and, for a plugin, adds it to\n * `kubb.config.ts`. Refuses when the running Kubb or Node.js version is outside its compatibility.\n */\nexport async function run({ id: input, configPath, yes, install }: AddOptions): Promise<void> {\n const cwd = process.cwd()\n logIntro({ title: styleText('bgCyan', styleText('black', ' Kubb Add ')) })\n\n try {\n const registry = registryUrl()\n const detail = await fetchRegistryDetail({ id: toRegistryId(input), registry })\n const { artifact, manifest } = detail\n\n const problem = incompatibility(manifest)\n if (problem) throw new Error(problem)\n\n const spec = `${artifact.package}@${artifact.version}`\n const configFile = manifest.kind === 'plugin' ? (configPath ? path.resolve(configPath) : findConfigFile(cwd)) : undefined\n if (manifest.kind === 'plugin' && !configFile) throw new Error('No kubb.config.ts found. Run `kubb init` first, or pass --config.')\n\n logInfo(`${styleText('cyan', manifest.displayName)} (${manifest.kind}): ${manifest.description}`)\n logBlock([\n install ? `Install ${styleText('cyan', spec)} as a dev dependency` : `Skip installing ${spec}`,\n configFile\n ? `Add ${styleText('cyan', `${manifest.export}()`)} to ${path.relative(cwd, configFile) || configFile}`\n : `Print the ${manifest.kind} snippet to add`,\n ])\n\n const confirmed = yes || (await clack.confirm({ message: 'Continue?', initialValue: true }))\n if (clack.isCancel(confirmed) || !confirmed) {\n clack.cancel('Operation canceled.')\n return\n }\n\n if (install) {\n const packageManager = detectPackageManager(cwd)\n logStep(`Installing ${spec} with ${packageManager.name}`)\n await installPackages([spec], packageManager, cwd)\n }\n\n const reason = configFile ? await addToConfig({ detail, configFile }) : `add the ${manifest.kind} to your config`\n if (!reason) {\n logOutro(styleText('green', install ? `Added ${spec}` : `Added ${manifest.export}() to the config. Install ${spec} to use it.`))\n return\n }\n\n if (configFile) logWarn(`Could not edit ${configFile}: ${reason}`)\n logBlock(['Add the import to your Kubb config and merge the property into its defineConfig call:', '', toSnippet(detail)])\n logOutro(styleText('green', install ? `Installed ${spec}. Add it with the snippet above.` : `Install ${spec} and add the snippet above.`))\n } catch (error) {\n logError(getErrorMessage(error))\n process.exitCode = 1\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,SAAgB,UAAU,EAAE,UAAU,YAAmE;CACvG,MAAM,OAAO,GAAG,SAAS,OAAO;CAChC,MAAM,WAAsD;EAC1D,QAAQ,kBAAkB,KAAK;EAC/B,SAAS,YAAY,KAAK;EAC1B,QAAQ,kBAAkB,KAAK;CACjC;CACA,OAAO;EAAC,YAAY,SAAS,OAAO,WAAW,SAAS,QAAQ;EAAI;EAAI,SAAS,SAAS;CAAK,CAAC,CAAC,KAAK,IAAI;AAC5G;;AAGA,eAAe,YAAY,EAAE,QAAQ,cAA2F;CAC9H,MAAM,EAAE,UAAU,aAAa;CAC/B,IAAI;EACF,MAAM,EAAE,qBAAqB,MAAM,OAAO;EAC1C,MAAM,EAAE,aAAa,MAAM,iBAAiB;GAC1C,UAAU;GACV,OAAO,CAAC;IAAE,WAAW;IAAc,QAAQ,SAAS;IAAS,YAAY,SAAS;GAAO,CAAC;GAC1F,4BAAY,IAAI,IAAI,CAAC,CAAC,SAAS,SAAS;IAAE,SAAS,SAAS;IAAS,SAAS,SAAS;IAAS;GAAS,CAAC,CAAC,CAAC;EAC9G,CAAC;EACD,OAAO,SAAS,EAAE,EAAE,UAAU,KAAA,IAAa,SAAS,EAAE,EAAE,UAAU;CACpE,SAAS,OAAO;EACd,OAAO,gBAAgB,KAAK;CAC9B;AACF;;;;;AAMA,eAAsB,IAAI,EAAE,IAAI,OAAO,YAAY,KAAK,WAAsC;CAC5F,MAAM,MAAM,QAAQ,IAAI;CACxB,SAAS,EAAE,OAAO,UAAU,UAAU,UAAU,SAAS,YAAY,CAAC,EAAE,CAAC;CAEzE,IAAI;EACF,MAAM,WAAW,YAAY;EAC7B,MAAM,SAAS,MAAM,oBAAoB;GAAE,IAAI,aAAa,KAAK;GAAG;EAAS,CAAC;EAC9E,MAAM,EAAE,UAAU,aAAa;EAE/B,MAAM,UAAU,gBAAgB,QAAQ;EACxC,IAAI,SAAS,MAAM,IAAI,MAAM,OAAO;EAEpC,MAAM,OAAO,GAAG,SAAS,QAAQ,GAAG,SAAS;EAC7C,MAAM,aAAa,SAAS,SAAS,WAAY,aAAa,KAAK,QAAQ,UAAU,IAAI,eAAe,GAAG,IAAK,KAAA;EAChH,IAAI,SAAS,SAAS,YAAY,CAAC,YAAY,MAAM,IAAI,MAAM,mEAAmE;EAElI,QAAQ,GAAG,UAAU,QAAQ,SAAS,WAAW,EAAE,IAAI,SAAS,KAAK,KAAK,SAAS,aAAa;EAChG,SAAS,CACP,UAAU,WAAW,UAAU,QAAQ,IAAI,EAAE,wBAAwB,mBAAmB,QACxF,aACI,OAAO,UAAU,QAAQ,GAAG,SAAS,OAAO,GAAG,EAAE,MAAM,KAAK,SAAS,KAAK,UAAU,KAAK,eACzF,aAAa,SAAS,KAAK,gBACjC,CAAC;EAED,MAAM,YAAY,OAAQ,MAAM,MAAM,QAAQ;GAAE,SAAS;GAAa,cAAc;EAAK,CAAC;EAC1F,IAAI,MAAM,SAAS,SAAS,KAAK,CAAC,WAAW;GAC3C,MAAM,OAAO,qBAAqB;GAClC;EACF;EAEA,IAAI,SAAS;GACX,MAAM,iBAAiB,qBAAqB,GAAG;GAC/C,QAAQ,cAAc,KAAK,QAAQ,eAAe,MAAM;GACxD,MAAM,gBAAgB,CAAC,IAAI,GAAG,gBAAgB,GAAG;EACnD;EAEA,MAAM,SAAS,aAAa,MAAM,YAAY;GAAE;GAAQ;EAAW,CAAC,IAAI,WAAW,SAAS,KAAK;EACjG,IAAI,CAAC,QAAQ;GACX,SAAS,UAAU,SAAS,UAAU,SAAS,SAAS,SAAS,SAAS,OAAO,4BAA4B,KAAK,YAAY,CAAC;GAC/H;EACF;EAEA,IAAI,YAAY,QAAQ,kBAAkB,WAAW,IAAI,QAAQ;EACjE,SAAS;GAAC;GAAyF;GAAI,UAAU,MAAM;EAAC,CAAC;EACzH,SAAS,UAAU,SAAS,UAAU,aAAa,KAAK,oCAAoC,WAAW,KAAK,4BAA4B,CAAC;CAC3I,SAAS,OAAO;EACd,SAAS,gBAAgB,KAAK,CAAC;EAC/B,QAAQ,WAAW;CACrB;AACF"}
@@ -0,0 +1,72 @@
1
+ const require_agent = require("./agent-DElUuYuy.cjs");
2
+ const require_errors = require("./errors-BdA8M78q.cjs");
3
+ const require_output = require("./output-CWupdozw.cjs");
4
+ const require_registry = require("./registry-CCKUL3ps.cjs");
5
+ let node_util = require("node:util");
6
+ let node_process = require("node:process");
7
+ node_process = require_agent.__toESM(node_process, 1);
8
+ let _kubb_core = require("@kubb/core");
9
+ //#region src/runners/list/run.ts
10
+ /**
11
+ * The installed packages that ship a `kubb-extension.json` or have a registry entry, with the
12
+ * version the registry pins.
13
+ */
14
+ async function listExtensions({ cwd, registry }) {
15
+ const [installed, entries] = await Promise.all([(0, _kubb_core.readInstalledPackages)({ root: cwd }), require_registry.fetchRegistryIndex({ registry }).catch((error) => {
16
+ require_output.logWarn(`Showing installed extensions only: ${require_errors.getErrorMessage(error)}`);
17
+ return [];
18
+ })]);
19
+ const byPackage = new Map(entries.map((entry) => [entry.artifact.package, entry]));
20
+ return installed.flatMap(({ package: name, version, manifest }) => {
21
+ const entry = byPackage.get(name);
22
+ if (!entry && !manifest) return [];
23
+ const latest = entry?.artifact.version;
24
+ return [{
25
+ id: entry?.id,
26
+ package: name,
27
+ installed: version,
28
+ registry: latest,
29
+ update: !!latest && require_registry.isOutdated({
30
+ installed: version,
31
+ latest
32
+ })
33
+ }];
34
+ });
35
+ }
36
+ /** Prints the installed extensions as a table. */
37
+ async function run() {
38
+ try {
39
+ const rows = await listExtensions({
40
+ cwd: node_process.default.cwd(),
41
+ registry: require_registry.registryUrl()
42
+ });
43
+ if (!rows.length) {
44
+ require_output.logOutro("No installed extensions found.");
45
+ return;
46
+ }
47
+ const header = [
48
+ "ID",
49
+ "PACKAGE",
50
+ "INSTALLED",
51
+ "REGISTRY",
52
+ "UPDATE"
53
+ ];
54
+ const cells = rows.map((row) => [
55
+ row.id ?? "-",
56
+ row.package,
57
+ row.installed ?? "-",
58
+ row.registry ?? "-",
59
+ row.update ? "yes" : "no"
60
+ ]);
61
+ const widths = header.map((title, index) => Math.max(title.length, ...cells.map((cell) => cell[index].length)));
62
+ const line = (cell) => cell.map((value, index) => value.padEnd(widths[index])).join(" ").trimEnd();
63
+ require_output.logBlock([(0, node_util.styleText)("dim", line(header)), ...cells.map(line)]);
64
+ } catch (error) {
65
+ require_output.logError(require_errors.getErrorMessage(error));
66
+ node_process.default.exitCode = 1;
67
+ }
68
+ }
69
+ //#endregion
70
+ exports.run = run;
71
+
72
+ //# sourceMappingURL=run-BaFyksnF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-BaFyksnF.cjs","names":["readInstalledPackages","fetchRegistryIndex","getErrorMessage","isOutdated","process","registryUrl","styleText"],"sources":["../src/runners/list/run.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { getErrorMessage } from '@internals/utils'\nimport { readInstalledPackages, type RegistryEntry } from '@kubb/core'\nimport { logBlock, logError, logOutro, logWarn } from '../../loggers/output.ts'\nimport { fetchRegistryIndex, isOutdated, registryUrl } from '../../utils/registry.ts'\n\nexport type ListRow = {\n id?: string\n package: string\n installed?: string\n registry?: string\n update: boolean\n}\n\n/**\n * The installed packages that ship a `kubb-extension.json` or have a registry entry, with the\n * version the registry pins.\n */\nexport async function listExtensions({ cwd, registry }: { cwd: string; registry: string }): Promise<Array<ListRow>> {\n const [installed, entries] = await Promise.all([\n readInstalledPackages({ root: cwd }),\n fetchRegistryIndex({ registry }).catch((error: unknown): Array<RegistryEntry> => {\n logWarn(`Showing installed extensions only: ${getErrorMessage(error)}`)\n return []\n }),\n ])\n const byPackage = new Map(entries.map((entry) => [entry.artifact.package, entry]))\n\n return installed.flatMap(({ package: name, version, manifest }): Array<ListRow> => {\n const entry = byPackage.get(name)\n if (!entry && !manifest) return []\n const latest = entry?.artifact.version\n return [{ id: entry?.id, package: name, installed: version, registry: latest, update: !!latest && isOutdated({ installed: version, latest }) }]\n })\n}\n\n/** Prints the installed extensions as a table. */\nexport async function run(): Promise<void> {\n try {\n const rows = await listExtensions({ cwd: process.cwd(), registry: registryUrl() })\n if (!rows.length) {\n logOutro('No installed extensions found.')\n return\n }\n\n const header = ['ID', 'PACKAGE', 'INSTALLED', 'REGISTRY', 'UPDATE']\n const cells = rows.map((row) => [row.id ?? '-', row.package, row.installed ?? '-', row.registry ?? '-', row.update ? 'yes' : 'no'])\n const widths = header.map((title, index) => Math.max(title.length, ...cells.map((cell) => cell[index]!.length)))\n const line = (cell: Array<string>) =>\n cell\n .map((value, index) => value.padEnd(widths[index]!))\n .join(' ')\n .trimEnd()\n\n logBlock([styleText('dim', line(header)), ...cells.map(line)])\n } catch (error) {\n logError(getErrorMessage(error))\n process.exitCode = 1\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,eAAsB,eAAe,EAAE,KAAK,YAAwE;CAClH,MAAM,CAAC,WAAW,WAAW,MAAM,QAAQ,IAAI,EAAA,GAC7CA,WAAAA,sBAAAA,CAAsB,EAAE,MAAM,IAAI,CAAC,GACnCC,iBAAAA,mBAAmB,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,UAAyC;EAC/E,eAAA,QAAQ,sCAAsCC,eAAAA,gBAAgB,KAAK,GAAG;EACtE,OAAO,CAAC;CACV,CAAC,CACH,CAAC;CACD,MAAM,YAAY,IAAI,IAAI,QAAQ,KAAK,UAAU,CAAC,MAAM,SAAS,SAAS,KAAK,CAAC,CAAC;CAEjF,OAAO,UAAU,SAAS,EAAE,SAAS,MAAM,SAAS,eAA+B;EACjF,MAAM,QAAQ,UAAU,IAAI,IAAI;EAChC,IAAI,CAAC,SAAS,CAAC,UAAU,OAAO,CAAC;EACjC,MAAM,SAAS,OAAO,SAAS;EAC/B,OAAO,CAAC;GAAE,IAAI,OAAO;GAAI,SAAS;GAAM,WAAW;GAAS,UAAU;GAAQ,QAAQ,CAAC,CAAC,UAAUC,iBAAAA,WAAW;IAAE,WAAW;IAAS;GAAO,CAAC;EAAE,CAAC;CAChJ,CAAC;AACH;;AAGA,eAAsB,MAAqB;CACzC,IAAI;EACF,MAAM,OAAO,MAAM,eAAe;GAAE,KAAKC,aAAAA,QAAQ,IAAI;GAAG,UAAUC,iBAAAA,YAAY;EAAE,CAAC;EACjF,IAAI,CAAC,KAAK,QAAQ;GAChB,eAAA,SAAS,gCAAgC;GACzC;EACF;EAEA,MAAM,SAAS;GAAC;GAAM;GAAW;GAAa;GAAY;EAAQ;EAClE,MAAM,QAAQ,KAAK,KAAK,QAAQ;GAAC,IAAI,MAAM;GAAK,IAAI;GAAS,IAAI,aAAa;GAAK,IAAI,YAAY;GAAK,IAAI,SAAS,QAAQ;EAAI,CAAC;EAClI,MAAM,SAAS,OAAO,KAAK,OAAO,UAAU,KAAK,IAAI,MAAM,QAAQ,GAAG,MAAM,KAAK,SAAS,KAAK,MAAM,CAAE,MAAM,CAAC,CAAC;EAC/G,MAAM,QAAQ,SACZ,KACG,KAAK,OAAO,UAAU,MAAM,OAAO,OAAO,MAAO,CAAC,CAAC,CACnD,KAAK,IAAI,CAAC,CACV,QAAQ;EAEb,eAAA,SAAS,EAAA,GAACC,UAAAA,UAAAA,CAAU,OAAO,KAAK,MAAM,CAAC,GAAG,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC;CAC/D,SAAS,OAAO;EACd,eAAA,SAASJ,eAAAA,gBAAgB,KAAK,CAAC;EAC/B,aAAA,QAAA,WAAmB;CACrB;AACF"}
@@ -1,9 +1,10 @@
1
1
  const require_agent = require("./agent-DElUuYuy.cjs");
2
- const require_errors = require("./errors-CMbMAwyW.cjs");
3
- const require_Telemetry = require("./Telemetry-C2052gYB.cjs");
4
- const require_output = require("./output-DekB5lg3.cjs");
5
- const require_config = require("./config-DX176_YM.cjs");
2
+ const require_errors = require("./errors-BdA8M78q.cjs");
3
+ const require_Telemetry = require("./Telemetry-D6v6WUtX.cjs");
6
4
  const require_constants = require("./constants-CdxpgX3_.cjs");
5
+ const require_config = require("./config-CRBZcWwg.cjs");
6
+ const require_output = require("./output-CWupdozw.cjs");
7
+ const require_reporters = require("./reporters-C5HAypFq.cjs");
7
8
  let node_util = require("node:util");
8
9
  let node_crypto = require("node:crypto");
9
10
  let node_os = require("node:os");
@@ -12,9 +13,9 @@ node_process = require_agent.__toESM(node_process, 1);
12
13
  let tinyexec = require("tinyexec");
13
14
  let node_path = require("node:path");
14
15
  node_path = require_agent.__toESM(node_path, 1);
15
- let _kubb_core = require("@kubb/core");
16
16
  let _clack_prompts = require("@clack/prompts");
17
17
  _clack_prompts = require_agent.__toESM(_clack_prompts, 1);
18
+ let _kubb_core = require("@kubb/core");
18
19
  let _kubb_studio = require("@kubb/studio");
19
20
  //#region ../../internals/utils/src/openInBrowser.ts
20
21
  const ignore = () => {};
@@ -281,7 +282,7 @@ async function connect(options, context = {}) {
281
282
  }
282
283
  try {
283
284
  if (!context.prepared) {
284
- const { getWorkerStatus } = await Promise.resolve().then(() => require("./background-DFGFUYGe.cjs"));
285
+ const { getWorkerStatus } = await Promise.resolve().then(() => require("./background-B-5uPpUT.cjs"));
285
286
  if ((await getWorkerStatus()).running) throw new Error("This project is running in the background. Run `kubb studio stop` first.");
286
287
  }
287
288
  const prepared = context.prepared ?? await prepareConnection(options, signal);
@@ -290,7 +291,7 @@ async function connect(options, context = {}) {
290
291
  let hinted = false;
291
292
  let pairedAgain = false;
292
293
  const hooks = new _kubb_core.Hookable();
293
- require_config.setupReporters(hooks, {
294
+ require_reporters.setupReporters(hooks, {
294
295
  logLevel: _kubb_core.logLevel[options.logLevel ?? "info"],
295
296
  reporters: [_kubb_core.cliReporter],
296
297
  ...context.onState ? { logger: require_output.plainLogger } : {}
@@ -423,4 +424,4 @@ Object.defineProperty(exports, "run", {
423
424
  }
424
425
  });
425
426
 
426
- //# sourceMappingURL=run-BSPA8JKH.cjs.map
427
+ //# sourceMappingURL=run-BbSYIW7v.cjs.map