mm_machine 2.7.5 → 2.7.7
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/index.js +7 -7
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -432,12 +432,12 @@ Manager.prototype.getDirName = function () {
|
|
|
432
432
|
* @param {string} dir 目录路径
|
|
433
433
|
* @returns {Array} 文件路径数组
|
|
434
434
|
*/
|
|
435
|
-
Manager.prototype._getAllDirFiles = function (dir) {
|
|
435
|
+
Manager.prototype._getAllDirFiles = async function (dir) {
|
|
436
436
|
let files = [];
|
|
437
|
-
let dirs = $.dir.
|
|
437
|
+
let dirs = await $.dir.getAllAsync(dir, this.getDirName());
|
|
438
438
|
for (let i = 0; i < dirs.length; i++) {
|
|
439
439
|
let d = dirs[i];
|
|
440
|
-
let lt = $.file.
|
|
440
|
+
let lt = await $.file.getAllAsync(d, this.config.filename);
|
|
441
441
|
if (lt.length > 0) {
|
|
442
442
|
files.push(...lt);
|
|
443
443
|
}
|
|
@@ -451,7 +451,7 @@ Manager.prototype._getAllDirFiles = function (dir) {
|
|
|
451
451
|
* @param {string} dir 目录路径
|
|
452
452
|
* @returns {Array} 文件路径数组
|
|
453
453
|
*/
|
|
454
|
-
Manager.prototype._findFiles = function (dir) {
|
|
454
|
+
Manager.prototype._findFiles = async function (dir) {
|
|
455
455
|
// 检查目录是否存在
|
|
456
456
|
if (!dir) {
|
|
457
457
|
this.log('error', '目录不能为空');
|
|
@@ -462,10 +462,10 @@ Manager.prototype._findFiles = function (dir) {
|
|
|
462
462
|
return [];
|
|
463
463
|
}
|
|
464
464
|
if (this.config.search_way === 'dir') {
|
|
465
|
-
return this._getAllDirFiles(dir);
|
|
465
|
+
return await this._getAllDirFiles(dir);
|
|
466
466
|
}
|
|
467
467
|
// 检索目录下所有文件
|
|
468
|
-
return $.file.
|
|
468
|
+
return await $.file.getAllAsync(dir, this.config.filename);
|
|
469
469
|
};
|
|
470
470
|
|
|
471
471
|
/**
|
|
@@ -506,7 +506,7 @@ Manager.prototype.update = async function (dir, clear = true) {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
// 查找所有json文件
|
|
509
|
-
let files = this._findFiles(dir || this.config.dir);
|
|
509
|
+
let files = await this._findFiles(dir || this.config.dir);
|
|
510
510
|
// 批量注册模块
|
|
511
511
|
this.registerMods(files);
|
|
512
512
|
// 更新配置信息
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_machine",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.7",
|
|
4
4
|
"description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@prettier/sync": "^0.6.1",
|
|
37
|
-
"mm_config": "^2.
|
|
38
|
-
"mm_hot_reload": "^1.3.
|
|
39
|
-
"mm_tpl": "^2.5.
|
|
37
|
+
"mm_config": "^2.4.1",
|
|
38
|
+
"mm_hot_reload": "^1.3.8",
|
|
39
|
+
"mm_tpl": "^2.5.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"eslint": "^10.
|
|
43
|
-
"eslint-plugin-jsdoc": "^
|
|
44
|
-
"mm_eslint": "^1.7.
|
|
42
|
+
"eslint": "^10.6.0",
|
|
43
|
+
"eslint-plugin-jsdoc": "^63.0.10",
|
|
44
|
+
"mm_eslint": "^1.7.5"
|
|
45
45
|
}
|
|
46
46
|
}
|