@kubb/core 4.11.1 → 4.11.2
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/{getBarrelFiles-BkDzzugQ.cjs → getBarrelFiles-8VEWWk9Z.cjs} +80 -111
- package/dist/getBarrelFiles-8VEWWk9Z.cjs.map +1 -0
- package/dist/{getBarrelFiles-BVMBhc50.d.cts → getBarrelFiles-B_2WDywH.d.cts} +3 -3
- package/dist/{getBarrelFiles-a-GlnjYa.js → getBarrelFiles-DQ0hksqD.js} +80 -111
- package/dist/getBarrelFiles-DQ0hksqD.js.map +1 -0
- package/dist/{getBarrelFiles-DjQ68d4e.d.ts → getBarrelFiles-ZIHk_1ln.d.ts} +3 -3
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.cjs +261 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +262 -43
- package/dist/index.js.map +1 -1
- package/dist/{logger-DIA19Yfz.js → logger-CQn6sdC0.js} +72 -7
- package/dist/{logger-CPt4U57Z.cjs.map → logger-CQn6sdC0.js.map} +1 -1
- package/dist/{logger-CPt4U57Z.cjs → logger-US5g7KdM.cjs} +72 -7
- package/dist/logger-US5g7KdM.cjs.map +1 -0
- package/dist/{logger-C96jDrSt.d.ts → logger-mq06Cxxv.d.cts} +29 -4
- package/dist/{logger-BJDkLsF0.d.cts → logger-o16AyvGp.d.ts} +29 -4
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/{types-tSSA1oz8.d.cts → types-CCEy_FVr.d.cts} +36 -27
- package/dist/{types-69-evK37.d.ts → types-DgfEZ3IN.d.ts} +36 -27
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/src/PluginManager.ts +81 -114
- package/src/build.ts +229 -25
- package/src/logger.ts +87 -9
- package/src/utils/ciDetection.ts +40 -0
- package/src/utils/diagnostics.ts +15 -0
- package/dist/getBarrelFiles-BkDzzugQ.cjs.map +0 -1
- package/dist/getBarrelFiles-a-GlnjYa.js.map +0 -1
- package/dist/logger-DIA19Yfz.js.map +0 -1
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
import { n as Logger, o as EventEmitter } from "./logger-
|
|
1
|
+
import { n as Logger, o as EventEmitter } from "./logger-mq06Cxxv.cjs";
|
|
2
2
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
4
|
|
|
5
5
|
//#region src/PluginManager.d.ts
|
|
6
6
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
7
7
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
8
|
-
type
|
|
9
|
-
message: string;
|
|
8
|
+
type ExecutingMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
10
9
|
strategy: Strategy;
|
|
11
10
|
hookName: H;
|
|
12
11
|
plugin: Plugin;
|
|
13
12
|
parameters?: unknown[] | undefined;
|
|
14
13
|
output?: unknown;
|
|
15
14
|
};
|
|
15
|
+
type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
16
|
+
duration: number;
|
|
17
|
+
strategy: Strategy;
|
|
18
|
+
hookName: H;
|
|
19
|
+
plugin: Plugin;
|
|
20
|
+
parameters?: unknown[] | undefined;
|
|
21
|
+
output?: unknown;
|
|
22
|
+
};
|
|
23
|
+
type ErrorMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
24
|
+
hookName: H;
|
|
25
|
+
duration: number;
|
|
26
|
+
strategy: Strategy;
|
|
27
|
+
parameters?: unknown[] | undefined;
|
|
28
|
+
plugin: Plugin;
|
|
29
|
+
};
|
|
30
|
+
type ProgressStartMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
31
|
+
hookName: H;
|
|
32
|
+
plugins: Array<Plugin>;
|
|
33
|
+
};
|
|
34
|
+
type ProgressStopMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
35
|
+
hookName: H;
|
|
36
|
+
};
|
|
16
37
|
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
17
38
|
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
18
39
|
result: Result;
|
|
@@ -27,9 +48,11 @@ type Options = {
|
|
|
27
48
|
concurrency?: number;
|
|
28
49
|
};
|
|
29
50
|
type Events = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
progress_start: [meta: ProgressStartMeta];
|
|
52
|
+
progress_stop: [meta: ProgressStopMeta];
|
|
53
|
+
executing: [meta: ExecutingMeta];
|
|
54
|
+
executed: [meta: ExecutedMeta];
|
|
55
|
+
error: [error: Error, meta: ErrorMeta];
|
|
33
56
|
};
|
|
34
57
|
type GetFileProps<TOptions = object> = {
|
|
35
58
|
name: string;
|
|
@@ -43,8 +66,6 @@ declare class PluginManager {
|
|
|
43
66
|
#private;
|
|
44
67
|
readonly events: EventEmitter<Events>;
|
|
45
68
|
readonly config: Config;
|
|
46
|
-
readonly executed: Array<Executer>;
|
|
47
|
-
readonly logger: Logger;
|
|
48
69
|
readonly options: Options;
|
|
49
70
|
constructor(config: Config, options: Options);
|
|
50
71
|
getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any>;
|
|
@@ -70,13 +91,11 @@ declare class PluginManager {
|
|
|
70
91
|
hookForPlugin<H extends PluginLifecycleHooks>({
|
|
71
92
|
pluginKey,
|
|
72
93
|
hookName,
|
|
73
|
-
parameters
|
|
74
|
-
message
|
|
94
|
+
parameters
|
|
75
95
|
}: {
|
|
76
96
|
pluginKey: Plugin['key'];
|
|
77
97
|
hookName: H;
|
|
78
98
|
parameters: PluginParameter<H>;
|
|
79
|
-
message: string;
|
|
80
99
|
}): Promise<Array<ReturnType<ParseResult<H>> | null>>;
|
|
81
100
|
/**
|
|
82
101
|
* Run a specific hookName for plugin x.
|
|
@@ -84,13 +103,11 @@ declare class PluginManager {
|
|
|
84
103
|
hookForPluginSync<H extends PluginLifecycleHooks>({
|
|
85
104
|
pluginKey,
|
|
86
105
|
hookName,
|
|
87
|
-
parameters
|
|
88
|
-
message
|
|
106
|
+
parameters
|
|
89
107
|
}: {
|
|
90
108
|
pluginKey: Plugin['key'];
|
|
91
109
|
hookName: H;
|
|
92
110
|
parameters: PluginParameter<H>;
|
|
93
|
-
message: string;
|
|
94
111
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
95
112
|
/**
|
|
96
113
|
* First non-null result stops and will return it's value.
|
|
@@ -98,13 +115,11 @@ declare class PluginManager {
|
|
|
98
115
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
99
116
|
hookName,
|
|
100
117
|
parameters,
|
|
101
|
-
skipped
|
|
102
|
-
message
|
|
118
|
+
skipped
|
|
103
119
|
}: {
|
|
104
120
|
hookName: H;
|
|
105
121
|
parameters: PluginParameter<H>;
|
|
106
122
|
skipped?: ReadonlySet<Plugin> | null;
|
|
107
|
-
message: string;
|
|
108
123
|
}): Promise<SafeParseResult<H>>;
|
|
109
124
|
/**
|
|
110
125
|
* First non-null result stops and will return it's value.
|
|
@@ -112,37 +127,31 @@ declare class PluginManager {
|
|
|
112
127
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
113
128
|
hookName,
|
|
114
129
|
parameters,
|
|
115
|
-
skipped
|
|
116
|
-
message
|
|
130
|
+
skipped
|
|
117
131
|
}: {
|
|
118
132
|
hookName: H;
|
|
119
133
|
parameters: PluginParameter<H>;
|
|
120
134
|
skipped?: ReadonlySet<Plugin> | null;
|
|
121
|
-
message: string;
|
|
122
135
|
}): SafeParseResult<H>;
|
|
123
136
|
/**
|
|
124
137
|
* Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
|
|
125
138
|
*/
|
|
126
139
|
hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
|
|
127
140
|
hookName,
|
|
128
|
-
parameters
|
|
129
|
-
message
|
|
141
|
+
parameters
|
|
130
142
|
}: {
|
|
131
143
|
hookName: H;
|
|
132
144
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
133
|
-
message: string;
|
|
134
145
|
}): Promise<Awaited<TOuput>[]>;
|
|
135
146
|
/**
|
|
136
147
|
* Chains plugins
|
|
137
148
|
*/
|
|
138
149
|
hookSeq<H extends PluginLifecycleHooks>({
|
|
139
150
|
hookName,
|
|
140
|
-
parameters
|
|
141
|
-
message
|
|
151
|
+
parameters
|
|
142
152
|
}: {
|
|
143
153
|
hookName: H;
|
|
144
154
|
parameters?: PluginParameter<H>;
|
|
145
|
-
message: string;
|
|
146
155
|
}): Promise<void>;
|
|
147
156
|
getPluginByKey(pluginKey: Plugin['key']): Plugin | undefined;
|
|
148
157
|
getPluginsByKey(hookName: keyof PluginWithLifeCycle, pluginKey: Plugin['key']): Plugin[];
|
|
@@ -466,4 +475,4 @@ type Group = {
|
|
|
466
475
|
};
|
|
467
476
|
//#endregion
|
|
468
477
|
export { getMode as C, PluginManager as S, ResolvePathParams as _, InputData as a, UserPluginWithLifeCycle as b, Plugin as c, PluginKey as d, PluginLifecycle as f, ResolveNameParams as g, PluginWithLifeCycle as h, Group as i, PluginContext as l, PluginParameter as m, Config as n, InputPath as o, PluginLifecycleHooks as p, GetPluginFactoryOptions as r, Output as s, BarrelType as t, PluginFactoryOptions as u, UserConfig as v, PossiblePromise as x, UserPlugin as y };
|
|
469
|
-
//# sourceMappingURL=types-
|
|
478
|
+
//# sourceMappingURL=types-CCEy_FVr.d.cts.map
|
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
import { n as Logger, o as EventEmitter } from "./logger-
|
|
1
|
+
import { n as Logger, o as EventEmitter } from "./logger-o16AyvGp.js";
|
|
2
2
|
import { Fabric } from "@kubb/react-fabric";
|
|
3
3
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
4
|
|
|
5
5
|
//#region src/PluginManager.d.ts
|
|
6
6
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
7
7
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
8
|
-
type
|
|
9
|
-
message: string;
|
|
8
|
+
type ExecutingMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
10
9
|
strategy: Strategy;
|
|
11
10
|
hookName: H;
|
|
12
11
|
plugin: Plugin;
|
|
13
12
|
parameters?: unknown[] | undefined;
|
|
14
13
|
output?: unknown;
|
|
15
14
|
};
|
|
15
|
+
type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
16
|
+
duration: number;
|
|
17
|
+
strategy: Strategy;
|
|
18
|
+
hookName: H;
|
|
19
|
+
plugin: Plugin;
|
|
20
|
+
parameters?: unknown[] | undefined;
|
|
21
|
+
output?: unknown;
|
|
22
|
+
};
|
|
23
|
+
type ErrorMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
24
|
+
hookName: H;
|
|
25
|
+
duration: number;
|
|
26
|
+
strategy: Strategy;
|
|
27
|
+
parameters?: unknown[] | undefined;
|
|
28
|
+
plugin: Plugin;
|
|
29
|
+
};
|
|
30
|
+
type ProgressStartMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
31
|
+
hookName: H;
|
|
32
|
+
plugins: Array<Plugin>;
|
|
33
|
+
};
|
|
34
|
+
type ProgressStopMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
35
|
+
hookName: H;
|
|
36
|
+
};
|
|
16
37
|
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
17
38
|
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
18
39
|
result: Result;
|
|
@@ -27,9 +48,11 @@ type Options = {
|
|
|
27
48
|
concurrency?: number;
|
|
28
49
|
};
|
|
29
50
|
type Events = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
progress_start: [meta: ProgressStartMeta];
|
|
52
|
+
progress_stop: [meta: ProgressStopMeta];
|
|
53
|
+
executing: [meta: ExecutingMeta];
|
|
54
|
+
executed: [meta: ExecutedMeta];
|
|
55
|
+
error: [error: Error, meta: ErrorMeta];
|
|
33
56
|
};
|
|
34
57
|
type GetFileProps<TOptions = object> = {
|
|
35
58
|
name: string;
|
|
@@ -43,8 +66,6 @@ declare class PluginManager {
|
|
|
43
66
|
#private;
|
|
44
67
|
readonly events: EventEmitter<Events>;
|
|
45
68
|
readonly config: Config;
|
|
46
|
-
readonly executed: Array<Executer>;
|
|
47
|
-
readonly logger: Logger;
|
|
48
69
|
readonly options: Options;
|
|
49
70
|
constructor(config: Config, options: Options);
|
|
50
71
|
getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any>;
|
|
@@ -70,13 +91,11 @@ declare class PluginManager {
|
|
|
70
91
|
hookForPlugin<H extends PluginLifecycleHooks>({
|
|
71
92
|
pluginKey,
|
|
72
93
|
hookName,
|
|
73
|
-
parameters
|
|
74
|
-
message
|
|
94
|
+
parameters
|
|
75
95
|
}: {
|
|
76
96
|
pluginKey: Plugin['key'];
|
|
77
97
|
hookName: H;
|
|
78
98
|
parameters: PluginParameter<H>;
|
|
79
|
-
message: string;
|
|
80
99
|
}): Promise<Array<ReturnType<ParseResult<H>> | null>>;
|
|
81
100
|
/**
|
|
82
101
|
* Run a specific hookName for plugin x.
|
|
@@ -84,13 +103,11 @@ declare class PluginManager {
|
|
|
84
103
|
hookForPluginSync<H extends PluginLifecycleHooks>({
|
|
85
104
|
pluginKey,
|
|
86
105
|
hookName,
|
|
87
|
-
parameters
|
|
88
|
-
message
|
|
106
|
+
parameters
|
|
89
107
|
}: {
|
|
90
108
|
pluginKey: Plugin['key'];
|
|
91
109
|
hookName: H;
|
|
92
110
|
parameters: PluginParameter<H>;
|
|
93
|
-
message: string;
|
|
94
111
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
95
112
|
/**
|
|
96
113
|
* First non-null result stops and will return it's value.
|
|
@@ -98,13 +115,11 @@ declare class PluginManager {
|
|
|
98
115
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
99
116
|
hookName,
|
|
100
117
|
parameters,
|
|
101
|
-
skipped
|
|
102
|
-
message
|
|
118
|
+
skipped
|
|
103
119
|
}: {
|
|
104
120
|
hookName: H;
|
|
105
121
|
parameters: PluginParameter<H>;
|
|
106
122
|
skipped?: ReadonlySet<Plugin> | null;
|
|
107
|
-
message: string;
|
|
108
123
|
}): Promise<SafeParseResult<H>>;
|
|
109
124
|
/**
|
|
110
125
|
* First non-null result stops and will return it's value.
|
|
@@ -112,37 +127,31 @@ declare class PluginManager {
|
|
|
112
127
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
113
128
|
hookName,
|
|
114
129
|
parameters,
|
|
115
|
-
skipped
|
|
116
|
-
message
|
|
130
|
+
skipped
|
|
117
131
|
}: {
|
|
118
132
|
hookName: H;
|
|
119
133
|
parameters: PluginParameter<H>;
|
|
120
134
|
skipped?: ReadonlySet<Plugin> | null;
|
|
121
|
-
message: string;
|
|
122
135
|
}): SafeParseResult<H>;
|
|
123
136
|
/**
|
|
124
137
|
* Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
|
|
125
138
|
*/
|
|
126
139
|
hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
|
|
127
140
|
hookName,
|
|
128
|
-
parameters
|
|
129
|
-
message
|
|
141
|
+
parameters
|
|
130
142
|
}: {
|
|
131
143
|
hookName: H;
|
|
132
144
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
133
|
-
message: string;
|
|
134
145
|
}): Promise<Awaited<TOuput>[]>;
|
|
135
146
|
/**
|
|
136
147
|
* Chains plugins
|
|
137
148
|
*/
|
|
138
149
|
hookSeq<H extends PluginLifecycleHooks>({
|
|
139
150
|
hookName,
|
|
140
|
-
parameters
|
|
141
|
-
message
|
|
151
|
+
parameters
|
|
142
152
|
}: {
|
|
143
153
|
hookName: H;
|
|
144
154
|
parameters?: PluginParameter<H>;
|
|
145
|
-
message: string;
|
|
146
155
|
}): Promise<void>;
|
|
147
156
|
getPluginByKey(pluginKey: Plugin['key']): Plugin | undefined;
|
|
148
157
|
getPluginsByKey(hookName: keyof PluginWithLifeCycle, pluginKey: Plugin['key']): Plugin[];
|
|
@@ -466,4 +475,4 @@ type Group = {
|
|
|
466
475
|
};
|
|
467
476
|
//#endregion
|
|
468
477
|
export { getMode as C, PluginManager as S, ResolvePathParams as _, InputData as a, UserPluginWithLifeCycle as b, Plugin as c, PluginKey as d, PluginLifecycle as f, ResolveNameParams as g, PluginWithLifeCycle as h, Group as i, PluginContext as l, PluginParameter as m, Config as n, InputPath as o, PluginLifecycleHooks as p, GetPluginFactoryOptions as r, Output as s, BarrelType as t, PluginFactoryOptions as u, UserConfig as v, PossiblePromise as x, UserPlugin as y };
|
|
469
|
-
//# sourceMappingURL=types-
|
|
478
|
+
//# sourceMappingURL=types-DgfEZ3IN.d.ts.map
|
package/dist/utils.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
-
const require_getBarrelFiles = require('./getBarrelFiles-
|
|
2
|
+
const require_getBarrelFiles = require('./getBarrelFiles-8VEWWk9Z.cjs');
|
|
3
3
|
const require_transformers = require('./transformers-B-zCAPV-.cjs');
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as PossiblePromise } from "./types-
|
|
2
|
-
import { n as getBarrelFiles } from "./getBarrelFiles-
|
|
1
|
+
import { x as PossiblePromise } from "./types-CCEy_FVr.cjs";
|
|
2
|
+
import { n as getBarrelFiles } from "./getBarrelFiles-B_2WDywH.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/buildJSDoc.d.ts
|
|
5
5
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as PossiblePromise } from "./types-
|
|
2
|
-
import { n as getBarrelFiles } from "./getBarrelFiles-
|
|
1
|
+
import { x as PossiblePromise } from "./types-DgfEZ3IN.js";
|
|
2
|
+
import { n as getBarrelFiles } from "./getBarrelFiles-ZIHk_1ln.js";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/buildJSDoc.d.ts
|
|
5
5
|
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getUniqueName, n as URLPath, o as setUniqueName, t as getBarrelFiles } from "./getBarrelFiles-
|
|
1
|
+
import { a as getUniqueName, n as URLPath, o as setUniqueName, t as getBarrelFiles } from "./getBarrelFiles-DQ0hksqD.js";
|
|
2
2
|
import { m as camelCase } from "./transformers-CjdbeLAK.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { orderBy } from "natural-orderby";
|
package/package.json
CHANGED