@kubb/cli 5.0.0-beta.1 → 5.0.0-beta.100

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 (148) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +171 -51
  3. package/bin/kubb.js +9 -3
  4. package/dist/Telemetry-7z2tIqPm.js +282 -0
  5. package/dist/Telemetry-7z2tIqPm.js.map +1 -0
  6. package/dist/Telemetry-xcWb-UWT.cjs +331 -0
  7. package/dist/Telemetry-xcWb-UWT.cjs.map +1 -0
  8. package/dist/{errors-CjPmyZHy.js → errors-CMvLO2NE.js} +3 -15
  9. package/dist/{errors-CjPmyZHy.js.map → errors-CMvLO2NE.js.map} +1 -1
  10. package/dist/{errors-CLCjoSg0.cjs → errors-DNxBUo3k.cjs} +2 -20
  11. package/dist/{errors-CLCjoSg0.cjs.map → errors-DNxBUo3k.cjs.map} +1 -1
  12. package/dist/generate-dIcWEfOA.cjs +95 -0
  13. package/dist/generate-dIcWEfOA.cjs.map +1 -0
  14. package/dist/generate-nPLBd69v.js +95 -0
  15. package/dist/generate-nPLBd69v.js.map +1 -0
  16. package/dist/index.cjs +33 -252
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +6 -2
  19. package/dist/index.js +34 -253
  20. package/dist/index.js.map +1 -1
  21. package/dist/init-6h3K2syO.cjs +52 -0
  22. package/dist/init-6h3K2syO.cjs.map +1 -0
  23. package/dist/init-CNV6OC7m.js +53 -0
  24. package/dist/init-CNV6OC7m.js.map +1 -0
  25. package/dist/mcp-BzPiZA36.js +21 -0
  26. package/dist/mcp-BzPiZA36.js.map +1 -0
  27. package/dist/mcp-CmxnIZku.cjs +20 -0
  28. package/dist/mcp-CmxnIZku.cjs.map +1 -0
  29. package/dist/package-By3tigpl.js +6 -0
  30. package/dist/package-By3tigpl.js.map +1 -0
  31. package/dist/{package-Cdo6lNjF.cjs → package-CImfPtTH.cjs} +2 -2
  32. package/dist/package-CImfPtTH.cjs.map +1 -0
  33. package/dist/run-BJhB7Qer.js +306 -0
  34. package/dist/run-BJhB7Qer.js.map +1 -0
  35. package/dist/run-BdtVrLKu.cjs +46 -0
  36. package/dist/run-BdtVrLKu.cjs.map +1 -0
  37. package/dist/run-CaOjZRiQ.js +45 -0
  38. package/dist/run-CaOjZRiQ.js.map +1 -0
  39. package/dist/run-D-gAS1Vq.js +1264 -0
  40. package/dist/run-D-gAS1Vq.js.map +1 -0
  41. package/dist/run-DAHp52w3.js +33 -0
  42. package/dist/run-DAHp52w3.js.map +1 -0
  43. package/dist/run-DaVewTtW.cjs +310 -0
  44. package/dist/run-DaVewTtW.cjs.map +1 -0
  45. package/dist/run-HUVxfpGj.cjs +1267 -0
  46. package/dist/run-HUVxfpGj.cjs.map +1 -0
  47. package/dist/run-iidDikJH.cjs +34 -0
  48. package/dist/run-iidDikJH.cjs.map +1 -0
  49. package/dist/tools-CzgGQa64.cjs +175 -0
  50. package/dist/tools-CzgGQa64.cjs.map +1 -0
  51. package/dist/tools-DH1a7ZJH.js +152 -0
  52. package/dist/tools-DH1a7ZJH.js.map +1 -0
  53. package/dist/validate-BUw6PkPp.js +25 -0
  54. package/dist/validate-BUw6PkPp.js.map +1 -0
  55. package/dist/validate-DMfyLIta.cjs +24 -0
  56. package/dist/validate-DMfyLIta.cjs.map +1 -0
  57. package/package.json +24 -30
  58. package/dist/agent-B_pirbeB.cjs +0 -116
  59. package/dist/agent-B_pirbeB.cjs.map +0 -1
  60. package/dist/agent-CUmEyiqY.cjs +0 -58
  61. package/dist/agent-CUmEyiqY.cjs.map +0 -1
  62. package/dist/agent-Ev5hU5hH.js +0 -112
  63. package/dist/agent-Ev5hU5hH.js.map +0 -1
  64. package/dist/agent-v_2S-bnN.js +0 -56
  65. package/dist/agent-v_2S-bnN.js.map +0 -1
  66. package/dist/constants-CnDXa1R6.cjs +0 -148
  67. package/dist/constants-CnDXa1R6.cjs.map +0 -1
  68. package/dist/constants-aL3CP_Wq.js +0 -95
  69. package/dist/constants-aL3CP_Wq.js.map +0 -1
  70. package/dist/define-Bdn8j5VM.cjs +0 -54
  71. package/dist/define-Bdn8j5VM.cjs.map +0 -1
  72. package/dist/define-Ctii4bel.js +0 -43
  73. package/dist/define-Ctii4bel.js.map +0 -1
  74. package/dist/generate-BaJRhbCS.js +0 -66
  75. package/dist/generate-BaJRhbCS.js.map +0 -1
  76. package/dist/generate-CuxArvEk.js +0 -1753
  77. package/dist/generate-CuxArvEk.js.map +0 -1
  78. package/dist/generate-TL8zY_IT.cjs +0 -65
  79. package/dist/generate-TL8zY_IT.cjs.map +0 -1
  80. package/dist/generate-UCP0qpDp.cjs +0 -1756
  81. package/dist/generate-UCP0qpDp.cjs.map +0 -1
  82. package/dist/init-CZ5Xq2Hd.cjs +0 -293
  83. package/dist/init-CZ5Xq2Hd.cjs.map +0 -1
  84. package/dist/init-DRR_YWIq.cjs +0 -25
  85. package/dist/init-DRR_YWIq.cjs.map +0 -1
  86. package/dist/init-DSnRd1RJ.js +0 -25
  87. package/dist/init-DSnRd1RJ.js.map +0 -1
  88. package/dist/init-eNRlotJK.js +0 -289
  89. package/dist/init-eNRlotJK.js.map +0 -1
  90. package/dist/mcp-CLcDV4Jm.cjs +0 -41
  91. package/dist/mcp-CLcDV4Jm.cjs.map +0 -1
  92. package/dist/mcp-D7EIR9fR.js +0 -40
  93. package/dist/mcp-D7EIR9fR.js.map +0 -1
  94. package/dist/mcp-Dakxi9CL.js +0 -16
  95. package/dist/mcp-Dakxi9CL.js.map +0 -1
  96. package/dist/mcp-Dr_RY-hd.cjs +0 -16
  97. package/dist/mcp-Dr_RY-hd.cjs.map +0 -1
  98. package/dist/package-Cdo6lNjF.cjs.map +0 -1
  99. package/dist/package-DPooAj2l.js +0 -6
  100. package/dist/package-DPooAj2l.js.map +0 -1
  101. package/dist/shell-475fQKaX.cjs +0 -62
  102. package/dist/shell-475fQKaX.cjs.map +0 -1
  103. package/dist/shell-DLzN4fRo.js +0 -51
  104. package/dist/shell-DLzN4fRo.js.map +0 -1
  105. package/dist/telemetry-DN95_2pF.cjs +0 -282
  106. package/dist/telemetry-DN95_2pF.cjs.map +0 -1
  107. package/dist/telemetry-LgT_sdPe.js +0 -245
  108. package/dist/telemetry-LgT_sdPe.js.map +0 -1
  109. package/dist/validate-B1o-rY9o.js +0 -25
  110. package/dist/validate-B1o-rY9o.js.map +0 -1
  111. package/dist/validate-CXFY-mHL.cjs +0 -25
  112. package/dist/validate-CXFY-mHL.cjs.map +0 -1
  113. package/dist/validate-kLJoT_hi.js +0 -33
  114. package/dist/validate-kLJoT_hi.js.map +0 -1
  115. package/dist/validate-yKKzqEZ5.cjs +0 -34
  116. package/dist/validate-yKKzqEZ5.cjs.map +0 -1
  117. package/src/commands/agent/start.ts +0 -47
  118. package/src/commands/agent.ts +0 -8
  119. package/src/commands/generate.ts +0 -57
  120. package/src/commands/init.ts +0 -20
  121. package/src/commands/mcp.ts +0 -12
  122. package/src/commands/validate.ts +0 -20
  123. package/src/constants.ts +0 -104
  124. package/src/index.ts +0 -43
  125. package/src/loggers/clackLogger.ts +0 -458
  126. package/src/loggers/fileSystemLogger.ts +0 -138
  127. package/src/loggers/githubActionsLogger.ts +0 -379
  128. package/src/loggers/plainLogger.ts +0 -254
  129. package/src/loggers/types.ts +0 -1
  130. package/src/loggers/utils.ts +0 -106
  131. package/src/runners/agent.ts +0 -149
  132. package/src/runners/generate.ts +0 -333
  133. package/src/runners/init.ts +0 -296
  134. package/src/runners/mcp.ts +0 -45
  135. package/src/runners/validate.ts +0 -39
  136. package/src/types.ts +0 -11
  137. package/src/utils/Writables.ts +0 -17
  138. package/src/utils/executeHooks.ts +0 -45
  139. package/src/utils/flags.ts +0 -9
  140. package/src/utils/getConfig.ts +0 -10
  141. package/src/utils/getCosmiConfig.ts +0 -80
  142. package/src/utils/getSummary.ts +0 -68
  143. package/src/utils/packageManager.ts +0 -23
  144. package/src/utils/runHook.ts +0 -91
  145. package/src/utils/telemetry.ts +0 -273
  146. package/src/utils/watcher.ts +0 -19
  147. /package/dist/{chunk-ByKO4r7w.cjs → rolldown-runtime-Bx3C2hgW.cjs} +0 -0
  148. /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
@@ -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,54 +0,0 @@
1
- require("./chunk-ByKO4r7w.cjs");
2
- //#region ../../internals/utils/src/cli/define.ts
3
- /**
4
- * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.
5
- *
6
- * @example
7
- * ```ts
8
- * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })
9
- * createCLI({ adapter }).run(commands, argv, opts)
10
- * ```
11
- */
12
- function defineCLIAdapter(adapter) {
13
- return adapter;
14
- }
15
- /**
16
- * Returns a `CommandDefinition` with typed `values` in `run()`.
17
- * The callback receives `values` inferred from the declared options — no casts needed.
18
- *
19
- * @example
20
- * ```ts
21
- * const generate = defineCommand({
22
- * name: 'generate',
23
- * description: 'Generate client code',
24
- * options: { config: { type: 'string', description: 'Config path' } },
25
- * async run({ values }) { console.log(values.config) },
26
- * })
27
- * ```
28
- */
29
- function defineCommand(def) {
30
- const { run, ...rest } = def;
31
- if (!run) return rest;
32
- return {
33
- ...rest,
34
- run: (args) => run({
35
- values: args.values,
36
- positionals: args.positionals
37
- })
38
- };
39
- }
40
- //#endregion
41
- Object.defineProperty(exports, "defineCLIAdapter", {
42
- enumerable: true,
43
- get: function() {
44
- return defineCLIAdapter;
45
- }
46
- });
47
- Object.defineProperty(exports, "defineCommand", {
48
- enumerable: true,
49
- get: function() {
50
- return defineCommand;
51
- }
52
- });
53
-
54
- //# sourceMappingURL=define-Bdn8j5VM.cjs.map
@@ -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,43 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- //#region ../../internals/utils/src/cli/define.ts
3
- /**
4
- * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.
5
- *
6
- * @example
7
- * ```ts
8
- * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })
9
- * createCLI({ adapter }).run(commands, argv, opts)
10
- * ```
11
- */
12
- function defineCLIAdapter(adapter) {
13
- return adapter;
14
- }
15
- /**
16
- * Returns a `CommandDefinition` with typed `values` in `run()`.
17
- * The callback receives `values` inferred from the declared options — no casts needed.
18
- *
19
- * @example
20
- * ```ts
21
- * const generate = defineCommand({
22
- * name: 'generate',
23
- * description: 'Generate client code',
24
- * options: { config: { type: 'string', description: 'Config path' } },
25
- * async run({ values }) { console.log(values.config) },
26
- * })
27
- * ```
28
- */
29
- function defineCommand(def) {
30
- const { run, ...rest } = def;
31
- if (!run) return rest;
32
- return {
33
- ...rest,
34
- run: (args) => run({
35
- values: args.values,
36
- positionals: args.positionals
37
- })
38
- };
39
- }
40
- //#endregion
41
- export { defineCommand as n, defineCLIAdapter as t };
42
-
43
- //# sourceMappingURL=define-Ctii4bel.js.map
@@ -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"}
@@ -1,66 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { n as defineCommand } from "./define-Ctii4bel.js";
3
- //#region src/commands/generate.ts
4
- const command = defineCommand({
5
- name: "generate",
6
- description: "[input] Generate files based on a 'kubb.config.ts' file",
7
- arguments: ["[input]"],
8
- options: {
9
- config: {
10
- type: "string",
11
- description: "Path to the Kubb config",
12
- short: "c"
13
- },
14
- logLevel: {
15
- type: "string",
16
- description: "Info, silent, verbose or debug",
17
- short: "l",
18
- default: "info",
19
- hint: "silent|info|verbose|debug",
20
- enum: [
21
- "silent",
22
- "info",
23
- "verbose",
24
- "debug"
25
- ]
26
- },
27
- watch: {
28
- type: "boolean",
29
- description: "Watch mode based on the input file",
30
- short: "w",
31
- default: false
32
- },
33
- debug: {
34
- type: "boolean",
35
- description: "Override logLevel to debug",
36
- short: "d",
37
- default: false
38
- },
39
- verbose: {
40
- type: "boolean",
41
- description: "Override logLevel to verbose",
42
- short: "v",
43
- default: false
44
- },
45
- silent: {
46
- type: "boolean",
47
- description: "Override logLevel to silent",
48
- short: "s",
49
- default: false
50
- }
51
- },
52
- async run({ values, positionals }) {
53
- const logLevel = values.debug ? "debug" : values.verbose ? "verbose" : values.silent ? "silent" : values.logLevel;
54
- const { runGenerateCommand } = await import("./generate-CuxArvEk.js");
55
- await runGenerateCommand({
56
- input: positionals[0],
57
- configPath: values.config,
58
- logLevel,
59
- watch: values.watch
60
- });
61
- }
62
- });
63
- //#endregion
64
- export { command };
65
-
66
- //# sourceMappingURL=generate-BaJRhbCS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-BaJRhbCS.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: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\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: {\n type: 'boolean',\n description: 'Watch mode based on the input file',\n short: 'w',\n default: false,\n },\n debug: {\n type: 'boolean',\n description: 'Override logLevel to debug',\n short: 'd',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n short: 'v',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\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({\n input: positionals[0],\n configPath: values.config,\n logLevel,\n watch: values.watch,\n })\n },\n})\n"],"mappings":";;;AAEA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACR;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,OAAO;GACL,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,SAAS;GACP,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACV;EACF;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;GACvB,OAAO,YAAY;GACnB,YAAY,OAAO;GACnB;GACA,OAAO,OAAO;GACf,CAAC;;CAEL,CAAC"}