@kubb/cli 5.0.0-alpha.43 → 5.0.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-CWitLsL9.cjs → agent-BDKgkBp2.cjs} +3 -3
- package/dist/{agent-CWitLsL9.cjs.map → agent-BDKgkBp2.cjs.map} +1 -1
- package/dist/{agent-poGbscec.js → agent-BfqmQb32.js} +3 -3
- package/dist/{agent-poGbscec.js.map → agent-BfqmQb32.js.map} +1 -1
- package/dist/{agent-dAvD6Qlt.cjs → agent-CHFJ2Uap.cjs} +4 -4
- package/dist/{agent-dAvD6Qlt.cjs.map → agent-CHFJ2Uap.cjs.map} +1 -1
- package/dist/{agent-gIWBobyC.js → agent-h-dcOZmR.js} +4 -4
- package/dist/{agent-gIWBobyC.js.map → agent-h-dcOZmR.js.map} +1 -1
- package/dist/{constants-D0XHAHeZ.cjs → constants-B2q7VPbi.cjs} +14 -2
- package/dist/constants-B2q7VPbi.cjs.map +1 -0
- package/dist/{constants-DJM9zCXm.js → constants-T_2rsi7T.js} +9 -3
- package/dist/constants-T_2rsi7T.js.map +1 -0
- package/dist/{generate-Cot9oHPK.cjs → generate-CYkg_BlH.cjs} +2 -2
- package/dist/{generate-Cot9oHPK.cjs.map → generate-CYkg_BlH.cjs.map} +1 -1
- package/dist/{generate-ByuXn3l6.js → generate-Cq_CZ2bV.js} +2 -2
- package/dist/{generate-ByuXn3l6.js.map → generate-Cq_CZ2bV.js.map} +1 -1
- package/dist/{generate-CTa0WBEL.cjs → generate-DvH7BPcI.cjs} +4 -4
- package/dist/{generate-CTa0WBEL.cjs.map → generate-DvH7BPcI.cjs.map} +1 -1
- package/dist/{generate-BuOyrlAd.js → generate-mGl32oAA.js} +4 -4
- package/dist/{generate-BuOyrlAd.js.map → generate-mGl32oAA.js.map} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +8 -8
- package/dist/{init-CwFwcgW6.cjs → init-AVT-2Uxi.cjs} +8 -8
- package/dist/init-AVT-2Uxi.cjs.map +1 -0
- package/dist/{init-qKPqtrGT.js → init-BecEYFRb.js} +8 -8
- package/dist/init-BecEYFRb.js.map +1 -0
- package/dist/{init-Lixf1A0k.js → init-DR6zaX9s.js} +3 -3
- package/dist/{init-Lixf1A0k.js.map → init-DR6zaX9s.js.map} +1 -1
- package/dist/{init-d5UWmNrP.cjs → init-DvBiO6eR.cjs} +3 -3
- package/dist/{init-d5UWmNrP.cjs.map → init-DvBiO6eR.cjs.map} +1 -1
- package/dist/{mcp-B_FoDCTh.js → mcp-BDHEbuy3.js} +2 -2
- package/dist/{mcp-B_FoDCTh.js.map → mcp-BDHEbuy3.js.map} +1 -1
- package/dist/{mcp-BRsYx5qz.js → mcp-CCZ1ZASf.js} +3 -3
- package/dist/{mcp-BRsYx5qz.js.map → mcp-CCZ1ZASf.js.map} +1 -1
- package/dist/{mcp-STc97s14.cjs → mcp-CqpVw3PO.cjs} +2 -2
- package/dist/{mcp-STc97s14.cjs.map → mcp-CqpVw3PO.cjs.map} +1 -1
- package/dist/{mcp-RN0WsHq_.cjs → mcp-iloOXxJ7.cjs} +3 -3
- package/dist/{mcp-RN0WsHq_.cjs.map → mcp-iloOXxJ7.cjs.map} +1 -1
- package/dist/{package-CFbqPfx6.cjs → package-C83USFM0.cjs} +2 -2
- package/dist/package-C83USFM0.cjs.map +1 -0
- package/dist/package-CIbH7U3M.js +6 -0
- package/dist/package-CIbH7U3M.js.map +1 -0
- package/dist/{telemetry-D_Bi2E3I.cjs → telemetry-B6ZbZOrb.cjs} +2 -2
- package/dist/{telemetry-D_Bi2E3I.cjs.map → telemetry-B6ZbZOrb.cjs.map} +1 -1
- package/dist/{telemetry-CBISr5w4.js → telemetry-Dis5nWR_.js} +2 -2
- package/dist/{telemetry-CBISr5w4.js.map → telemetry-Dis5nWR_.js.map} +1 -1
- package/dist/{validate--Somzrer.js → validate-BWlfhXcD.js} +3 -3
- package/dist/{validate--Somzrer.js.map → validate-BWlfhXcD.js.map} +1 -1
- package/dist/{validate-ipF21nm2.cjs → validate-CZnUuVQF.cjs} +3 -3
- package/dist/{validate-ipF21nm2.cjs.map → validate-CZnUuVQF.cjs.map} +1 -1
- package/dist/{validate-CqwT945Z.cjs → validate-D-8_wAFV.cjs} +2 -2
- package/dist/{validate-CqwT945Z.cjs.map → validate-D-8_wAFV.cjs.map} +1 -1
- package/dist/{validate-NZ0mduJ3.js → validate-GfErHsnI.js} +2 -2
- package/dist/{validate-NZ0mduJ3.js.map → validate-GfErHsnI.js.map} +1 -1
- package/package.json +5 -5
- package/src/constants.ts +8 -1
- package/src/runners/init.ts +7 -7
- package/dist/constants-D0XHAHeZ.cjs.map +0 -1
- package/dist/constants-DJM9zCXm.js.map +0 -1
- package/dist/init-CwFwcgW6.cjs.map +0 -1
- package/dist/init-qKPqtrGT.js.map +0 -1
- package/dist/package-CFbqPfx6.cjs.map +0 -1
- package/dist/package-KJfRdbQA.js +0 -6
- package/dist/package-KJfRdbQA.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-ByKO4r7w.cjs");
|
|
2
|
-
const require_telemetry = require("./telemetry-
|
|
2
|
+
const require_telemetry = require("./telemetry-B6ZbZOrb.cjs");
|
|
3
3
|
const require_shell = require("./shell-475fQKaX.cjs");
|
|
4
|
-
const require_constants = require("./constants-
|
|
4
|
+
const require_constants = require("./constants-B2q7VPbi.cjs");
|
|
5
5
|
let node_util = require("node:util");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
node_path = require_chunk.__toESM(node_path, 1);
|
|
@@ -106,4 +106,4 @@ async function runAgentStart({ port, host, configPath, allowWrite, allowAll, ver
|
|
|
106
106
|
//#endregion
|
|
107
107
|
exports.runAgentStart = runAgentStart;
|
|
108
108
|
|
|
109
|
-
//# sourceMappingURL=agent-
|
|
109
|
+
//# sourceMappingURL=agent-BDKgkBp2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-BDKgkBp2.cjs","names":["process","agentDefaults","path","net","spawnAsync","sendTelemetry","buildTelemetryEvent"],"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 const agentPkgUrl = import.meta.resolve('@kubb/agent/package.json')\n const agentPkgPath = fileURLToPath(agentPkgUrl)\n const agentDir = path.dirname(agentPkgPath)\n const serverPath = path.join(agentDir, agentDefaults.serverEntryPath)\n\n const resolvedEnv = resolveAgentStartEnvironment({ port, host, configPath, allowWrite, allowAll })\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(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'success' }))\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'failed' }))\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,7 +1,7 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
|
-
import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-
|
|
2
|
+
import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-Dis5nWR_.js";
|
|
3
3
|
import { t as spawnAsync } from "./shell-DLzN4fRo.js";
|
|
4
|
-
import {
|
|
4
|
+
import { s as agentDefaults } from "./constants-T_2rsi7T.js";
|
|
5
5
|
import { styleText } from "node:util";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import * as process$1 from "node:process";
|
|
@@ -102,4 +102,4 @@ async function runAgentStart({ port, host, configPath, allowWrite, allowAll, ver
|
|
|
102
102
|
//#endregion
|
|
103
103
|
export { runAgentStart };
|
|
104
104
|
|
|
105
|
-
//# sourceMappingURL=agent-
|
|
105
|
+
//# sourceMappingURL=agent-BfqmQb32.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-BfqmQb32.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 const agentPkgUrl = import.meta.resolve('@kubb/agent/package.json')\n const agentPkgPath = fileURLToPath(agentPkgUrl)\n const agentDir = path.dirname(agentPkgPath)\n const serverPath = path.join(agentDir, agentDefaults.serverEntryPath)\n\n const resolvedEnv = resolveAgentStartEnvironment({ port, host, configPath, allowWrite, allowAll })\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(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'success' }))\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'failed' }))\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,7 +1,7 @@
|
|
|
1
1
|
require("./chunk-ByKO4r7w.cjs");
|
|
2
2
|
const require_define = require("./define-Bdn8j5VM.cjs");
|
|
3
|
-
const require_package = require("./package-
|
|
4
|
-
const require_constants = require("./constants-
|
|
3
|
+
const require_package = require("./package-C83USFM0.cjs");
|
|
4
|
+
const require_constants = require("./constants-B2q7VPbi.cjs");
|
|
5
5
|
//#region src/commands/agent/start.ts
|
|
6
6
|
const command$1 = require_define.defineCommand({
|
|
7
7
|
name: "start",
|
|
@@ -34,7 +34,7 @@ const command$1 = require_define.defineCommand({
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
async run({ values }) {
|
|
37
|
-
const { runAgentStart } = await Promise.resolve().then(() => require("./agent-
|
|
37
|
+
const { runAgentStart } = await Promise.resolve().then(() => require("./agent-BDKgkBp2.cjs"));
|
|
38
38
|
await runAgentStart({
|
|
39
39
|
port: values.port !== void 0 ? values.port : void 0,
|
|
40
40
|
host: values.host,
|
|
@@ -55,4 +55,4 @@ const command = require_define.defineCommand({
|
|
|
55
55
|
//#endregion
|
|
56
56
|
exports.command = command;
|
|
57
57
|
|
|
58
|
-
//# sourceMappingURL=agent-
|
|
58
|
+
//# sourceMappingURL=agent-CHFJ2Uap.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-CHFJ2Uap.cjs","names":["command","defineCommand","agentDefaults","defineCommand","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description: 'Start the Agent server',\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n port: { type: 'string', description: `Port for the server (default: ${agentDefaults.port})`, short: 'p' },\n host: { type: 'string', description: 'Host for the server', default: agentDefaults.host },\n 'allow-write': {\n type: 'boolean',\n description: 'Allow writing generated files to the filesystem. When not set, no files are written and the config patch is not persisted.',\n default: false,\n },\n 'allow-all': { type: 'boolean', description: 'Grant all permissions (implies --allow-write).', default: false },\n },\n async run({ values }) {\n const { runAgentStart } = await import('../../runners/agent.ts')\n\n await runAgentStart({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description: 'Manage the Kubb Agent server',\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;AAIA,MAAaA,YAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,MAAM;GAAE,MAAM;GAAU,aAAa,iCAAiCC,kBAAAA,cAAc,KAAK;GAAI,OAAO;GAAK;EACzG,MAAM;GAAE,MAAM;GAAU,aAAa;GAAuB,SAASA,kBAAAA,cAAc;GAAM;EACzF,eAAe;GACb,MAAM;GACN,aAAa;GACb,SAAS;GACV;EACD,aAAa;GAAE,MAAM;GAAW,aAAa;GAAkD,SAAS;GAAO;EAChH;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,kBAAkB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;AAEhC,QAAM,cAAc;GAClB,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;GAChD,MAAM,OAAO;GACb,YAAY,OAAO;GACnB,YAAY,OAAO;GACnB,UAAU,OAAO;GACjB,SAAA,gBAAA;GACD,CAAC;;CAEL,CAAC;;;AC3BF,MAAa,UAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,aAAa,CAACC,UAAa;CAC5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
2
|
import { n as defineCommand } from "./define-Ctii4bel.js";
|
|
3
|
-
import { t as version } from "./package-
|
|
4
|
-
import {
|
|
3
|
+
import { t as version } from "./package-CIbH7U3M.js";
|
|
4
|
+
import { s as agentDefaults } from "./constants-T_2rsi7T.js";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/commands/agent.ts
|
|
7
7
|
const command = defineCommand({
|
|
@@ -38,7 +38,7 @@ const command = defineCommand({
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
async run({ values }) {
|
|
41
|
-
const { runAgentStart } = await import("./agent-
|
|
41
|
+
const { runAgentStart } = await import("./agent-BfqmQb32.js");
|
|
42
42
|
await runAgentStart({
|
|
43
43
|
port: values.port !== void 0 ? values.port : void 0,
|
|
44
44
|
host: values.host,
|
|
@@ -53,4 +53,4 @@ const command = defineCommand({
|
|
|
53
53
|
//#endregion
|
|
54
54
|
export { command };
|
|
55
55
|
|
|
56
|
-
//# sourceMappingURL=agent-
|
|
56
|
+
//# sourceMappingURL=agent-h-dcOZmR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-
|
|
1
|
+
{"version":3,"file":"agent-h-dcOZmR.js","names":["command","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description: 'Start the Agent server',\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n port: { type: 'string', description: `Port for the server (default: ${agentDefaults.port})`, short: 'p' },\n host: { type: 'string', description: 'Host for the server', default: agentDefaults.host },\n 'allow-write': {\n type: 'boolean',\n description: 'Allow writing generated files to the filesystem. When not set, no files are written and the config patch is not persisted.',\n default: false,\n },\n 'allow-all': { type: 'boolean', description: 'Grant all permissions (implies --allow-write).', default: false },\n },\n async run({ values }) {\n const { runAgentStart } = await import('../../runners/agent.ts')\n\n await runAgentStart({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description: 'Manage the Kubb Agent server',\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;;ACGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,aAAa,CDFQ,cAAc;EACnC,MAAM;EACN,aAAa;EACb,SAAS;GACP,QAAQ;IAAE,MAAM;IAAU,aAAa;IAA2B,OAAO;IAAK;GAC9E,MAAM;IAAE,MAAM;IAAU,aAAa,iCAAiC,cAAc,KAAK;IAAI,OAAO;IAAK;GACzG,MAAM;IAAE,MAAM;IAAU,aAAa;IAAuB,SAAS,cAAc;IAAM;GACzF,eAAe;IACb,MAAM;IACN,aAAa;IACb,SAAS;IACV;GACD,aAAa;IAAE,MAAM;IAAW,aAAa;IAAkD,SAAS;IAAO;GAChH;EACD,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,SAAM,cAAc;IAClB,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;IAChD,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB;IACD,CAAC;;EAEL,CAAC,CCxB2B;CAC5B,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region src/constants.ts
|
|
2
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
|
+
/**
|
|
3
9
|
* NPM registry endpoint used to check for @kubb/cli updates.
|
|
4
10
|
*/
|
|
5
11
|
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
@@ -71,7 +77,7 @@ new Set([
|
|
|
71
77
|
const agentDefaults = {
|
|
72
78
|
port: "3000",
|
|
73
79
|
host: "localhost",
|
|
74
|
-
configFile:
|
|
80
|
+
configFile: KUBB_CONFIG_FILENAME,
|
|
75
81
|
retryTimeout: "30000",
|
|
76
82
|
studioUrl: "https://studio.kubb.dev",
|
|
77
83
|
serverEntryPath: ".output/server/index.mjs"
|
|
@@ -126,6 +132,12 @@ const pluginDefaultConfigs = {
|
|
|
126
132
|
* Color palette used by randomCliColor() for deterministic plugin name coloring.
|
|
127
133
|
*/
|
|
128
134
|
//#endregion
|
|
135
|
+
Object.defineProperty(exports, "KUBB_CONFIG_FILENAME", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function() {
|
|
138
|
+
return KUBB_CONFIG_FILENAME;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
129
141
|
Object.defineProperty(exports, "KUBB_NPM_PACKAGE_URL", {
|
|
130
142
|
enumerable: true,
|
|
131
143
|
get: function() {
|
|
@@ -175,4 +187,4 @@ Object.defineProperty(exports, "pluginDefaultConfigs", {
|
|
|
175
187
|
}
|
|
176
188
|
});
|
|
177
189
|
|
|
178
|
-
//# sourceMappingURL=constants-
|
|
190
|
+
//# sourceMappingURL=constants-B2q7VPbi.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-B2q7VPbi.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 QUITE_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\n/**\n * Flags accepted by the `generate` command.\n */\nexport const GENERATE_FLAGS = new Set(['--config', '-c', '--log-level', '-l', '--watch', '-w', '--debug', '-d', '--verbose', '-v', '--silent', '-s'] as const)\n\n/**\n * Flags accepted by the `validate` command.\n */\nexport const VALIDATE_FLAGS = new Set(['--input', '-i'] as const)\n\n/**\n * Flags accepted by the `init` command.\n */\nexport const INIT_FLAGS = new Set(['--yes', '-y'] as const)\n\n/**\n * Flags accepted by the `agent start` command.\n */\nexport const AGENT_START_FLAGS = new Set(['--config', '-c', '--port', '-p', '--host', '--allow-write', '--allow-all'] as const)\n\n/**\n * All known CLI flags across every command.\n */\nexport const ARGS = new Set([...QUITE_FLAGS, ...GENERATE_FLAGS, ...VALIDATE_FLAGS, ...INIT_FLAGS, ...AGENT_START_FLAGS] 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-oas', '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-oas': 'pluginOas()',\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-solid-query': `pluginSolidQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-svelte-query': `pluginSvelteQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-swr': `pluginSwr({\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} 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;;;;AAKhF,MAAa,iBAAiB,IAAI,IAAI;CAAC;CAAY;CAAM;CAAe;CAAM;CAAW;CAAM;CAAW;CAAM;CAAa;CAAM;CAAY;CAAK,CAAU;;;;AAK9J,MAAa,iBAAiB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAU;;;;AAKjE,MAAa,aAAa,IAAI,IAAI,CAAC,SAAS,KAAK,CAAU;;;;AAK3D,MAAa,oBAAoB,IAAI,IAAI;CAAC;CAAY;CAAM;CAAU;CAAM;CAAU;CAAiB;CAAc,CAAU;AAK3G,IAAI,IAAI;CAAC,GAAG;CAAa,GAAG;CAAgB,GAAG;CAAgB,GAAG;CAAY,GAAG;CAAkB,CAAU;AAEjI,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,cAAc,YAAY;CACrC;;;;;;AAOD,MAAa,uBAAuB;CAClC,cAAc;CACd,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,sBAAsB;;;CAGtB,uBAAuB;;;CAGvB,oBAAoB;;;CAGpB,cAAc;;;CAGd,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGf"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region src/constants.ts
|
|
2
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
|
+
/**
|
|
3
9
|
* NPM registry endpoint used to check for @kubb/cli updates.
|
|
4
10
|
*/
|
|
5
11
|
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
@@ -71,7 +77,7 @@ new Set([
|
|
|
71
77
|
const agentDefaults = {
|
|
72
78
|
port: "3000",
|
|
73
79
|
host: "localhost",
|
|
74
|
-
configFile:
|
|
80
|
+
configFile: KUBB_CONFIG_FILENAME,
|
|
75
81
|
retryTimeout: "30000",
|
|
76
82
|
studioUrl: "https://studio.kubb.dev",
|
|
77
83
|
serverEntryPath: ".output/server/index.mjs"
|
|
@@ -126,6 +132,6 @@ const pluginDefaultConfigs = {
|
|
|
126
132
|
* Color palette used by randomCliColor() for deterministic plugin name coloring.
|
|
127
133
|
*/
|
|
128
134
|
//#endregion
|
|
129
|
-
export {
|
|
135
|
+
export { SUMMARY_SEPARATOR as a, initDefaults as c, QUITE_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 };
|
|
130
136
|
|
|
131
|
-
//# sourceMappingURL=constants-
|
|
137
|
+
//# sourceMappingURL=constants-T_2rsi7T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-T_2rsi7T.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 QUITE_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\n/**\n * Flags accepted by the `generate` command.\n */\nexport const GENERATE_FLAGS = new Set(['--config', '-c', '--log-level', '-l', '--watch', '-w', '--debug', '-d', '--verbose', '-v', '--silent', '-s'] as const)\n\n/**\n * Flags accepted by the `validate` command.\n */\nexport const VALIDATE_FLAGS = new Set(['--input', '-i'] as const)\n\n/**\n * Flags accepted by the `init` command.\n */\nexport const INIT_FLAGS = new Set(['--yes', '-y'] as const)\n\n/**\n * Flags accepted by the `agent start` command.\n */\nexport const AGENT_START_FLAGS = new Set(['--config', '-c', '--port', '-p', '--host', '--allow-write', '--allow-all'] as const)\n\n/**\n * All known CLI flags across every command.\n */\nexport const ARGS = new Set([...QUITE_FLAGS, ...GENERATE_FLAGS, ...VALIDATE_FLAGS, ...INIT_FLAGS, ...AGENT_START_FLAGS] 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-oas', '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-oas': 'pluginOas()',\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-solid-query': `pluginSolidQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-svelte-query': `pluginSvelteQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-swr': `pluginSwr({\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} 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;;;;AAKhF,MAAa,iBAAiB,IAAI,IAAI;CAAC;CAAY;CAAM;CAAe;CAAM;CAAW;CAAM;CAAW;CAAM;CAAa;CAAM;CAAY;CAAK,CAAU;;;;AAK9J,MAAa,iBAAiB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAU;;;;AAKjE,MAAa,aAAa,IAAI,IAAI,CAAC,SAAS,KAAK,CAAU;;;;AAK3D,MAAa,oBAAoB,IAAI,IAAI;CAAC;CAAY;CAAM;CAAU;CAAM;CAAU;CAAiB;CAAc,CAAU;AAK3G,IAAI,IAAI;CAAC,GAAG;CAAa,GAAG;CAAgB,GAAG;CAAgB,GAAG;CAAY,GAAG;CAAkB,CAAU;AAEjI,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,cAAc,YAAY;CACrC;;;;;;AAOD,MAAa,uBAAuB;CAClC,cAAc;CACd,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,sBAAsB;;;CAGtB,uBAAuB;;;CAGvB,oBAAoB;;;CAGpB,cAAc;;;CAGd,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGf"}
|
|
@@ -50,7 +50,7 @@ const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
|
50
50
|
},
|
|
51
51
|
async run({ values, positionals }) {
|
|
52
52
|
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
53
|
-
const { runGenerateCommand } = await Promise.resolve().then(() => require("./generate-
|
|
53
|
+
const { runGenerateCommand } = await Promise.resolve().then(() => require("./generate-DvH7BPcI.cjs"));
|
|
54
54
|
await runGenerateCommand({
|
|
55
55
|
input: positionals[0],
|
|
56
56
|
configPath: values.config,
|
|
@@ -62,4 +62,4 @@ const command = require("./define-Bdn8j5VM.cjs").defineCommand({
|
|
|
62
62
|
//#endregion
|
|
63
63
|
exports.command = command;
|
|
64
64
|
|
|
65
|
-
//# sourceMappingURL=generate-
|
|
65
|
+
//# sourceMappingURL=generate-CYkg_BlH.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-CYkg_BlH.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\n name: 'generate',\n description: \"[input] Generate files based on a 'kubb.config.ts' file\",\n arguments: ['[input]'],\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },\n debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },\n verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },\n silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })\n },\n})\n"],"mappings":";;AAEA,MAAa,2CAAUA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GAAE,MAAM;GAAW,aAAa;GAAsC,OAAO;GAAK,SAAS;GAAO;EACzG,OAAO;GAAE,MAAM;GAAW,aAAa;GAA8B,OAAO;GAAK,SAAS;GAAO;EACjG,SAAS;GAAE,MAAM;GAAW,aAAa;GAAgC,OAAO;GAAK,SAAS;GAAO;EACrG,QAAQ;GAAE,MAAM;GAAW,aAAa;GAA+B,OAAO;GAAK,SAAS;GAAO;EACpG;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAErC,QAAM,mBAAmB;GAAE,OAAO,YAAY;GAAI,YAAY,OAAO;GAAQ;GAAU,OAAO,OAAO;GAAO,CAAC;;CAEhH,CAAC"}
|
|
@@ -51,7 +51,7 @@ const command = defineCommand({
|
|
|
51
51
|
},
|
|
52
52
|
async run({ values, positionals }) {
|
|
53
53
|
const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
|
|
54
|
-
const { runGenerateCommand } = await import("./generate-
|
|
54
|
+
const { runGenerateCommand } = await import("./generate-mGl32oAA.js");
|
|
55
55
|
await runGenerateCommand({
|
|
56
56
|
input: positionals[0],
|
|
57
57
|
configPath: values.config,
|
|
@@ -63,4 +63,4 @@ const command = defineCommand({
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { command };
|
|
65
65
|
|
|
66
|
-
//# sourceMappingURL=generate-
|
|
66
|
+
//# sourceMappingURL=generate-Cq_CZ2bV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-Cq_CZ2bV.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\n name: 'generate',\n description: \"[input] Generate files based on a 'kubb.config.ts' file\",\n arguments: ['[input]'],\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },\n debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },\n verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },\n silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })\n },\n})\n"],"mappings":";;;AAEA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GAAE,MAAM;GAAW,aAAa;GAAsC,OAAO;GAAK,SAAS;GAAO;EACzG,OAAO;GAAE,MAAM;GAAW,aAAa;GAA8B,OAAO;GAAK,SAAS;GAAO;EACjG,SAAS;GAAE,MAAM;GAAW,aAAa;GAAgC,OAAO;GAAK,SAAS;GAAO;EACrG,QAAQ;GAAE,MAAM;GAAW,aAAa;GAA+B,OAAO;GAAK,SAAS;GAAO;EACpG;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAM,OAAO;AAE5C,QAAM,mBAAmB;GAAE,OAAO,YAAY;GAAI,YAAY,OAAO;GAAQ;GAAU,OAAO,OAAO;GAAO,CAAC;;CAEhH,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-ByKO4r7w.cjs");
|
|
2
2
|
const require_errors = require("./errors-CLCjoSg0.cjs");
|
|
3
|
-
const require_telemetry = require("./telemetry-
|
|
3
|
+
const require_telemetry = require("./telemetry-B6ZbZOrb.cjs");
|
|
4
4
|
const require_shell = require("./shell-475fQKaX.cjs");
|
|
5
|
-
const require_package = require("./package-
|
|
6
|
-
const require_constants = require("./constants-
|
|
5
|
+
const require_package = require("./package-C83USFM0.cjs");
|
|
6
|
+
const require_constants = require("./constants-B2q7VPbi.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
let node_events = require("node:events");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1697,4 +1697,4 @@ async function runGenerateCommand({ input, configPath, logLevel: logLevelKey, wa
|
|
|
1697
1697
|
//#endregion
|
|
1698
1698
|
exports.runGenerateCommand = runGenerateCommand;
|
|
1699
1699
|
|
|
1700
|
-
//# sourceMappingURL=generate-
|
|
1700
|
+
//# sourceMappingURL=generate-DvH7BPcI.cjs.map
|