perf: [comm] 支持插件管理

This commit is contained in:
xiaojunnuo
2024-10-14 00:19:55 +08:00
parent 417971d15d
commit e8b617b80c
24 changed files with 270 additions and 179 deletions
@@ -0,0 +1,23 @@
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { pluginGroups, pluginRegistry } from '@certd/pipeline';
@Provide()
@Scope(ScopeEnum.Singleton)
export class BuiltInPluginService {
getList() {
const collection = pluginRegistry.storage;
const list = [];
for (const key in collection) {
const Plugin = collection[key];
if (Plugin?.define?.deprecated) {
continue;
}
list.push({ ...Plugin.define, key });
}
return list;
}
getGroups() {
return pluginGroups;
}
}