@midwayjs/web 3.0.0-beta.11 → 3.0.0-beta.15

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
@@ -3,6 +3,51 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.15](https://github.com/midwayjs/midway/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2022-01-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * add secret filter ([#1531](https://github.com/midwayjs/midway/issues/1531)) ([ce77e48](https://github.com/midwayjs/midway/commit/ce77e4804aaffc18a0a091d3726e36d7ec1514b2))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.14](https://github.com/midwayjs/midway/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2022-01-04)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * cos config definition & 3.x doc update ([#1515](https://github.com/midwayjs/midway/issues/1515)) ([0ac7ac5](https://github.com/midwayjs/midway/commit/0ac7ac5805b7ab8873f8792fc1712a74e3223172))
23
+
24
+
25
+
26
+
27
+
28
+ # [3.0.0-beta.13](https://github.com/midwayjs/midway/compare/v3.0.0-beta.12...v3.0.0-beta.13) (2021-12-30)
29
+
30
+
31
+ ### Features
32
+
33
+ * 404 error ([#1465](https://github.com/midwayjs/midway/issues/1465)) ([e7e8a9d](https://github.com/midwayjs/midway/commit/e7e8a9dedfa7198ac05b161b41024c2871f93965))
34
+
35
+
36
+
37
+
38
+
39
+ # [3.0.0-beta.12](https://github.com/midwayjs/midway/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2021-12-28)
40
+
41
+
42
+ ### Features
43
+
44
+ * custom error code & add @Files/@Fields ([#1438](https://github.com/midwayjs/midway/issues/1438)) ([b0032af](https://github.com/midwayjs/midway/commit/b0032afd2fa9ea0416fe69f4bd0c1a58bea5314e))
45
+ * support throw err status ([#1440](https://github.com/midwayjs/midway/issues/1440)) ([7b98110](https://github.com/midwayjs/midway/commit/7b98110d65c5287a8fcb3eb5356dea2d7a32cee9))
46
+
47
+
48
+
49
+
50
+
6
51
  # [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
7
52
 
8
53
  **Note:** Version bump only for package @midwayjs/web
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # midway-web
1
+ # @midwayjs/web
2
2
 
3
- [![Package Quality](http://npm.packagequality.com/shield/midway-web.svg)](http://packagequality.com/#?package=midway-web)
3
+ [![Package Quality](http://npm.packagequality.com/shield/@midwayjs/web.svg)](http://packagequality.com/#?package=@midwayjs/web)
4
4
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/midway/pulls)
5
5
 
6
6
  this is a sub package for midway.
package/config/plugin.js CHANGED
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
+ onerror: true,
5
+ security: true,
4
6
  static: false,
5
7
  development: false,
6
8
  watcher: false,
7
- onerror: true,
8
- multipart: true,
9
- security: true,
9
+ multipart: false,
10
10
  logrotator: false,
11
11
  view: false,
12
12
  schedule: false,
13
+ i18n: false,
13
14
  };
@@ -27,7 +27,7 @@ export declare class MidwayWebFramework extends BaseFramework<Application, Conte
27
27
  run(): Promise<void>;
28
28
  getLogger(name?: string): any;
29
29
  setContextLoggerClass(BaseContextLogger: any): void;
30
- generateMiddleware(middlewareId: string): Promise<any>;
30
+ generateMiddleware(middlewareId: any): Promise<any>;
31
31
  beforeStop(): Promise<void>;
32
32
  }
33
33
  export {};
@@ -69,10 +69,17 @@ let MidwayWebFramework = class MidwayWebFramework extends core_1.BaseFramework {
69
69
  if (!this.isClusterMode) {
70
70
  await this.initSingleProcessEgg();
71
71
  }
72
+ // not found middleware
73
+ const notFound = async (ctx, next) => {
74
+ await next();
75
+ if (!ctx._matchedRoute) {
76
+ throw new core_1.httpError.NotFoundError();
77
+ }
78
+ };
72
79
  // insert error handler
73
80
  const midwayRootMiddleware = async (ctx, next) => {
74
81
  // this.app.createAnonymousContext(ctx);
75
- await (await this.applyMiddleware())(ctx, next);
82
+ await (await this.applyMiddleware(notFound))(ctx, next);
76
83
  };
77
84
  this.app.use(midwayRootMiddleware);
78
85
  this.generator = new EggControllerGenerator(this.app);
@@ -7,7 +7,7 @@ export interface IMidwayWebBaseApplication {
7
7
  applicationContext: IMidwayContainer;
8
8
  getLogger(name?: string): ILogger;
9
9
  getCoreLogger(): ILogger;
10
- generateMiddleware?(middlewareId: string): Promise<Middleware<DefaultState, EggContext>>;
10
+ generateMiddleware?(middlewareId: any): Promise<Middleware<DefaultState, EggContext>>;
11
11
  createLogger(name: string, options: LoggerOptions): ILogger;
12
12
  }
13
13
  declare module 'egg' {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/web",
3
- "version": "3.0.0-beta.11",
3
+ "version": "3.0.0-beta.15",
4
4
  "description": "Midway Web Framework for Egg.js",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -27,27 +27,27 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@midwayjs/decorator": "^3.0.0-beta.11",
31
- "@midwayjs/logger": "^3.0.0-beta.11",
32
- "@midwayjs/mock": "^3.0.0-beta.11",
33
- "dayjs": "^1.10.7",
34
- "egg-logger": "^2.4.2",
35
- "egg-mock": "^3.26.0",
36
- "egg-socket.io": "^4.1.6",
37
- "egg-view-nunjucks": "^2.3.0",
30
+ "@midwayjs/decorator": "^3.0.0-beta.15",
31
+ "@midwayjs/logger": "2.14.0",
32
+ "@midwayjs/mock": "^3.0.0-beta.15",
33
+ "dayjs": "1.10.7",
34
+ "egg-logger": "2.7.1",
35
+ "egg-mock": "4.2.0",
36
+ "egg-socket.io": "4.1.6",
37
+ "egg-view-nunjucks": "2.3.0",
38
38
  "fake-egg": "1.0.0",
39
- "fs-extra": "^8.0.1",
40
- "mm": "3",
41
- "pedding": "^1.1.0",
42
- "react": "^16.13.1",
43
- "react-dom": "^16.13.1"
39
+ "fs-extra": "10.0.0",
40
+ "mm": "3.2.0",
41
+ "pedding": "1.1.0",
42
+ "react": "17.0.2",
43
+ "react-dom": "17.0.2"
44
44
  },
45
45
  "dependencies": {
46
46
  "@eggjs/router": "^2.0.0",
47
- "@midwayjs/core": "^3.0.0-beta.11",
47
+ "@midwayjs/core": "^3.0.0-beta.15",
48
48
  "egg": "^2.28.0",
49
49
  "extend2": "^1.0.0",
50
- "find-up": "^5.0.0",
50
+ "find-up": "5.0.0",
51
51
  "mkdirp": "^1.0.4"
52
52
  },
53
53
  "author": "Harry Chen <czy88840616@gmail.com>",
@@ -58,5 +58,5 @@
58
58
  "engines": {
59
59
  "node": ">=12"
60
60
  },
61
- "gitHead": "a2b066fd500e815e799e7f421cd216f12e0e9f8e"
61
+ "gitHead": "6b9778557289d9e8b562c7ce6127736db1248973"
62
62
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2013 - Now midwayjs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.