@kubb/cli 5.0.0-beta.75 → 5.0.0-beta.76

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 (150) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +171 -51
  3. package/bin/kubb.js +9 -3
  4. package/dist/Telemetry-CxzkLSdD.js +284 -0
  5. package/dist/Telemetry-CxzkLSdD.js.map +1 -0
  6. package/dist/Telemetry-D8jhC5Bc.cjs +315 -0
  7. package/dist/Telemetry-D8jhC5Bc.cjs.map +1 -0
  8. package/dist/{define-Bdn8j5VM.cjs → defineCommand-Bo3yZTWI.cjs} +3 -21
  9. package/dist/defineCommand-Bo3yZTWI.cjs.map +1 -0
  10. package/dist/{define-Ctii4bel.js → defineCommand-DMEeqliP.js} +4 -16
  11. package/dist/defineCommand-DMEeqliP.js.map +1 -0
  12. package/dist/{errors-CjPmyZHy.js → errors-Dc_d7BfX.js} +2 -2
  13. package/dist/{errors-CjPmyZHy.js.map → errors-Dc_d7BfX.js.map} +1 -1
  14. package/dist/{errors-CLCjoSg0.cjs → errors-gxFK0vrp.cjs} +2 -2
  15. package/dist/{errors-CLCjoSg0.cjs.map → errors-gxFK0vrp.cjs.map} +1 -1
  16. package/dist/generate-DD2TMRmo.js +77 -0
  17. package/dist/generate-DD2TMRmo.js.map +1 -0
  18. package/dist/generate-DJUcRnD9.cjs +76 -0
  19. package/dist/generate-DJUcRnD9.cjs.map +1 -0
  20. package/dist/index.cjs +93 -149
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.ts +6 -1
  23. package/dist/index.js +93 -149
  24. package/dist/index.js.map +1 -1
  25. package/dist/init-BYgTbDpy.cjs +53 -0
  26. package/dist/init-BYgTbDpy.cjs.map +1 -0
  27. package/dist/init-CONuOE9n.js +53 -0
  28. package/dist/init-CONuOE9n.js.map +1 -0
  29. package/dist/mcp---VI5xTX.js +21 -0
  30. package/dist/mcp---VI5xTX.js.map +1 -0
  31. package/dist/mcp-CbM2iAFq.cjs +21 -0
  32. package/dist/mcp-CbM2iAFq.cjs.map +1 -0
  33. package/dist/package-6guIlMlB.js +6 -0
  34. package/dist/package-6guIlMlB.js.map +1 -0
  35. package/dist/{package-D5arPDnh.cjs → package-DnvclOkv.cjs} +2 -2
  36. package/dist/package-DnvclOkv.cjs.map +1 -0
  37. package/dist/run-44Zxh8Ec.js +289 -0
  38. package/dist/run-44Zxh8Ec.js.map +1 -0
  39. package/dist/run-BPLW8mrc.cjs +52 -0
  40. package/dist/run-BPLW8mrc.cjs.map +1 -0
  41. package/dist/run-D1rr0epF.js +1327 -0
  42. package/dist/run-D1rr0epF.js.map +1 -0
  43. package/dist/run-DXEMoDFa.cjs +293 -0
  44. package/dist/run-DXEMoDFa.cjs.map +1 -0
  45. package/dist/run-Dq0CXCqU.cjs +1330 -0
  46. package/dist/run-Dq0CXCqU.cjs.map +1 -0
  47. package/dist/run-Dv-1NGl-.js +32 -0
  48. package/dist/run-Dv-1NGl-.js.map +1 -0
  49. package/dist/run-GFI-E4ua.cjs +33 -0
  50. package/dist/run-GFI-E4ua.cjs.map +1 -0
  51. package/dist/run-WfvBLKQY.js +51 -0
  52. package/dist/run-WfvBLKQY.js.map +1 -0
  53. package/dist/tools-CZT9wSA6.cjs +175 -0
  54. package/dist/tools-CZT9wSA6.cjs.map +1 -0
  55. package/dist/tools-D0UogMU3.js +152 -0
  56. package/dist/tools-D0UogMU3.js.map +1 -0
  57. package/dist/validate-CNvR28KI.cjs +26 -0
  58. package/dist/validate-CNvR28KI.cjs.map +1 -0
  59. package/dist/validate-ClAyEQgx.js +26 -0
  60. package/dist/validate-ClAyEQgx.js.map +1 -0
  61. package/package.json +24 -28
  62. package/dist/agent-BEgI2HXH.cjs +0 -58
  63. package/dist/agent-BEgI2HXH.cjs.map +0 -1
  64. package/dist/agent-B_pirbeB.cjs +0 -116
  65. package/dist/agent-B_pirbeB.cjs.map +0 -1
  66. package/dist/agent-CTdJEHEs.js +0 -56
  67. package/dist/agent-CTdJEHEs.js.map +0 -1
  68. package/dist/agent-Ev5hU5hH.js +0 -112
  69. package/dist/agent-Ev5hU5hH.js.map +0 -1
  70. package/dist/constants-CnDXa1R6.cjs +0 -148
  71. package/dist/constants-CnDXa1R6.cjs.map +0 -1
  72. package/dist/constants-aL3CP_Wq.js +0 -95
  73. package/dist/constants-aL3CP_Wq.js.map +0 -1
  74. package/dist/define-Bdn8j5VM.cjs.map +0 -1
  75. package/dist/define-Ctii4bel.js.map +0 -1
  76. package/dist/generate-Cg8yufrw.js +0 -1753
  77. package/dist/generate-Cg8yufrw.js.map +0 -1
  78. package/dist/generate-DDCwNQNo.cjs +0 -65
  79. package/dist/generate-DDCwNQNo.cjs.map +0 -1
  80. package/dist/generate-K8MJ9aQF.cjs +0 -1756
  81. package/dist/generate-K8MJ9aQF.cjs.map +0 -1
  82. package/dist/generate-YPtfjsg4.js +0 -66
  83. package/dist/generate-YPtfjsg4.js.map +0 -1
  84. package/dist/init-Bu95ML_u.cjs +0 -25
  85. package/dist/init-Bu95ML_u.cjs.map +0 -1
  86. package/dist/init-CZ5Xq2Hd.cjs +0 -293
  87. package/dist/init-CZ5Xq2Hd.cjs.map +0 -1
  88. package/dist/init-eNRlotJK.js +0 -289
  89. package/dist/init-eNRlotJK.js.map +0 -1
  90. package/dist/init-ooJeOBGt.js +0 -25
  91. package/dist/init-ooJeOBGt.js.map +0 -1
  92. package/dist/mcp-C-d5N1wZ.js +0 -16
  93. package/dist/mcp-C-d5N1wZ.js.map +0 -1
  94. package/dist/mcp-CLcDV4Jm.cjs +0 -41
  95. package/dist/mcp-CLcDV4Jm.cjs.map +0 -1
  96. package/dist/mcp-D7EIR9fR.js +0 -40
  97. package/dist/mcp-D7EIR9fR.js.map +0 -1
  98. package/dist/mcp-Dpu8vzzj.cjs +0 -16
  99. package/dist/mcp-Dpu8vzzj.cjs.map +0 -1
  100. package/dist/package-D5arPDnh.cjs.map +0 -1
  101. package/dist/package-DqZsMLZ9.js +0 -6
  102. package/dist/package-DqZsMLZ9.js.map +0 -1
  103. package/dist/shell-475fQKaX.cjs +0 -62
  104. package/dist/shell-475fQKaX.cjs.map +0 -1
  105. package/dist/shell-DLzN4fRo.js +0 -51
  106. package/dist/shell-DLzN4fRo.js.map +0 -1
  107. package/dist/telemetry-DN95_2pF.cjs +0 -282
  108. package/dist/telemetry-DN95_2pF.cjs.map +0 -1
  109. package/dist/telemetry-LgT_sdPe.js +0 -245
  110. package/dist/telemetry-LgT_sdPe.js.map +0 -1
  111. package/dist/validate-CIR3_lZI.js +0 -25
  112. package/dist/validate-CIR3_lZI.js.map +0 -1
  113. package/dist/validate-DcqUb4DM.cjs +0 -25
  114. package/dist/validate-DcqUb4DM.cjs.map +0 -1
  115. package/dist/validate-kLJoT_hi.js +0 -33
  116. package/dist/validate-kLJoT_hi.js.map +0 -1
  117. package/dist/validate-yKKzqEZ5.cjs +0 -34
  118. package/dist/validate-yKKzqEZ5.cjs.map +0 -1
  119. package/src/commands/agent/start.ts +0 -47
  120. package/src/commands/agent.ts +0 -8
  121. package/src/commands/generate.ts +0 -57
  122. package/src/commands/init.ts +0 -20
  123. package/src/commands/mcp.ts +0 -12
  124. package/src/commands/validate.ts +0 -20
  125. package/src/constants.ts +0 -104
  126. package/src/index.ts +0 -43
  127. package/src/loggers/clackLogger.ts +0 -458
  128. package/src/loggers/fileSystemLogger.ts +0 -138
  129. package/src/loggers/githubActionsLogger.ts +0 -379
  130. package/src/loggers/plainLogger.ts +0 -254
  131. package/src/loggers/types.ts +0 -1
  132. package/src/loggers/utils.ts +0 -106
  133. package/src/runners/agent.ts +0 -149
  134. package/src/runners/generate.ts +0 -333
  135. package/src/runners/init.ts +0 -296
  136. package/src/runners/mcp.ts +0 -45
  137. package/src/runners/validate.ts +0 -39
  138. package/src/types.ts +0 -11
  139. package/src/utils/Writables.ts +0 -17
  140. package/src/utils/executeHooks.ts +0 -45
  141. package/src/utils/flags.ts +0 -9
  142. package/src/utils/getConfig.ts +0 -10
  143. package/src/utils/getCosmiConfig.ts +0 -80
  144. package/src/utils/getSummary.ts +0 -68
  145. package/src/utils/packageManager.ts +0 -23
  146. package/src/utils/runHook.ts +0 -91
  147. package/src/utils/telemetry.ts +0 -273
  148. package/src/utils/watcher.ts +0 -19
  149. /package/dist/{chunk-ByKO4r7w.cjs → rolldown-runtime-Bx3C2hgW.cjs} +0 -0
  150. /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
@@ -1,112 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-LgT_sdPe.js";
3
- import { t as spawnAsync } from "./shell-DLzN4fRo.js";
4
- import { s as agentDefaults } from "./constants-aL3CP_Wq.js";
5
- import { styleText } from "node:util";
6
- import path from "node:path";
7
- import * as process$1 from "node:process";
8
- import net from "node:net";
9
- import { fileURLToPath } from "node:url";
10
- import * as clack from "@clack/prompts";
11
- //#region src/runners/agent.ts
12
- /**
13
- * Resolves the environment passed to the detached agent process using CLI values first, then environment values, then CLI defaults.
14
- */
15
- function resolveAgentStartEnvironment({ port, host, configPath, allowWrite, allowAll }) {
16
- const resolvedPort = port ?? process$1.env.PORT ?? agentDefaults.port;
17
- const resolvedHost = host !== agentDefaults.host ? host : process$1.env.HOST ?? agentDefaults.host;
18
- const resolvedAllowAll = allowAll || process$1.env.KUBB_AGENT_ALLOW_ALL === "true";
19
- const resolvedAllowWrite = resolvedAllowAll || allowWrite || process$1.env.KUBB_AGENT_ALLOW_WRITE === "true";
20
- const agentRoot = process$1.env.KUBB_AGENT_ROOT ?? process$1.cwd();
21
- const agentConfigPath = path.resolve(process$1.cwd(), configPath || process$1.env.KUBB_AGENT_CONFIG || agentDefaults.configFile);
22
- return {
23
- port: resolvedPort,
24
- host: resolvedHost,
25
- allowWrite: resolvedAllowWrite,
26
- allowAll: resolvedAllowAll,
27
- agentConfigPath,
28
- env: {
29
- ...process$1.env,
30
- PORT: resolvedPort,
31
- HOST: resolvedHost,
32
- KUBB_AGENT_ROOT: agentRoot,
33
- KUBB_AGENT_CONFIG: agentConfigPath,
34
- KUBB_AGENT_ALLOW_WRITE: String(resolvedAllowWrite),
35
- KUBB_AGENT_ALLOW_ALL: String(resolvedAllowAll),
36
- KUBB_AGENT_TOKEN: process$1.env.KUBB_AGENT_TOKEN,
37
- KUBB_AGENT_RETRY_TIMEOUT: process$1.env.KUBB_AGENT_RETRY_TIMEOUT ?? agentDefaults.retryTimeout,
38
- KUBB_STUDIO_URL: process$1.env.KUBB_STUDIO_URL ?? agentDefaults.studioUrl
39
- }
40
- };
41
- }
42
- function isPortAvailable(port, host) {
43
- return new Promise((resolve) => {
44
- const server = net.createServer();
45
- server.once("error", () => resolve(false));
46
- server.once("listening", () => {
47
- server.close();
48
- resolve(true);
49
- });
50
- server.listen(port, host);
51
- });
52
- }
53
- async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }) {
54
- const hrStart = process$1.hrtime();
55
- try {
56
- try {
57
- process$1.loadEnvFile();
58
- } catch {}
59
- let agentPkgUrl;
60
- try {
61
- agentPkgUrl = import.meta.resolve("@kubb/agent/package.json");
62
- } catch (_e) {
63
- console.error(`Import of '@kubb/agent' is required to start the Agent server`);
64
- process$1.exit(1);
65
- }
66
- const agentPkgPath = fileURLToPath(agentPkgUrl);
67
- const agentDir = path.dirname(agentPkgPath);
68
- const serverPath = path.join(agentDir, agentDefaults.serverEntryPath);
69
- const resolvedEnv = resolveAgentStartEnvironment({
70
- port,
71
- host,
72
- configPath,
73
- allowWrite,
74
- allowAll
75
- });
76
- const numericPort = Number(resolvedEnv.port);
77
- if (!Number.isInteger(numericPort) || numericPort <= 0) throw new Error(`Invalid port "${resolvedEnv.port}". Provide a positive integer with --port or PORT.`);
78
- clack.log.step(styleText("cyan", "Starting agent server..."));
79
- clack.log.info(styleText("dim", `Config: ${resolvedEnv.agentConfigPath}`));
80
- clack.log.info(styleText("dim", `Host: ${resolvedEnv.host}`));
81
- clack.log.info(styleText("dim", `Port: ${resolvedEnv.port}`));
82
- if (!resolvedEnv.allowWrite && !resolvedEnv.allowAll) clack.log.warn(styleText("yellow", "Filesystem writes disabled. Use --allow-write or --allow-all to enable."));
83
- if (!await isPortAvailable(numericPort, resolvedEnv.host)) {
84
- clack.log.error(styleText("red", `Port ${resolvedEnv.port} is already in use. Stop the existing process or choose a different port with --port.`));
85
- process$1.exit(1);
86
- }
87
- await spawnAsync("node", [serverPath], {
88
- env: resolvedEnv.env,
89
- cwd: process$1.cwd()
90
- });
91
- await sendTelemetry(buildTelemetryEvent({
92
- command: "agent",
93
- kubbVersion: version,
94
- hrStart,
95
- status: "success"
96
- }));
97
- } catch (error) {
98
- await sendTelemetry(buildTelemetryEvent({
99
- command: "agent",
100
- kubbVersion: version,
101
- hrStart,
102
- status: "failed"
103
- }));
104
- clack.log.error(styleText("red", "Failed to start agent server"));
105
- console.error(error);
106
- process$1.exit(1);
107
- }
108
- }
109
- //#endregion
110
- export { runAgentStart };
111
-
112
- //# sourceMappingURL=agent-Ev5hU5hH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-Ev5hU5hH.js","names":["process"],"sources":["../src/runners/agent.ts"],"sourcesContent":["import net from 'node:net'\nimport path from 'node:path'\nimport * as process from 'node:process'\nimport { fileURLToPath } from 'node:url'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { spawnAsync } from '@internals/utils'\nimport { agentDefaults } from '../constants.ts'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype AgentStartOptions = {\n port: string | undefined\n host: string\n configPath: string | undefined\n allowWrite: boolean\n allowAll: boolean\n version: string\n}\n\ntype ResolvedAgentStartEnvironment = {\n port: string\n host: string\n allowWrite: boolean\n allowAll: boolean\n agentConfigPath: string\n env: NodeJS.ProcessEnv\n}\n\n/**\n * Resolves the environment passed to the detached agent process using CLI values first, then environment values, then CLI defaults.\n */\nfunction resolveAgentStartEnvironment({ port, host, configPath, allowWrite, allowAll }: Omit<AgentStartOptions, 'version'>): ResolvedAgentStartEnvironment {\n const resolvedPort = port ?? process.env.PORT ?? agentDefaults.port\n const resolvedHost = host !== agentDefaults.host ? host : (process.env.HOST ?? agentDefaults.host)\n const resolvedAllowAll = allowAll || process.env.KUBB_AGENT_ALLOW_ALL === 'true'\n const resolvedAllowWrite = resolvedAllowAll || allowWrite || process.env.KUBB_AGENT_ALLOW_WRITE === 'true'\n const agentRoot = process.env.KUBB_AGENT_ROOT ?? process.cwd()\n const agentConfigPath = path.resolve(process.cwd(), configPath || process.env.KUBB_AGENT_CONFIG || agentDefaults.configFile)\n\n return {\n port: resolvedPort,\n host: resolvedHost,\n allowWrite: resolvedAllowWrite,\n allowAll: resolvedAllowAll,\n agentConfigPath,\n env: {\n ...process.env,\n PORT: resolvedPort,\n HOST: resolvedHost,\n KUBB_AGENT_ROOT: agentRoot,\n KUBB_AGENT_CONFIG: agentConfigPath,\n KUBB_AGENT_ALLOW_WRITE: String(resolvedAllowWrite),\n KUBB_AGENT_ALLOW_ALL: String(resolvedAllowAll),\n KUBB_AGENT_TOKEN: process.env.KUBB_AGENT_TOKEN,\n KUBB_AGENT_RETRY_TIMEOUT: process.env.KUBB_AGENT_RETRY_TIMEOUT ?? agentDefaults.retryTimeout,\n KUBB_STUDIO_URL: process.env.KUBB_STUDIO_URL ?? agentDefaults.studioUrl,\n },\n }\n}\n\nfunction isPortAvailable(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const server = net.createServer()\n server.once('error', () => resolve(false))\n server.once('listening', () => {\n server.close()\n resolve(true)\n })\n server.listen(port, host)\n })\n}\n\nexport async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }: AgentStartOptions): Promise<void> {\n const hrStart = process.hrtime()\n\n try {\n // Load .env file into process.env using Node.js built-in (v20.12.0+)\n try {\n process.loadEnvFile()\n } catch {\n // .env file may not exist; ignore\n }\n\n // Resolve the @kubb/agent package path\n let agentPkgUrl: string\n try {\n agentPkgUrl = import.meta.resolve('@kubb/agent/package.json')\n } catch (_e) {\n console.error(`Import of '@kubb/agent' is required to start the Agent server`)\n process.exit(1)\n }\n const agentPkgPath = fileURLToPath(agentPkgUrl)\n const agentDir = path.dirname(agentPkgPath)\n const serverPath = path.join(agentDir, agentDefaults.serverEntryPath)\n\n const resolvedEnv = resolveAgentStartEnvironment({\n port,\n host,\n configPath,\n allowWrite,\n allowAll,\n })\n const numericPort = Number(resolvedEnv.port)\n\n if (!Number.isInteger(numericPort) || numericPort <= 0) {\n throw new Error(`Invalid port \"${resolvedEnv.port}\". Provide a positive integer with --port or PORT.`)\n }\n\n clack.log.step(styleText('cyan', 'Starting agent server...'))\n clack.log.info(styleText('dim', `Config: ${resolvedEnv.agentConfigPath}`))\n clack.log.info(styleText('dim', `Host: ${resolvedEnv.host}`))\n clack.log.info(styleText('dim', `Port: ${resolvedEnv.port}`))\n if (!resolvedEnv.allowWrite && !resolvedEnv.allowAll) {\n clack.log.warn(styleText('yellow', 'Filesystem writes disabled. Use --allow-write or --allow-all to enable.'))\n }\n\n if (!(await isPortAvailable(numericPort, resolvedEnv.host))) {\n clack.log.error(styleText('red', `Port ${resolvedEnv.port} is already in use. Stop the existing process or choose a different port with --port.`))\n process.exit(1)\n }\n\n // Spawns the server as a detached background process so the CLI can exit independently.\n await spawnAsync('node', [serverPath], {\n env: resolvedEnv.env,\n cwd: process.cwd(),\n })\n\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'agent',\n kubbVersion: version,\n hrStart,\n status: 'success',\n }),\n )\n } catch (error) {\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'agent',\n kubbVersion: version,\n hrStart,\n status: 'failed',\n }),\n )\n clack.log.error(styleText('red', 'Failed to start agent server'))\n console.error(error)\n process.exit(1)\n }\n}\n"],"mappings":"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"}
@@ -1,148 +0,0 @@
1
- //#region src/constants.ts
2
- /**
3
- * Default filename for the Kubb configuration file.
4
- *
5
- * Used by the `init` command when scaffolding new projects and by the `agent` default config.
6
- */
7
- const KUBB_CONFIG_FILENAME = "kubb.config.ts";
8
- /**
9
- * NPM registry endpoint used to check for @kubb/cli updates.
10
- */
11
- const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
12
- /**
13
- * OpenTelemetry ingestion endpoint for anonymous usage telemetry.
14
- */
15
- const OTLP_ENDPOINT = "https://otlp.kubb.dev";
16
- /**
17
- * Horizontal rule rendered above/below the plain-logger generation summary.
18
- */
19
- const SUMMARY_SEPARATOR = "─".repeat(27);
20
- /**
21
- * Glob pattern for paths the file watcher ignores.
22
- */
23
- const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
24
- /**
25
- * Flags that short-circuit execution (help/version) — no telemetry notice is shown.
26
- */
27
- const QUIET_FLAGS = new Set([
28
- "--help",
29
- "-h",
30
- "--version",
31
- "-v"
32
- ]);
33
- const agentDefaults = {
34
- port: "3000",
35
- host: "localhost",
36
- configFile: KUBB_CONFIG_FILENAME,
37
- retryTimeout: "30000",
38
- studioUrl: "https://studio.kubb.dev",
39
- /**
40
- * Relative path from the @kubb/agent package root to the server entry.
41
- */
42
- serverEntryPath: ".output/server/index.mjs"
43
- };
44
- /**
45
- * Default values used during interactive `init` scaffolding.
46
- */
47
- const initDefaults = {
48
- inputPath: "./openapi.yaml",
49
- outputPath: "./src/gen",
50
- plugins: ["plugin-ts"]
51
- };
52
- /**
53
- * Maps each plugin value to the default config snippet inserted by `init`.
54
- * The `satisfies` constraint ensures all values remain plain strings while
55
- * `as const` keeps the object deeply immutable.
56
- */
57
- const pluginDefaultConfigs = {
58
- "plugin-ts": `pluginTs({
59
- output: { path: 'models' },
60
- })`,
61
- "plugin-client": `pluginClient({
62
- output: { path: 'clients' },
63
- })`,
64
- "plugin-react-query": `pluginReactQuery({
65
- output: { path: 'hooks' },
66
- })`,
67
- "plugin-vue-query": `pluginVueQuery({
68
- output: { path: 'hooks' },
69
- })`,
70
- "plugin-zod": `pluginZod({
71
- output: { path: 'zod' },
72
- })`,
73
- "plugin-faker": `pluginFaker({
74
- output: { path: 'mocks' },
75
- })`,
76
- "plugin-msw": `pluginMsw({
77
- output: { path: 'msw' },
78
- })`,
79
- "plugin-cypress": `pluginCypress({
80
- output: { path: 'cypress' },
81
- })`,
82
- "plugin-mcp": `pluginMcp({
83
- output: { path: 'mcp' },
84
- })`,
85
- "plugin-redoc": `pluginRedoc({
86
- output: { path: 'redoc' },
87
- })`
88
- };
89
- /**
90
- * Color palette used by randomCliColor() for deterministic plugin name coloring.
91
- */
92
- //#endregion
93
- Object.defineProperty(exports, "KUBB_CONFIG_FILENAME", {
94
- enumerable: true,
95
- get: function() {
96
- return KUBB_CONFIG_FILENAME;
97
- }
98
- });
99
- Object.defineProperty(exports, "KUBB_NPM_PACKAGE_URL", {
100
- enumerable: true,
101
- get: function() {
102
- return KUBB_NPM_PACKAGE_URL;
103
- }
104
- });
105
- Object.defineProperty(exports, "OTLP_ENDPOINT", {
106
- enumerable: true,
107
- get: function() {
108
- return OTLP_ENDPOINT;
109
- }
110
- });
111
- Object.defineProperty(exports, "QUIET_FLAGS", {
112
- enumerable: true,
113
- get: function() {
114
- return QUIET_FLAGS;
115
- }
116
- });
117
- Object.defineProperty(exports, "SUMMARY_SEPARATOR", {
118
- enumerable: true,
119
- get: function() {
120
- return SUMMARY_SEPARATOR;
121
- }
122
- });
123
- Object.defineProperty(exports, "WATCHER_IGNORED_PATHS", {
124
- enumerable: true,
125
- get: function() {
126
- return WATCHER_IGNORED_PATHS;
127
- }
128
- });
129
- Object.defineProperty(exports, "agentDefaults", {
130
- enumerable: true,
131
- get: function() {
132
- return agentDefaults;
133
- }
134
- });
135
- Object.defineProperty(exports, "initDefaults", {
136
- enumerable: true,
137
- get: function() {
138
- return initDefaults;
139
- }
140
- });
141
- Object.defineProperty(exports, "pluginDefaultConfigs", {
142
- enumerable: true,
143
- get: function() {
144
- return pluginDefaultConfigs;
145
- }
146
- });
147
-
148
- //# sourceMappingURL=constants-CnDXa1R6.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-CnDXa1R6.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Default filename for the Kubb configuration file.\n *\n * Used by the `init` command when scaffolding new projects and by the `agent` default config.\n */\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/**\n * NPM registry endpoint used to check for @kubb/cli updates.\n */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/**\n * OpenTelemetry ingestion endpoint for anonymous usage telemetry.\n */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/**\n * Horizontal rule rendered above/below the plain-logger generation summary.\n */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/**\n * Maximum number of █ characters in a plugin timing bar.\n */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/**\n * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).\n */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/**\n * Glob pattern for paths the file watcher ignores.\n */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/**\n * Flags that short-circuit execution (help/version) — no telemetry notice is shown.\n */\nexport const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: KUBB_CONFIG_FILENAME,\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /**\n * Relative path from the @kubb/agent package root to the server entry.\n */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/**\n * Default values used during interactive `init` scaffolding.\n */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n 'plugin-cypress': `pluginCypress({\n output: { path: 'cypress' },\n })`,\n 'plugin-mcp': `pluginMcp({\n output: { path: 'mcp' },\n })`,\n 'plugin-redoc': `pluginRedoc({\n output: { path: 'redoc' },\n })`,\n} as const satisfies Record<string, string>\n\n/**\n * Color palette used by randomCliColor() for deterministic plugin name coloring.\n */\n"],"mappings":";;;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;;;;AAK7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;;;AAe/C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;CAAK,CAAU;AAEhF,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;CAClB;;;;AAKD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,YAAY;CACvB;;;;;;AAOD,MAAa,uBAAuB;CAClC,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,oBAAoB;;;CAGpB,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGd,kBAAkB;;;CAGlB,cAAc;;;CAGd,gBAAgB;;;CAGjB"}
@@ -1,95 +0,0 @@
1
- //#region src/constants.ts
2
- /**
3
- * Default filename for the Kubb configuration file.
4
- *
5
- * Used by the `init` command when scaffolding new projects and by the `agent` default config.
6
- */
7
- const KUBB_CONFIG_FILENAME = "kubb.config.ts";
8
- /**
9
- * NPM registry endpoint used to check for @kubb/cli updates.
10
- */
11
- const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
12
- /**
13
- * OpenTelemetry ingestion endpoint for anonymous usage telemetry.
14
- */
15
- const OTLP_ENDPOINT = "https://otlp.kubb.dev";
16
- /**
17
- * Horizontal rule rendered above/below the plain-logger generation summary.
18
- */
19
- const SUMMARY_SEPARATOR = "─".repeat(27);
20
- /**
21
- * Glob pattern for paths the file watcher ignores.
22
- */
23
- const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
24
- /**
25
- * Flags that short-circuit execution (help/version) — no telemetry notice is shown.
26
- */
27
- const QUIET_FLAGS = new Set([
28
- "--help",
29
- "-h",
30
- "--version",
31
- "-v"
32
- ]);
33
- const agentDefaults = {
34
- port: "3000",
35
- host: "localhost",
36
- configFile: KUBB_CONFIG_FILENAME,
37
- retryTimeout: "30000",
38
- studioUrl: "https://studio.kubb.dev",
39
- /**
40
- * Relative path from the @kubb/agent package root to the server entry.
41
- */
42
- serverEntryPath: ".output/server/index.mjs"
43
- };
44
- /**
45
- * Default values used during interactive `init` scaffolding.
46
- */
47
- const initDefaults = {
48
- inputPath: "./openapi.yaml",
49
- outputPath: "./src/gen",
50
- plugins: ["plugin-ts"]
51
- };
52
- /**
53
- * Maps each plugin value to the default config snippet inserted by `init`.
54
- * The `satisfies` constraint ensures all values remain plain strings while
55
- * `as const` keeps the object deeply immutable.
56
- */
57
- const pluginDefaultConfigs = {
58
- "plugin-ts": `pluginTs({
59
- output: { path: 'models' },
60
- })`,
61
- "plugin-client": `pluginClient({
62
- output: { path: 'clients' },
63
- })`,
64
- "plugin-react-query": `pluginReactQuery({
65
- output: { path: 'hooks' },
66
- })`,
67
- "plugin-vue-query": `pluginVueQuery({
68
- output: { path: 'hooks' },
69
- })`,
70
- "plugin-zod": `pluginZod({
71
- output: { path: 'zod' },
72
- })`,
73
- "plugin-faker": `pluginFaker({
74
- output: { path: 'mocks' },
75
- })`,
76
- "plugin-msw": `pluginMsw({
77
- output: { path: 'msw' },
78
- })`,
79
- "plugin-cypress": `pluginCypress({
80
- output: { path: 'cypress' },
81
- })`,
82
- "plugin-mcp": `pluginMcp({
83
- output: { path: 'mcp' },
84
- })`,
85
- "plugin-redoc": `pluginRedoc({
86
- output: { path: 'redoc' },
87
- })`
88
- };
89
- /**
90
- * Color palette used by randomCliColor() for deterministic plugin name coloring.
91
- */
92
- //#endregion
93
- export { SUMMARY_SEPARATOR as a, initDefaults as c, QUIET_FLAGS as i, pluginDefaultConfigs as l, KUBB_NPM_PACKAGE_URL as n, WATCHER_IGNORED_PATHS as o, OTLP_ENDPOINT as r, agentDefaults as s, KUBB_CONFIG_FILENAME as t };
94
-
95
- //# sourceMappingURL=constants-aL3CP_Wq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-aL3CP_Wq.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Default filename for the Kubb configuration file.\n *\n * Used by the `init` command when scaffolding new projects and by the `agent` default config.\n */\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/**\n * NPM registry endpoint used to check for @kubb/cli updates.\n */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/**\n * OpenTelemetry ingestion endpoint for anonymous usage telemetry.\n */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/**\n * Horizontal rule rendered above/below the plain-logger generation summary.\n */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/**\n * Maximum number of █ characters in a plugin timing bar.\n */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/**\n * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).\n */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/**\n * Glob pattern for paths the file watcher ignores.\n */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/**\n * Flags that short-circuit execution (help/version) — no telemetry notice is shown.\n */\nexport const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: KUBB_CONFIG_FILENAME,\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /**\n * Relative path from the @kubb/agent package root to the server entry.\n */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/**\n * Default values used during interactive `init` scaffolding.\n */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n 'plugin-cypress': `pluginCypress({\n output: { path: 'cypress' },\n })`,\n 'plugin-mcp': `pluginMcp({\n output: { path: 'mcp' },\n })`,\n 'plugin-redoc': `pluginRedoc({\n output: { path: 'redoc' },\n })`,\n} as const satisfies Record<string, string>\n\n/**\n * Color palette used by randomCliColor() for deterministic plugin name coloring.\n */\n"],"mappings":";;;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;;;;AAK7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;;;AAe/C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;CAAK,CAAU;AAEhF,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;CAClB;;;;AAKD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,YAAY;CACvB;;;;;;AAOD,MAAa,uBAAuB;CAClC,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,oBAAoB;;;CAGpB,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGd,kBAAkB;;;CAGlB,cAAc;;;CAGd,gBAAgB;;;CAGjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-Bdn8j5VM.cjs","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-Ctii4bel.js","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}