Port global_chat plugin to typescript (#497)

* .js to .ts

* translate

* update paths to dist/plugin

* add "tsc --build" to prepare

* use field main in package.json de find info

* tsc --build need to append before webpack

* update test and use for plugins package.main
This commit is contained in:
Luciole authored and GitHub committed 2023-08-18 00:06:49 +02:00
1 parent 477b600b1b
commit 50f12c719b
26 files changed
+104 -102

No files matched your search

+2 -3
View File
@@ -24,12 +24,11 @@ export async function loadPluginInfos(pluginList: Map<string, string>) {
let plugins: libPlugin.PluginInfo[] = [];
for (let [pluginName, pluginPath] of pluginList) {
let pluginInfo: libPlugin.PluginInfo;
let pluginPackage: { version: string };
let pluginPackage: { version: string, main?: string };
try {
pluginInfo = require(path.posix.join(pluginPath, "info"));
pluginInfo = require(pluginPath).default;
pluginPackage = require(path.posix.join(pluginPath, "package.json"));
} catch (err: any) {
throw new libErrors.PluginError(pluginName, err);
}