mm_machine 2.3.9 → 2.4.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.
Files changed (2) hide show
  1. package/index.js +9 -14
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -196,25 +196,13 @@ Manager.prototype.updateInfo = function () {
196
196
  let info = this.newInfo(name, o.config.sort, o.config.state, o.config_file);
197
197
  this.infos.push(info);
198
198
  }
199
- this.exec('sort');
200
- };
201
-
202
- /**
203
- * 排序前钩子函数
204
- */
205
- Manager.prototype.sortBefore = function () {
206
- };
207
-
208
- /**
209
- * 排序后钩子函数
210
- */
211
- Manager.prototype.sortAfter = function () {
199
+ this.sort();
212
200
  };
213
201
 
214
202
  /**
215
203
  * 排序
216
204
  */
217
- Manager.prototype.sort = function () {
205
+ Manager.prototype._sort = function () {
218
206
  var sort_key = this.config.sort_key || 'sort';
219
207
  this.infos.sort((o1, o2) => {
220
208
  let p1 = o1[sort_key] || 100;
@@ -223,6 +211,13 @@ Manager.prototype.sort = function () {
223
211
  });
224
212
  };
225
213
 
214
+ /**
215
+ * 排序
216
+ */
217
+ Manager.prototype.sort = function () {
218
+ this._sort();
219
+ };
220
+
226
221
  // ==== 模块管理接口 ====
227
222
  /**
228
223
  * 删除模块
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "2.3.9",
3
+ "version": "2.4.1",
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": {