mm_machine 3.2.9 → 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.
Files changed (2) hide show
  1. package/lib/manager.js +18 -1
  2. package/package.json +2 -2
package/lib/manager.js CHANGED
@@ -437,7 +437,24 @@ Manager.prototype.updateBefore = function () { };
437
437
  /**
438
438
  * 更新配置前的钩子函数
439
439
  */
440
- Manager.prototype.updateAfter = function () { };
440
+ Manager.prototype.updateAfter = function () {
441
+ this.sort();
442
+ };
443
+
444
+ /**
445
+ * 排序模块信息
446
+ */
447
+ Manager.prototype.sort = function () {
448
+ this.infos.sort((a, b) => {
449
+ // 先按 sort 排序
450
+ let cha = a.sort - b.sort;
451
+ if (cha !== 0) {
452
+ return cha;
453
+ }
454
+ // 再按 name 排序
455
+ return a.name.localeCompare(b.name);
456
+ });
457
+ };
441
458
 
442
459
  /**
443
460
  * 更新配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "3.2.9",
3
+ "version": "3.3.0",
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": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "eslint": "^10.7.0",
42
- "eslint-plugin-jsdoc": "^63.0.14",
42
+ "eslint-plugin-jsdoc": "^63.1.0",
43
43
  "mm_eslint": "^1.7.5"
44
44
  }
45
45
  }