node-pluginsmanager 2.4.4 → 2.5.1
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/LICENSE +1 -1
- package/lib/cjs/PluginsManager.d.ts +38 -38
- package/lib/cjs/PluginsManager.js +451 -442
- package/lib/cjs/checkers/checkAbsoluteDirectory.d.ts +1 -1
- package/lib/cjs/checkers/checkAbsoluteDirectory.js +19 -20
- package/lib/cjs/checkers/checkDirectory.d.ts +1 -1
- package/lib/cjs/checkers/checkDirectory.js +23 -24
- package/lib/cjs/checkers/checkFunction.d.ts +1 -1
- package/lib/cjs/checkers/checkFunction.js +15 -16
- package/lib/cjs/checkers/checkNonEmptyArray.d.ts +1 -1
- package/lib/cjs/checkers/checkNonEmptyArray.js +18 -19
- package/lib/cjs/checkers/checkNonEmptyString.d.ts +1 -1
- package/lib/cjs/checkers/checkNonEmptyString.js +18 -19
- package/lib/cjs/checkers/checkOrchestrator.d.ts +2 -1
- package/lib/cjs/checkers/checkOrchestrator.js +35 -36
- package/lib/cjs/cmd/cmd.d.ts +1 -1
- package/lib/cjs/cmd/cmd.js +38 -37
- package/lib/cjs/cmd/git/gitInstall.d.ts +1 -1
- package/lib/cjs/cmd/git/gitInstall.js +41 -42
- package/lib/cjs/cmd/git/gitUpdate.d.ts +1 -1
- package/lib/cjs/cmd/git/gitUpdate.js +17 -18
- package/lib/cjs/cmd/npm/npmInstall.d.ts +1 -1
- package/lib/cjs/cmd/npm/npmInstall.js +17 -14
- package/lib/cjs/cmd/npm/npmUpdate.d.ts +1 -1
- package/lib/cjs/cmd/npm/npmUpdate.js +17 -14
- package/lib/cjs/cmd/stdToString.d.ts +1 -1
- package/lib/cjs/cmd/stdToString.js +15 -16
- package/lib/cjs/createPluginByDirectory.d.ts +2 -2
- package/lib/cjs/createPluginByDirectory.js +60 -61
- package/lib/cjs/extractGithub.d.ts +7 -1
- package/lib/cjs/extractGithub.js +20 -20
- package/lib/cjs/initSortedPlugins.d.ts +2 -2
- package/lib/cjs/initSortedPlugins.js +60 -60
- package/lib/cjs/loadSortedPlugins.d.ts +2 -2
- package/lib/cjs/loadSortedPlugins.js +77 -78
- package/lib/cjs/main.cjs +8 -8
- package/lib/cjs/main.d.cts +2 -2
- package/lib/cjs/utils/isDirectory.d.ts +1 -0
- package/lib/cjs/utils/isDirectory.js +25 -0
- package/lib/cjs/utils/rmdirp.d.ts +1 -0
- package/lib/cjs/utils/rmdirp.js +19 -0
- package/package.json +46 -34
- package/lib/cjs/cmd/npm/npmCmd.d.ts +0 -1
- package/lib/cjs/cmd/npm/npmCmd.js +0 -18
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
// module
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = stdToString;
|
|
5
|
+
function stdToString(msg) {
|
|
6
|
+
if ("object" !== typeof msg) {
|
|
7
|
+
return String(msg);
|
|
8
|
+
}
|
|
9
|
+
else if (msg instanceof Buffer) {
|
|
10
|
+
return msg.toString("utf8");
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return msg.message ? msg.message : String(msg);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
|
|
2
|
-
export default function createPluginByDirectory(directory: string, externalRessourcesDirectory: string, logger: tLogger | null, ...data: any): Promise<Orchestrator>;
|
|
1
|
+
import type { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
|
|
2
|
+
export default function createPluginByDirectory(directory: string, externalRessourcesDirectory: string, logger: tLogger | null, ...data: any): Promise<Orchestrator>;
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.default = createPluginByDirectory;
|
|
8
|
+
// natives
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
// locals
|
|
11
|
+
const checkAbsoluteDirectory_1 = __importDefault(require("./checkers/checkAbsoluteDirectory"));
|
|
12
|
+
const checkOrchestrator_1 = __importDefault(require("./checkers/checkOrchestrator"));
|
|
13
|
+
const checkFunction_1 = __importDefault(require("./checkers/checkFunction"));
|
|
14
|
+
// module
|
|
15
|
+
function createPluginByDirectory(directory, externalRessourcesDirectory, logger, ...data) {
|
|
16
|
+
return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/directory", directory).then(() => {
|
|
17
|
+
return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/externalRessourcesDirectory", externalRessourcesDirectory);
|
|
18
|
+
}).then(() => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
try {
|
|
21
|
+
resolve(require(directory));
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}).then((Plugin) => {
|
|
27
|
+
if (Plugin.Orchestrator) {
|
|
28
|
+
return Promise.resolve(Plugin.Orchestrator);
|
|
29
|
+
}
|
|
30
|
+
else if (Plugin.default) {
|
|
31
|
+
return Promise.resolve(Plugin.default);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return Promise.resolve(Plugin);
|
|
35
|
+
}
|
|
36
|
+
}).then((Plugin) => {
|
|
37
|
+
return (0, checkFunction_1.default)("createPluginByDirectory/function", Plugin).then(() => {
|
|
38
|
+
const pluginBaseNameDirectory = (0, node_path_1.basename)(directory);
|
|
39
|
+
const plugin = new Plugin({
|
|
40
|
+
// usefull for inherited Orchestrators
|
|
41
|
+
"externalRessourcesDirectory": (0, node_path_1.join)(externalRessourcesDirectory, pluginBaseNameDirectory),
|
|
42
|
+
"logger": logger,
|
|
43
|
+
// useless, setted in inherited Orchestrators
|
|
44
|
+
"packageFile": "",
|
|
45
|
+
"descriptorFile": "",
|
|
46
|
+
"mediatorFile": "",
|
|
47
|
+
"serverFile": ""
|
|
48
|
+
});
|
|
49
|
+
return (0, checkOrchestrator_1.default)("createPluginByDirectory/orchestrator", plugin).then(() => {
|
|
50
|
+
plugin.name = pluginBaseNameDirectory;
|
|
51
|
+
return plugin.load(...data).then(() => {
|
|
52
|
+
return plugin.name === pluginBaseNameDirectory ? Promise.resolve() : Promise.reject(new Error("Plugin's name (\"" + plugin.name + "\") does not fit with plugin's directory basename (\"" + pluginBaseNameDirectory + "\")"));
|
|
53
|
+
});
|
|
54
|
+
}).then(() => {
|
|
55
|
+
return Promise.resolve(plugin);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Orchestrator } from "node-pluginsmanager-plugin";
|
|
2
|
+
interface OrchestratorExtended extends Orchestrator {
|
|
3
|
+
"github"?: string;
|
|
4
|
+
"repository"?: string | Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
export default function extractGithub(plugin: OrchestratorExtended): string;
|
|
7
|
+
export {};
|
package/lib/cjs/extractGithub.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// types & interfaces
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = extractGithub;
|
|
5
|
+
// module
|
|
6
|
+
function extractGithub(plugin) {
|
|
7
|
+
let github = "";
|
|
8
|
+
if ("object" === typeof plugin) {
|
|
9
|
+
if ("string" === typeof plugin.github) {
|
|
10
|
+
github = plugin.github;
|
|
11
|
+
}
|
|
12
|
+
else if ("string" === typeof plugin.repository) {
|
|
13
|
+
github = plugin.repository;
|
|
14
|
+
}
|
|
15
|
+
else if ("object" === typeof plugin.repository && "string" === typeof plugin.repository.url) {
|
|
16
|
+
github = plugin.repository.url;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return github;
|
|
20
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Orchestrator } from "node-pluginsmanager-plugin";
|
|
2
|
-
export default function initSortedPlugins(plugins:
|
|
1
|
+
import type { Orchestrator } from "node-pluginsmanager-plugin";
|
|
2
|
+
export default function initSortedPlugins(plugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: any) => void, ...data: any): Promise<void>;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// types & interfaces
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = initSortedPlugins;
|
|
5
|
+
// private
|
|
6
|
+
// methods
|
|
7
|
+
function _initPlugin(plugin, emit, ...data) {
|
|
8
|
+
emit("initializing", plugin, ...data);
|
|
9
|
+
return plugin.init(...data).then(() => {
|
|
10
|
+
emit("initialized", plugin, ...data);
|
|
11
|
+
return Promise.resolve();
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function _initPlugins(pluginsToInit, emit, data, i = 0) {
|
|
15
|
+
return i < pluginsToInit.length ? Promise.resolve().then(() => {
|
|
16
|
+
return _initPlugin(pluginsToInit[i], emit, ...data);
|
|
17
|
+
// loop
|
|
18
|
+
}).then(() => {
|
|
19
|
+
return _initPlugins(pluginsToInit, emit, data, i + 1);
|
|
20
|
+
}) : Promise.resolve();
|
|
21
|
+
}
|
|
22
|
+
// module
|
|
23
|
+
function initSortedPlugins(plugins, orderedPluginsNames, emit, ...data) {
|
|
24
|
+
// if no plugins, does not run
|
|
25
|
+
return !plugins.length ? Promise.resolve() : Promise.resolve().then(() => {
|
|
26
|
+
const sortedPlugins = [];
|
|
27
|
+
orderedPluginsNames.forEach((pluginName) => {
|
|
28
|
+
const plugin = plugins.find((p) => {
|
|
29
|
+
return p.name === pluginName;
|
|
30
|
+
});
|
|
31
|
+
if (plugin) {
|
|
32
|
+
sortedPlugins.push(plugin);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
// first, sorted plugins
|
|
36
|
+
return sortedPlugins.length
|
|
37
|
+
? _initPlugins(sortedPlugins, emit, data)
|
|
38
|
+
: Promise.resolve();
|
|
39
|
+
}).then(() => {
|
|
40
|
+
const unsortedPlugin = [
|
|
41
|
+
...plugins.filter((plugin) => {
|
|
42
|
+
return !orderedPluginsNames.includes(plugin.name);
|
|
43
|
+
}).sort((a, b) => {
|
|
44
|
+
if (a.name < b.name) {
|
|
45
|
+
return -1;
|
|
46
|
+
}
|
|
47
|
+
else if (a.name > b.name) {
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
];
|
|
55
|
+
// then, all other plugins, asynchronously
|
|
56
|
+
return unsortedPlugin.length
|
|
57
|
+
? _initPlugins(unsortedPlugin, emit, data)
|
|
58
|
+
: Promise.resolve();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
|
|
2
|
-
export default function loadSortedPlugins(globalDirectory: string, externalRessourcesDirectory: string, files:
|
|
1
|
+
import type { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
|
|
2
|
+
export default function loadSortedPlugins(globalDirectory: string, externalRessourcesDirectory: string, files: string[], loadedPlugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: any) => void, logger: tLogger | null, ...data: any): Promise<void>;
|
|
@@ -1,78 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.default = loadSortedPlugins;
|
|
8
|
+
// natives
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
// locals
|
|
11
|
+
const createPluginByDirectory_1 = __importDefault(require("./createPluginByDirectory"));
|
|
12
|
+
// private
|
|
13
|
+
// methods
|
|
14
|
+
function _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginFileName, loadedPlugins, emit, logger, ...data) {
|
|
15
|
+
// is already loaded ?
|
|
16
|
+
const plugin = loadedPlugins.find((p) => {
|
|
17
|
+
return pluginFileName === p.name;
|
|
18
|
+
});
|
|
19
|
+
// is already exists ?
|
|
20
|
+
return plugin ? Promise.resolve() : Promise.resolve().then(() => {
|
|
21
|
+
emit("loading", pluginFileName, ...data);
|
|
22
|
+
const directory = (0, node_path_1.join)(globalDirectory, pluginFileName);
|
|
23
|
+
return (0, createPluginByDirectory_1.default)(directory, externalRessourcesDirectory, logger, ...data);
|
|
24
|
+
// emit event
|
|
25
|
+
}).then((createdPlugin) => {
|
|
26
|
+
emit("loaded", createdPlugin, ...data);
|
|
27
|
+
loadedPlugins.push(createdPlugin);
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function _loadPlugins(globalDirectory, externalRessourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, data, i = 0) {
|
|
32
|
+
return i < pluginsToLoad.length ? Promise.resolve().then(() => {
|
|
33
|
+
return _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginsToLoad[i], loadedPlugins, emit, logger, ...data);
|
|
34
|
+
// loop
|
|
35
|
+
}).then(() => {
|
|
36
|
+
return _loadPlugins(globalDirectory, externalRessourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, data, i + 1);
|
|
37
|
+
}) : Promise.resolve();
|
|
38
|
+
}
|
|
39
|
+
// module
|
|
40
|
+
function loadSortedPlugins(globalDirectory, externalRessourcesDirectory, files, loadedPlugins, orderedPluginsNames, emit, logger, ...data) {
|
|
41
|
+
// if no files, does not run
|
|
42
|
+
return !files.length ? Promise.resolve() : Promise.resolve().then(() => {
|
|
43
|
+
const sortedPluginsNames = [];
|
|
44
|
+
orderedPluginsNames.forEach((pluginName) => {
|
|
45
|
+
const plugin = files.find((p) => {
|
|
46
|
+
return p === pluginName;
|
|
47
|
+
});
|
|
48
|
+
if (plugin) {
|
|
49
|
+
sortedPluginsNames.push(pluginName);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
// first, sorted plugins
|
|
53
|
+
return sortedPluginsNames.length
|
|
54
|
+
? _loadPlugins(globalDirectory, externalRessourcesDirectory, sortedPluginsNames, loadedPlugins, emit, logger, data)
|
|
55
|
+
: Promise.resolve();
|
|
56
|
+
}).then(() => {
|
|
57
|
+
const unsortedPluginsNames = [
|
|
58
|
+
...files.filter((pluginName) => {
|
|
59
|
+
return !orderedPluginsNames.includes(pluginName);
|
|
60
|
+
}).sort((a, b) => {
|
|
61
|
+
if (a < b) {
|
|
62
|
+
return -1;
|
|
63
|
+
}
|
|
64
|
+
else if (a > b) {
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
];
|
|
72
|
+
// then, all other plugins, asynchronously
|
|
73
|
+
return unsortedPluginsNames.length
|
|
74
|
+
? _loadPlugins(globalDirectory, externalRessourcesDirectory, unsortedPluginsNames, loadedPlugins, emit, logger, data)
|
|
75
|
+
: Promise.resolve();
|
|
76
|
+
});
|
|
77
|
+
}
|
package/lib/cjs/main.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
// locals
|
|
7
|
-
const PluginsManager_1 = __importDefault(require("./PluginsManager"));
|
|
8
|
-
module.exports = PluginsManager_1.default;
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
// locals
|
|
7
|
+
const PluginsManager_1 = __importDefault(require("./PluginsManager"));
|
|
8
|
+
module.exports = PluginsManager_1.default;
|
package/lib/cjs/main.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginsManager from "./PluginsManager";
|
|
2
|
-
export = PluginsManager;
|
|
1
|
+
import PluginsManager from "./PluginsManager";
|
|
2
|
+
export = PluginsManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isDirectory(directory: string): Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = isDirectory;
|
|
5
|
+
// natives
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
// module
|
|
8
|
+
function isDirectory(directory) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
if ("undefined" === typeof directory) {
|
|
11
|
+
reject(new ReferenceError("missing \"directory\" argument"));
|
|
12
|
+
}
|
|
13
|
+
else if ("string" !== typeof directory) {
|
|
14
|
+
reject(new TypeError("\"directory\" argument is not a string"));
|
|
15
|
+
}
|
|
16
|
+
else if ("" === directory.trim()) {
|
|
17
|
+
reject(new Error("\"directory\" argument is empty"));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
(0, node_fs_1.lstat)(directory, (err, stats) => {
|
|
21
|
+
return resolve(Boolean(!err && stats.isDirectory()));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function rmdirp(directory: string): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.default = rmdirp;
|
|
8
|
+
// natives
|
|
9
|
+
const promises_1 = require("node:fs/promises");
|
|
10
|
+
// locals
|
|
11
|
+
const isDirectory_1 = __importDefault(require("./isDirectory"));
|
|
12
|
+
// module
|
|
13
|
+
function rmdirp(directory) {
|
|
14
|
+
return (0, isDirectory_1.default)(directory).then((exists) => {
|
|
15
|
+
return exists ? (0, promises_1.rm)(directory, {
|
|
16
|
+
"recursive": true
|
|
17
|
+
}) : Promise.resolve();
|
|
18
|
+
});
|
|
19
|
+
}
|