@modern-js/prod-server 1.18.1 → 1.20.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @modern-js/prod-server
2
2
 
3
+ ## 1.20.0
4
+
5
+ ### Patch Changes
6
+
7
+ - baf7337: fix: console error message if error stack not exist
8
+ fix: 如果错误堆栈不存在,则输出错误信息
9
+ - Updated dependencies [d5d570b]
10
+ - Updated dependencies [4ddc185]
11
+ - Updated dependencies [df8ee7e]
12
+ - Updated dependencies [8c05089]
13
+ - @modern-js/utils@1.20.0
14
+ - @modern-js/server-core@1.20.0
15
+
16
+ ## 1.19.0
17
+
18
+ ### Patch Changes
19
+
20
+ - 1903f68: fix(server): failed to access static files when output.assetPrefix ends with /
21
+
22
+ fix(server): 修复 output.assetPrefix 以 / 结尾时无法正确访问的问题
23
+
24
+ - @modern-js/server-core@1.19.0
25
+ - @modern-js/utils@1.19.0
26
+
3
27
  ## 1.18.1
4
28
 
5
29
  ### Patch Changes
@@ -46,7 +46,7 @@ export const createRenderHandler = ({
46
46
  }, runner);
47
47
  return result;
48
48
  } catch (err) {
49
- ctx.error(ERROR_DIGEST.ERENDER, err.stack);
49
+ ctx.error(ERROR_DIGEST.ERENDER, err.stack || err.message);
50
50
  ctx.res.setHeader('x-modern-ssr-fallback', '1');
51
51
  }
52
52
  }
@@ -94,8 +94,8 @@ export const getStaticReg = (output = {}) => {
94
94
  const staticFiles = [cssPath, jsPath, mediaPath].filter(v => Boolean(v));
95
95
  const staticReg = ['static/', 'upload/', ...staticFiles];
96
96
  const iconReg = ['favicon.ico', 'icon.png', ...favicons];
97
- const regPrefix = prefix === '/' ? '' : prefix;
98
- const staticPathRegExp = new RegExp(`^${regPrefix}/(${[...staticReg, ...iconReg].join('|')})`);
97
+ const regPrefix = prefix.endsWith('/') ? prefix : `${prefix}/`;
98
+ const staticPathRegExp = new RegExp(`^${regPrefix}(${[...staticReg, ...iconReg].join('|')})`);
99
99
  return staticPathRegExp;
100
100
  };
101
101
  export const prepareFavicons = (favicon, faviconByEntries) => {
@@ -69,7 +69,7 @@ const createRenderHandler = ({
69
69
  }, runner);
70
70
  return result;
71
71
  } catch (err) {
72
- ctx.error(_constants.ERROR_DIGEST.ERENDER, err.stack);
72
+ ctx.error(_constants.ERROR_DIGEST.ERENDER, err.stack || err.message);
73
73
  ctx.res.setHeader('x-modern-ssr-fallback', '1');
74
74
  }
75
75
  }
@@ -123,8 +123,8 @@ const getStaticReg = (output = {}) => {
123
123
  const staticFiles = [cssPath, jsPath, mediaPath].filter(v => Boolean(v));
124
124
  const staticReg = ['static/', 'upload/', ...staticFiles];
125
125
  const iconReg = ['favicon.ico', 'icon.png', ...favicons];
126
- const regPrefix = prefix === '/' ? '' : prefix;
127
- const staticPathRegExp = new RegExp(`^${regPrefix}/(${[...staticReg, ...iconReg].join('|')})`);
126
+ const regPrefix = prefix.endsWith('/') ? prefix : `${prefix}/`;
127
+ const staticPathRegExp = new RegExp(`^${regPrefix}(${[...staticReg, ...iconReg].join('|')})`);
128
128
  return staticPathRegExp;
129
129
  };
130
130
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.18.1",
14
+ "version": "1.20.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -28,9 +28,9 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@modern-js/utils": "1.18.1",
31
+ "@modern-js/utils": "1.20.0",
32
32
  "@babel/compat-data": "^7.17.10",
33
- "@modern-js/server-core": "1.18.1",
33
+ "@modern-js/server-core": "1.20.0",
34
34
  "axios": "^0.24.0",
35
35
  "etag": "^1.8.1",
36
36
  "fresh": "^0.5.2",
@@ -45,10 +45,10 @@
45
45
  "ua-parser-js": "^0.7.28"
46
46
  },
47
47
  "devDependencies": {
48
- "@modern-js/types": "1.18.1",
49
- "@modern-js/core": "1.18.1",
50
- "@scripts/jest-config": "1.18.1",
51
- "@scripts/build": "1.18.1",
48
+ "@modern-js/types": "1.20.0",
49
+ "@modern-js/core": "1.20.0",
50
+ "@scripts/jest-config": "1.20.0",
51
+ "@scripts/build": "1.20.0",
52
52
  "@types/cookie": "^0.4.1",
53
53
  "@types/jest": "^27",
54
54
  "@types/lru-cache": "^5.1.1",
@@ -101,6 +101,5 @@
101
101
  "build": "wireit",
102
102
  "dev": "modern build --watch",
103
103
  "test": "wireit"
104
- },
105
- "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
104
+ }
106
105
  }