@kubb/mcp 5.0.0-beta.6 → 5.0.0-beta.60
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.
- package/LICENSE +17 -10
- package/README.md +64 -17
- package/dist/index.cjs +322 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +322 -187
- package/dist/index.js.map +1 -1
- package/package.json +16 -24
- package/src/constants.ts +24 -0
- package/src/index.ts +1 -1
- package/src/schemas/generateSchema.ts +1 -1
- package/src/server.ts +9 -1
- package/src/tools/generate.ts +22 -24
- package/src/tools/init.ts +1 -1
- package/src/tools/validate.ts +4 -1
- package/src/{utils/loadUserConfig.ts → utils.ts} +63 -12
- package/src/types.ts +0 -23
- package/src/utils/resolveCwd.ts +0 -20
- package/src/utils/resolveUserConfig.ts +0 -13
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/src/utils/resolveCwd.ts
DELETED
|
@@ -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,13 +0,0 @@
|
|
|
1
|
-
import { isPromise } from '@internals/utils'
|
|
2
|
-
import type { CLIOptions, Config, PossibleConfig } from '@kubb/core'
|
|
3
|
-
|
|
4
|
-
export type ResolveUserConfigOptions = {
|
|
5
|
-
configPath?: string
|
|
6
|
-
logLevel?: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export async function resolveUserConfig(config: PossibleConfig<CLIOptions>, options: ResolveUserConfigOptions): Promise<Config> {
|
|
10
|
-
const result = typeof config === 'function' ? config({ logLevel: options.logLevel as CLIOptions['logLevel'], config: options.configPath }) : config
|
|
11
|
-
const resolved = isPromise(result) ? await result : result
|
|
12
|
-
return (Array.isArray(resolved) ? resolved[0] : resolved) as Config
|
|
13
|
-
}
|
|
File without changes
|