@kubb/cli 5.0.0-beta.6 → 5.0.0-beta.61

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 (142) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +170 -51
  3. package/dist/Telemetry-CVdyJarO.js +283 -0
  4. package/dist/Telemetry-CVdyJarO.js.map +1 -0
  5. package/dist/Telemetry-DrppRqqW.cjs +320 -0
  6. package/dist/Telemetry-DrppRqqW.cjs.map +1 -0
  7. package/dist/{define-Bdn8j5VM.cjs → define-C4AB3POr.cjs} +2 -2
  8. package/dist/{define-Bdn8j5VM.cjs.map → define-C4AB3POr.cjs.map} +1 -1
  9. package/dist/{define-Ctii4bel.js → define-C63T4jp6.js} +2 -2
  10. package/dist/{define-Ctii4bel.js.map → define-C63T4jp6.js.map} +1 -1
  11. package/dist/{errors-CjPmyZHy.js → errors-BsemQCMn.js} +2 -2
  12. package/dist/{errors-CjPmyZHy.js.map → errors-BsemQCMn.js.map} +1 -1
  13. package/dist/{errors-CLCjoSg0.cjs → errors-DykI11xo.cjs} +2 -2
  14. package/dist/{errors-CLCjoSg0.cjs.map → errors-DykI11xo.cjs.map} +1 -1
  15. package/dist/{generate-BB2Q7I9s.cjs → generate-CJuBlTeJ.cjs} +22 -17
  16. package/dist/generate-CJuBlTeJ.cjs.map +1 -0
  17. package/dist/{generate-BmulGxIM.js → generate-DAePC4G2.js} +22 -17
  18. package/dist/generate-DAePC4G2.js.map +1 -0
  19. package/dist/index.cjs +10 -27
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +10 -27
  23. package/dist/index.js.map +1 -1
  24. package/dist/{init-BTp9if7K.js → init-C8m7Z_W8.js} +6 -6
  25. package/dist/{init-BTp9if7K.js.map → init-C8m7Z_W8.js.map} +1 -1
  26. package/dist/{init-Dpg8e1HN.cjs → init-T1DC44PT.cjs} +6 -6
  27. package/dist/{init-Dpg8e1HN.cjs.map → init-T1DC44PT.cjs.map} +1 -1
  28. package/dist/{mcp-wpl6sYYR.cjs → mcp-B60MeTmD.cjs} +6 -6
  29. package/dist/{mcp-wpl6sYYR.cjs.map → mcp-B60MeTmD.cjs.map} +1 -1
  30. package/dist/{mcp-C9RoU-Dg.js → mcp-lEYflz1a.js} +6 -6
  31. package/dist/{mcp-C9RoU-Dg.js.map → mcp-lEYflz1a.js.map} +1 -1
  32. package/dist/package-BynuV_3t.js +6 -0
  33. package/dist/package-BynuV_3t.js.map +1 -0
  34. package/dist/{package-iheSdfas.cjs → package-QUV6JOtx.cjs} +2 -2
  35. package/dist/package-QUV6JOtx.cjs.map +1 -0
  36. package/dist/run-9ZhHuNZQ.cjs +33 -0
  37. package/dist/run-9ZhHuNZQ.cjs.map +1 -0
  38. package/dist/run-BG7Giryi.js +296 -0
  39. package/dist/run-BG7Giryi.js.map +1 -0
  40. package/dist/{validate-BU4fPTMc.cjs → run-BQO_tPlc.cjs} +25 -20
  41. package/dist/run-BQO_tPlc.cjs.map +1 -0
  42. package/dist/run-C-5oRB_f.cjs +1380 -0
  43. package/dist/run-C-5oRB_f.cjs.map +1 -0
  44. package/dist/run-CYnDu3ch.js +51 -0
  45. package/dist/run-CYnDu3ch.js.map +1 -0
  46. package/dist/run-Da0AZlgo.js +1377 -0
  47. package/dist/run-Da0AZlgo.js.map +1 -0
  48. package/dist/run-DpKny2hT.cjs +300 -0
  49. package/dist/run-DpKny2hT.cjs.map +1 -0
  50. package/dist/run-h8NTawHO.js +32 -0
  51. package/dist/run-h8NTawHO.js.map +1 -0
  52. package/dist/tools-BU99bhi8.js +152 -0
  53. package/dist/tools-BU99bhi8.js.map +1 -0
  54. package/dist/tools-_Xp8-_zy.cjs +175 -0
  55. package/dist/tools-_Xp8-_zy.cjs.map +1 -0
  56. package/dist/{validate-BfJoCxrC.js → validate-BhDi3x5e.js} +6 -6
  57. package/dist/{validate-BfJoCxrC.js.map → validate-BhDi3x5e.js.map} +1 -1
  58. package/dist/{validate-DIDBROB2.cjs → validate-CUEvWAyG.cjs} +6 -6
  59. package/dist/{validate-DIDBROB2.cjs.map → validate-CUEvWAyG.cjs.map} +1 -1
  60. package/package.json +12 -27
  61. package/src/Telemetry.ts +297 -0
  62. package/src/commands/generate.ts +18 -12
  63. package/src/commands/init.ts +2 -2
  64. package/src/commands/mcp.ts +2 -2
  65. package/src/commands/validate.ts +2 -2
  66. package/src/constants.ts +2 -35
  67. package/src/index.ts +5 -21
  68. package/src/loggers/clackLogger.ts +136 -202
  69. package/src/loggers/defineLogger.ts +59 -0
  70. package/src/loggers/plainLogger.ts +48 -103
  71. package/src/loggers/types.ts +6 -1
  72. package/src/loggers/utils.ts +167 -24
  73. package/src/runners/generate/run.ts +399 -0
  74. package/src/runners/generate/utils.ts +229 -0
  75. package/src/runners/{init.ts → init/run.ts} +81 -78
  76. package/src/runners/init/utils.ts +39 -0
  77. package/src/runners/mcp/run.ts +37 -0
  78. package/src/runners/{validate.ts → validate/run.ts} +25 -20
  79. package/dist/agent-BJEvbSiP.js +0 -68
  80. package/dist/agent-BJEvbSiP.js.map +0 -1
  81. package/dist/agent-CXNO6dgj.cjs +0 -70
  82. package/dist/agent-CXNO6dgj.cjs.map +0 -1
  83. package/dist/agent-D9CKYh4K.cjs +0 -122
  84. package/dist/agent-D9CKYh4K.cjs.map +0 -1
  85. package/dist/agent-VXKxLCho.js +0 -118
  86. package/dist/agent-VXKxLCho.js.map +0 -1
  87. package/dist/constants-BPJBMT_6.js +0 -45
  88. package/dist/constants-BPJBMT_6.js.map +0 -1
  89. package/dist/constants-BYGmiFs0.cjs +0 -139
  90. package/dist/constants-BYGmiFs0.cjs.map +0 -1
  91. package/dist/constants-DSJ-Xrbv.js +0 -116
  92. package/dist/constants-DSJ-Xrbv.js.map +0 -1
  93. package/dist/constants-Rcaqzyd-.cjs +0 -80
  94. package/dist/constants-Rcaqzyd-.cjs.map +0 -1
  95. package/dist/generate-BB2Q7I9s.cjs.map +0 -1
  96. package/dist/generate-B_p5dl68.cjs +0 -1755
  97. package/dist/generate-B_p5dl68.cjs.map +0 -1
  98. package/dist/generate-BmulGxIM.js.map +0 -1
  99. package/dist/generate-DAsdUw3z.js +0 -1752
  100. package/dist/generate-DAsdUw3z.js.map +0 -1
  101. package/dist/init-CJ80lKSP.cjs +0 -239
  102. package/dist/init-CJ80lKSP.cjs.map +0 -1
  103. package/dist/init-DCqcEq86.js +0 -235
  104. package/dist/init-DCqcEq86.js.map +0 -1
  105. package/dist/mcp-D1llTaRM.cjs +0 -50
  106. package/dist/mcp-D1llTaRM.cjs.map +0 -1
  107. package/dist/mcp-DNUw8nqb.js +0 -49
  108. package/dist/mcp-DNUw8nqb.js.map +0 -1
  109. package/dist/package-iheSdfas.cjs.map +0 -1
  110. package/dist/package-vLafMWCe.js +0 -6
  111. package/dist/package-vLafMWCe.js.map +0 -1
  112. package/dist/shell-475fQKaX.cjs +0 -62
  113. package/dist/shell-475fQKaX.cjs.map +0 -1
  114. package/dist/shell-DLzN4fRo.js +0 -51
  115. package/dist/shell-DLzN4fRo.js.map +0 -1
  116. package/dist/telemetry-BLX0NzRk.cjs +0 -282
  117. package/dist/telemetry-BLX0NzRk.cjs.map +0 -1
  118. package/dist/telemetry-juq4QBf7.js +0 -245
  119. package/dist/telemetry-juq4QBf7.js.map +0 -1
  120. package/dist/validate-BU4fPTMc.cjs.map +0 -1
  121. package/dist/validate-k9s_hFah.js +0 -46
  122. package/dist/validate-k9s_hFah.js.map +0 -1
  123. package/src/commands/agent/start.ts +0 -50
  124. package/src/commands/agent.ts +0 -10
  125. package/src/loggers/fileSystemLogger.ts +0 -138
  126. package/src/loggers/githubActionsLogger.ts +0 -379
  127. package/src/runners/agent.ts +0 -155
  128. package/src/runners/generate.ts +0 -333
  129. package/src/runners/mcp.ts +0 -56
  130. package/src/types.ts +0 -11
  131. package/src/utils/Writables.ts +0 -17
  132. package/src/utils/executeHooks.ts +0 -45
  133. package/src/utils/flags.ts +0 -9
  134. package/src/utils/getConfig.ts +0 -10
  135. package/src/utils/getCosmiConfig.ts +0 -75
  136. package/src/utils/getSummary.ts +0 -68
  137. package/src/utils/packageManager.ts +0 -23
  138. package/src/utils/runHook.ts +0 -91
  139. package/src/utils/telemetry.ts +0 -273
  140. package/src/utils/watcher.ts +0 -19
  141. /package/dist/{chunk-ByKO4r7w.cjs → chunk-Bx3C2hgW.cjs} +0 -0
  142. /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
@@ -0,0 +1,152 @@
1
+ import "./chunk-C0LytTxp.js";
2
+ import { spawn } from "node:child_process";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { join } from "node:path";
5
+ //#region ../../internals/utils/src/tools.ts
6
+ /**
7
+ * CLI command descriptors for each supported code formatter.
8
+ *
9
+ * Each entry contains the executable `command`, an `args` factory that maps an
10
+ * output path to the correct argument list, and an `errorMessage` shown when
11
+ * the formatter is not found.
12
+ */
13
+ const formatters = {
14
+ prettier: {
15
+ command: "prettier",
16
+ args: (outputPath) => [
17
+ "--ignore-unknown",
18
+ "--write",
19
+ outputPath
20
+ ],
21
+ errorMessage: "Prettier not found"
22
+ },
23
+ biome: {
24
+ command: "biome",
25
+ args: (outputPath) => [
26
+ "format",
27
+ "--write",
28
+ outputPath
29
+ ],
30
+ errorMessage: "Biome not found"
31
+ },
32
+ oxfmt: {
33
+ command: "oxfmt",
34
+ args: (outputPath) => [outputPath],
35
+ errorMessage: "Oxfmt not found"
36
+ }
37
+ };
38
+ /**
39
+ * CLI command descriptors for each supported linter.
40
+ *
41
+ * Each entry contains the executable `command`, an `args` factory that maps an
42
+ * output path to the correct argument list, and an `errorMessage` shown when
43
+ * the linter is not found.
44
+ */
45
+ const linters = {
46
+ eslint: {
47
+ command: "eslint",
48
+ args: (outputPath) => [outputPath, "--fix"],
49
+ errorMessage: "Eslint not found"
50
+ },
51
+ biome: {
52
+ command: "biome",
53
+ args: (outputPath) => [
54
+ "lint",
55
+ "--fix",
56
+ outputPath
57
+ ],
58
+ errorMessage: "Biome not found"
59
+ },
60
+ oxlint: {
61
+ command: "oxlint",
62
+ args: (outputPath) => [
63
+ "--fix",
64
+ "--no-ignore",
65
+ outputPath
66
+ ],
67
+ errorMessage: "Oxlint not found"
68
+ }
69
+ };
70
+ /**
71
+ * Resolves to `true` when running `tool --version` exits with code 0.
72
+ */
73
+ async function isToolAvailable(tool) {
74
+ return new Promise((resolve) => {
75
+ const child = spawn(tool, ["--version"], { stdio: "ignore" });
76
+ child.on("close", (code) => resolve(code === 0));
77
+ child.on("error", () => resolve(false));
78
+ });
79
+ }
80
+ /**
81
+ * Returns the first installed tool from `candidates`, checked in order, or `null` when none are found.
82
+ *
83
+ * Availability is probed by running `<tool> --version` and checking for a zero exit code.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const formatter = await detectTool(['oxfmt', 'biome', 'prettier'] as const)
88
+ * const linter = await detectTool(['oxlint', 'biome', 'eslint'] as const)
89
+ * ```
90
+ */
91
+ async function detectTool(candidates) {
92
+ for (const tool of candidates) if (await isToolAvailable(tool)) return tool;
93
+ return null;
94
+ }
95
+ /**
96
+ * Metadata for each supported package manager, keyed by its short name.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * packageManagers.pnpm.installCommand // ['add', '-D']
101
+ * packageManagers.npm.lockFile // 'package-lock.json'
102
+ * ```
103
+ */
104
+ const packageManagers = {
105
+ pnpm: {
106
+ name: "pnpm",
107
+ lockFile: "pnpm-lock.yaml",
108
+ installCommand: ["add", "-D"]
109
+ },
110
+ yarn: {
111
+ name: "yarn",
112
+ lockFile: "yarn.lock",
113
+ installCommand: ["add", "-D"]
114
+ },
115
+ bun: {
116
+ name: "bun",
117
+ lockFile: "bun.lockb",
118
+ installCommand: ["add", "-d"]
119
+ },
120
+ npm: {
121
+ name: "npm",
122
+ lockFile: "package-lock.json",
123
+ installCommand: ["install", "--save-dev"]
124
+ }
125
+ };
126
+ /**
127
+ * Detects the active package manager for the given directory.
128
+ * Resolution order: `packageManager` field in `package.json`, then presence of a lock file.
129
+ * Falls back to `npm` when no signal is found.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }
134
+ * detectPackageManager() // falls back to npm when no lock file is found
135
+ * ```
136
+ */
137
+ function detectPackageManager(cwd = process.cwd()) {
138
+ const packageJsonPath = join(cwd, "package.json");
139
+ if (existsSync(packageJsonPath)) try {
140
+ const pmField = JSON.parse(readFileSync(packageJsonPath, "utf-8")).packageManager;
141
+ if (typeof pmField === "string") {
142
+ const name = pmField.split("@")[0];
143
+ if (name && name in packageManagers) return packageManagers[name];
144
+ }
145
+ } catch {}
146
+ for (const pm of Object.values(packageManagers)) if (existsSync(join(cwd, pm.lockFile))) return pm;
147
+ return packageManagers.npm;
148
+ }
149
+ //#endregion
150
+ export { linters as i, detectTool as n, formatters as r, detectPackageManager as t };
151
+
152
+ //# sourceMappingURL=tools-BU99bhi8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools-BU99bhi8.js","names":[],"sources":["../../../internals/utils/src/tools.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\n/**\n * CLI command descriptors for each supported code formatter.\n *\n * Each entry contains the executable `command`, an `args` factory that maps an\n * output path to the correct argument list, and an `errorMessage` shown when\n * the formatter is not found.\n */\nexport const formatters = {\n prettier: {\n command: 'prettier',\n args: (outputPath: string) => ['--ignore-unknown', '--write', outputPath],\n errorMessage: 'Prettier not found',\n },\n biome: {\n command: 'biome',\n args: (outputPath: string) => ['format', '--write', outputPath],\n errorMessage: 'Biome not found',\n },\n oxfmt: {\n command: 'oxfmt',\n args: (outputPath: string) => [outputPath],\n errorMessage: 'Oxfmt not found',\n },\n} as const\n\n/**\n * CLI command descriptors for each supported linter.\n *\n * Each entry contains the executable `command`, an `args` factory that maps an\n * output path to the correct argument list, and an `errorMessage` shown when\n * the linter is not found.\n */\nexport const linters = {\n eslint: {\n command: 'eslint',\n args: (outputPath: string) => [outputPath, '--fix'],\n errorMessage: 'Eslint not found',\n },\n biome: {\n command: 'biome',\n args: (outputPath: string) => ['lint', '--fix', outputPath],\n errorMessage: 'Biome not found',\n },\n oxlint: {\n command: 'oxlint',\n // --no-ignore so oxlint lints the folder even when it's gitignored (generated output dirs usually are).\n args: (outputPath: string) => ['--fix', '--no-ignore', outputPath],\n errorMessage: 'Oxlint not found',\n },\n} as const\n\n/**\n * Resolves to `true` when running `tool --version` exits with code 0.\n */\nasync function isToolAvailable(tool: string): Promise<boolean> {\n return new Promise((resolve) => {\n const child = spawn(tool, ['--version'], { stdio: 'ignore' })\n child.on('close', (code) => resolve(code === 0))\n child.on('error', () => resolve(false))\n })\n}\n\n/**\n * Returns the first installed tool from `candidates`, checked in order, or `null` when none are found.\n *\n * Availability is probed by running `<tool> --version` and checking for a zero exit code.\n *\n * @example\n * ```ts\n * const formatter = await detectTool(['oxfmt', 'biome', 'prettier'] as const)\n * const linter = await detectTool(['oxlint', 'biome', 'eslint'] as const)\n * ```\n */\nexport async function detectTool<TName extends string>(candidates: ReadonlyArray<TName>): Promise<TName | null> {\n for (const tool of candidates) {\n if (await isToolAvailable(tool)) {\n return tool\n }\n }\n\n return null\n}\n\n/**\n * Supported package manager identifiers.\n *\n * @example\n * ```ts\n * const pm: PackageManagerName = 'pnpm'\n * ```\n */\nexport type PackageManagerName = 'npm' | 'pnpm' | 'yarn' | 'bun'\n\n/**\n * Metadata describing a package manager's lock file and install command.\n */\nexport interface PackageManagerInfo {\n /**\n * Identifier used in CLI commands, e.g. `pnpm`, `yarn`.\n */\n name: PackageManagerName\n /**\n * Lock file name that uniquely identifies this package manager in a project root.\n */\n lockFile: string\n /**\n * Subcommands passed to the package manager binary to install a dev dependency.\n */\n installCommand: ReadonlyArray<string>\n}\n\n/**\n * Metadata for each supported package manager, keyed by its short name.\n *\n * @example\n * ```ts\n * packageManagers.pnpm.installCommand // ['add', '-D']\n * packageManagers.npm.lockFile // 'package-lock.json'\n * ```\n */\nconst packageManagers: Record<PackageManagerName, PackageManagerInfo> = {\n pnpm: {\n name: 'pnpm',\n lockFile: 'pnpm-lock.yaml',\n installCommand: ['add', '-D'],\n },\n yarn: {\n name: 'yarn',\n lockFile: 'yarn.lock',\n installCommand: ['add', '-D'],\n },\n bun: {\n name: 'bun',\n lockFile: 'bun.lockb',\n installCommand: ['add', '-d'],\n },\n npm: {\n name: 'npm',\n lockFile: 'package-lock.json',\n installCommand: ['install', '--save-dev'],\n },\n}\n\n/**\n * Minimal shape of `package.json` fields read during detection.\n */\ntype PackageJson = {\n /**\n * The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`).\n */\n packageManager?: string\n}\n\n/**\n * Detects the active package manager for the given directory.\n * Resolution order: `packageManager` field in `package.json`, then presence of a lock file.\n * Falls back to `npm` when no signal is found.\n *\n * @example\n * ```ts\n * detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }\n * detectPackageManager() // falls back to npm when no lock file is found\n * ```\n */\nexport function detectPackageManager(cwd: string = process.cwd()): PackageManagerInfo {\n const packageJsonPath = join(cwd, 'package.json')\n if (existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as PackageJson\n const pmField = packageJson.packageManager\n if (typeof pmField === 'string') {\n const name = pmField.split('@')[0]\n if (name && name in packageManagers) {\n return packageManagers[name as PackageManagerName]\n }\n }\n } catch {\n // Continue to lock file detection\n }\n }\n\n for (const pm of Object.values(packageManagers)) {\n if (existsSync(join(cwd, pm.lockFile))) {\n return pm\n }\n }\n\n return packageManagers.npm\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,aAAa;CACxB,UAAU;EACR,SAAS;EACT,OAAO,eAAuB;GAAC;GAAoB;GAAW;EAAU;EACxE,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB;GAAC;GAAU;GAAW;EAAU;EAC9D,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB,CAAC,UAAU;EACzC,cAAc;CAChB;AACF;;;;;;;;AASA,MAAa,UAAU;CACrB,QAAQ;EACN,SAAS;EACT,OAAO,eAAuB,CAAC,YAAY,OAAO;EAClD,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB;GAAC;GAAQ;GAAS;EAAU;EAC1D,cAAc;CAChB;CACA,QAAQ;EACN,SAAS;EAET,OAAO,eAAuB;GAAC;GAAS;GAAe;EAAU;EACjE,cAAc;CAChB;AACF;;;;AAKA,eAAe,gBAAgB,MAAgC;CAC7D,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,QAAQ,MAAM,MAAM,CAAC,WAAW,GAAG,EAAE,OAAO,SAAS,CAAC;EAC5D,MAAM,GAAG,UAAU,SAAS,QAAQ,SAAS,CAAC,CAAC;EAC/C,MAAM,GAAG,eAAe,QAAQ,KAAK,CAAC;CACxC,CAAC;AACH;;;;;;;;;;;;AAaA,eAAsB,WAAiC,YAAyD;CAC9G,KAAK,MAAM,QAAQ,YACjB,IAAI,MAAM,gBAAgB,IAAI,GAC5B,OAAO;CAIX,OAAO;AACT;;;;;;;;;;AAuCA,MAAM,kBAAkE;CACtE,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,WAAW,YAAY;CAC1C;AACF;;;;;;;;;;;;AAuBA,SAAgB,qBAAqB,MAAc,QAAQ,IAAI,GAAuB;CACpF,MAAM,kBAAkB,KAAK,KAAK,cAAc;CAChD,IAAI,WAAW,eAAe,GAC5B,IAAI;EAEF,MAAM,UADc,KAAK,MAAM,aAAa,iBAAiB,OAAO,CAC1C,CAAC,CAAC;EAC5B,IAAI,OAAO,YAAY,UAAU;GAC/B,MAAM,OAAO,QAAQ,MAAM,GAAG,CAAC,CAAC;GAChC,IAAI,QAAQ,QAAQ,iBAClB,OAAO,gBAAgB;EAE3B;CACF,QAAQ,CAER;CAGF,KAAK,MAAM,MAAM,OAAO,OAAO,eAAe,GAC5C,IAAI,WAAW,KAAK,KAAK,GAAG,QAAQ,CAAC,GACnC,OAAO;CAIX,OAAO,gBAAgB;AACzB"}
@@ -0,0 +1,175 @@
1
+ require("./chunk-Bx3C2hgW.cjs");
2
+ let node_child_process = require("node:child_process");
3
+ let node_fs = require("node:fs");
4
+ let node_path = require("node:path");
5
+ //#region ../../internals/utils/src/tools.ts
6
+ /**
7
+ * CLI command descriptors for each supported code formatter.
8
+ *
9
+ * Each entry contains the executable `command`, an `args` factory that maps an
10
+ * output path to the correct argument list, and an `errorMessage` shown when
11
+ * the formatter is not found.
12
+ */
13
+ const formatters = {
14
+ prettier: {
15
+ command: "prettier",
16
+ args: (outputPath) => [
17
+ "--ignore-unknown",
18
+ "--write",
19
+ outputPath
20
+ ],
21
+ errorMessage: "Prettier not found"
22
+ },
23
+ biome: {
24
+ command: "biome",
25
+ args: (outputPath) => [
26
+ "format",
27
+ "--write",
28
+ outputPath
29
+ ],
30
+ errorMessage: "Biome not found"
31
+ },
32
+ oxfmt: {
33
+ command: "oxfmt",
34
+ args: (outputPath) => [outputPath],
35
+ errorMessage: "Oxfmt not found"
36
+ }
37
+ };
38
+ /**
39
+ * CLI command descriptors for each supported linter.
40
+ *
41
+ * Each entry contains the executable `command`, an `args` factory that maps an
42
+ * output path to the correct argument list, and an `errorMessage` shown when
43
+ * the linter is not found.
44
+ */
45
+ const linters = {
46
+ eslint: {
47
+ command: "eslint",
48
+ args: (outputPath) => [outputPath, "--fix"],
49
+ errorMessage: "Eslint not found"
50
+ },
51
+ biome: {
52
+ command: "biome",
53
+ args: (outputPath) => [
54
+ "lint",
55
+ "--fix",
56
+ outputPath
57
+ ],
58
+ errorMessage: "Biome not found"
59
+ },
60
+ oxlint: {
61
+ command: "oxlint",
62
+ args: (outputPath) => [
63
+ "--fix",
64
+ "--no-ignore",
65
+ outputPath
66
+ ],
67
+ errorMessage: "Oxlint not found"
68
+ }
69
+ };
70
+ /**
71
+ * Resolves to `true` when running `tool --version` exits with code 0.
72
+ */
73
+ async function isToolAvailable(tool) {
74
+ return new Promise((resolve) => {
75
+ const child = (0, node_child_process.spawn)(tool, ["--version"], { stdio: "ignore" });
76
+ child.on("close", (code) => resolve(code === 0));
77
+ child.on("error", () => resolve(false));
78
+ });
79
+ }
80
+ /**
81
+ * Returns the first installed tool from `candidates`, checked in order, or `null` when none are found.
82
+ *
83
+ * Availability is probed by running `<tool> --version` and checking for a zero exit code.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const formatter = await detectTool(['oxfmt', 'biome', 'prettier'] as const)
88
+ * const linter = await detectTool(['oxlint', 'biome', 'eslint'] as const)
89
+ * ```
90
+ */
91
+ async function detectTool(candidates) {
92
+ for (const tool of candidates) if (await isToolAvailable(tool)) return tool;
93
+ return null;
94
+ }
95
+ /**
96
+ * Metadata for each supported package manager, keyed by its short name.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * packageManagers.pnpm.installCommand // ['add', '-D']
101
+ * packageManagers.npm.lockFile // 'package-lock.json'
102
+ * ```
103
+ */
104
+ const packageManagers = {
105
+ pnpm: {
106
+ name: "pnpm",
107
+ lockFile: "pnpm-lock.yaml",
108
+ installCommand: ["add", "-D"]
109
+ },
110
+ yarn: {
111
+ name: "yarn",
112
+ lockFile: "yarn.lock",
113
+ installCommand: ["add", "-D"]
114
+ },
115
+ bun: {
116
+ name: "bun",
117
+ lockFile: "bun.lockb",
118
+ installCommand: ["add", "-d"]
119
+ },
120
+ npm: {
121
+ name: "npm",
122
+ lockFile: "package-lock.json",
123
+ installCommand: ["install", "--save-dev"]
124
+ }
125
+ };
126
+ /**
127
+ * Detects the active package manager for the given directory.
128
+ * Resolution order: `packageManager` field in `package.json`, then presence of a lock file.
129
+ * Falls back to `npm` when no signal is found.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }
134
+ * detectPackageManager() // falls back to npm when no lock file is found
135
+ * ```
136
+ */
137
+ function detectPackageManager(cwd = process.cwd()) {
138
+ const packageJsonPath = (0, node_path.join)(cwd, "package.json");
139
+ if ((0, node_fs.existsSync)(packageJsonPath)) try {
140
+ const pmField = JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf-8")).packageManager;
141
+ if (typeof pmField === "string") {
142
+ const name = pmField.split("@")[0];
143
+ if (name && name in packageManagers) return packageManagers[name];
144
+ }
145
+ } catch {}
146
+ for (const pm of Object.values(packageManagers)) if ((0, node_fs.existsSync)((0, node_path.join)(cwd, pm.lockFile))) return pm;
147
+ return packageManagers.npm;
148
+ }
149
+ //#endregion
150
+ Object.defineProperty(exports, "detectPackageManager", {
151
+ enumerable: true,
152
+ get: function() {
153
+ return detectPackageManager;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, "detectTool", {
157
+ enumerable: true,
158
+ get: function() {
159
+ return detectTool;
160
+ }
161
+ });
162
+ Object.defineProperty(exports, "formatters", {
163
+ enumerable: true,
164
+ get: function() {
165
+ return formatters;
166
+ }
167
+ });
168
+ Object.defineProperty(exports, "linters", {
169
+ enumerable: true,
170
+ get: function() {
171
+ return linters;
172
+ }
173
+ });
174
+
175
+ //# sourceMappingURL=tools-_Xp8-_zy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools-_Xp8-_zy.cjs","names":[],"sources":["../../../internals/utils/src/tools.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\n/**\n * CLI command descriptors for each supported code formatter.\n *\n * Each entry contains the executable `command`, an `args` factory that maps an\n * output path to the correct argument list, and an `errorMessage` shown when\n * the formatter is not found.\n */\nexport const formatters = {\n prettier: {\n command: 'prettier',\n args: (outputPath: string) => ['--ignore-unknown', '--write', outputPath],\n errorMessage: 'Prettier not found',\n },\n biome: {\n command: 'biome',\n args: (outputPath: string) => ['format', '--write', outputPath],\n errorMessage: 'Biome not found',\n },\n oxfmt: {\n command: 'oxfmt',\n args: (outputPath: string) => [outputPath],\n errorMessage: 'Oxfmt not found',\n },\n} as const\n\n/**\n * CLI command descriptors for each supported linter.\n *\n * Each entry contains the executable `command`, an `args` factory that maps an\n * output path to the correct argument list, and an `errorMessage` shown when\n * the linter is not found.\n */\nexport const linters = {\n eslint: {\n command: 'eslint',\n args: (outputPath: string) => [outputPath, '--fix'],\n errorMessage: 'Eslint not found',\n },\n biome: {\n command: 'biome',\n args: (outputPath: string) => ['lint', '--fix', outputPath],\n errorMessage: 'Biome not found',\n },\n oxlint: {\n command: 'oxlint',\n // --no-ignore so oxlint lints the folder even when it's gitignored (generated output dirs usually are).\n args: (outputPath: string) => ['--fix', '--no-ignore', outputPath],\n errorMessage: 'Oxlint not found',\n },\n} as const\n\n/**\n * Resolves to `true` when running `tool --version` exits with code 0.\n */\nasync function isToolAvailable(tool: string): Promise<boolean> {\n return new Promise((resolve) => {\n const child = spawn(tool, ['--version'], { stdio: 'ignore' })\n child.on('close', (code) => resolve(code === 0))\n child.on('error', () => resolve(false))\n })\n}\n\n/**\n * Returns the first installed tool from `candidates`, checked in order, or `null` when none are found.\n *\n * Availability is probed by running `<tool> --version` and checking for a zero exit code.\n *\n * @example\n * ```ts\n * const formatter = await detectTool(['oxfmt', 'biome', 'prettier'] as const)\n * const linter = await detectTool(['oxlint', 'biome', 'eslint'] as const)\n * ```\n */\nexport async function detectTool<TName extends string>(candidates: ReadonlyArray<TName>): Promise<TName | null> {\n for (const tool of candidates) {\n if (await isToolAvailable(tool)) {\n return tool\n }\n }\n\n return null\n}\n\n/**\n * Supported package manager identifiers.\n *\n * @example\n * ```ts\n * const pm: PackageManagerName = 'pnpm'\n * ```\n */\nexport type PackageManagerName = 'npm' | 'pnpm' | 'yarn' | 'bun'\n\n/**\n * Metadata describing a package manager's lock file and install command.\n */\nexport interface PackageManagerInfo {\n /**\n * Identifier used in CLI commands, e.g. `pnpm`, `yarn`.\n */\n name: PackageManagerName\n /**\n * Lock file name that uniquely identifies this package manager in a project root.\n */\n lockFile: string\n /**\n * Subcommands passed to the package manager binary to install a dev dependency.\n */\n installCommand: ReadonlyArray<string>\n}\n\n/**\n * Metadata for each supported package manager, keyed by its short name.\n *\n * @example\n * ```ts\n * packageManagers.pnpm.installCommand // ['add', '-D']\n * packageManagers.npm.lockFile // 'package-lock.json'\n * ```\n */\nconst packageManagers: Record<PackageManagerName, PackageManagerInfo> = {\n pnpm: {\n name: 'pnpm',\n lockFile: 'pnpm-lock.yaml',\n installCommand: ['add', '-D'],\n },\n yarn: {\n name: 'yarn',\n lockFile: 'yarn.lock',\n installCommand: ['add', '-D'],\n },\n bun: {\n name: 'bun',\n lockFile: 'bun.lockb',\n installCommand: ['add', '-d'],\n },\n npm: {\n name: 'npm',\n lockFile: 'package-lock.json',\n installCommand: ['install', '--save-dev'],\n },\n}\n\n/**\n * Minimal shape of `package.json` fields read during detection.\n */\ntype PackageJson = {\n /**\n * The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`).\n */\n packageManager?: string\n}\n\n/**\n * Detects the active package manager for the given directory.\n * Resolution order: `packageManager` field in `package.json`, then presence of a lock file.\n * Falls back to `npm` when no signal is found.\n *\n * @example\n * ```ts\n * detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }\n * detectPackageManager() // falls back to npm when no lock file is found\n * ```\n */\nexport function detectPackageManager(cwd: string = process.cwd()): PackageManagerInfo {\n const packageJsonPath = join(cwd, 'package.json')\n if (existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as PackageJson\n const pmField = packageJson.packageManager\n if (typeof pmField === 'string') {\n const name = pmField.split('@')[0]\n if (name && name in packageManagers) {\n return packageManagers[name as PackageManagerName]\n }\n }\n } catch {\n // Continue to lock file detection\n }\n }\n\n for (const pm of Object.values(packageManagers)) {\n if (existsSync(join(cwd, pm.lockFile))) {\n return pm\n }\n }\n\n return packageManagers.npm\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,aAAa;CACxB,UAAU;EACR,SAAS;EACT,OAAO,eAAuB;GAAC;GAAoB;GAAW;EAAU;EACxE,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB;GAAC;GAAU;GAAW;EAAU;EAC9D,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB,CAAC,UAAU;EACzC,cAAc;CAChB;AACF;;;;;;;;AASA,MAAa,UAAU;CACrB,QAAQ;EACN,SAAS;EACT,OAAO,eAAuB,CAAC,YAAY,OAAO;EAClD,cAAc;CAChB;CACA,OAAO;EACL,SAAS;EACT,OAAO,eAAuB;GAAC;GAAQ;GAAS;EAAU;EAC1D,cAAc;CAChB;CACA,QAAQ;EACN,SAAS;EAET,OAAO,eAAuB;GAAC;GAAS;GAAe;EAAU;EACjE,cAAc;CAChB;AACF;;;;AAKA,eAAe,gBAAgB,MAAgC;CAC7D,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAAA,GAAA,mBAAA,MAAA,CAAc,MAAM,CAAC,WAAW,GAAG,EAAE,OAAO,SAAS,CAAC;EAC5D,MAAM,GAAG,UAAU,SAAS,QAAQ,SAAS,CAAC,CAAC;EAC/C,MAAM,GAAG,eAAe,QAAQ,KAAK,CAAC;CACxC,CAAC;AACH;;;;;;;;;;;;AAaA,eAAsB,WAAiC,YAAyD;CAC9G,KAAK,MAAM,QAAQ,YACjB,IAAI,MAAM,gBAAgB,IAAI,GAC5B,OAAO;CAIX,OAAO;AACT;;;;;;;;;;AAuCA,MAAM,kBAAkE;CACtE,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,IAAI;CAC9B;CACA,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,WAAW,YAAY;CAC1C;AACF;;;;;;;;;;;;AAuBA,SAAgB,qBAAqB,MAAc,QAAQ,IAAI,GAAuB;CACpF,MAAM,mBAAA,GAAA,UAAA,KAAA,CAAuB,KAAK,cAAc;CAChD,KAAA,GAAA,QAAA,WAAA,CAAe,eAAe,GAC5B,IAAI;EAEF,MAAM,UADc,KAAK,OAAA,GAAA,QAAA,aAAA,CAAmB,iBAAiB,OAAO,CAC1C,CAAC,CAAC;EAC5B,IAAI,OAAO,YAAY,UAAU;GAC/B,MAAM,OAAO,QAAQ,MAAM,GAAG,CAAC,CAAC;GAChC,IAAI,QAAQ,QAAQ,iBAClB,OAAO,gBAAgB;EAE3B;CACF,QAAQ,CAER;CAGF,KAAK,MAAM,MAAM,OAAO,OAAO,eAAe,GAC5C,KAAA,GAAA,QAAA,WAAA,EAAA,GAAA,UAAA,KAAA,CAAoB,KAAK,GAAG,QAAQ,CAAC,GACnC,OAAO;CAIX,OAAO,gBAAgB;AACzB"}
@@ -1,6 +1,6 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { n as defineCommand } from "./define-Ctii4bel.js";
3
- import { t as version } from "./package-vLafMWCe.js";
1
+ import "./chunk-C0LytTxp.js";
2
+ import { n as defineCommand } from "./define-C63T4jp6.js";
3
+ import { t as version } from "./package-BynuV_3t.js";
4
4
  //#region src/commands/validate.ts
5
5
  const command = defineCommand({
6
6
  name: "validate",
@@ -13,8 +13,8 @@ const command = defineCommand({
13
13
  required: true
14
14
  } },
15
15
  async run({ values }) {
16
- const { runValidate } = await import("./validate-k9s_hFah.js");
17
- await runValidate({
16
+ const { run } = await import("./run-CYnDu3ch.js");
17
+ await run({
18
18
  input: values.input,
19
19
  version
20
20
  });
@@ -23,4 +23,4 @@ const command = defineCommand({
23
23
  //#endregion
24
24
  export { command };
25
25
 
26
- //# sourceMappingURL=validate-BfJoCxrC.js.map
26
+ //# sourceMappingURL=validate-BhDi3x5e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-BfJoCxrC.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:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\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,aACE;CACF,UAAU,CAAC,wCAAwC,yEAAyE;CAC5H,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAM,OAAO;EAErC,MAAM,YAAY;GAAE,OAAO,OAAO;GAAO;GAAS,CAAC;;CAEtD,CAAC"}
1
+ {"version":3,"file":"validate-BhDi3x5e.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:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n\n await run({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU,CAAC,wCAAwC,wEAAwE;CAC3H,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;CACZ,EACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO;EAAQ,CAAC;CAC5C;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
- require("./chunk-ByKO4r7w.cjs");
2
- const require_define = require("./define-Bdn8j5VM.cjs");
3
- const require_package = require("./package-iheSdfas.cjs");
1
+ require("./chunk-Bx3C2hgW.cjs");
2
+ const require_define = require("./define-C4AB3POr.cjs");
3
+ const require_package = require("./package-QUV6JOtx.cjs");
4
4
  //#region src/commands/validate.ts
5
5
  const command = require_define.defineCommand({
6
6
  name: "validate",
@@ -13,8 +13,8 @@ const command = require_define.defineCommand({
13
13
  required: true
14
14
  } },
15
15
  async run({ values }) {
16
- const { runValidate } = await Promise.resolve().then(() => require("./validate-BU4fPTMc.cjs"));
17
- await runValidate({
16
+ const { run } = await Promise.resolve().then(() => require("./run-BQO_tPlc.cjs"));
17
+ await run({
18
18
  input: values.input,
19
19
  version: require_package.version
20
20
  });
@@ -23,4 +23,4 @@ const command = require_define.defineCommand({
23
23
  //#endregion
24
24
  exports.command = command;
25
25
 
26
- //# sourceMappingURL=validate-DIDBROB2.cjs.map
26
+ //# sourceMappingURL=validate-CUEvWAyG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-DIDBROB2.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:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\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,aACE;CACF,UAAU,CAAC,wCAAwC,yEAAyE;CAC5H,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;EAE9B,MAAM,YAAY;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;GAAS,CAAC;;CAEtD,CAAC"}
1
+ {"version":3,"file":"validate-CUEvWAyG.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:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate --input ./openapi.yaml', 'kubb validate --input https://petstore3.swagger.io/api/v3/openapi.json'],\n options: {\n input: {\n type: 'string',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n short: 'i',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n\n await run({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU,CAAC,wCAAwC,wEAAwE;CAC3H,SAAS,EACP,OAAO;EACL,MAAM;EACN,aAAa;EACb,OAAO;EACP,UAAU;CACZ,EACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;EAAQ,CAAC;CAC5C;AACF,CAAC"}
package/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "@kubb/cli",
3
- "version": "5.0.0-beta.6",
4
- "description": "Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.",
3
+ "version": "5.0.0-beta.61",
4
+ "description": "Official CLI for Kubb. Run kubb generate, kubb init, kubb validate, and kubb mcp to manage the full code generation lifecycle from OpenAPI/Swagger specs.",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "code-generator",
8
8
  "codegen",
9
- "command-line",
10
- "command-line-tool",
11
9
  "kubb",
12
- "oas",
13
10
  "openapi",
14
- "plugins",
15
11
  "sdk-generator",
16
12
  "swagger",
17
- "terminal",
18
13
  "typescript"
19
14
  ],
20
15
  "license": "MIT",
@@ -52,52 +47,42 @@
52
47
  "registry": "https://registry.npmjs.org/"
53
48
  },
54
49
  "dependencies": {
55
- "@clack/prompts": "^1.3.0",
50
+ "@clack/prompts": "^1.5.1",
56
51
  "chokidar": "^5.0.0",
57
- "cosmiconfig": "^9.0.1",
52
+ "cosmiconfig": "^9.0.2",
58
53
  "jiti": "^2.7.0",
59
- "tinyexec": "^1.1.2",
60
- "@kubb/core": "5.0.0-beta.6"
54
+ "tinyexec": "~1.1.2",
55
+ "@kubb/core": "5.0.0-beta.61"
61
56
  },
62
57
  "devDependencies": {
63
58
  "@internals/shared": "0.0.0",
64
59
  "@internals/utils": "0.0.0",
65
- "@kubb/adapter-oas": "5.0.0-beta.6"
60
+ "@kubb/adapter-oas": "5.0.0-beta.61"
66
61
  },
67
62
  "peerDependencies": {
68
- "@kubb/adapter-oas": "5.0.0-beta.6",
69
- "@kubb/agent": "5.0.0-beta.6",
70
- "@kubb/mcp": "5.0.0-beta.6"
63
+ "@kubb/adapter-oas": "5.0.0-beta.61",
64
+ "@kubb/mcp": "5.0.0-beta.61"
71
65
  },
72
66
  "peerDependenciesMeta": {
73
67
  "@kubb/adapter-oas": {
74
68
  "optional": true
75
69
  },
76
- "@kubb/agent": {
77
- "optional": true
78
- },
79
70
  "@kubb/mcp": {
80
71
  "optional": true
81
72
  }
82
73
  },
83
- "size-limit": [
84
- {
85
- "path": "./dist/*.js",
86
- "limit": "510 KiB",
87
- "gzip": true
88
- }
89
- ],
90
74
  "preferGlobal": true,
91
75
  "engines": {
92
76
  "node": ">=22"
93
77
  },
94
78
  "scripts": {
95
- "build": "tsdown && size-limit",
96
- "clean": "npx rimraf ./dist",
79
+ "build": "tsdown",
80
+ "clean": "node -e \"require('node:fs').rmSync('./dist', {recursive:true,force:true})\"",
97
81
  "lint": "oxlint .",
98
82
  "lint:fix": "oxlint --fix .",
99
83
  "release": "pnpm publish --no-git-check",
100
84
  "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
85
+ "release:stage": "pnpm stage publish --no-git-check",
101
86
  "start": "tsdown --watch",
102
87
  "test": "vitest --passWithNoTests",
103
88
  "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"