@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/README.md +1 -0
- package/dist/index.cjs +1 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/src/config.ts +7 -3
- package/src/index.ts +1 -1
- package/src/utils/getConfigs.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ type CLIOptions = {
|
|
|
48
48
|
logLevel?: 'silent' | 'info' | 'debug'; /** Run Kubb with Bun */
|
|
49
49
|
bun?: boolean;
|
|
50
50
|
};
|
|
51
|
+
/** All accepted forms of a Kubb configuration. */
|
|
52
|
+
type ConfigInput = PossiblePromise<UserConfig | UserConfig[]> | ((cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>);
|
|
51
53
|
/**
|
|
52
54
|
* Helper for defining a Kubb configuration.
|
|
53
55
|
*
|
|
@@ -62,7 +64,8 @@ type CLIOptions = {
|
|
|
62
64
|
* plugins: [myPlugin()],
|
|
63
65
|
* }))
|
|
64
66
|
*/
|
|
65
|
-
declare function defineConfig(config:
|
|
67
|
+
declare function defineConfig(config: (cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>): typeof config;
|
|
68
|
+
declare function defineConfig(config: PossiblePromise<UserConfig | UserConfig[]>): typeof config;
|
|
66
69
|
/**
|
|
67
70
|
* Type guard to check if a given config has an `input.path`.
|
|
68
71
|
*/
|
|
@@ -236,11 +239,11 @@ declare function getBarrelFiles(files: Array<KubbFile.ResolvedFile>, {
|
|
|
236
239
|
/**
|
|
237
240
|
* Converting UserConfig to Config Array without a change in the object beside the JSON convert.
|
|
238
241
|
*/
|
|
239
|
-
declare function getConfigs(config:
|
|
242
|
+
declare function getConfigs(config: ConfigInput | UserConfig, args: CLIOptions): Promise<Array<Config>>;
|
|
240
243
|
//#endregion
|
|
241
244
|
//#region src/utils/linters.d.ts
|
|
242
245
|
type Linter = keyof typeof linters;
|
|
243
246
|
declare function detectLinter(): Promise<Linter | undefined>;
|
|
244
247
|
//#endregion
|
|
245
|
-
export { BarrelType, type CLIOptions, Config, type FileMetaBase, FunctionParams, type FunctionParamsAST, GetPluginFactoryOptions, Group, InputData, InputPath, KubbEvents, Logger, LoggerContext, LoggerOptions, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PromiseManager, ResolveNameParams, ResolvePathParams, UnknownUserPlugin, UserConfig, UserLogger, UserPlugin, UserPluginWithLifeCycle, build, build as default, defineConfig, defineLogger, definePlugin, detectFormatter, detectLinter, formatters, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, safeBuild, setup };
|
|
248
|
+
export { BarrelType, type CLIOptions, Config, type ConfigInput, type FileMetaBase, FunctionParams, type FunctionParamsAST, GetPluginFactoryOptions, Group, InputData, InputPath, KubbEvents, Logger, LoggerContext, LoggerOptions, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PromiseManager, ResolveNameParams, ResolvePathParams, UnknownUserPlugin, UserConfig, UserLogger, UserPlugin, UserPluginWithLifeCycle, build, build as default, defineConfig, defineLogger, definePlugin, detectFormatter, detectLinter, formatters, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, safeBuild, setup };
|
|
246
249
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -653,20 +653,6 @@ var URLPath = class {
|
|
|
653
653
|
};
|
|
654
654
|
//#endregion
|
|
655
655
|
//#region src/config.ts
|
|
656
|
-
/**
|
|
657
|
-
* Helper for defining a Kubb configuration.
|
|
658
|
-
*
|
|
659
|
-
* Accepts either:
|
|
660
|
-
* - A config object or array of configs
|
|
661
|
-
* - A function returning the config(s), optionally async,
|
|
662
|
-
* receiving the CLI options as argument
|
|
663
|
-
*
|
|
664
|
-
* @example
|
|
665
|
-
* export default defineConfig(({ logLevel }) => ({
|
|
666
|
-
* root: 'src',
|
|
667
|
-
* plugins: [myPlugin()],
|
|
668
|
-
* }))
|
|
669
|
-
*/
|
|
670
656
|
function defineConfig(config) {
|
|
671
657
|
return config;
|
|
672
658
|
}
|
|
@@ -1307,7 +1293,7 @@ var PluginManager = class {
|
|
|
1307
1293
|
};
|
|
1308
1294
|
//#endregion
|
|
1309
1295
|
//#region package.json
|
|
1310
|
-
var version$1 = "4.33.
|
|
1296
|
+
var version$1 = "4.33.5";
|
|
1311
1297
|
//#endregion
|
|
1312
1298
|
//#region src/utils/diagnostics.ts
|
|
1313
1299
|
/**
|