@kubb/mcp 5.0.0-beta.75 → 5.0.0-beta.76

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.
@@ -1,20 +0,0 @@
1
- import path from 'node:path'
2
- import type { Config } from '@kubb/core'
3
-
4
- /**
5
- * Determine the root directory based on userConfig.root and resolvedConfigDir
6
- * 1. If userConfig.root exists and is absolute, use it as-is
7
- * 2. If userConfig.root exists and is relative, resolve it relative to config directory
8
- * 3. Otherwise, use the config directory as root
9
- */
10
- export function resolveCwd(userConfig: Config, cwd: string): string {
11
- if (userConfig.root) {
12
- if (path.isAbsolute(userConfig.root)) {
13
- return userConfig.root
14
- }
15
-
16
- return path.resolve(cwd, userConfig.root)
17
- }
18
-
19
- return cwd
20
- }
@@ -1,28 +0,0 @@
1
- import { isPromise } from '@internals/utils'
2
- import type { CLIOptions, Config } from '@kubb/core'
3
-
4
- export type ResolveUserConfigOptions = {
5
- configPath?: string
6
- logLevel?: string
7
- }
8
-
9
- /**
10
- * Resolve the config by handling function configs and returning the final configuration
11
- */
12
- export async function resolveUserConfig(config: Config, options: ResolveUserConfigOptions): Promise<Config> {
13
- let kubbUserConfig = Promise.resolve(config) as Promise<Config>
14
-
15
- if (typeof config === 'function') {
16
- const possiblePromise = (config as any)({
17
- logLevel: options.logLevel,
18
- config: options.configPath,
19
- } as CLIOptions)
20
- if (isPromise(possiblePromise)) {
21
- kubbUserConfig = possiblePromise
22
- } else {
23
- kubbUserConfig = Promise.resolve(possiblePromise)
24
- }
25
- }
26
-
27
- return (await kubbUserConfig) as Config
28
- }