node-pluginsmanager 3.1.0 → 3.3.0
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/lib/cjs/PluginsManager.js +11 -5
- package/package.json +14 -20
|
@@ -11,6 +11,7 @@ const node_os_1 = require("node:os");
|
|
|
11
11
|
const promises_1 = require("node:fs/promises");
|
|
12
12
|
// externals
|
|
13
13
|
const check_version_modules_1 = __importDefault(require("check-version-modules"));
|
|
14
|
+
const check_node_engine_1 = __importDefault(require("check-node-engine"));
|
|
14
15
|
// locals
|
|
15
16
|
const rmdirp_1 = __importDefault(require("./utils/rmdirp"));
|
|
16
17
|
const checkAbsoluteDirectory_1 = __importDefault(require("./checkers/checkAbsoluteDirectory"));
|
|
@@ -102,11 +103,16 @@ class PluginsManager extends node_events_1.default {
|
|
|
102
103
|
return (0, checkAbsoluteDirectory_1.default)("checkModules/directory", this.directory).then(() => {
|
|
103
104
|
return (0, checkOrchestrator_1.default)("checkModules/plugin", plugin);
|
|
104
105
|
}).then(() => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
const packageFile = (0, node_path_1.join)(this.directory, plugin.name, "package.json");
|
|
107
|
+
// start with node engine checker to compare minimal node version used
|
|
108
|
+
return (0, check_node_engine_1.default)(packageFile).then(() => {
|
|
109
|
+
// then check used packages versions
|
|
110
|
+
return (0, check_version_modules_1.default)(packageFile, {
|
|
111
|
+
"failAtMajor": false, // can break and be a huge source of dev
|
|
112
|
+
"failAtMinor": true, // mandatory, most important updates
|
|
113
|
+
"failAtPatch": false, // not critical
|
|
114
|
+
"dev": false
|
|
115
|
+
});
|
|
110
116
|
}).then((analyze) => {
|
|
111
117
|
return analyze.result ? Promise.resolve() : Promise.reject(new Error("\"" + plugin.name + "\" plugin has obsoletes modules"));
|
|
112
118
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "node-pluginsmanager",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"description": "A plugins manager.",
|
|
6
6
|
|
|
7
7
|
"type": "commonjs",
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
|
|
22
|
-
"prepare": "npx husky || true",
|
|
23
|
-
|
|
24
22
|
"lint-back": "npx eslint --config .eslintrc-back.js --ext .ts,.cts,.mts ./lib/src/**/*",
|
|
25
23
|
"lint-tests": "npx eslint --config .eslintrc-tests.js --ext .js,.cjs,.mjs ./test/**/*.js",
|
|
26
24
|
"lint": "npm run lint-back && npm run lint-tests",
|
|
@@ -31,11 +29,13 @@
|
|
|
31
29
|
"build-back": "npm run clean-back && npx tsc --project ./tsconfig.json",
|
|
32
30
|
"build": "npm run build-back",
|
|
33
31
|
|
|
32
|
+
"check-node-engine": "npx check-node-engine",
|
|
34
33
|
"check-requires": "npx used-deps-analyzer ./package.json ./lib/src --no-dev",
|
|
35
|
-
"check-updates": "npx check-version-modules",
|
|
36
|
-
"unit-tests": "
|
|
34
|
+
"check-updates": "npx check-version-modules --no-fail-at-major --fail-at-minor --fail-at-patch",
|
|
35
|
+
"unit-tests": "npx mocha",
|
|
36
|
+
"unit-tests-local": "npx nyc --reporter=html --reporter=text mocha",
|
|
37
37
|
|
|
38
|
-
"tests": "npm run lint && npm run check-requires && npm run check-updates && npm run unit-tests"
|
|
38
|
+
"tests": "npm run lint && npm run check-node-engine && npm run check-requires && npm run check-updates && npm run build && npm run unit-tests-local"
|
|
39
39
|
|
|
40
40
|
},
|
|
41
41
|
|
|
@@ -43,36 +43,30 @@
|
|
|
43
43
|
"/lib/cjs"
|
|
44
44
|
],
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": ">=22.22.
|
|
46
|
+
"node": ">=22.22.3"
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"check-
|
|
50
|
+
"check-node-engine": "1.0.0",
|
|
51
|
+
"check-version-modules": "2.5.0"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@types/express": "5.0.6",
|
|
54
|
-
"@types/node": "25.
|
|
55
|
+
"@types/node": "25.9.1",
|
|
55
56
|
"@types/socket.io": "3.0.2",
|
|
56
57
|
"@types/ws": "8.18.1",
|
|
57
58
|
"eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
|
|
58
59
|
"express": "5.2.1",
|
|
59
60
|
"husky": "9.1.7",
|
|
60
|
-
"mocha": "11.7.
|
|
61
|
-
"node-pluginsmanager-plugin": "7.0
|
|
61
|
+
"mocha": "11.7.6",
|
|
62
|
+
"node-pluginsmanager-plugin": "7.2.0",
|
|
62
63
|
"nyc": "18.0.0",
|
|
63
64
|
"proxyquire": "2.1.3",
|
|
64
65
|
"rimraf": "6.1.3",
|
|
65
66
|
"socket.io": "4.8.3",
|
|
66
67
|
"typescript": "5.9.3",
|
|
67
|
-
"used-deps-analyzer": "0.
|
|
68
|
-
"ws": "8.
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
"husky": {
|
|
72
|
-
"hooks": {
|
|
73
|
-
"pre-commit": "npm run lint",
|
|
74
|
-
"pre-push": "npm run unit-tests"
|
|
75
|
-
}
|
|
68
|
+
"used-deps-analyzer": "0.3.0",
|
|
69
|
+
"ws": "8.21.0"
|
|
76
70
|
},
|
|
77
71
|
|
|
78
72
|
"keywords": [
|