@midwayjs/web 3.0.0-beta.10 → 3.0.0-beta.14

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,48 @@
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.14](https://github.com/midwayjs/midway/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2022-01-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * cos config definition & 3.x doc update ([#1515](https://github.com/midwayjs/midway/issues/1515)) ([0ac7ac5](https://github.com/midwayjs/midway/commit/0ac7ac5805b7ab8873f8792fc1712a74e3223172))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.13](https://github.com/midwayjs/midway/compare/v3.0.0-beta.12...v3.0.0-beta.13) (2021-12-30)
18
+
19
+
20
+ ### Features
21
+
22
+ * 404 error ([#1465](https://github.com/midwayjs/midway/issues/1465)) ([e7e8a9d](https://github.com/midwayjs/midway/commit/e7e8a9dedfa7198ac05b161b41024c2871f93965))
23
+
24
+
25
+
26
+
27
+
28
+ # [3.0.0-beta.12](https://github.com/midwayjs/midway/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2021-12-28)
29
+
30
+
31
+ ### Features
32
+
33
+ * custom error code & add @Files/@Fields ([#1438](https://github.com/midwayjs/midway/issues/1438)) ([b0032af](https://github.com/midwayjs/midway/commit/b0032afd2fa9ea0416fe69f4bd0c1a58bea5314e))
34
+ * support throw err status ([#1440](https://github.com/midwayjs/midway/issues/1440)) ([7b98110](https://github.com/midwayjs/midway/commit/7b98110d65c5287a8fcb3eb5356dea2d7a32cee9))
35
+
36
+
37
+
38
+
39
+
40
+ # [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
41
+
42
+ **Note:** Version bump only for package @midwayjs/web
43
+
44
+
45
+
46
+
47
+
6
48
  # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
7
49
 
8
50
 
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.10",
3
+ "version": "3.0.0-beta.14",
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.10",
31
- "@midwayjs/logger": "^3.0.0-beta.10",
32
- "@midwayjs/mock": "^3.0.0-beta.10",
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.14",
31
+ "@midwayjs/logger": "2.14.0",
32
+ "@midwayjs/mock": "^3.0.0-beta.14",
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.10",
47
+ "@midwayjs/core": "^3.0.0-beta.14",
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": "153870f2e2dd6b17673ec7591e49224a6bd51b36"
61
+ "gitHead": "95695ada36190cf376e93a1a8866b3fb6dde06bc"
62
62
  }