@kubb/core 1.1.5 → 1.1.6
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/index.cjs +32 -30
- package/dist/index.d.ts +14 -2
- package/dist/index.js +32 -30
- package/package.json +3 -3
- package/src/build.ts +0 -3
- package/src/managers/fileManager/FileManager.ts +10 -1
- package/src/managers/pluginManager/PluginManager.ts +38 -30
package/dist/index.cjs
CHANGED
|
@@ -523,6 +523,13 @@ var FileManager = class {
|
|
|
523
523
|
});
|
|
524
524
|
return files;
|
|
525
525
|
}
|
|
526
|
+
get cachedFiles() {
|
|
527
|
+
const files = [];
|
|
528
|
+
this.cache.forEach((item) => {
|
|
529
|
+
files.push(item);
|
|
530
|
+
});
|
|
531
|
+
return files;
|
|
532
|
+
}
|
|
526
533
|
async add(file) {
|
|
527
534
|
const cacheItem = { id: crypto__default.default.randomUUID(), file, status: "new" };
|
|
528
535
|
this.cache.set(cacheItem.id, cacheItem);
|
|
@@ -691,9 +698,9 @@ var PluginManager = class {
|
|
|
691
698
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
692
699
|
if (skipped && skipped.has(plugin))
|
|
693
700
|
continue;
|
|
694
|
-
promise = promise.then(async (
|
|
695
|
-
if (result != null) {
|
|
696
|
-
return
|
|
701
|
+
promise = promise.then(async (parseResult) => {
|
|
702
|
+
if (parseResult?.result != null) {
|
|
703
|
+
return parseResult;
|
|
697
704
|
}
|
|
698
705
|
const value = await this.execute({
|
|
699
706
|
strategy: "hookFirst",
|
|
@@ -718,45 +725,38 @@ var PluginManager = class {
|
|
|
718
725
|
parameters,
|
|
719
726
|
skipped
|
|
720
727
|
}) {
|
|
721
|
-
let
|
|
728
|
+
let parseResult = null;
|
|
722
729
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
723
730
|
if (skipped && skipped.has(plugin))
|
|
724
731
|
continue;
|
|
725
|
-
|
|
732
|
+
parseResult = {
|
|
726
733
|
result: this.executeSync({
|
|
727
734
|
strategy: "hookFirst",
|
|
728
735
|
hookName,
|
|
729
736
|
parameters,
|
|
730
737
|
plugin
|
|
731
|
-
})
|
|
738
|
+
}),
|
|
739
|
+
plugin
|
|
732
740
|
};
|
|
733
|
-
if (result != null) {
|
|
741
|
+
if (parseResult?.result != null) {
|
|
734
742
|
break;
|
|
735
743
|
}
|
|
736
744
|
}
|
|
737
|
-
return
|
|
745
|
+
return parseResult;
|
|
738
746
|
}
|
|
739
|
-
|
|
747
|
+
/**
|
|
748
|
+
*
|
|
749
|
+
* Parallel, runs all plugins
|
|
750
|
+
*/
|
|
740
751
|
async hookParallel({
|
|
741
752
|
hookName,
|
|
742
753
|
parameters
|
|
743
754
|
}) {
|
|
744
755
|
const parallelPromises = [];
|
|
745
756
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
parallelPromises.
|
|
749
|
-
await this.execute({
|
|
750
|
-
strategy: "hookParallel",
|
|
751
|
-
hookName,
|
|
752
|
-
parameters,
|
|
753
|
-
plugin
|
|
754
|
-
});
|
|
755
|
-
} else {
|
|
756
|
-
const promise = this.execute({ strategy: "hookParallel", hookName, parameters, plugin });
|
|
757
|
-
if (promise) {
|
|
758
|
-
parallelPromises.push(promise);
|
|
759
|
-
}
|
|
757
|
+
const promise = this.execute({ strategy: "hookParallel", hookName, parameters, plugin });
|
|
758
|
+
if (promise) {
|
|
759
|
+
parallelPromises.push(promise);
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
const results = await Promise.allSettled(parallelPromises);
|
|
@@ -766,7 +766,10 @@ var PluginManager = class {
|
|
|
766
766
|
}
|
|
767
767
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
768
768
|
}
|
|
769
|
-
|
|
769
|
+
/**
|
|
770
|
+
*
|
|
771
|
+
* Chains, reduces returned value, handling the reduced value as the first hook argument
|
|
772
|
+
*/
|
|
770
773
|
hookReduceArg0({
|
|
771
774
|
hookName,
|
|
772
775
|
parameters,
|
|
@@ -775,11 +778,11 @@ var PluginManager = class {
|
|
|
775
778
|
const [argument0, ...rest] = parameters;
|
|
776
779
|
let promise = Promise.resolve(argument0);
|
|
777
780
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
778
|
-
promise = promise.then((
|
|
781
|
+
promise = promise.then((arg0) => {
|
|
779
782
|
const value = this.execute({
|
|
780
783
|
strategy: "hookReduceArg0",
|
|
781
784
|
hookName,
|
|
782
|
-
parameters: [
|
|
785
|
+
parameters: [arg0, ...rest],
|
|
783
786
|
plugin
|
|
784
787
|
});
|
|
785
788
|
return value;
|
|
@@ -787,7 +790,9 @@ var PluginManager = class {
|
|
|
787
790
|
}
|
|
788
791
|
return promise;
|
|
789
792
|
}
|
|
790
|
-
|
|
793
|
+
/**
|
|
794
|
+
* Chains plugins
|
|
795
|
+
*/
|
|
791
796
|
hookSeq({ hookName, parameters }) {
|
|
792
797
|
let promise = Promise.resolve();
|
|
793
798
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
@@ -1067,9 +1072,6 @@ ${source}`;
|
|
|
1067
1072
|
|
|
1068
1073
|
// src/build.ts
|
|
1069
1074
|
async function transformReducer(_previousCode, result, _plugin) {
|
|
1070
|
-
if (result === null) {
|
|
1071
|
-
return null;
|
|
1072
|
-
}
|
|
1073
1075
|
return result;
|
|
1074
1076
|
}
|
|
1075
1077
|
async function build(options) {
|
package/dist/index.d.ts
CHANGED
|
@@ -124,11 +124,12 @@ declare class FileManager {
|
|
|
124
124
|
private queue?;
|
|
125
125
|
constructor(options?: {
|
|
126
126
|
queue: Queue;
|
|
127
|
-
task
|
|
127
|
+
task?: QueueTask<unknown>;
|
|
128
128
|
});
|
|
129
129
|
private getCache;
|
|
130
130
|
getCacheByPath(path: string | undefined): CacheStore | undefined;
|
|
131
131
|
get files(): File[];
|
|
132
|
+
get cachedFiles(): CacheStore[];
|
|
132
133
|
add(file: File): Promise<File>;
|
|
133
134
|
addOrAppend(file: File): Promise<File>;
|
|
134
135
|
setStatus(id: UUID, status: Status): void;
|
|
@@ -210,21 +211,32 @@ declare class PluginManager {
|
|
|
210
211
|
parameters: Parameters<PluginLifecycle[H]>;
|
|
211
212
|
skipped?: ReadonlySet<KubbPlugin> | null;
|
|
212
213
|
}): SafeParseResult<H>;
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
* Parallel, runs all plugins
|
|
217
|
+
*/
|
|
213
218
|
hookParallel<H extends PluginLifecycleHooks, TOuput = void>({ hookName, parameters, }: {
|
|
214
219
|
hookName: H;
|
|
215
220
|
parameters?: Parameters<PluginLifecycle[H]> | undefined;
|
|
216
221
|
}): Promise<Awaited<TOuput>[]>;
|
|
222
|
+
/**
|
|
223
|
+
*
|
|
224
|
+
* Chains, reduces returned value, handling the reduced value as the first hook argument
|
|
225
|
+
*/
|
|
217
226
|
hookReduceArg0<H extends PluginLifecycleHooks>({ hookName, parameters, reduce, }: {
|
|
218
227
|
hookName: H;
|
|
219
228
|
parameters: Parameters<PluginLifecycle[H]>;
|
|
220
229
|
reduce: (reduction: Argument0<H>, result: ReturnType<ParseResult<H>>, plugin: KubbPlugin) => MaybePromise<Argument0<H> | null>;
|
|
221
230
|
}): Promise<Argument0<H>>;
|
|
231
|
+
/**
|
|
232
|
+
* Chains plugins
|
|
233
|
+
*/
|
|
222
234
|
hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: {
|
|
223
235
|
hookName: H;
|
|
224
236
|
parameters?: Parameters<PluginLifecycle[H]>;
|
|
225
237
|
}): Promise<void>;
|
|
226
238
|
private getSortedPlugins;
|
|
227
|
-
|
|
239
|
+
getPlugin(hookName: keyof PluginLifecycle, pluginName: string): KubbPlugin;
|
|
228
240
|
private addExecuter;
|
|
229
241
|
/**
|
|
230
242
|
* Run an async plugin hook and return the result.
|
package/dist/index.js
CHANGED
|
@@ -513,6 +513,13 @@ var FileManager = class {
|
|
|
513
513
|
});
|
|
514
514
|
return files;
|
|
515
515
|
}
|
|
516
|
+
get cachedFiles() {
|
|
517
|
+
const files = [];
|
|
518
|
+
this.cache.forEach((item) => {
|
|
519
|
+
files.push(item);
|
|
520
|
+
});
|
|
521
|
+
return files;
|
|
522
|
+
}
|
|
516
523
|
async add(file) {
|
|
517
524
|
const cacheItem = { id: crypto.randomUUID(), file, status: "new" };
|
|
518
525
|
this.cache.set(cacheItem.id, cacheItem);
|
|
@@ -681,9 +688,9 @@ var PluginManager = class {
|
|
|
681
688
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
682
689
|
if (skipped && skipped.has(plugin))
|
|
683
690
|
continue;
|
|
684
|
-
promise = promise.then(async (
|
|
685
|
-
if (result != null) {
|
|
686
|
-
return
|
|
691
|
+
promise = promise.then(async (parseResult) => {
|
|
692
|
+
if (parseResult?.result != null) {
|
|
693
|
+
return parseResult;
|
|
687
694
|
}
|
|
688
695
|
const value = await this.execute({
|
|
689
696
|
strategy: "hookFirst",
|
|
@@ -708,45 +715,38 @@ var PluginManager = class {
|
|
|
708
715
|
parameters,
|
|
709
716
|
skipped
|
|
710
717
|
}) {
|
|
711
|
-
let
|
|
718
|
+
let parseResult = null;
|
|
712
719
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
713
720
|
if (skipped && skipped.has(plugin))
|
|
714
721
|
continue;
|
|
715
|
-
|
|
722
|
+
parseResult = {
|
|
716
723
|
result: this.executeSync({
|
|
717
724
|
strategy: "hookFirst",
|
|
718
725
|
hookName,
|
|
719
726
|
parameters,
|
|
720
727
|
plugin
|
|
721
|
-
})
|
|
728
|
+
}),
|
|
729
|
+
plugin
|
|
722
730
|
};
|
|
723
|
-
if (result != null) {
|
|
731
|
+
if (parseResult?.result != null) {
|
|
724
732
|
break;
|
|
725
733
|
}
|
|
726
734
|
}
|
|
727
|
-
return
|
|
735
|
+
return parseResult;
|
|
728
736
|
}
|
|
729
|
-
|
|
737
|
+
/**
|
|
738
|
+
*
|
|
739
|
+
* Parallel, runs all plugins
|
|
740
|
+
*/
|
|
730
741
|
async hookParallel({
|
|
731
742
|
hookName,
|
|
732
743
|
parameters
|
|
733
744
|
}) {
|
|
734
745
|
const parallelPromises = [];
|
|
735
746
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
parallelPromises.
|
|
739
|
-
await this.execute({
|
|
740
|
-
strategy: "hookParallel",
|
|
741
|
-
hookName,
|
|
742
|
-
parameters,
|
|
743
|
-
plugin
|
|
744
|
-
});
|
|
745
|
-
} else {
|
|
746
|
-
const promise = this.execute({ strategy: "hookParallel", hookName, parameters, plugin });
|
|
747
|
-
if (promise) {
|
|
748
|
-
parallelPromises.push(promise);
|
|
749
|
-
}
|
|
747
|
+
const promise = this.execute({ strategy: "hookParallel", hookName, parameters, plugin });
|
|
748
|
+
if (promise) {
|
|
749
|
+
parallelPromises.push(promise);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
const results = await Promise.allSettled(parallelPromises);
|
|
@@ -756,7 +756,10 @@ var PluginManager = class {
|
|
|
756
756
|
}
|
|
757
757
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
758
758
|
}
|
|
759
|
-
|
|
759
|
+
/**
|
|
760
|
+
*
|
|
761
|
+
* Chains, reduces returned value, handling the reduced value as the first hook argument
|
|
762
|
+
*/
|
|
760
763
|
hookReduceArg0({
|
|
761
764
|
hookName,
|
|
762
765
|
parameters,
|
|
@@ -765,11 +768,11 @@ var PluginManager = class {
|
|
|
765
768
|
const [argument0, ...rest] = parameters;
|
|
766
769
|
let promise = Promise.resolve(argument0);
|
|
767
770
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
768
|
-
promise = promise.then((
|
|
771
|
+
promise = promise.then((arg0) => {
|
|
769
772
|
const value = this.execute({
|
|
770
773
|
strategy: "hookReduceArg0",
|
|
771
774
|
hookName,
|
|
772
|
-
parameters: [
|
|
775
|
+
parameters: [arg0, ...rest],
|
|
773
776
|
plugin
|
|
774
777
|
});
|
|
775
778
|
return value;
|
|
@@ -777,7 +780,9 @@ var PluginManager = class {
|
|
|
777
780
|
}
|
|
778
781
|
return promise;
|
|
779
782
|
}
|
|
780
|
-
|
|
783
|
+
/**
|
|
784
|
+
* Chains plugins
|
|
785
|
+
*/
|
|
781
786
|
hookSeq({ hookName, parameters }) {
|
|
782
787
|
let promise = Promise.resolve();
|
|
783
788
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
@@ -1057,9 +1062,6 @@ ${source}`;
|
|
|
1057
1062
|
|
|
1058
1063
|
// src/build.ts
|
|
1059
1064
|
async function transformReducer(_previousCode, result, _plugin) {
|
|
1060
|
-
if (result === null) {
|
|
1061
|
-
return null;
|
|
1062
|
-
}
|
|
1063
1065
|
return result;
|
|
1064
1066
|
}
|
|
1065
1067
|
async function build(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Generator core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"change-case": "^4.1.2",
|
|
44
44
|
"directory-tree": "^3.5.1",
|
|
45
45
|
"rimraf": "^5.0.1",
|
|
46
|
-
"@kubb/ts-codegen": "1.1.
|
|
46
|
+
"@kubb/ts-codegen": "1.1.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"tsup": "^6.7.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"registry": "https://registry.npmjs.org/"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
58
|
+
"node": ">=18",
|
|
59
59
|
"pnpm": ">=8"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
package/src/build.ts
CHANGED
|
@@ -12,7 +12,7 @@ export class FileManager {
|
|
|
12
12
|
|
|
13
13
|
private queue?: Queue
|
|
14
14
|
|
|
15
|
-
constructor(options?: { queue: Queue; task
|
|
15
|
+
constructor(options?: { queue: Queue; task?: QueueTask<unknown> }) {
|
|
16
16
|
if (options) {
|
|
17
17
|
this.task = options.task
|
|
18
18
|
this.queue = options.queue
|
|
@@ -43,6 +43,15 @@ export class FileManager {
|
|
|
43
43
|
return files
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
get cachedFiles() {
|
|
47
|
+
const files: CacheStore[] = []
|
|
48
|
+
this.cache.forEach((item) => {
|
|
49
|
+
files.push(item)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return files
|
|
53
|
+
}
|
|
54
|
+
|
|
46
55
|
async add(file: File) {
|
|
47
56
|
const cacheItem = { id: crypto.randomUUID(), file, status: 'new' as Status }
|
|
48
57
|
|
|
@@ -165,9 +165,9 @@ export class PluginManager {
|
|
|
165
165
|
|
|
166
166
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
167
167
|
if (skipped && skipped.has(plugin)) continue
|
|
168
|
-
promise = promise.then(async (
|
|
169
|
-
if (result != null) {
|
|
170
|
-
return
|
|
168
|
+
promise = promise.then(async (parseResult) => {
|
|
169
|
+
if (parseResult?.result != null) {
|
|
170
|
+
return parseResult
|
|
171
171
|
}
|
|
172
172
|
const value = await this.execute<H>({
|
|
173
173
|
strategy: 'hookFirst',
|
|
@@ -179,7 +179,7 @@ export class PluginManager {
|
|
|
179
179
|
return Promise.resolve({
|
|
180
180
|
plugin,
|
|
181
181
|
result: value,
|
|
182
|
-
} as typeof
|
|
182
|
+
} as typeof parseResult)
|
|
183
183
|
})
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -199,28 +199,32 @@ export class PluginManager {
|
|
|
199
199
|
parameters: Parameters<PluginLifecycle[H]>
|
|
200
200
|
skipped?: ReadonlySet<KubbPlugin> | null
|
|
201
201
|
}): SafeParseResult<H> {
|
|
202
|
-
let
|
|
202
|
+
let parseResult: SafeParseResult<H> = null as unknown as SafeParseResult<H>
|
|
203
203
|
|
|
204
204
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
205
205
|
if (skipped && skipped.has(plugin)) continue
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
parseResult = {
|
|
208
208
|
result: this.executeSync<H>({
|
|
209
209
|
strategy: 'hookFirst',
|
|
210
210
|
hookName,
|
|
211
211
|
parameters,
|
|
212
212
|
plugin,
|
|
213
213
|
}),
|
|
214
|
+
plugin,
|
|
214
215
|
} as SafeParseResult<H>
|
|
215
216
|
|
|
216
|
-
if (result != null) {
|
|
217
|
+
if (parseResult?.result != null) {
|
|
217
218
|
break
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
return
|
|
221
|
+
return parseResult as SafeParseResult<H>
|
|
221
222
|
}
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* Parallel, runs all plugins
|
|
227
|
+
*/
|
|
224
228
|
async hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
|
|
225
229
|
hookName,
|
|
226
230
|
parameters,
|
|
@@ -231,21 +235,21 @@ export class PluginManager {
|
|
|
231
235
|
const parallelPromises: Promise<TOuput>[] = []
|
|
232
236
|
|
|
233
237
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
238
|
+
// TODO implement sequential with `buildStart` as an object({ sequential: boolean; handler: PluginContext["buildStart"] })
|
|
239
|
+
// if ((plugin[hookName] as { sequential?: boolean })?.sequential) {
|
|
240
|
+
// await Promise.all(parallelPromises)
|
|
241
|
+
// parallelPromises.length = 0
|
|
242
|
+
// await this.execute({
|
|
243
|
+
// strategy: 'hookParallel',
|
|
244
|
+
// hookName,
|
|
245
|
+
// parameters,
|
|
246
|
+
// plugin,
|
|
247
|
+
// })
|
|
248
|
+
// }
|
|
249
|
+
const promise: Promise<TOuput> | null = this.execute({ strategy: 'hookParallel', hookName, parameters, plugin })
|
|
250
|
+
|
|
251
|
+
if (promise) {
|
|
252
|
+
parallelPromises.push(promise)
|
|
249
253
|
}
|
|
250
254
|
}
|
|
251
255
|
const results = await Promise.allSettled(parallelPromises)
|
|
@@ -258,7 +262,10 @@ export class PluginManager {
|
|
|
258
262
|
return results.filter((result) => result.status === 'fulfilled').map((result) => (result as PromiseFulfilledResult<Awaited<TOuput>>).value)
|
|
259
263
|
}
|
|
260
264
|
|
|
261
|
-
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* Chains, reduces returned value, handling the reduced value as the first hook argument
|
|
268
|
+
*/
|
|
262
269
|
hookReduceArg0<H extends PluginLifecycleHooks>({
|
|
263
270
|
hookName,
|
|
264
271
|
parameters,
|
|
@@ -273,11 +280,11 @@ export class PluginManager {
|
|
|
273
280
|
let promise: Promise<Argument0<H>> = Promise.resolve(argument0)
|
|
274
281
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
275
282
|
promise = promise
|
|
276
|
-
.then((
|
|
283
|
+
.then((arg0) => {
|
|
277
284
|
const value = this.execute({
|
|
278
285
|
strategy: 'hookReduceArg0',
|
|
279
286
|
hookName,
|
|
280
|
-
parameters: [
|
|
287
|
+
parameters: [arg0, ...rest] as Parameters<PluginLifecycle[H]>,
|
|
281
288
|
plugin,
|
|
282
289
|
})
|
|
283
290
|
return value
|
|
@@ -287,8 +294,9 @@ export class PluginManager {
|
|
|
287
294
|
return promise
|
|
288
295
|
}
|
|
289
296
|
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Chains plugins
|
|
299
|
+
*/
|
|
292
300
|
hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: { hookName: H; parameters?: Parameters<PluginLifecycle[H]> }) {
|
|
293
301
|
let promise: Promise<void | null> = Promise.resolve()
|
|
294
302
|
for (const plugin of this.getSortedPlugins(hookName)) {
|
|
@@ -310,7 +318,7 @@ export class PluginManager {
|
|
|
310
318
|
return plugins
|
|
311
319
|
}
|
|
312
320
|
|
|
313
|
-
|
|
321
|
+
public getPlugin(hookName: keyof PluginLifecycle, pluginName: string): KubbPlugin {
|
|
314
322
|
const plugins = [...this.plugins]
|
|
315
323
|
|
|
316
324
|
const pluginByPluginName = plugins.find((item) => item.name === pluginName && item[hookName])
|