egg 3.17.0 → 3.17.2

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.
@@ -14,7 +14,7 @@ class Messenger extends EventEmitter {
14
14
  constructor() {
15
15
  super();
16
16
  this.pid = String(process.pid);
17
- // pids of agent or app maneged by master
17
+ // pids of agent or app managed by master
18
18
  // - retrieve app worker pids when it's an agent worker
19
19
  // - retrieve agent worker pids when it's an app worker
20
20
  this.opids = [];
package/lib/egg.js CHANGED
@@ -3,7 +3,6 @@ const path = require('path');
3
3
  const fs = require('fs');
4
4
  const ms = require('ms');
5
5
  const http = require('http');
6
- const inspector = require('inspector');
7
6
  const EggCore = require('egg-core').EggCore;
8
7
  const cluster = require('cluster-client');
9
8
  const extend = require('extend2');
@@ -27,7 +26,7 @@ const EGG_PATH = Symbol.for('egg#eggPath');
27
26
  const CLUSTER_CLIENTS = Symbol.for('egg#clusterClients');
28
27
 
29
28
  /**
30
- * Base on koa's Application
29
+ * Based on koa's Application
31
30
  * @see https://github.com/eggjs/egg-core
32
31
  * @see http://koajs.com/#application
33
32
  * @augments EggCore
@@ -62,8 +61,8 @@ class EggApplication extends EggCore {
62
61
  */
63
62
  this.messenger = Messenger.create(this);
64
63
 
65
- // trigger serverDidReady hook when all app workers
66
- // and agent worker is ready
64
+ // trigger `serverDidReady` hook when all the app workers
65
+ // and agent worker are ready
67
66
  this.messenger.once('egg-ready', () => {
68
67
  this.lifecycle.triggerServerDidReady();
69
68
  });
@@ -115,7 +114,7 @@ class EggApplication extends EggCore {
115
114
  isLeader: this.type === 'agent',
116
115
  logger: this.coreLogger,
117
116
  // debug mode does not check heartbeat
118
- isCheckHeartbeat: inspector.url() === undefined,
117
+ isCheckHeartbeat: this.config.env === 'prod' ? true : require('inspector').url() === undefined,
119
118
  });
120
119
  const client = cluster(clientClass, options);
121
120
  this._patchClusterClient(client);
@@ -40,7 +40,7 @@ class AppWorkerLoader extends EggLoader {
40
40
  // app
41
41
  this.loadController();
42
42
  // app
43
- this.loadRouter(); // Dependent on controllers
43
+ this.loadRouter(); // Depend on controllers
44
44
  }
45
45
 
46
46
  }
package/lib/start.js CHANGED
@@ -3,9 +3,6 @@
3
3
  const path = require('path');
4
4
 
5
5
  module.exports = async (options = {}) => {
6
- if (!options.ignoreWarning) {
7
- console.warn('single process mode is still in experiment, please don\'t use it in production environment');
8
- }
9
6
 
10
7
  options.baseDir = options.baseDir || process.cwd();
11
8
  options.mode = 'single';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.17.0",
3
+ "version": "3.17.2",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },
@@ -46,7 +46,7 @@
46
46
  "graceful": "^1.1.0",
47
47
  "humanize-ms": "^1.2.1",
48
48
  "is-type-of": "^1.2.1",
49
- "koa-bodyparser": "^4.3.0",
49
+ "koa-bodyparser": "^4.4.1",
50
50
  "koa-is-json": "^1.0.0",
51
51
  "koa-override": "^3.0.0",
52
52
  "ms": "^2.1.3",
@@ -1,42 +0,0 @@
1
- /**
2
- * 继承 koa 的 Context
3
- * @class Context
4
- * @see http://koajs.com/#context
5
- */
6
-
7
- /**
8
- * 实现页面跳转
9
- * @see Response#redirect
10
- * @method Context#redirect
11
- * @param {String} url 需要跳转的地址
12
- */
13
-
14
- /**
15
- * 开启 {@link Rest} 功能后,将会有 `this.params` 对象
16
- * @member {Object} Context#params
17
- * @example
18
- * ##### ctx.params.id {String}
19
- *
20
- * 资源 id,如 `GET /api/users/1` => `'1'`
21
- *
22
- * ##### ctx.params.ids {Array<String>}
23
- *
24
- * 一组资源 id,如 `GET /api/users/1,2,3` => `['1', '2', '3']`
25
- *
26
- * ##### ctx.params.fields {Array<String>}
27
- *
28
- * 期待返回的资源字段,如 `GET /api/users/1?fields=name,title` => `['name', 'title']`.
29
- * 即使应用 Controller 实现返回了全部字段,[REST] 处理器会根据 `fields` 筛选只需要的字段。
30
- *
31
- * ##### ctx.params.data {Object}
32
- *
33
- * 请求数据对象
34
- *
35
- * ##### ctx.params.page {Number}
36
- *
37
- * 分页码,如 `GET /api/users?page=10` => `10`
38
- *
39
- * ##### ctx.params.per_page {Number}
40
- *
41
- * 每页资源数目,如 `GET /api/users?per_page=20` => `20`
42
- */
@@ -1,48 +0,0 @@
1
- /**
2
- * 继承 koa 的 Request
3
- * @class Request
4
- * @see http://koajs.com/#request
5
- */
6
-
7
-
8
- // 文档注释
9
- /**
10
- * Request header
11
- * @member {Object} Request#header
12
- */
13
-
14
- /**
15
- * Request headers
16
- * @member {Object} Request#headers
17
- */
18
-
19
- /**
20
- * Request HTTP Method, 比如: GET, POST, PATCH, PUT, DELETE
21
- * @member {String} Request#method
22
- */
23
-
24
- /**
25
- * 完整的请求 URL 地址
26
- * @member {String} Request#url
27
- */
28
-
29
- /**
30
- * 完整的请求 URL 地址
31
- * @member {String} Request#originalUrl
32
- */
33
-
34
- /**
35
- * 完整的请求 URL 地址,的路径部分(不包含域名)
36
- * @member {String} Request#path
37
- */
38
-
39
- /**
40
- * 请求的 GET 参数
41
- * @member {String} Request#querystring
42
- * @example
43
- * GET http://127.0.0.1:7001?name=Foo&age=20
44
- * ```js
45
- * this.request.querystring
46
- * => 'name=Foo&age=20'
47
- * ```
48
- */
@@ -1,5 +0,0 @@
1
- /**
2
- * 继承 koa 的 Response
3
- * @class Response
4
- * @see http://koajs.com/#response
5
- */