@kubb/core 3.16.2 → 3.16.4
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/dist/FileManager-Dk759iZ3.js +918 -0
- package/dist/FileManager-Dk759iZ3.js.map +1 -0
- package/dist/FileManager-DsRjYJa_.cjs +1031 -0
- package/dist/FileManager-DsRjYJa_.cjs.map +1 -0
- package/dist/PluginManager-1jPxuyQK.d.ts +511 -0
- package/dist/PluginManager-Cvj5AlsU.d.cts +511 -0
- package/dist/chunk-DWy1uDak.cjs +39 -0
- package/dist/chunk-DbvY3SJr.js +33 -0
- package/dist/fs-BacxV1CO.js +87 -0
- package/dist/fs-BacxV1CO.js.map +1 -0
- package/dist/fs-BazSaf2y.cjs +129 -0
- package/dist/fs-BazSaf2y.cjs.map +1 -0
- package/dist/fs.cjs +15 -39
- package/dist/fs.d.cts +2 -19
- package/dist/fs.d.ts +2 -19
- package/dist/fs.js +4 -3
- package/dist/index-BKHQGQVq.d.ts +140 -0
- package/dist/index-BfD6z1P5.d.cts +141 -0
- package/dist/index-Cb4pChs8.d.ts +180 -0
- package/dist/index-D2ptHzfn.d.cts +180 -0
- package/dist/index.cjs +997 -1077
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -89
- package/dist/index.d.ts +107 -89
- package/dist/index.js +1020 -864
- package/dist/index.js.map +1 -1
- package/dist/logger-BxvJpQMX.cjs +1115 -0
- package/dist/logger-BxvJpQMX.cjs.map +1 -0
- package/dist/logger-Cs45J4yy.js +1085 -0
- package/dist/logger-Cs45J4yy.js.map +1 -0
- package/dist/logger-OWS6fqk0.d.cts +69 -0
- package/dist/logger-xcdTETKy.d.ts +69 -0
- package/dist/logger.cjs +6 -24
- package/dist/logger.d.cts +2 -3
- package/dist/logger.d.ts +2 -3
- package/dist/logger.js +4 -4
- package/dist/mocks.cjs +49 -65
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +6 -6
- package/dist/mocks.d.ts +6 -6
- package/dist/mocks.js +48 -59
- package/dist/mocks.js.map +1 -1
- package/dist/prompt-DwEAzq0q.js +853 -0
- package/dist/prompt-DwEAzq0q.js.map +1 -0
- package/dist/prompt-qiwl6Be9.cjs +855 -0
- package/dist/prompt-qiwl6Be9.cjs.map +1 -0
- package/dist/transformers-B3CHtwuB.cjs +948 -0
- package/dist/transformers-B3CHtwuB.cjs.map +1 -0
- package/dist/transformers-CJqBQFIl.js +829 -0
- package/dist/transformers-CJqBQFIl.js.map +1 -0
- package/dist/transformers.cjs +33 -88
- package/dist/transformers.d.cts +75 -54
- package/dist/transformers.d.ts +75 -54
- package/dist/transformers.js +4 -3
- package/dist/utils.cjs +20 -73
- package/dist/utils.d.cts +5 -126
- package/dist/utils.d.ts +5 -126
- package/dist/utils.js +6 -5
- package/dist/write-CLTPlucv.js +42 -0
- package/dist/write-CLTPlucv.js.map +1 -0
- package/dist/write-l_NzIqyy.cjs +48 -0
- package/dist/write-l_NzIqyy.cjs.map +1 -0
- package/package.json +25 -32
- package/src/BarrelManager.ts +1 -0
- package/src/PromiseManager.ts +1 -7
- package/src/build.ts +9 -11
- package/src/index.ts +5 -5
- package/src/logger.ts +10 -10
- package/src/utils/FunctionParams.ts +3 -1
- package/src/utils/TreeNode.ts +3 -1
- package/dist/PluginManager-E3SghPP9.d.cts +0 -458
- package/dist/PluginManager-PDmRCu9k.d.ts +0 -458
- package/dist/chunk-4V7HK7PT.js +0 -1199
- package/dist/chunk-4V7HK7PT.js.map +0 -1
- package/dist/chunk-BHSTNFNQ.cjs +0 -701
- package/dist/chunk-BHSTNFNQ.cjs.map +0 -1
- package/dist/chunk-CAZ37TGB.js +0 -918
- package/dist/chunk-CAZ37TGB.js.map +0 -1
- package/dist/chunk-E4XLCCPK.cjs +0 -170
- package/dist/chunk-E4XLCCPK.cjs.map +0 -1
- package/dist/chunk-GBYHPDPK.js +0 -595
- package/dist/chunk-GBYHPDPK.js.map +0 -1
- package/dist/chunk-L3A3DTAX.cjs +0 -1074
- package/dist/chunk-L3A3DTAX.cjs.map +0 -1
- package/dist/chunk-MCNA6SYG.cjs +0 -1231
- package/dist/chunk-MCNA6SYG.cjs.map +0 -1
- package/dist/chunk-YRPOID7E.js +0 -157
- package/dist/chunk-YRPOID7E.js.map +0 -1
- package/dist/fs.cjs.map +0 -1
- package/dist/fs.js.map +0 -1
- package/dist/logger-BWq-oJU_.d.cts +0 -63
- package/dist/logger-BWq-oJU_.d.ts +0 -63
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/parser-C1vOjVEd.d.ts +0 -41
- package/dist/parser-D6vU1kA9.d.cts +0 -41
- package/dist/prompt-ELTHGQK6.js +0 -753
- package/dist/prompt-ELTHGQK6.js.map +0 -1
- package/dist/prompt-U7M5G25C.cjs +0 -761
- package/dist/prompt-U7M5G25C.cjs.map +0 -1
- package/dist/transformers.cjs.map +0 -1
- package/dist/transformers.js.map +0 -1
- package/dist/types-CA8nQKwM.d.cts +0 -132
- package/dist/types-CA8nQKwM.d.ts +0 -132
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,122 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export { g as getDefaultBanner } from './parser-C1vOjVEd.js';
|
|
6
|
-
import 'consola/utils';
|
|
7
|
-
import 'consola';
|
|
1
|
+
import { ResolvedFile } from "./index-BKHQGQVq.js";
|
|
2
|
+
import { Logger } from "./logger-xcdTETKy.js";
|
|
3
|
+
import { BarrelType, Config, FileManager, FileMetaBase, GetPluginFactoryOptions, Group, InputData, InputPath, Output, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PossiblePromise, ResolveNameParams, ResolvePathParams, UserConfig, UserPlugin, UserPluginWithLifeCycle, getSource } from "./PluginManager-1jPxuyQK.js";
|
|
4
|
+
import { getDefaultBanner } from "./index-Cb4pChs8.js";
|
|
8
5
|
|
|
6
|
+
//#region src/BaseGenerator.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
9
|
+
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
10
|
+
*/
|
|
11
|
+
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options?: TOptions, context?: TContext);
|
|
14
|
+
get options(): TOptions;
|
|
15
|
+
get context(): TContext;
|
|
16
|
+
set options(options: TOptions);
|
|
17
|
+
abstract build(...params: unknown[]): unknown;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/build.d.ts
|
|
9
21
|
type BuildOptions = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
config: UserConfig;
|
|
23
|
+
/**
|
|
24
|
+
* @default Logger without the spinner
|
|
25
|
+
*/
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
pluginManager?: PluginManager;
|
|
16
28
|
};
|
|
17
29
|
type BuildOutput = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
files: Array<ResolvedFile>;
|
|
31
|
+
pluginManager: PluginManager;
|
|
32
|
+
/**
|
|
33
|
+
* Only for safeBuild
|
|
34
|
+
*/
|
|
35
|
+
error?: Error;
|
|
24
36
|
};
|
|
25
37
|
declare function setup(options: BuildOptions): Promise<PluginManager>;
|
|
26
38
|
declare function build(options: BuildOptions): Promise<BuildOutput>;
|
|
27
39
|
declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
|
|
28
|
-
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/config.d.ts
|
|
29
42
|
type Args = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Path to `kubb.config.js`
|
|
45
|
+
*/
|
|
46
|
+
config?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Watch changes on input
|
|
49
|
+
*/
|
|
50
|
+
watch?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Log level to report when using the CLI
|
|
53
|
+
*
|
|
54
|
+
* `silent` will hide all information that is not relevant
|
|
55
|
+
*
|
|
56
|
+
* `info` will show all information possible(not related to the PluginManager)
|
|
57
|
+
*
|
|
58
|
+
* `debug` will show all information possible(related to the PluginManager), handy for seeing logs
|
|
59
|
+
* @default `silent`
|
|
60
|
+
*/
|
|
61
|
+
logLevel?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Run Kubb with Bun
|
|
64
|
+
*/
|
|
65
|
+
bun?: boolean;
|
|
53
66
|
};
|
|
54
67
|
/**
|
|
55
68
|
* Type helper to make it easier to use vite.config.ts accepts a direct UserConfig object, or a function that returns it. The function receives a ConfigEnv object.
|
|
56
69
|
*/
|
|
57
|
-
declare function defineConfig(options: PossiblePromise<UserConfig | Array<UserConfig>> | ((
|
|
58
|
-
/** The options derived from the CLI flags */
|
|
70
|
+
declare function defineConfig(options: PossiblePromise<UserConfig | Array<UserConfig>> | ((/** The options derived from the CLI flags */
|
|
59
71
|
args: Args) => PossiblePromise<UserConfig | Array<UserConfig>>)): typeof options;
|
|
60
72
|
declare function isInputPath(result: UserConfig | undefined): result is UserConfig<InputPath>;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
64
|
-
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
65
|
-
*/
|
|
66
|
-
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
67
|
-
#private;
|
|
68
|
-
constructor(options?: TOptions, context?: TContext);
|
|
69
|
-
get options(): TOptions;
|
|
70
|
-
get context(): TContext;
|
|
71
|
-
set options(options: TOptions);
|
|
72
|
-
abstract build(...params: unknown[]): unknown;
|
|
73
|
-
}
|
|
74
|
-
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/PackageManager.d.ts
|
|
75
75
|
type PackageJSON = {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
dependencies?: Record<string, string>;
|
|
77
|
+
devDependencies?: Record<string, string>;
|
|
78
78
|
};
|
|
79
79
|
type DependencyName = string;
|
|
80
80
|
type DependencyVersion = string;
|
|
81
81
|
declare class PackageManager {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
#private;
|
|
83
|
+
constructor(workspace?: string);
|
|
84
|
+
set workspace(workspace: string);
|
|
85
|
+
get workspace(): string | undefined;
|
|
86
|
+
normalizeDirectory(directory: string): string;
|
|
87
|
+
getLocation(path: string): string;
|
|
88
|
+
import(path: string): Promise<any | undefined>;
|
|
89
|
+
getPackageJSON(): Promise<PackageJSON | undefined>;
|
|
90
|
+
getPackageJSONSync(): PackageJSON | undefined;
|
|
91
|
+
static setVersion(dependency: DependencyName, version: DependencyVersion): void;
|
|
92
|
+
getVersion(dependency: DependencyName | RegExp): Promise<DependencyVersion | undefined>;
|
|
93
|
+
getVersionSync(dependency: DependencyName | RegExp): DependencyVersion | undefined;
|
|
94
|
+
isValid(dependency: DependencyName | RegExp, version: DependencyVersion): Promise<boolean>;
|
|
95
|
+
isValidSync(dependency: DependencyName | RegExp, version: DependencyVersion): boolean;
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
type OptionalPluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options?: T['options']) => UserPluginWithLifeCycle<T>;
|
|
100
|
-
declare function createPlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(factory: PluginFactory<T>): OptionalPluginFactory<T>;
|
|
101
|
-
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/utils/executeStrategies.d.ts
|
|
102
99
|
type PromiseFunc$1<T = unknown, T2 = never> = (state?: T) => T2 extends never ? Promise<T> : Promise<T> | T2;
|
|
103
100
|
type ValueOfPromiseFuncArray<TInput extends Array<unknown>> = TInput extends Array<PromiseFunc$1<infer X, infer Y>> ? X | Y : never;
|
|
104
101
|
type SeqOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = Promise<Array<Awaited<ValueOfPromiseFuncArray<TInput>>>>;
|
|
102
|
+
/**
|
|
103
|
+
* Chains promises
|
|
104
|
+
*/
|
|
105
|
+
|
|
105
106
|
type HookFirstOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue = unknown> = ValueOfPromiseFuncArray<TInput>;
|
|
107
|
+
/**
|
|
108
|
+
* Chains promises, first non-null result stops and returns
|
|
109
|
+
*/
|
|
110
|
+
|
|
106
111
|
type HookParallelOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = Promise<PromiseSettledResult<Awaited<ValueOfPromiseFuncArray<TInput>>>[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Runs an array of promise functions with optional concurrency limit.
|
|
114
|
+
*/
|
|
115
|
+
|
|
107
116
|
type Strategy = 'seq' | 'first' | 'parallel';
|
|
108
117
|
type StrategySwitch<TStrategy extends Strategy, TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = TStrategy extends 'first' ? HookFirstOutput<TInput, TValue> : TStrategy extends 'seq' ? SeqOutput<TInput, TValue> : TStrategy extends 'parallel' ? HookParallelOutput<TInput, TValue> : never;
|
|
109
|
-
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/PromiseManager.d.ts
|
|
110
120
|
type PromiseFunc<T = unknown, T2 = never> = () => T2 extends never ? Promise<T> : Promise<T> | T2;
|
|
111
121
|
type Options<TState = any> = {
|
|
112
|
-
|
|
122
|
+
nullCheck?: (state: TState) => boolean;
|
|
113
123
|
};
|
|
114
124
|
declare class PromiseManager<TState = any> {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
#private;
|
|
126
|
+
constructor(options?: Options<TState>);
|
|
127
|
+
run<TInput extends Array<PromiseFunc<TValue, null>>, TValue, TStrategy extends Strategy, TOutput = StrategySwitch<TStrategy, TInput, TValue>>(strategy: TStrategy, promises: TInput, {
|
|
128
|
+
concurrency
|
|
129
|
+
}?: {
|
|
130
|
+
concurrency?: number;
|
|
131
|
+
}): TOutput;
|
|
120
132
|
}
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/plugin.d.ts
|
|
135
|
+
type PluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => UserPluginWithLifeCycle<T>;
|
|
136
|
+
type OptionalPluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options?: T['options']) => UserPluginWithLifeCycle<T>;
|
|
137
|
+
declare function createPlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(factory: PluginFactory<T>): OptionalPluginFactory<T>;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { BarrelType, BaseGenerator, Config, FileManager, type FileMetaBase, GetPluginFactoryOptions, Group, InputData, InputPath, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PromiseManager, ResolveNameParams, ResolvePathParams, UserConfig, UserPlugin, UserPluginWithLifeCycle, build, createPlugin, build as default, defineConfig, getDefaultBanner, getSource, isInputPath, safeBuild, setup };
|
|
140
|
+
//# sourceMappingURL=index.d.ts.map
|