mm_os 2.8.3 → 2.8.5
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/core/com/api/drive.js +3 -0
- package/core/com/api/index.js +3 -1
- package/core/com/cmd/drive.js +2 -1
- package/core/com/cmd/index.js +2 -0
- package/core/com/component/drive.js +2 -1
- package/core/com/component/index.js +2 -0
- package/core/com/event/drive.js +1 -1
- package/core/com/event/index.js +4 -3
- package/core/com/eventer/com.js +1 -1
- package/core/com/nav/drive.js +3 -2
- package/core/com/nav/index.js +2 -0
- package/core/com/param/drive.js +2 -1
- package/core/com/param/index.js +2 -0
- package/core/com/plugin/drive.js +2 -1
- package/core/com/plugin/index.js +2 -0
- package/core/com/sql/drive.js +2 -1
- package/core/com/sql/index.js +3 -1
- package/core/com/static/drive.js +4 -4
- package/core/com/task/index.js +4 -1
- package/package.json +2 -2
package/core/com/api/drive.js
CHANGED
package/core/com/api/index.js
CHANGED
|
@@ -18,6 +18,8 @@ class Api extends Index {
|
|
|
18
18
|
this.Drive = Drive;
|
|
19
19
|
this.type = "api";
|
|
20
20
|
this.title = title;
|
|
21
|
+
// 默认启用热更新
|
|
22
|
+
this.mode = 2;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -55,7 +57,7 @@ Api.prototype.run = async function(ctx, db) {
|
|
|
55
57
|
for (var i = 0, o; o = lt[i++];) {
|
|
56
58
|
if (o.config.state === 1 && path.has(o.config.path)) {
|
|
57
59
|
var ret = await o.run(ctx, db);
|
|
58
|
-
if (this.mode) {
|
|
60
|
+
if (this.mode > 2) {
|
|
59
61
|
o.load(o.filename);
|
|
60
62
|
}
|
|
61
63
|
if (ret) {
|
package/core/com/cmd/drive.js
CHANGED
package/core/com/cmd/index.js
CHANGED
package/core/com/event/drive.js
CHANGED
package/core/com/event/index.js
CHANGED
|
@@ -18,7 +18,8 @@ class Event extends Index {
|
|
|
18
18
|
this.Drive = Drive;
|
|
19
19
|
this.type = "event";
|
|
20
20
|
this.title = title;
|
|
21
|
-
|
|
21
|
+
// 默认启用热更新
|
|
22
|
+
this.mode = 2;
|
|
22
23
|
/* === 验证 === */
|
|
23
24
|
// 验证前
|
|
24
25
|
this.list_before = [];
|
|
@@ -149,7 +150,7 @@ Event.prototype.doing = async function(o, ctx, db) {
|
|
|
149
150
|
if (types.isPromise(ret)) {
|
|
150
151
|
ret = await ret;
|
|
151
152
|
}
|
|
152
|
-
if (this.mode) {
|
|
153
|
+
if (this.mode > 2) {
|
|
153
154
|
o.load(o.filename);
|
|
154
155
|
}
|
|
155
156
|
return ret;
|
|
@@ -167,7 +168,7 @@ Event.prototype.run_sub = async function(list, target, ctx, db) {
|
|
|
167
168
|
for (var i = 0, o; o = list[i++];) {
|
|
168
169
|
if (o.config.state === 1 && target.has(o.config.target)) {
|
|
169
170
|
var ret = await o.run(ctx, db);
|
|
170
|
-
if (this.mode) {
|
|
171
|
+
if (this.mode > 2) {
|
|
171
172
|
o.load(o.filename);
|
|
172
173
|
}
|
|
173
174
|
if (ret) {
|
package/core/com/eventer/com.js
CHANGED
package/core/com/nav/drive.js
CHANGED
|
@@ -28,7 +28,8 @@ class Drive extends Item {
|
|
|
28
28
|
|
|
29
29
|
// 模板路径
|
|
30
30
|
this.tpl_path = "./tpl/";
|
|
31
|
-
|
|
31
|
+
// 默认启用热更新
|
|
32
|
+
this.mode = 2;
|
|
32
33
|
/* 通用项 */
|
|
33
34
|
// 配置参数
|
|
34
35
|
this.config = {
|
|
@@ -563,4 +564,4 @@ Drive.prototype.update_vue = async function(route_path, cover) {
|
|
|
563
564
|
}
|
|
564
565
|
};
|
|
565
566
|
|
|
566
|
-
module.exports = Drive;
|
|
567
|
+
module.exports = Drive;
|
package/core/com/nav/index.js
CHANGED
package/core/com/param/drive.js
CHANGED
package/core/com/param/index.js
CHANGED
package/core/com/plugin/drive.js
CHANGED
package/core/com/plugin/index.js
CHANGED
package/core/com/sql/drive.js
CHANGED
package/core/com/sql/index.js
CHANGED
|
@@ -18,6 +18,8 @@ class Sql extends Index {
|
|
|
18
18
|
this.Drive = Drive;
|
|
19
19
|
this.type = "sql";
|
|
20
20
|
this.title = title;
|
|
21
|
+
// 默认启用热更新
|
|
22
|
+
this.mode = 2;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -66,7 +68,7 @@ Sql.prototype.run = async function(name, query, body, db) {
|
|
|
66
68
|
var obj = this.get(name);
|
|
67
69
|
if (obj) {
|
|
68
70
|
var ret = await obj.run(query, body, db);
|
|
69
|
-
if (this.mode) {
|
|
71
|
+
if (this.mode > 2) {
|
|
70
72
|
o.load(o.filename);
|
|
71
73
|
}
|
|
72
74
|
return ret;
|
package/core/com/static/drive.js
CHANGED
|
@@ -74,7 +74,7 @@ class Drive extends Item {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
if (this.config.convert_amd) {
|
|
77
|
-
this.
|
|
77
|
+
this.run_mode(true);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -95,7 +95,7 @@ Drive.prototype.loadObj = function(obj) {
|
|
|
95
95
|
$.push(this.config, obj, true);
|
|
96
96
|
var cg = this.config;
|
|
97
97
|
if (cg.convert_amd) {
|
|
98
|
-
this.
|
|
98
|
+
this.run_mode(true);
|
|
99
99
|
}
|
|
100
100
|
var f = cg.func_file;
|
|
101
101
|
if (f) {
|
|
@@ -142,10 +142,10 @@ Drive.prototype.main = async function(ctx, path) {
|
|
|
142
142
|
Drive.prototype.after = async function(ctx, path) {};
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* 切换运行模式
|
|
146
146
|
* @param {Boolean} convert_amd 是否将ES6转换AMD
|
|
147
147
|
*/
|
|
148
|
-
Drive.prototype.
|
|
148
|
+
Drive.prototype.run_mode = async function(convert_amd) {
|
|
149
149
|
var cg = this.config;
|
|
150
150
|
if (convert_amd) {
|
|
151
151
|
this.main = async function main(ctx, path) {
|
package/core/com/task/index.js
CHANGED
|
@@ -61,7 +61,10 @@ Task.prototype.load_item = function(dir, cg, file) {
|
|
|
61
61
|
var drive = new this.Drive(dir);
|
|
62
62
|
drive.loadObj(cg);
|
|
63
63
|
drive.filename = file;
|
|
64
|
-
|
|
64
|
+
var _this = this;
|
|
65
|
+
drive.admin = function() {
|
|
66
|
+
return this;
|
|
67
|
+
};
|
|
65
68
|
this.list.push(drive);
|
|
66
69
|
};
|
|
67
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_os",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"description": "这是超级美眉服务端框架,用于快速构建应用程序。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"mm_html": "^1.1.6",
|
|
43
43
|
"mm_koa_proxy": "^1.0.0",
|
|
44
44
|
"mm_logs": "^1.1.7",
|
|
45
|
-
"mm_machine": "^1.8.
|
|
45
|
+
"mm_machine": "^1.8.9",
|
|
46
46
|
"mm_mongodb": "^1.4.2",
|
|
47
47
|
"mm_mqtt": "^1.0.6",
|
|
48
48
|
"mm_mysql": "^1.8.9",
|