@midwayjs/web 3.8.0 → 3.9.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/dist/logger.js +15 -10
  2. package/package.json +6 -6
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
- if ((0, fs_1.existsSync)(file) && !(0, fs_1.lstatSync)(file).isSymbolicLink()) {
48
- // 如果是空文件,则直接删了,否则加入备份队列
49
- if (isEmptyFile(file)) {
50
- // midway 的软链在 windows 底下也不会创建出来,在 windows 底下就不做文件删除了
51
- if (!isWindows) {
52
- (0, fs_1.unlinkSync)(file);
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
- else {
56
- const timeFormat = (0, utils_1.getCurrentDateString)();
57
- (0, fs_1.renameSync)(file, file + '.' + timeFormat + '_eggjs_bak');
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.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "Midway Web Framework for Egg.js",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "license": "MIT",
30
30
  "devDependencies": {
31
31
  "@midwayjs/logger": "^2.15.0",
32
- "@midwayjs/mock": "^3.8.0",
33
- "dayjs": "1.11.6",
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",
@@ -38,14 +38,14 @@
38
38
  "egg-view-nunjucks": "2.3.0",
39
39
  "fake-egg": "1.0.0",
40
40
  "fs-extra": "10.0.1",
41
- "mm": "3.2.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.8.0",
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": "5c640c7182923587139f9f9c0aecf50585798e1e"
62
+ "gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
63
63
  }