@kubb/cli 5.0.0-alpha.70 → 5.0.0-alpha.71

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 (44) hide show
  1. package/dist/{agent-BCAFu93m.cjs → agent-D5OIwM0z.cjs} +2 -2
  2. package/dist/{agent-BCAFu93m.cjs.map → agent-D5OIwM0z.cjs.map} +1 -1
  3. package/dist/{agent-DGfH5C-Q.js → agent-DypvJBwO.js} +2 -2
  4. package/dist/{agent-DGfH5C-Q.js.map → agent-DypvJBwO.js.map} +1 -1
  5. package/dist/{generate-BE_BvWOw.cjs → generate-BW0J1wvg.cjs} +2 -2
  6. package/dist/{generate-BE_BvWOw.cjs.map → generate-BW0J1wvg.cjs.map} +1 -1
  7. package/dist/{generate-DWsOs080.cjs → generate-CLYhWYY1.cjs} +12 -12
  8. package/dist/generate-CLYhWYY1.cjs.map +1 -0
  9. package/dist/{generate-C3RN-5gL.js → generate-Cy11Ra5n.js} +2 -2
  10. package/dist/{generate-C3RN-5gL.js.map → generate-Cy11Ra5n.js.map} +1 -1
  11. package/dist/{generate-BRT5SVxO.js → generate-DfhKa1mG.js} +12 -12
  12. package/dist/{generate-BRT5SVxO.js.map → generate-DfhKa1mG.js.map} +1 -1
  13. package/dist/index.cjs +6 -6
  14. package/dist/index.js +6 -6
  15. package/dist/{init-CliE4oZa.cjs → init-C_EgqqO4.cjs} +2 -2
  16. package/dist/{init-CliE4oZa.cjs.map → init-C_EgqqO4.cjs.map} +1 -1
  17. package/dist/{init-BoMB8wCQ.js → init-CaQZcAvy.js} +2 -2
  18. package/dist/{init-BoMB8wCQ.js.map → init-CaQZcAvy.js.map} +1 -1
  19. package/dist/{mcp-M4g4NSVW.js → mcp-7rBVhoQz.js} +3 -3
  20. package/dist/{mcp-M4g4NSVW.js.map → mcp-7rBVhoQz.js.map} +1 -1
  21. package/dist/{mcp-DTg9tJ7Z.cjs → mcp-CmXrXzDF.cjs} +3 -3
  22. package/dist/{mcp-DTg9tJ7Z.cjs.map → mcp-CmXrXzDF.cjs.map} +1 -1
  23. package/dist/{mcp-C-HbwyVA.js → mcp-nlFo36z0.js} +2 -10
  24. package/dist/mcp-nlFo36z0.js.map +1 -0
  25. package/dist/{mcp-BCLUiocM.cjs → mcp-vi8t2Rkb.cjs} +2 -9
  26. package/dist/mcp-vi8t2Rkb.cjs.map +1 -0
  27. package/dist/package-BD90dOVc.js +6 -0
  28. package/dist/package-BD90dOVc.js.map +1 -0
  29. package/dist/{package-C1GUEFG8.cjs → package-DsKVMEXO.cjs} +2 -2
  30. package/dist/package-DsKVMEXO.cjs.map +1 -0
  31. package/dist/{validate-DMJZDsJ7.cjs → validate-BZKRjT0Y.cjs} +2 -2
  32. package/dist/{validate-DMJZDsJ7.cjs.map → validate-BZKRjT0Y.cjs.map} +1 -1
  33. package/dist/{validate-bW2wdaM8.js → validate-RG85Fqjh.js} +2 -2
  34. package/dist/{validate-bW2wdaM8.js.map → validate-RG85Fqjh.js.map} +1 -1
  35. package/package.json +6 -6
  36. package/src/runners/mcp.ts +1 -4
  37. package/src/utils/getCosmiConfig.ts +13 -10
  38. package/dist/generate-DWsOs080.cjs.map +0 -1
  39. package/dist/mcp-BCLUiocM.cjs.map +0 -1
  40. package/dist/mcp-C-HbwyVA.js.map +0 -1
  41. package/dist/package-C1GUEFG8.cjs.map +0 -1
  42. package/dist/package-CdqSi3-7.js +0 -6
  43. package/dist/package-CdqSi3-7.js.map +0 -1
  44. package/src/utils/jiti.ts +0 -9
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-ByKO4r7w.cjs");
3
3
  const require_define = require("./define-Bdn8j5VM.cjs");
4
4
  const require_telemetry = require("./telemetry-kmnc5OAT.cjs");
5
- const require_package = require("./package-C1GUEFG8.cjs");
5
+ const require_package = require("./package-DsKVMEXO.cjs");
6
6
  const require_constants = require("./constants-BgLUQ1nx.cjs");
7
7
  let node_util = require("node:util");
8
8
  //#region ../../internals/utils/src/cli/schema.ts
@@ -246,11 +246,11 @@ function shouldShowTelemetryNotice(argv) {
246
246
  }
247
247
  async function run(argv = process.argv) {
248
248
  if (shouldShowTelemetryNotice(argv)) console.log(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
249
- const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-BE_BvWOw.cjs"));
250
- const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-DMJZDsJ7.cjs"));
251
- const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-DTg9tJ7Z.cjs"));
252
- const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-BCAFu93m.cjs"));
253
- const { command: initCommand } = await Promise.resolve().then(() => require("./init-CliE4oZa.cjs"));
249
+ const { command: generateCommand } = await Promise.resolve().then(() => require("./generate-BW0J1wvg.cjs"));
250
+ const { command: validateCommand } = await Promise.resolve().then(() => require("./validate-BZKRjT0Y.cjs"));
251
+ const { command: mcpCommand } = await Promise.resolve().then(() => require("./mcp-CmXrXzDF.cjs"));
252
+ const { command: agentCommand } = await Promise.resolve().then(() => require("./agent-D5OIwM0z.cjs"));
253
+ const { command: initCommand } = await Promise.resolve().then(() => require("./init-C_EgqqO4.cjs"));
254
254
  await cli.run([
255
255
  generateCommand,
256
256
  validateCommand,
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./chunk--u3MIqq1.js";
2
2
  import { t as defineCLIAdapter } from "./define-Ctii4bel.js";
3
3
  import { n as isTelemetryDisabled } from "./telemetry-CS5ZE0cN.js";
4
- import { t as version } from "./package-CdqSi3-7.js";
4
+ import { t as version } from "./package-BD90dOVc.js";
5
5
  import { i as QUIET_FLAGS } from "./constants-mIdg9ls2.js";
6
6
  import { parseArgs, styleText } from "node:util";
7
7
  //#region ../../internals/utils/src/cli/schema.ts
@@ -245,11 +245,11 @@ function shouldShowTelemetryNotice(argv) {
245
245
  }
246
246
  async function run(argv = process.argv) {
247
247
  if (shouldShowTelemetryNotice(argv)) console.log(`${styleText("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
248
- const { command: generateCommand } = await import("./generate-C3RN-5gL.js");
249
- const { command: validateCommand } = await import("./validate-bW2wdaM8.js");
250
- const { command: mcpCommand } = await import("./mcp-M4g4NSVW.js");
251
- const { command: agentCommand } = await import("./agent-DGfH5C-Q.js");
252
- const { command: initCommand } = await import("./init-BoMB8wCQ.js");
248
+ const { command: generateCommand } = await import("./generate-Cy11Ra5n.js");
249
+ const { command: validateCommand } = await import("./validate-RG85Fqjh.js");
250
+ const { command: mcpCommand } = await import("./mcp-7rBVhoQz.js");
251
+ const { command: agentCommand } = await import("./agent-DypvJBwO.js");
252
+ const { command: initCommand } = await import("./init-CaQZcAvy.js");
253
253
  await cli.run([
254
254
  generateCommand,
255
255
  validateCommand,
@@ -1,6 +1,6 @@
1
1
  require("./chunk-ByKO4r7w.cjs");
2
2
  const require_define = require("./define-Bdn8j5VM.cjs");
3
- const require_package = require("./package-C1GUEFG8.cjs");
3
+ const require_package = require("./package-DsKVMEXO.cjs");
4
4
  //#region src/commands/init.ts
5
5
  const command = require_define.defineCommand({
6
6
  name: "init",
@@ -22,4 +22,4 @@ const command = require_define.defineCommand({
22
22
  //#endregion
23
23
  exports.command = command;
24
24
 
25
- //# sourceMappingURL=init-CliE4oZa.cjs.map
25
+ //# sourceMappingURL=init-C_EgqqO4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-CliE4oZa.cjs","names":["defineCommand"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description: 'Initialize a new Kubb project with interactive setup',\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n },\n async run({ values }) {\n const { runInit } = await import('../runners/init.ts')\n\n await runInit({ yes: values.yes, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,KAAK;EACH,MAAM;EACN,aAAa;EACb,OAAO;EACP,SAAS;EACV,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,YAAY,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,sBAAA,CAAA;AAE1B,QAAM,QAAQ;GAAE,KAAK,OAAO;GAAK,SAAA,gBAAA;GAAS,CAAC;;CAE9C,CAAC"}
1
+ {"version":3,"file":"init-C_EgqqO4.cjs","names":["defineCommand"],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description: 'Initialize a new Kubb project with interactive setup',\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n },\n async run({ values }) {\n const { runInit } = await import('../runners/init.ts')\n\n await runInit({ yes: values.yes, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,KAAK;EACH,MAAM;EACN,aAAa;EACb,OAAO;EACP,SAAS;EACV,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,YAAY,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,sBAAA,CAAA;AAE1B,QAAM,QAAQ;GAAE,KAAK,OAAO;GAAK,SAAA,gBAAA;GAAS,CAAC;;CAE9C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import "./chunk--u3MIqq1.js";
2
2
  import { n as defineCommand } from "./define-Ctii4bel.js";
3
- import { t as version } from "./package-CdqSi3-7.js";
3
+ import { t as version } from "./package-BD90dOVc.js";
4
4
  //#region src/commands/init.ts
5
5
  const command = defineCommand({
6
6
  name: "init",
@@ -22,4 +22,4 @@ const command = defineCommand({
22
22
  //#endregion
23
23
  export { command };
24
24
 
25
- //# sourceMappingURL=init-BoMB8wCQ.js.map
25
+ //# sourceMappingURL=init-CaQZcAvy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-BoMB8wCQ.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description: 'Initialize a new Kubb project with interactive setup',\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n },\n async run({ values }) {\n const { runInit } = await import('../runners/init.ts')\n\n await runInit({ yes: values.yes, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,KAAK;EACH,MAAM;EACN,aAAa;EACb,OAAO;EACP,SAAS;EACV,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,YAAY,MAAM,OAAO;AAEjC,QAAM,QAAQ;GAAE,KAAK,OAAO;GAAK;GAAS,CAAC;;CAE9C,CAAC"}
1
+ {"version":3,"file":"init-CaQZcAvy.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'init',\n description: 'Initialize a new Kubb project with interactive setup',\n options: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n },\n async run({ values }) {\n const { runInit } = await import('../runners/init.ts')\n\n await runInit({ yes: values.yes, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,KAAK;EACH,MAAM;EACN,aAAa;EACb,OAAO;EACP,SAAS;EACV,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,YAAY,MAAM,OAAO;AAEjC,QAAM,QAAQ;GAAE,KAAK,OAAO;GAAK;GAAS,CAAC;;CAE9C,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import "./chunk--u3MIqq1.js";
2
2
  import { n as defineCommand } from "./define-Ctii4bel.js";
3
- import { t as version } from "./package-CdqSi3-7.js";
3
+ import { t as version } from "./package-BD90dOVc.js";
4
4
  //#region src/commands/mcp.ts
5
5
  const command = defineCommand({
6
6
  name: "mcp",
7
7
  description: "Start the server to enable the MCP client to interact with the LLM.",
8
8
  async run() {
9
- const { runMcp } = await import("./mcp-C-HbwyVA.js");
9
+ const { runMcp } = await import("./mcp-nlFo36z0.js");
10
10
  await runMcp({ version });
11
11
  }
12
12
  });
13
13
  //#endregion
14
14
  export { command };
15
15
 
16
- //# sourceMappingURL=mcp-M4g4NSVW.js.map
16
+ //# sourceMappingURL=mcp-7rBVhoQz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-M4g4NSVW.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description: 'Start the server to enable the MCP client to interact with the LLM.',\n async run() {\n const { runMcp } = await import('../runners/mcp.ts')\n\n await runMcp({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,MAAM,MAAM;EACV,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,QAAM,OAAO,EAAE,SAAS,CAAC;;CAE5B,CAAC"}
1
+ {"version":3,"file":"mcp-7rBVhoQz.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description: 'Start the server to enable the MCP client to interact with the LLM.',\n async run() {\n const { runMcp } = await import('../runners/mcp.ts')\n\n await runMcp({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,MAAM,MAAM;EACV,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,QAAM,OAAO,EAAE,SAAS,CAAC;;CAE5B,CAAC"}
@@ -1,16 +1,16 @@
1
1
  require("./chunk-ByKO4r7w.cjs");
2
2
  const require_define = require("./define-Bdn8j5VM.cjs");
3
- const require_package = require("./package-C1GUEFG8.cjs");
3
+ const require_package = require("./package-DsKVMEXO.cjs");
4
4
  //#region src/commands/mcp.ts
5
5
  const command = require_define.defineCommand({
6
6
  name: "mcp",
7
7
  description: "Start the server to enable the MCP client to interact with the LLM.",
8
8
  async run() {
9
- const { runMcp } = await Promise.resolve().then(() => require("./mcp-BCLUiocM.cjs"));
9
+ const { runMcp } = await Promise.resolve().then(() => require("./mcp-vi8t2Rkb.cjs"));
10
10
  await runMcp({ version: require_package.version });
11
11
  }
12
12
  });
13
13
  //#endregion
14
14
  exports.command = command;
15
15
 
16
- //# sourceMappingURL=mcp-DTg9tJ7Z.cjs.map
16
+ //# sourceMappingURL=mcp-CmXrXzDF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-DTg9tJ7Z.cjs","names":["defineCommand"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description: 'Start the server to enable the MCP client to interact with the LLM.',\n async run() {\n const { runMcp } = await import('../runners/mcp.ts')\n\n await runMcp({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,MAAM,MAAM;EACV,MAAM,EAAE,WAAW,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;AAEzB,QAAM,OAAO,EAAE,SAAA,gBAAA,SAAS,CAAC;;CAE5B,CAAC"}
1
+ {"version":3,"file":"mcp-CmXrXzDF.cjs","names":["defineCommand"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description: 'Start the server to enable the MCP client to interact with the LLM.',\n async run() {\n const { runMcp } = await import('../runners/mcp.ts')\n\n await runMcp({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,MAAM,MAAM;EACV,MAAM,EAAE,WAAW,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;AAEzB,QAAM,OAAO,EAAE,SAAA,gBAAA,SAAS,CAAC;;CAE5B,CAAC"}
@@ -3,19 +3,11 @@ import { t as getErrorMessage } from "./errors-CjPmyZHy.js";
3
3
  import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-CS5ZE0cN.js";
4
4
  import { styleText } from "node:util";
5
5
  import process from "node:process";
6
- import { createJiti } from "jiti";
7
- //#region src/utils/jiti.ts
8
- /**
9
- * Shared jiti instance for dynamic ESM/TS imports across CLI commands.
10
- * Created once at module scope to avoid the overhead of repeated instantiation.
11
- */
12
- const jiti = createJiti(import.meta.url, { sourceMaps: true });
13
- //#endregion
14
6
  //#region src/runners/mcp.ts
15
7
  async function runMcp({ version }) {
16
8
  let mod;
17
9
  try {
18
- mod = await jiti.import("@kubb/mcp", { default: true });
10
+ mod = await import("@kubb/mcp");
19
11
  } catch (_e) {
20
12
  console.error(`Import of '@kubb/mcp' is required to start the MCP server`);
21
13
  process.exit(1);
@@ -45,4 +37,4 @@ async function runMcp({ version }) {
45
37
  //#endregion
46
38
  export { runMcp };
47
39
 
48
- //# sourceMappingURL=mcp-C-HbwyVA.js.map
40
+ //# sourceMappingURL=mcp-nlFo36z0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-nlFo36z0.js","names":[],"sources":["../src/runners/mcp.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { getErrorMessage } from '@internals/utils'\nimport type * as McpModule from '@kubb/mcp'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype McpOptions = {\n version: string\n}\n\nexport async function runMcp({ version }: McpOptions): Promise<void> {\n let mod: typeof McpModule\n try {\n mod = (await import('@kubb/mcp')) as typeof McpModule\n } catch (_e) {\n console.error(`Import of '@kubb/mcp' is required to start the MCP server`)\n process.exit(1)\n }\n\n const { run } = mod\n const hrStart = process.hrtime()\n try {\n console.log('⏳ Starting MCP server...')\n console.warn(styleText('yellow', 'This feature is still under development — use with caution'))\n run()\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'mcp',\n kubbVersion: version,\n hrStart,\n status: 'success',\n }),\n )\n } catch (error) {\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'mcp',\n kubbVersion: version,\n hrStart,\n status: 'failed',\n }),\n )\n console.error(getErrorMessage(error))\n }\n}\n"],"mappings":";;;;;;AAUA,eAAsB,OAAO,EAAE,WAAsC;CACnE,IAAI;AACJ,KAAI;AACF,QAAO,MAAM,OAAO;UACb,IAAI;AACX,UAAQ,MAAM,4DAA4D;AAC1E,UAAQ,KAAK,EAAE;;CAGjB,MAAM,EAAE,QAAQ;CAChB,MAAM,UAAU,QAAQ,QAAQ;AAChC,KAAI;AACF,UAAQ,IAAI,2BAA2B;AACvC,UAAQ,KAAK,UAAU,UAAU,6DAA6D,CAAC;AAC/F,OAAK;AACL,QAAM,cACJ,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;UACM,OAAO;AACd,QAAM,cACJ,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;AACD,UAAQ,MAAM,gBAAgB,MAAM,CAAC"}
@@ -4,18 +4,11 @@ const require_telemetry = require("./telemetry-kmnc5OAT.cjs");
4
4
  let node_util = require("node:util");
5
5
  let node_process = require("node:process");
6
6
  node_process = require_chunk.__toESM(node_process, 1);
7
- //#region src/utils/jiti.ts
8
- /**
9
- * Shared jiti instance for dynamic ESM/TS imports across CLI commands.
10
- * Created once at module scope to avoid the overhead of repeated instantiation.
11
- */
12
- const jiti$1 = (0, require("jiti").createJiti)(require("url").pathToFileURL(__filename).href, { sourceMaps: true });
13
- //#endregion
14
7
  //#region src/runners/mcp.ts
15
8
  async function runMcp({ version }) {
16
9
  let mod;
17
10
  try {
18
- mod = await jiti$1.import("@kubb/mcp", { default: true });
11
+ mod = await import("@kubb/mcp");
19
12
  } catch (_e) {
20
13
  console.error(`Import of '@kubb/mcp' is required to start the MCP server`);
21
14
  node_process.default.exit(1);
@@ -45,4 +38,4 @@ async function runMcp({ version }) {
45
38
  //#endregion
46
39
  exports.runMcp = runMcp;
47
40
 
48
- //# sourceMappingURL=mcp-BCLUiocM.cjs.map
41
+ //# sourceMappingURL=mcp-vi8t2Rkb.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-vi8t2Rkb.cjs","names":["process","sendTelemetry","buildTelemetryEvent","getErrorMessage"],"sources":["../src/runners/mcp.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { getErrorMessage } from '@internals/utils'\nimport type * as McpModule from '@kubb/mcp'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype McpOptions = {\n version: string\n}\n\nexport async function runMcp({ version }: McpOptions): Promise<void> {\n let mod: typeof McpModule\n try {\n mod = (await import('@kubb/mcp')) as typeof McpModule\n } catch (_e) {\n console.error(`Import of '@kubb/mcp' is required to start the MCP server`)\n process.exit(1)\n }\n\n const { run } = mod\n const hrStart = process.hrtime()\n try {\n console.log('⏳ Starting MCP server...')\n console.warn(styleText('yellow', 'This feature is still under development — use with caution'))\n run()\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'mcp',\n kubbVersion: version,\n hrStart,\n status: 'success',\n }),\n )\n } catch (error) {\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'mcp',\n kubbVersion: version,\n hrStart,\n status: 'failed',\n }),\n )\n console.error(getErrorMessage(error))\n }\n}\n"],"mappings":";;;;;;;AAUA,eAAsB,OAAO,EAAE,WAAsC;CACnE,IAAI;AACJ,KAAI;AACF,QAAO,MAAM,OAAO;UACb,IAAI;AACX,UAAQ,MAAM,4DAA4D;AAC1E,eAAA,QAAQ,KAAK,EAAE;;CAGjB,MAAM,EAAE,QAAQ;CAChB,MAAM,UAAUA,aAAAA,QAAQ,QAAQ;AAChC,KAAI;AACF,UAAQ,IAAI,2BAA2B;AACvC,UAAQ,MAAA,GAAA,UAAA,WAAe,UAAU,6DAA6D,CAAC;AAC/F,OAAK;AACL,QAAMC,kBAAAA,cACJC,kBAAAA,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;UACM,OAAO;AACd,QAAMD,kBAAAA,cACJC,kBAAAA,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;AACD,UAAQ,MAAMC,eAAAA,gBAAgB,MAAM,CAAC"}
@@ -0,0 +1,6 @@
1
+ //#region package.json
2
+ var version = "5.0.0-alpha.71";
3
+ //#endregion
4
+ export { version as t };
5
+
6
+ //# sourceMappingURL=package-BD90dOVc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-BD90dOVc.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "5.0.0-alpha.70";
2
+ var version = "5.0.0-alpha.71";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "version", {
8
8
  }
9
9
  });
10
10
 
11
- //# sourceMappingURL=package-C1GUEFG8.cjs.map
11
+ //# sourceMappingURL=package-DsKVMEXO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-DsKVMEXO.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  require("./chunk-ByKO4r7w.cjs");
2
2
  const require_define = require("./define-Bdn8j5VM.cjs");
3
- const require_package = require("./package-C1GUEFG8.cjs");
3
+ const require_package = require("./package-DsKVMEXO.cjs");
4
4
  //#region src/commands/validate.ts
5
5
  const command = require_define.defineCommand({
6
6
  name: "validate",
@@ -22,4 +22,4 @@ const command = require_define.defineCommand({
22
22
  //#endregion
23
23
  exports.command = command;
24
24
 
25
- //# sourceMappingURL=validate-DMJZDsJ7.cjs.map
25
+ //# sourceMappingURL=validate-BZKRjT0Y.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-DMJZDsJ7.cjs","names":["defineCommand"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: {\n type: 'string',\n description: 'Path to Swagger/OpenAPI file',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAE9B,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;GAAS,CAAC;;CAEtD,CAAC"}
1
+ {"version":3,"file":"validate-BZKRjT0Y.cjs","names":["defineCommand"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: {\n type: 'string',\n description: 'Path to Swagger/OpenAPI file',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAE9B,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;GAAS,CAAC;;CAEtD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import "./chunk--u3MIqq1.js";
2
2
  import { n as defineCommand } from "./define-Ctii4bel.js";
3
- import { t as version } from "./package-CdqSi3-7.js";
3
+ import { t as version } from "./package-BD90dOVc.js";
4
4
  //#region src/commands/validate.ts
5
5
  const command = defineCommand({
6
6
  name: "validate",
@@ -22,4 +22,4 @@ const command = defineCommand({
22
22
  //#endregion
23
23
  export { command };
24
24
 
25
- //# sourceMappingURL=validate-bW2wdaM8.js.map
25
+ //# sourceMappingURL=validate-RG85Fqjh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-bW2wdaM8.js","names":[],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: {\n type: 'string',\n description: 'Path to Swagger/OpenAPI file',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAM,OAAO;AAErC,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO;GAAS,CAAC;;CAEtD,CAAC"}
1
+ {"version":3,"file":"validate-RG85Fqjh.js","names":[],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: {\n type: 'string',\n description: 'Path to Swagger/OpenAPI file',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAM,OAAO;AAErC,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO;GAAS,CAAC;;CAEtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/cli",
3
- "version": "5.0.0-alpha.70",
3
+ "version": "5.0.0-alpha.71",
4
4
  "description": "Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "cli",
@@ -55,17 +55,17 @@
55
55
  "@clack/prompts": "^1.2.0",
56
56
  "chokidar": "^5.0.0",
57
57
  "cosmiconfig": "^9.0.1",
58
- "jiti": "^2.6.1",
59
58
  "tinyexec": "^1.1.1",
60
- "@kubb/adapter-oas": "5.0.0-alpha.70",
61
- "@kubb/core": "5.0.0-alpha.70"
59
+ "unrun": "^0.2.37",
60
+ "@kubb/adapter-oas": "5.0.0-alpha.71",
61
+ "@kubb/core": "5.0.0-alpha.71"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@internals/utils": "0.0.0"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@kubb/agent": "5.0.0-alpha.70",
68
- "@kubb/mcp": "5.0.0-alpha.70"
67
+ "@kubb/agent": "5.0.0-alpha.71",
68
+ "@kubb/mcp": "5.0.0-alpha.71"
69
69
  },
70
70
  "size-limit": [
71
71
  {
@@ -2,7 +2,6 @@ import process from 'node:process'
2
2
  import { styleText } from 'node:util'
3
3
  import { getErrorMessage } from '@internals/utils'
4
4
  import type * as McpModule from '@kubb/mcp'
5
- import { jiti } from '../utils/jiti.ts'
6
5
  import { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'
7
6
 
8
7
  type McpOptions = {
@@ -12,9 +11,7 @@ type McpOptions = {
12
11
  export async function runMcp({ version }: McpOptions): Promise<void> {
13
12
  let mod: typeof McpModule
14
13
  try {
15
- mod = (await jiti.import('@kubb/mcp', {
16
- default: true,
17
- })) as typeof McpModule
14
+ mod = (await import('@kubb/mcp')) as typeof McpModule
18
15
  } catch (_e) {
19
16
  console.error(`Import of '@kubb/mcp' is required to start the MCP server`)
20
17
  process.exit(1)
@@ -1,6 +1,6 @@
1
1
  import type { Config } from '@kubb/core'
2
2
  import { cosmiconfig } from 'cosmiconfig'
3
- import { createJiti } from 'jiti'
3
+ import { unrun } from 'unrun'
4
4
 
5
5
  type CosmiconfigResult = {
6
6
  filepath: string
@@ -8,18 +8,21 @@ type CosmiconfigResult = {
8
8
  config: Config
9
9
  }
10
10
 
11
- const jiti = createJiti(import.meta.url, {
12
- jsx: {
13
- runtime: 'automatic',
14
- importSource: '@kubb/renderer-jsx',
11
+ const unrunInputOptions = {
12
+ transform: {
13
+ jsx: {
14
+ runtime: 'automatic' as const,
15
+ importSource: '@kubb/renderer-jsx',
16
+ },
15
17
  },
16
- sourceMaps: true,
17
- interopDefault: true,
18
- })
18
+ }
19
19
 
20
20
  const tsLoader = async (configFile: string) => {
21
- const mod = await jiti.import(configFile, { default: true })
22
- return mod
21
+ const { module } = await unrun({
22
+ path: configFile,
23
+ inputOptions: unrunInputOptions,
24
+ })
25
+ return module
23
26
  }
24
27
 
25
28
  export async function getCosmiConfig(moduleName: string, config?: string): Promise<CosmiconfigResult> {