egg 2.33.1 → 2.34.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/History.md +18 -0
- package/README.md +7 -3
- package/README.zh-CN.md +2 -2
- package/app/middleware/site_file.js +1 -2
- package/config/config.default.js +3 -0
- package/package.json +13 -6
package/History.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
2.34.0 / 2022-03-16
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
**features**
|
|
6
|
+
* [[`caacd09c3`](http://github.com/eggjs/egg/commit/caacd09c38aae03fc291febbb97a43c8ecbdc221)] - feat: siteFile support custom control-cache (#4902) (binginsist <<yangbingmail@foxmail.com>>)
|
|
7
|
+
|
|
8
|
+
**others**
|
|
9
|
+
* [[`f97fe4a8c`](http://github.com/eggjs/egg/commit/f97fe4a8c8c0b5f8c097055213f9e7177b9ab2dd)] - test: change error code assert (#4907) (fengmk2 <<fengmk2@gmail.com>>)
|
|
10
|
+
* [[`a7aa7f37d`](http://github.com/eggjs/egg/commit/a7aa7f37d901afd4c26a2a9aa57fe938b2109e94)] - docs: typo fix on deployment.zh-CN.md (#4906) (Krryxa <<krryxq@163.com>>)
|
|
11
|
+
* [[`d3fe13aa2`](http://github.com/eggjs/egg/commit/d3fe13aa25065995cfa9d78461be80194176f183)] - docs: typo fix on security.zh-CN.md (#4905) (Krryxa <<krryxq@163.com>>)
|
|
12
|
+
* [[`2dc723129`](http://github.com/eggjs/egg/commit/2dc723129614bd727e86871ae3e7cfc60166dd81)] - docs: use egg brand color for site (#4900) (Peach <<scdzwyxst@gmail.com>>)
|
|
13
|
+
* [[`11bbd8527`](http://github.com/eggjs/egg/commit/11bbd852731b1583cae5a5d519baa20960c0521d)] - docs: enhance (#4884) (Suyi <<thonatos.yang@gmail.com>>)
|
|
14
|
+
* [[`76d014bd5`](http://github.com/eggjs/egg/commit/76d014bd583c6d0b9b9f40ac2e6e7ba9dd66e8ed)] - docs: update node version (#4886) (lxinr <<33972246+lxinr@users.noreply.github.com>>)
|
|
15
|
+
* [[`9003cb5ad`](http://github.com/eggjs/egg/commit/9003cb5ad370d0c07b2baee88f3b25c597ac3929)] - docs: update https://registry.npm.taobao.org to https://registry.npmmirror.com (#4881) (Non-Official NPM Mirror Bot <<99484857+npmmirror@users.noreply.github.com>>)
|
|
16
|
+
* [[`b47409770`](http://github.com/eggjs/egg/commit/b47409770d76f03eb1ea0476be9e00207186c42e)] - docs: dumi (#4879) (Suyi <<thonatos.yang@gmail.com>>)
|
|
17
|
+
* [[`56816dbc5`](http://github.com/eggjs/egg/commit/56816dbc59dbb1a4973ca60130c9ff3f5be8b2da)] - docs (sequelize): Changed `config.sequelize` to `exports.sequelize` in configuration part (#4873) (Aelita <<45784210+xsjcTony@users.noreply.github.com>>)
|
|
18
|
+
* [[`20842f9c2`](http://github.com/eggjs/egg/commit/20842f9c216ed538924936163b7ed18437c54cd7)] - docs: Add license scan report and status (#4880) (fossabot <<badges@fossa.io>>)
|
|
19
|
+
|
|
2
20
|
2.33.1 / 2021-12-07
|
|
3
21
|
==================
|
|
4
22
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<div style="text-align:center">
|
|
2
|
-
<img src="docs/assets/egg-banner.png" />
|
|
2
|
+
<img src="docs/public/assets/egg-banner.png" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
[](https://npmjs.org/package/egg)
|
|
6
6
|
[](http://packagequality.com/#?package=egg)
|
|
7
7
|
[](https://npmjs.org/package/egg)
|
|
8
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Feggjs%2Fegg?ref=badge_shield)
|
|
8
9
|
|
|
9
10
|
[](https://github.com/eggjs/egg/actions?query=branch%3Amaster)
|
|
10
11
|
[](https://codecov.io/gh/eggjs/egg)
|
|
@@ -31,7 +32,7 @@ $ npm run dev
|
|
|
31
32
|
$ open http://localhost:7001
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
> Node.js >= 8.
|
|
35
|
+
> Node.js >= 8.5.0 required.
|
|
35
36
|
|
|
36
37
|
## Documentations
|
|
37
38
|
|
|
@@ -42,7 +43,7 @@ $ open http://localhost:7001
|
|
|
42
43
|
|
|
43
44
|
## Contributors
|
|
44
45
|
|
|
45
|
-
[](https://github.com/eggjs/egg/graphs/contributors)
|
|
46
47
|
|
|
47
48
|
## How to Contribute
|
|
48
49
|
|
|
@@ -58,3 +59,6 @@ To become a contributor, please follow our [contributing guide](CONTRIBUTING.md)
|
|
|
58
59
|
## License
|
|
59
60
|
|
|
60
61
|
[MIT](LICENSE)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Feggjs%2Fegg?ref=badge_large)
|
package/README.zh-CN.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- 深度框架定制
|
|
19
19
|
- 丰富的[插件](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)
|
|
20
20
|
|
|
21
|
-
> 支持 Node.js 8.x 及以上版本。
|
|
21
|
+
> 支持 Node.js 8.5.x 及以上版本。
|
|
22
22
|
|
|
23
23
|
## 快速开始
|
|
24
24
|
|
|
@@ -39,7 +39,7 @@ $ open http://localhost:7001
|
|
|
39
39
|
|
|
40
40
|
## 贡献者
|
|
41
41
|
|
|
42
|
-
[](https://github.com/eggjs/egg/graphs/contributors)
|
|
43
43
|
|
|
44
44
|
## 贡献代码
|
|
45
45
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const MAX_AGE = 'public, max-age=2592000'; // 30 days
|
|
5
4
|
|
|
6
5
|
module.exports = options => {
|
|
7
6
|
return function siteFile(ctx, next) {
|
|
@@ -19,7 +18,7 @@ module.exports = options => {
|
|
|
19
18
|
// '/robots.txt': Buffer <xx..
|
|
20
19
|
// content is buffer
|
|
21
20
|
if (Buffer.isBuffer(content)) {
|
|
22
|
-
ctx.set('cache-control',
|
|
21
|
+
ctx.set('cache-control', options.cacheControl);
|
|
23
22
|
ctx.body = content;
|
|
24
23
|
ctx.type = path.extname(ctx.path);
|
|
25
24
|
return;
|
package/config/config.default.js
CHANGED
|
@@ -190,6 +190,7 @@ module.exports = appInfo => {
|
|
|
190
190
|
* You can map some files using this options, it will response immdiately when matching.
|
|
191
191
|
*
|
|
192
192
|
* @member {Object} Config#siteFile - key is path, and value is url or buffer.
|
|
193
|
+
* @property {String} cacheControl - files cache , default is public, max-age=2592000
|
|
193
194
|
* @example
|
|
194
195
|
* // specific app's favicon, => '/favicon.ico': 'https://eggjs.org/favicon.ico',
|
|
195
196
|
* config.siteFile = {
|
|
@@ -198,6 +199,8 @@ module.exports = appInfo => {
|
|
|
198
199
|
*/
|
|
199
200
|
config.siteFile = {
|
|
200
201
|
'/favicon.ico': fs.readFileSync(path.join(__dirname, 'favicon.png')),
|
|
202
|
+
// default cache in 30 days
|
|
203
|
+
cacheControl: 'public, max-age=2592000',
|
|
201
204
|
};
|
|
202
205
|
|
|
203
206
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "egg",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.34.0",
|
|
4
4
|
"description": "A web framework's framework for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -57,15 +57,19 @@
|
|
|
57
57
|
"ylru": "^1.2.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
+
"@umijs/preset-react": "^1.x",
|
|
60
61
|
"address": "^1.0.3",
|
|
62
|
+
"antd": "^4.18.6",
|
|
61
63
|
"assert-extends": "^1.0.1",
|
|
62
64
|
"assert-file": "^1.0.0",
|
|
63
65
|
"autod": "^3.0.1",
|
|
64
66
|
"autod-egg": "^1.1.0",
|
|
65
67
|
"coffee": "^5.2.1",
|
|
68
|
+
"dumi": "^1.1.38",
|
|
69
|
+
"dumi-theme-egg": "^1.2.0",
|
|
66
70
|
"egg-alinode": "^1.0.3",
|
|
67
71
|
"egg-bin": "^4.12.3",
|
|
68
|
-
"egg-doctools": "^2.
|
|
72
|
+
"egg-doctools": "^2.9.1",
|
|
69
73
|
"egg-mock": "^3.21.0",
|
|
70
74
|
"egg-plugin-puml": "^2.4.0",
|
|
71
75
|
"egg-tracer": "^1.1.0",
|
|
@@ -75,11 +79,13 @@
|
|
|
75
79
|
"findlinks": "^2.1.0",
|
|
76
80
|
"formstream": "^1.1.0",
|
|
77
81
|
"glob": "^7.1.3",
|
|
82
|
+
"jsdoc": "^3.6.10",
|
|
78
83
|
"koa": "^2.11.0",
|
|
79
84
|
"koa-static": "^3.0.0",
|
|
80
85
|
"mz": "^2.7.0",
|
|
81
86
|
"mz-modules": "^2.1.0",
|
|
82
87
|
"pedding": "^1.1.0",
|
|
88
|
+
"prettier": "^2.5.1",
|
|
83
89
|
"runscript": "^1.3.0",
|
|
84
90
|
"spy": "^1.0.0",
|
|
85
91
|
"supertest": "^3.4.2",
|
|
@@ -103,11 +109,12 @@
|
|
|
103
109
|
"test-local-changed": "egg-bin test --changed",
|
|
104
110
|
"cov": "egg-bin cov --timeout 100000",
|
|
105
111
|
"ci": "npm run lint && egg-bin pkgfiles --check && npm run cov",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
112
|
+
"site:jsdoc": "node ./scripts/jsdoc.js",
|
|
113
|
+
"site:dev": "APP_ROOT=./site dumi dev",
|
|
114
|
+
"site:build": "APP_ROOT=./site dumi build && npm run site:jsdoc",
|
|
115
|
+
"site:prettier": "prettier --config site/.prettierrc --ignore-path site/.prettierignore --write \"site/**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
109
116
|
"autod": "autod",
|
|
110
|
-
"puml": "puml . --dest ./
|
|
117
|
+
"puml": "puml . --dest ./site",
|
|
111
118
|
"commits": "./scripts/commits.sh"
|
|
112
119
|
},
|
|
113
120
|
"homepage": "https://github.com/eggjs/egg",
|