@kubb/cli 3.10.0 → 3.10.2

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.
@@ -10,8 +10,7 @@ import path from 'node:path'
10
10
  import * as process from 'node:process'
11
11
  import { PromiseManager, isInputPath } from '@kubb/core'
12
12
  import { LogMapper, createLogger } from '@kubb/core/logger'
13
- import { generate } from '../generate.ts'
14
- import { startServer } from '@kubb/ui'
13
+
15
14
  import open from 'open'
16
15
  import type { SingleBar } from 'cli-progress'
17
16
 
@@ -75,8 +74,7 @@ const command = defineCommand({
75
74
  const input = args._[0]
76
75
 
77
76
  if (args.help) {
78
- showUsage(command)
79
- return
77
+ return showUsage(command)
80
78
  }
81
79
 
82
80
  if (args.debug) {
@@ -87,6 +85,7 @@ const command = defineCommand({
87
85
  const logger = createLogger({
88
86
  logLevel,
89
87
  })
88
+ const { generate } = await import('../runners/generate.ts')
90
89
 
91
90
  logger.emit('start', 'Loading config')
92
91
 
@@ -127,6 +126,8 @@ const command = defineCommand({
127
126
  }
128
127
 
129
128
  if (args.ui) {
129
+ const { startServer } = await import('@kubb/ui')
130
+
130
131
  await startServer(
131
132
  {
132
133
  stop: () => process.exit(1),
package/src/index.ts CHANGED
@@ -34,7 +34,8 @@ Run \`npm install -g @kubb/cli\` to update`,
34
34
  }
35
35
  } catch (_e) {}
36
36
 
37
- if (rawArgs[0] !== 'generate') {
37
+ if (!['generate'].includes(rawArgs[0] as string)) {
38
+ console.log(rawArgs[0])
38
39
  // generate is not being used
39
40
  const generateCommand = await import('./commands/generate.ts').then((r) => r.default)
40
41
 
@@ -51,5 +52,3 @@ Run \`npm install -g @kubb/cli\` to update`,
51
52
  export async function run(_argv?: string[]): Promise<void> {
52
53
  await runMain(main)
53
54
  }
54
-
55
- export { generate } from './generate.ts'
@@ -3,13 +3,13 @@ import { LogMapper } from '@kubb/core/logger'
3
3
  import { colors } from 'consola/utils'
4
4
 
5
5
  import { type Config, safeBuild, setup } from '@kubb/core'
6
- import { executeHooks } from './utils/executeHooks.ts'
7
- import { getErrorCauses } from './utils/getErrorCauses.ts'
8
- import { getSummary } from './utils/getSummary.ts'
6
+ import { executeHooks } from '../utils/executeHooks.ts'
7
+ import { getErrorCauses } from '../utils/getErrorCauses.ts'
8
+ import { getSummary } from '../utils/getSummary.ts'
9
9
 
10
10
  import { createLogger } from '@kubb/core/logger'
11
11
  import { Presets, SingleBar } from 'cli-progress'
12
- import type { Args } from './commands/generate.ts'
12
+ import type { Args } from '../commands/generate.ts'
13
13
  import process from 'node:process'
14
14
 
15
15
  type GenerateProps = {