@midwayjs/web 3.8.0 → 3.9.9
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/dist/config/config.default.js +2 -1
- package/dist/logger.js +15 -10
- package/package.json +7 -7
|
@@ -22,10 +22,11 @@ exports.default = appInfo => {
|
|
|
22
22
|
exports.egg = {
|
|
23
23
|
dumpConfig: true,
|
|
24
24
|
contextLoggerFormat: info => {
|
|
25
|
+
var _a, _b, _c;
|
|
25
26
|
const ctx = info.ctx;
|
|
26
27
|
// format: '[$userId/$ip/$traceId/$use_ms $method $url]'
|
|
27
28
|
const userId = ctx.userId || '-';
|
|
28
|
-
const traceId = (ctx.
|
|
29
|
+
const traceId = (_c = (_a = ctx.traceId) !== null && _a !== void 0 ? _a : (_b = ctx.tracer) === null || _b === void 0 ? void 0 : _b.traceId) !== null && _c !== void 0 ? _c : '-';
|
|
29
30
|
const use = Date.now() - ctx.startTime;
|
|
30
31
|
const label = userId +
|
|
31
32
|
'/' +
|
package/dist/logger.js
CHANGED
|
@@ -44,18 +44,23 @@ const levelTransform = level => {
|
|
|
44
44
|
};
|
|
45
45
|
function checkEggLoggerExistsAndBackup(dir, fileName) {
|
|
46
46
|
const file = (0, path_1.isAbsolute)(fileName) ? fileName : (0, path_1.join)(dir, fileName);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
try {
|
|
48
|
+
if ((0, fs_1.existsSync)(file) && !(0, fs_1.lstatSync)(file).isSymbolicLink()) {
|
|
49
|
+
// 如果是空文件,则直接删了,否则加入备份队列
|
|
50
|
+
if (isEmptyFile(file)) {
|
|
51
|
+
// midway 的软链在 windows 底下也不会创建出来,在 windows 底下就不做文件删除了
|
|
52
|
+
if (!isWindows) {
|
|
53
|
+
(0, fs_1.unlinkSync)(file);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const timeFormat = (0, utils_1.getCurrentDateString)();
|
|
58
|
+
(0, fs_1.renameSync)(file, file + '.' + timeFormat + '_eggjs_bak');
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
// ignore
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
function cleanUndefinedProperty(obj) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.9",
|
|
4
4
|
"description": "Midway Web Framework for Egg.js",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@midwayjs/logger": "^2.15.0",
|
|
32
|
-
"@midwayjs/mock": "^3.
|
|
33
|
-
"dayjs": "1.11.
|
|
32
|
+
"@midwayjs/mock": "^3.9.0",
|
|
33
|
+
"dayjs": "1.11.7",
|
|
34
34
|
"egg-logger": "2.9.1",
|
|
35
35
|
"egg-mock": "4.2.1",
|
|
36
36
|
"egg-scripts": "2.17.0",
|
|
37
37
|
"egg-socket.io": "4.1.6",
|
|
38
38
|
"egg-view-nunjucks": "2.3.0",
|
|
39
39
|
"fake-egg": "1.0.0",
|
|
40
|
-
"fs-extra": "10.0
|
|
41
|
-
"mm": "3.2.
|
|
40
|
+
"fs-extra": "10.1.0",
|
|
41
|
+
"mm": "3.2.1",
|
|
42
42
|
"pedding": "1.1.0",
|
|
43
43
|
"react": "17.0.2",
|
|
44
44
|
"react-dom": "17.0.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@eggjs/router": "^2.0.0",
|
|
48
|
-
"@midwayjs/core": "^3.
|
|
48
|
+
"@midwayjs/core": "^3.9.0",
|
|
49
49
|
"egg": "^2.28.0",
|
|
50
50
|
"egg-cluster": "^1.27.1",
|
|
51
51
|
"find-up": "5.0.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=12"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "95bb5b3f23b41f685372c45d1c3bb12a3e31b4e0"
|
|
63
63
|
}
|