@kubb/core 4.33.3 → 4.33.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "4.33.3",
3
+ "version": "4.33.5",
4
4
  "description": "Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -64,6 +64,7 @@
64
64
  }
65
65
  ],
66
66
  "dependencies": {
67
+ "@kubb/fabric-core": "0.13.3",
67
68
  "@kubb/react-fabric": "0.13.3",
68
69
  "empathic": "^2.0.0",
69
70
  "remeda": "^2.33.6",
@@ -76,6 +77,7 @@
76
77
  "@internals/utils": "0.0.0"
77
78
  },
78
79
  "peerDependencies": {
80
+ "@kubb/fabric-core": "0.13.3",
79
81
  "@kubb/react-fabric": "0.13.3"
80
82
  },
81
83
  "engines": {
package/src/config.ts CHANGED
@@ -24,6 +24,10 @@ export type CLIOptions = {
24
24
  /** Run Kubb with Bun */
25
25
  bun?: boolean
26
26
  }
27
+
28
+ /** All accepted forms of a Kubb configuration. */
29
+ export type ConfigInput = PossiblePromise<UserConfig | UserConfig[]> | ((cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>)
30
+
27
31
  /**
28
32
  * Helper for defining a Kubb configuration.
29
33
  *
@@ -38,9 +42,9 @@ export type CLIOptions = {
38
42
  * plugins: [myPlugin()],
39
43
  * }))
40
44
  */
41
- export function defineConfig(
42
- config: PossiblePromise<UserConfig | UserConfig[]> | ((cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>),
43
- ): typeof config {
45
+ export function defineConfig(config: (cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>): typeof config
46
+ export function defineConfig(config: PossiblePromise<UserConfig | UserConfig[]>): typeof config
47
+ export function defineConfig(config: ConfigInput): ConfigInput {
44
48
  return config
45
49
  }
46
50
 
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { build, build as default, safeBuild, setup } from './build.ts'
2
- export { type CLIOptions, defineConfig, isInputPath } from './config.ts'
2
+ export { type CLIOptions, type ConfigInput, defineConfig, isInputPath } from './config.ts'
3
3
  export { formatters, linters, logLevel } from './constants.ts'
4
4
  export { defineLogger } from './defineLogger.ts'
5
5
  export { definePlugin } from './definePlugin.ts'
@@ -1,11 +1,11 @@
1
- import type { CLIOptions, defineConfig } from '../config.ts'
1
+ import type { CLIOptions, ConfigInput } from '../config.ts'
2
2
  import type { Config, UserConfig } from '../types.ts'
3
3
  import { getPlugins } from './getPlugins.ts'
4
4
 
5
5
  /**
6
6
  * Converting UserConfig to Config Array without a change in the object beside the JSON convert.
7
7
  */
8
- export async function getConfigs(config: ReturnType<typeof defineConfig> | UserConfig, args: CLIOptions): Promise<Array<Config>> {
8
+ export async function getConfigs(config: ConfigInput | UserConfig, args: CLIOptions): Promise<Array<Config>> {
9
9
  const resolvedConfig: Promise<UserConfig | Array<UserConfig>> =
10
10
  typeof config === 'function' ? Promise.resolve(config(args as CLIOptions)) : Promise.resolve(config)
11
11