@kubb/cli 5.0.0-alpha.8 → 5.0.0-beta.1

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 (139) hide show
  1. package/README.md +4 -2
  2. package/bin/kubb.js +6 -0
  3. package/dist/agent-B_pirbeB.cjs +116 -0
  4. package/dist/agent-B_pirbeB.cjs.map +1 -0
  5. package/dist/{agent-B116NMCE.cjs → agent-CUmEyiqY.cjs} +5 -5
  6. package/dist/agent-CUmEyiqY.cjs.map +1 -0
  7. package/dist/agent-Ev5hU5hH.js +112 -0
  8. package/dist/agent-Ev5hU5hH.js.map +1 -0
  9. package/dist/{agent-CFRroclh.js → agent-v_2S-bnN.js} +5 -5
  10. package/dist/agent-v_2S-bnN.js.map +1 -0
  11. package/dist/{constants-BTUap0zs.cjs → constants-CnDXa1R6.cjs} +60 -20
  12. package/dist/constants-CnDXa1R6.cjs.map +1 -0
  13. package/dist/constants-aL3CP_Wq.js +95 -0
  14. package/dist/constants-aL3CP_Wq.js.map +1 -0
  15. package/dist/define-Bdn8j5VM.cjs +54 -0
  16. package/dist/define-Bdn8j5VM.cjs.map +1 -0
  17. package/dist/define-Ctii4bel.js +43 -0
  18. package/dist/define-Ctii4bel.js.map +1 -0
  19. package/dist/{errors-DBW0N9w4.cjs → errors-CLCjoSg0.cjs} +22 -6
  20. package/dist/errors-CLCjoSg0.cjs.map +1 -0
  21. package/dist/errors-CjPmyZHy.js +43 -0
  22. package/dist/errors-CjPmyZHy.js.map +1 -0
  23. package/dist/{generate-B8tpu0Dc.js → generate-BaJRhbCS.js} +3 -3
  24. package/dist/generate-BaJRhbCS.js.map +1 -0
  25. package/dist/{generate-BblrHXQC.js → generate-CuxArvEk.js} +556 -262
  26. package/dist/generate-CuxArvEk.js.map +1 -0
  27. package/dist/{generate-D58EaZny.cjs → generate-TL8zY_IT.cjs} +3 -3
  28. package/dist/generate-TL8zY_IT.cjs.map +1 -0
  29. package/dist/{generate-D_pi7lhe.cjs → generate-UCP0qpDp.cjs} +563 -269
  30. package/dist/generate-UCP0qpDp.cjs.map +1 -0
  31. package/dist/index.cjs +48 -21
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +48 -21
  35. package/dist/index.js.map +1 -1
  36. package/dist/{init-hmolV6B4.cjs → init-CZ5Xq2Hd.cjs} +45 -58
  37. package/dist/init-CZ5Xq2Hd.cjs.map +1 -0
  38. package/dist/{init-B56F3Qon.cjs → init-DRR_YWIq.cjs} +4 -4
  39. package/dist/init-DRR_YWIq.cjs.map +1 -0
  40. package/dist/{init-v0GeyJkz.js → init-DSnRd1RJ.js} +4 -4
  41. package/dist/init-DSnRd1RJ.js.map +1 -0
  42. package/dist/{init-C-InrmSY.js → init-eNRlotJK.js} +41 -54
  43. package/dist/init-eNRlotJK.js.map +1 -0
  44. package/dist/{mcp-ChHFPRzD.cjs → mcp-CLcDV4Jm.cjs} +5 -6
  45. package/dist/mcp-CLcDV4Jm.cjs.map +1 -0
  46. package/dist/{mcp-D2SHEg_d.js → mcp-D7EIR9fR.js} +4 -5
  47. package/dist/mcp-D7EIR9fR.js.map +1 -0
  48. package/dist/{mcp-0AmU5JUD.js → mcp-Dakxi9CL.js} +4 -4
  49. package/dist/{mcp-0AmU5JUD.js.map → mcp-Dakxi9CL.js.map} +1 -1
  50. package/dist/{mcp-B0Jz5z2r.cjs → mcp-Dr_RY-hd.cjs} +4 -4
  51. package/dist/{mcp-B0Jz5z2r.cjs.map → mcp-Dr_RY-hd.cjs.map} +1 -1
  52. package/dist/{package-CbrJTkI2.cjs → package-Cdo6lNjF.cjs} +2 -2
  53. package/dist/package-Cdo6lNjF.cjs.map +1 -0
  54. package/dist/package-DPooAj2l.js +6 -0
  55. package/dist/package-DPooAj2l.js.map +1 -0
  56. package/dist/{shell-7HPrTCJ5.cjs → shell-475fQKaX.cjs} +8 -3
  57. package/dist/shell-475fQKaX.cjs.map +1 -0
  58. package/dist/{shell-DqqWsHCD.js → shell-DLzN4fRo.js} +8 -3
  59. package/dist/shell-DLzN4fRo.js.map +1 -0
  60. package/dist/{telemetry-Cn9X1I5B.cjs → telemetry-DN95_2pF.cjs} +50 -8
  61. package/dist/telemetry-DN95_2pF.cjs.map +1 -0
  62. package/dist/{telemetry-DxiR7clS.js → telemetry-LgT_sdPe.js} +48 -6
  63. package/dist/telemetry-LgT_sdPe.js.map +1 -0
  64. package/dist/{validate-D5CuvkLl.js → validate-B1o-rY9o.js} +4 -4
  65. package/dist/validate-B1o-rY9o.js.map +1 -0
  66. package/dist/{validate-D8Zb-dns.cjs → validate-CXFY-mHL.cjs} +4 -4
  67. package/dist/validate-CXFY-mHL.cjs.map +1 -0
  68. package/dist/{validate-l8vLmwKA.js → validate-kLJoT_hi.js} +5 -13
  69. package/dist/validate-kLJoT_hi.js.map +1 -0
  70. package/dist/{validate-Bbrn3Q-A.cjs → validate-yKKzqEZ5.cjs} +6 -14
  71. package/dist/validate-yKKzqEZ5.cjs.map +1 -0
  72. package/package.json +47 -46
  73. package/src/commands/agent/start.ts +20 -4
  74. package/src/commands/generate.ts +35 -6
  75. package/src/commands/init.ts +6 -1
  76. package/src/commands/validate.ts +6 -1
  77. package/src/constants.ts +50 -22
  78. package/src/index.ts +10 -12
  79. package/src/loggers/clackLogger.ts +57 -50
  80. package/src/loggers/fileSystemLogger.ts +17 -18
  81. package/src/loggers/githubActionsLogger.ts +25 -26
  82. package/src/loggers/plainLogger.ts +24 -25
  83. package/src/runners/agent.ts +81 -34
  84. package/src/runners/generate.ts +90 -100
  85. package/src/runners/init.ts +24 -51
  86. package/src/runners/mcp.ts +17 -4
  87. package/src/runners/validate.ts +19 -15
  88. package/src/types.ts +11 -0
  89. package/src/utils/executeHooks.ts +15 -15
  90. package/src/utils/flags.ts +9 -0
  91. package/src/utils/getConfig.ts +10 -0
  92. package/src/utils/getCosmiConfig.ts +21 -12
  93. package/src/utils/getSummary.ts +1 -1
  94. package/src/utils/runHook.ts +29 -13
  95. package/src/utils/telemetry.ts +16 -3
  96. package/bin/kubb.cjs +0 -18
  97. package/dist/agent-B116NMCE.cjs.map +0 -1
  98. package/dist/agent-C6o_6GSJ.cjs +0 -92
  99. package/dist/agent-C6o_6GSJ.cjs.map +0 -1
  100. package/dist/agent-CFRroclh.js.map +0 -1
  101. package/dist/agent-L50VNhXv.js +0 -88
  102. package/dist/agent-L50VNhXv.js.map +0 -1
  103. package/dist/constants-BTUap0zs.cjs.map +0 -1
  104. package/dist/constants-CM3dJzjK.js +0 -67
  105. package/dist/constants-CM3dJzjK.js.map +0 -1
  106. package/dist/define--M_JMcDC.js +0 -25
  107. package/dist/define--M_JMcDC.js.map +0 -1
  108. package/dist/define-D6Kfm7-Z.cjs +0 -36
  109. package/dist/define-D6Kfm7-Z.cjs.map +0 -1
  110. package/dist/errors-6mF_WKxg.js +0 -27
  111. package/dist/errors-6mF_WKxg.js.map +0 -1
  112. package/dist/errors-DBW0N9w4.cjs.map +0 -1
  113. package/dist/generate-B8tpu0Dc.js.map +0 -1
  114. package/dist/generate-BblrHXQC.js.map +0 -1
  115. package/dist/generate-D58EaZny.cjs.map +0 -1
  116. package/dist/generate-D_pi7lhe.cjs.map +0 -1
  117. package/dist/init-B56F3Qon.cjs.map +0 -1
  118. package/dist/init-C-InrmSY.js.map +0 -1
  119. package/dist/init-hmolV6B4.cjs.map +0 -1
  120. package/dist/init-v0GeyJkz.js.map +0 -1
  121. package/dist/jiti-Cd3S0xwr.cjs +0 -16
  122. package/dist/jiti-Cd3S0xwr.cjs.map +0 -1
  123. package/dist/jiti-e08mD2Ph.js +0 -11
  124. package/dist/jiti-e08mD2Ph.js.map +0 -1
  125. package/dist/mcp-ChHFPRzD.cjs.map +0 -1
  126. package/dist/mcp-D2SHEg_d.js.map +0 -1
  127. package/dist/package-BAVK5o-U.js +0 -6
  128. package/dist/package-BAVK5o-U.js.map +0 -1
  129. package/dist/package-CbrJTkI2.cjs.map +0 -1
  130. package/dist/shell-7HPrTCJ5.cjs.map +0 -1
  131. package/dist/shell-DqqWsHCD.js.map +0 -1
  132. package/dist/telemetry-Cn9X1I5B.cjs.map +0 -1
  133. package/dist/telemetry-DxiR7clS.js.map +0 -1
  134. package/dist/validate-Bbrn3Q-A.cjs.map +0 -1
  135. package/dist/validate-D5CuvkLl.js.map +0 -1
  136. package/dist/validate-D8Zb-dns.cjs.map +0 -1
  137. package/dist/validate-l8vLmwKA.js.map +0 -1
  138. package/src/utils/getIntro.ts +0 -1
  139. package/src/utils/jiti.ts +0 -9
package/package.json CHANGED
@@ -1,41 +1,31 @@
1
1
  {
2
2
  "name": "@kubb/cli",
3
- "version": "5.0.0-alpha.8",
3
+ "version": "5.0.0-beta.1",
4
4
  "description": "Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "cli",
7
+ "code-generator",
8
+ "codegen",
7
9
  "command-line",
8
10
  "command-line-tool",
9
- "terminal",
10
- "typescript",
11
- "openapi",
12
- "swagger",
11
+ "kubb",
13
12
  "oas",
14
- "code-generator",
15
- "codegen",
16
- "sdk-generator",
13
+ "openapi",
17
14
  "plugins",
18
- "kubb"
15
+ "sdk-generator",
16
+ "swagger",
17
+ "terminal",
18
+ "typescript"
19
19
  ],
20
+ "license": "MIT",
21
+ "author": "stijnvanhulle",
20
22
  "repository": {
21
23
  "type": "git",
22
24
  "url": "git+https://github.com/kubb-labs/kubb.git",
23
25
  "directory": "packages/cli"
24
26
  },
25
- "license": "MIT",
26
- "author": "stijnvanhulle",
27
- "sideEffects": false,
28
- "type": "module",
29
- "exports": {
30
- ".": {
31
- "import": "./dist/index.js",
32
- "require": "./dist/index.cjs"
33
- },
34
- "./package.json": "./package.json"
35
- },
36
- "types": "./dist/index.d.ts",
37
27
  "bin": {
38
- "kubb": "bin/kubb.cjs"
28
+ "kubb": "bin/kubb.js"
39
29
  },
40
30
  "files": [
41
31
  "src",
@@ -45,6 +35,38 @@
45
35
  "!/**/__tests__/**",
46
36
  "!/**/__snapshots__/**"
47
37
  ],
38
+ "type": "module",
39
+ "sideEffects": false,
40
+ "main": "./dist/index.cjs",
41
+ "module": "./dist/index.js",
42
+ "types": "./dist/index.d.ts",
43
+ "exports": {
44
+ ".": {
45
+ "import": "./dist/index.js",
46
+ "require": "./dist/index.cjs"
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "dependencies": {
55
+ "@clack/prompts": "^1.3.0",
56
+ "chokidar": "^5.0.0",
57
+ "cosmiconfig": "^9.0.1",
58
+ "tinyexec": "^1.1.2",
59
+ "unrun": "^0.2.37",
60
+ "@kubb/adapter-oas": "5.0.0-beta.1",
61
+ "@kubb/core": "5.0.0-beta.1"
62
+ },
63
+ "devDependencies": {
64
+ "@internals/utils": "0.0.0"
65
+ },
66
+ "optionalDependencies": {
67
+ "@kubb/agent": "5.0.0-beta.1",
68
+ "@kubb/mcp": "5.0.0-beta.1"
69
+ },
48
70
  "size-limit": [
49
71
  {
50
72
  "path": "./dist/*.js",
@@ -52,36 +74,15 @@
52
74
  "gzip": true
53
75
  }
54
76
  ],
55
- "dependencies": {
56
- "@clack/prompts": "^1.1.0",
57
- "chokidar": "^5.0.0",
58
- "cosmiconfig": "^9.0.1",
59
- "jiti": "2.5.1",
60
- "tinyexec": "^1.0.4",
61
- "@kubb/core": "5.0.0-alpha.8"
62
- },
63
- "devDependencies": {
64
- "source-map-support": "^0.5.21",
65
- "@internals/utils": "0.0.0",
66
- "@kubb/agent": "5.0.0-alpha.8",
67
- "@kubb/mcp": "5.0.0-alpha.8",
68
- "@kubb/oas": "5.0.0-alpha.8"
69
- },
77
+ "preferGlobal": true,
70
78
  "engines": {
71
79
  "node": ">=22"
72
80
  },
73
- "preferGlobal": true,
74
- "publishConfig": {
75
- "access": "public",
76
- "registry": "https://registry.npmjs.org/"
77
- },
78
- "main": "./dist/index.cjs",
79
- "module": "./dist/index.js",
80
81
  "scripts": {
81
82
  "build": "tsdown && size-limit",
82
83
  "clean": "npx rimraf ./dist",
83
- "lint": "bun biome lint .",
84
- "lint:fix": "bun biome lint --fix --unsafe .",
84
+ "lint": "oxlint .",
85
+ "lint:fix": "oxlint --fix .",
85
86
  "release": "pnpm publish --no-git-check",
86
87
  "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
87
88
  "start": "tsdown --watch",
@@ -6,15 +6,31 @@ export const command = defineCommand({
6
6
  name: 'start',
7
7
  description: 'Start the Agent server',
8
8
  options: {
9
- config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },
10
- port: { type: 'string', description: `Port for the server (default: ${agentDefaults.port})`, short: 'p' },
11
- host: { type: 'string', description: 'Host for the server', default: agentDefaults.host },
9
+ config: {
10
+ type: 'string',
11
+ description: 'Path to the Kubb config',
12
+ short: 'c',
13
+ },
14
+ port: {
15
+ type: 'string',
16
+ description: `Port for the server (default: ${agentDefaults.port})`,
17
+ short: 'p',
18
+ },
19
+ host: {
20
+ type: 'string',
21
+ description: 'Host for the server',
22
+ default: agentDefaults.host,
23
+ },
12
24
  'allow-write': {
13
25
  type: 'boolean',
14
26
  description: 'Allow writing generated files to the filesystem. When not set, no files are written and the config patch is not persisted.',
15
27
  default: false,
16
28
  },
17
- 'allow-all': { type: 'boolean', description: 'Grant all permissions (implies --allow-write).', default: false },
29
+ 'allow-all': {
30
+ type: 'boolean',
31
+ description: 'Grant all permissions (implies --allow-write).',
32
+ default: false,
33
+ },
18
34
  },
19
35
  async run({ values }) {
20
36
  const { runAgentStart } = await import('../../runners/agent.ts')
@@ -5,7 +5,11 @@ export const command = defineCommand({
5
5
  description: "[input] Generate files based on a 'kubb.config.ts' file",
6
6
  arguments: ['[input]'],
7
7
  options: {
8
- config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },
8
+ config: {
9
+ type: 'string',
10
+ description: 'Path to the Kubb config',
11
+ short: 'c',
12
+ },
9
13
  logLevel: {
10
14
  type: 'string',
11
15
  description: 'Info, silent, verbose or debug',
@@ -14,15 +18,40 @@ export const command = defineCommand({
14
18
  hint: 'silent|info|verbose|debug',
15
19
  enum: ['silent', 'info', 'verbose', 'debug'],
16
20
  },
17
- watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },
18
- debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },
19
- verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },
20
- silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },
21
+ watch: {
22
+ type: 'boolean',
23
+ description: 'Watch mode based on the input file',
24
+ short: 'w',
25
+ default: false,
26
+ },
27
+ debug: {
28
+ type: 'boolean',
29
+ description: 'Override logLevel to debug',
30
+ short: 'd',
31
+ default: false,
32
+ },
33
+ verbose: {
34
+ type: 'boolean',
35
+ description: 'Override logLevel to verbose',
36
+ short: 'v',
37
+ default: false,
38
+ },
39
+ silent: {
40
+ type: 'boolean',
41
+ description: 'Override logLevel to silent',
42
+ short: 's',
43
+ default: false,
44
+ },
21
45
  },
22
46
  async run({ values, positionals }) {
23
47
  const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel
24
48
  const { runGenerateCommand } = await import('../runners/generate.ts')
25
49
 
26
- await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })
50
+ await runGenerateCommand({
51
+ input: positionals[0],
52
+ configPath: values.config,
53
+ logLevel,
54
+ watch: values.watch,
55
+ })
27
56
  },
28
57
  })
@@ -5,7 +5,12 @@ export const command = defineCommand({
5
5
  name: 'init',
6
6
  description: 'Initialize a new Kubb project with interactive setup',
7
7
  options: {
8
- yes: { type: 'boolean', description: 'Skip prompts and use default options', short: 'y', default: false },
8
+ yes: {
9
+ type: 'boolean',
10
+ description: 'Skip prompts and use default options',
11
+ short: 'y',
12
+ default: false,
13
+ },
9
14
  },
10
15
  async run({ values }) {
11
16
  const { runInit } = await import('../runners/init.ts')
@@ -5,7 +5,12 @@ export const command = defineCommand({
5
5
  name: 'validate',
6
6
  description: 'Validate a Swagger/OpenAPI file',
7
7
  options: {
8
- input: { type: 'string', description: 'Path to Swagger/OpenAPI file', short: 'i', required: true },
8
+ input: {
9
+ type: 'string',
10
+ description: 'Path to Swagger/OpenAPI file',
11
+ short: 'i',
12
+ required: true,
13
+ },
9
14
  },
10
15
  async run({ values }) {
11
16
  const { runValidate } = await import('../runners/validate.ts')
package/src/constants.ts CHANGED
@@ -1,37 +1,64 @@
1
- /** NPM registry endpoint used to check for @kubb/cli updates. */
1
+ /**
2
+ * Default filename for the Kubb configuration file.
3
+ *
4
+ * Used by the `init` command when scaffolding new projects and by the `agent` default config.
5
+ */
6
+ export const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const
7
+
8
+ /**
9
+ * NPM registry endpoint used to check for @kubb/cli updates.
10
+ */
2
11
  export const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const
3
12
 
4
- /** OpenTelemetry ingestion endpoint for anonymous usage telemetry. */
13
+ /**
14
+ * OpenTelemetry ingestion endpoint for anonymous usage telemetry.
15
+ */
5
16
  export const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const
6
17
 
7
- /** Horizontal rule rendered above/below the plain-logger generation summary. */
18
+ /**
19
+ * Horizontal rule rendered above/below the plain-logger generation summary.
20
+ */
8
21
  export const SUMMARY_SEPARATOR = '─'.repeat(27)
9
22
 
10
- /** Maximum number of █ characters in a plugin timing bar. */
23
+ /**
24
+ * Maximum number of █ characters in a plugin timing bar.
25
+ */
11
26
  export const SUMMARY_MAX_BAR_LENGTH = 10 as const
12
27
 
13
- /** Divides elapsed milliseconds into bar-length units (1 block per 100 ms). */
28
+ /**
29
+ * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).
30
+ */
14
31
  export const SUMMARY_TIME_SCALE_DIVISOR = 100 as const
15
32
 
16
- /** Glob pattern for paths the file watcher ignores. */
33
+ /**
34
+ * Glob pattern for paths the file watcher ignores.
35
+ */
17
36
  export const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const
18
37
 
19
- /** Default runtime values for the `agent start` command. */
38
+ /**
39
+ * Flags that short-circuit execution (help/version) — no telemetry notice is shown.
40
+ */
41
+ export const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)
42
+
20
43
  export const agentDefaults = {
21
44
  port: '3000',
22
45
  host: 'localhost',
23
- configFile: 'kubb.config.ts',
46
+ configFile: KUBB_CONFIG_FILENAME,
24
47
  retryTimeout: '30000',
25
48
  studioUrl: 'https://studio.kubb.dev',
26
- /** Relative path from the @kubb/agent package root to the server entry. */
49
+ /**
50
+ * Relative path from the @kubb/agent package root to the server entry.
51
+ */
27
52
  serverEntryPath: '.output/server/index.mjs',
28
53
  } as const
29
54
 
30
- /** Default values used during interactive `init` scaffolding. */
55
+ /**
56
+ * Default values used during interactive `init` scaffolding.
57
+ */
31
58
  export const initDefaults = {
32
59
  inputPath: './openapi.yaml',
33
60
  outputPath: './src/gen',
34
- plugins: ['plugin-oas', 'plugin-ts'],
61
+ plugins: ['plugin-ts'],
35
62
  } as const
36
63
 
37
64
  /**
@@ -40,7 +67,6 @@ export const initDefaults = {
40
67
  * `as const` keeps the object deeply immutable.
41
68
  */
42
69
  export const pluginDefaultConfigs = {
43
- 'plugin-oas': 'pluginOas()',
44
70
  'plugin-ts': `pluginTs({
45
71
  output: { path: 'models' },
46
72
  })`,
@@ -50,18 +76,9 @@ export const pluginDefaultConfigs = {
50
76
  'plugin-react-query': `pluginReactQuery({
51
77
  output: { path: 'hooks' },
52
78
  })`,
53
- 'plugin-solid-query': `pluginSolidQuery({
54
- output: { path: 'hooks' },
55
- })`,
56
- 'plugin-svelte-query': `pluginSvelteQuery({
57
- output: { path: 'hooks' },
58
- })`,
59
79
  'plugin-vue-query': `pluginVueQuery({
60
80
  output: { path: 'hooks' },
61
81
  })`,
62
- 'plugin-swr': `pluginSwr({
63
- output: { path: 'hooks' },
64
- })`,
65
82
  'plugin-zod': `pluginZod({
66
83
  output: { path: 'zod' },
67
84
  })`,
@@ -71,6 +88,17 @@ export const pluginDefaultConfigs = {
71
88
  'plugin-msw': `pluginMsw({
72
89
  output: { path: 'msw' },
73
90
  })`,
91
+ 'plugin-cypress': `pluginCypress({
92
+ output: { path: 'cypress' },
93
+ })`,
94
+ 'plugin-mcp': `pluginMcp({
95
+ output: { path: 'mcp' },
96
+ })`,
97
+ 'plugin-redoc': `pluginRedoc({
98
+ output: { path: 'redoc' },
99
+ })`,
74
100
  } as const satisfies Record<string, string>
75
101
 
76
- /** Color palette used by randomCliColor() for deterministic plugin name coloring. */
102
+ /**
103
+ * Color palette used by randomCliColor() for deterministic plugin name coloring.
104
+ */
package/src/index.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  import { styleText } from 'node:util'
2
2
  import { createCLI } from '@internals/utils'
3
3
  import { version } from '../package.json'
4
+ import { QUIET_FLAGS } from './constants.ts'
5
+ import { isFlag } from './utils/flags.ts'
4
6
  import { isTelemetryDisabled } from './utils/telemetry.ts'
5
7
 
6
8
  const cli = createCLI()
7
9
 
8
- function shouldShowTelemetryNotice(argv: string[]): boolean {
10
+ function shouldShowTelemetryNotice(argv: Array<string>): boolean {
9
11
  if (isTelemetryDisabled()) {
10
12
  return false
11
13
  }
12
14
  // Skip when the user is just asking for help or version info
13
- const quietFlags = new Set(['--help', '-h', '--version', '-v'])
14
- if (argv.some((arg) => quietFlags.has(arg))) {
15
+ if (argv.some((arg) => isFlag(QUIET_FLAGS, arg))) {
15
16
  return false
16
17
  }
17
18
  // Skip in non-interactive / scripting contexts
@@ -21,21 +22,18 @@ function shouldShowTelemetryNotice(argv: string[]): boolean {
21
22
  return true
22
23
  }
23
24
 
24
- export async function run(argv: string[] = process.argv): Promise<void> {
25
+ export async function run(argv: Array<string> = process.argv): Promise<void> {
25
26
  if (shouldShowTelemetryNotice(argv)) {
26
27
  console.log(
27
28
  `${styleText('yellow', 'Notice:')} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText('cyan', 'KUBB_DISABLE_TELEMETRY=1')}.\n`,
28
29
  )
29
30
  }
30
31
 
31
- const [{ command: generateCommand }, { command: validateCommand }, { command: mcpCommand }, { command: agentCommand }, { command: initCommand }] =
32
- await Promise.all([
33
- import('./commands/generate.ts'),
34
- import('./commands/validate.ts'),
35
- import('./commands/mcp.ts'),
36
- import('./commands/agent.ts'),
37
- import('./commands/init.ts'),
38
- ])
32
+ const { command: generateCommand } = await import('./commands/generate.ts')
33
+ const { command: validateCommand } = await import('./commands/validate.ts')
34
+ const { command: mcpCommand } = await import('./commands/mcp.ts')
35
+ const { command: agentCommand } = await import('./commands/agent.ts')
36
+ const { command: initCommand } = await import('./commands/init.ts')
39
37
 
40
38
  await cli.run([generateCommand, validateCommand, mcpCommand, agentCommand, initCommand], argv, {
41
39
  programName: 'kubb',