mm_machine 1.6.4 → 1.6.6

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.
@@ -0,0 +1,34 @@
1
+ {
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo1",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本1",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./index.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 1,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
+ }
@@ -0,0 +1,11 @@
1
+
2
+ var i = 0;
3
+ function test() {
4
+ console.log("你好123", i++)
5
+ }
6
+
7
+ function main() {
8
+ test();
9
+ }
10
+
11
+ exports.main = main;
@@ -3,7 +3,7 @@ class Demo {
3
3
  }
4
4
  var i = 0;
5
5
  Demo.prototype.main = function() {
6
- console.log("我很好7654321", i++);
6
+ console.log("我很好123", i++);
7
7
  }
8
8
 
9
9
  module.exports = new Demo();
package/index.js CHANGED
@@ -466,7 +466,7 @@ Index.prototype.load = function(path) {
466
466
  path = ph.join('app', path);
467
467
  }
468
468
  } else {
469
- path = '/app/';
469
+ path = './app/';
470
470
  }
471
471
 
472
472
  // 获取所有应用路径
@@ -498,14 +498,32 @@ Index.prototype.sort = function() {
498
498
  });
499
499
  };
500
500
 
501
+
502
+ /**
503
+ * 更新前
504
+ */
505
+ Index.prototype.update_before = async function(dir) {
506
+ console.log("更新前")
507
+ }
508
+
509
+
510
+ /**
511
+ * 更新后
512
+ */
513
+ Index.prototype.update_after = async function(dir) {
514
+ console.log("更新后")
515
+ }
516
+
501
517
  /**
502
518
  * 更新配置
503
519
  * @param {String} dir 检索的路径
504
520
  */
505
521
  Index.prototype.update = async function(dir) {
522
+ await this.update_before(dir);
506
523
  this.clear();
507
524
  this.load(dir);
508
525
  this.sort();
526
+ await this.update_after(dir);
509
527
  };
510
528
 
511
529
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "这是超级美眉框架机制构建辅助模块,用于快速构建一个机制",
5
5
  "main": "index.js",
6
6
  "scripts": {