node-pluginsmanager 2.4.1 → 2.4.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.
|
@@ -296,7 +296,7 @@ class PluginsManager extends events_1.default {
|
|
|
296
296
|
return (0, gitInstall_1.default)(directory, user, repo);
|
|
297
297
|
}).then(() => {
|
|
298
298
|
// install dependencies & execute install script
|
|
299
|
-
return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger);
|
|
299
|
+
return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger, ...data);
|
|
300
300
|
// check plugin modules versions
|
|
301
301
|
}).then((plugin) => {
|
|
302
302
|
return this.checkModules(plugin).then(() => {
|
|
@@ -358,7 +358,7 @@ class PluginsManager extends events_1.default {
|
|
|
358
358
|
// release plugin
|
|
359
359
|
}).then(() => {
|
|
360
360
|
const pluginName = plugin.name;
|
|
361
|
-
return plugin.release(data).then(() => {
|
|
361
|
+
return plugin.release(...data).then(() => {
|
|
362
362
|
this.emit("released", plugin, ...data);
|
|
363
363
|
return plugin.destroy();
|
|
364
364
|
}).then(() => {
|
|
@@ -369,7 +369,7 @@ class PluginsManager extends events_1.default {
|
|
|
369
369
|
// download plugin
|
|
370
370
|
}).then(() => {
|
|
371
371
|
return (0, gitUpdate_1.default)(directory).then(() => {
|
|
372
|
-
return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger);
|
|
372
|
+
return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger, ...data);
|
|
373
373
|
});
|
|
374
374
|
// check plugin modules versions
|
|
375
375
|
}).then((_plugin) => {
|
|
@@ -384,7 +384,7 @@ class PluginsManager extends events_1.default {
|
|
|
384
384
|
return _plugin.update(...data);
|
|
385
385
|
}).then(() => {
|
|
386
386
|
this.emit("updated", _plugin, ...data);
|
|
387
|
-
return _plugin.init(data);
|
|
387
|
+
return _plugin.init(...data);
|
|
388
388
|
// execute init script
|
|
389
389
|
}).then(() => {
|
|
390
390
|
this.emit("initialized", _plugin, ...data);
|
|
@@ -415,11 +415,11 @@ class PluginsManager extends events_1.default {
|
|
|
415
415
|
});
|
|
416
416
|
// release plugin
|
|
417
417
|
}).then(() => {
|
|
418
|
-
return plugin.release(data).then(() => {
|
|
418
|
+
return plugin.release(...data).then(() => {
|
|
419
419
|
return (0, fs_extra_1.remove)((0, path_1.join)(this.externalRessourcesDirectory, pluginName));
|
|
420
420
|
}).then(() => {
|
|
421
421
|
this.emit("released", plugin, ...data);
|
|
422
|
-
return plugin.destroy();
|
|
422
|
+
return plugin.destroy(...data);
|
|
423
423
|
}).then(() => {
|
|
424
424
|
this.emit("destroyed", pluginName, ...data);
|
|
425
425
|
this.plugins.splice(key, 1);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
|
|
2
|
-
export default function createPluginByDirectory(directory: string, externalRessourcesDirectory: string, logger: tLogger | null): Promise<Orchestrator>;
|
|
2
|
+
export default function createPluginByDirectory(directory: string, externalRessourcesDirectory: string, logger: tLogger | null, ...data: any): Promise<Orchestrator>;
|
|
@@ -11,7 +11,7 @@ const checkAbsoluteDirectory_1 = __importDefault(require("./checkers/checkAbsolu
|
|
|
11
11
|
const checkOrchestrator_1 = __importDefault(require("./checkers/checkOrchestrator"));
|
|
12
12
|
const checkFunction_1 = __importDefault(require("./checkers/checkFunction"));
|
|
13
13
|
// module
|
|
14
|
-
function createPluginByDirectory(directory, externalRessourcesDirectory, logger) {
|
|
14
|
+
function createPluginByDirectory(directory, externalRessourcesDirectory, logger, ...data) {
|
|
15
15
|
return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/directory", directory).then(() => {
|
|
16
16
|
return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/externalRessourcesDirectory", externalRessourcesDirectory);
|
|
17
17
|
}).then(() => {
|
|
@@ -47,7 +47,7 @@ function createPluginByDirectory(directory, externalRessourcesDirectory, logger)
|
|
|
47
47
|
});
|
|
48
48
|
return (0, checkOrchestrator_1.default)("createPluginByDirectory/orchestrator", plugin).then(() => {
|
|
49
49
|
plugin.name = pluginBaseNameDirectory;
|
|
50
|
-
return plugin.load().then(() => {
|
|
50
|
+
return plugin.load(...data).then(() => {
|
|
51
51
|
return plugin.name === pluginBaseNameDirectory ? Promise.resolve() : Promise.reject(new Error("Plugin's name (\"" + plugin.name + "\") does not fit with plugin's directory basename (\"" + pluginBaseNameDirectory + "\")"));
|
|
52
52
|
});
|
|
53
53
|
}).then(() => {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
// methods
|
|
5
5
|
function _initPlugin(plugin, emit, ...data) {
|
|
6
6
|
emit("initializing", plugin, ...data);
|
|
7
|
-
return plugin.init(data).then(() => {
|
|
7
|
+
return plugin.init(...data).then(() => {
|
|
8
8
|
emit("initialized", plugin, ...data);
|
|
9
9
|
return Promise.resolve();
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-pluginsmanager",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "A plugins manager",
|
|
5
5
|
|
|
6
6
|
"type": "commonjs",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/express": "4.17.13",
|
|
60
60
|
"@types/fs-extra": "9.0.13",
|
|
61
|
-
"@types/node": "18.0.
|
|
61
|
+
"@types/node": "18.0.1",
|
|
62
62
|
"@types/socket.io": "3.0.2",
|
|
63
63
|
"@types/ws": "8.5.3",
|
|
64
64
|
"coveralls": "3.1.1",
|
|
65
65
|
"express": "4.18.1",
|
|
66
66
|
"husky": "8.0.1",
|
|
67
67
|
"mocha": "10.0.0",
|
|
68
|
-
"node-pluginsmanager-plugin": "5.0.
|
|
68
|
+
"node-pluginsmanager-plugin": "5.0.5",
|
|
69
69
|
"nyc": "15.1.0",
|
|
70
70
|
"typescript": "4.7.4",
|
|
71
71
|
"ws": "8.8.0"
|