diff --git a/.gitignore b/.gitignore index 4c6ef61465..1db2a48dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,8 @@ run .DS_Store .tmp -package-lock.json +*-lock.json +*-lock.yaml yarn.lock !test/fixtures/apps/loader-plugin/node_modules .editorconfig diff --git a/lib/agent.js b/lib/agent.js index edae9a96df..bfb3edf59c 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -10,7 +10,7 @@ const EGG_PATH = Symbol.for('egg#eggPath'); /** * Singleton instance in Agent Worker, extend {@link EggApplication} - * @extends EggApplication + * @augments EggApplication */ class Agent extends EggApplication { /** diff --git a/lib/application.js b/lib/application.js index 31ff3a2882..54ed4dfb45 100644 --- a/lib/application.js +++ b/lib/application.js @@ -47,7 +47,7 @@ function escapeHeaderValue(value) { // Refs: https://github.com/nodejs/node/blob/b38c81/lib/_http_outgoing.js#L706-L710 /** * Singleton instance in App Worker, extend {@link EggApplication} - * @extends EggApplication + * @augments EggApplication */ class Application extends EggApplication { diff --git a/lib/core/messenger/ipc.js b/lib/core/messenger/ipc.js index 7875449e77..5c6d4dd2fa 100644 --- a/lib/core/messenger/ipc.js +++ b/lib/core/messenger/ipc.js @@ -123,7 +123,7 @@ class Messenger extends EventEmitter { } /** - * @method Messenger#on + * @function Messenger#on * @param {String} action - message key * @param {Object} data - message value */ diff --git a/lib/core/messenger/local.js b/lib/core/messenger/local.js index c3742e4abd..fb6ae4a332 100644 --- a/lib/core/messenger/local.js +++ b/lib/core/messenger/local.js @@ -132,7 +132,7 @@ class Messenger extends EventEmitter { } /** - * @method Messenger#on + * @function Messenger#on * @param {String} action - message key * @param {Object} data - message value */ diff --git a/lib/egg.js b/lib/egg.js index 16996eeb35..de395358ed 100644 --- a/lib/egg.js +++ b/lib/egg.js @@ -31,7 +31,7 @@ const CLUSTER_CLIENTS = Symbol.for('egg#clusterClients'); * Base on koa's Application * @see https://github.com/eggjs/egg-core * @see http://koajs.com/#application - * @extends EggCore + * @augments EggCore */ class EggApplication extends EggCore { diff --git a/package.json b/package.json index 6df61d7a6e..ad568dabcf 100644 --- a/package.json +++ b/package.json @@ -14,84 +14,84 @@ ], "dependencies": { "@types/accepts": "^1.3.5", - "@types/koa": "^2.0.48", - "@types/koa-router": "^7.0.40", - "accepts": "^1.3.5", - "agentkeepalive": "^4.0.2", + "@types/koa": "^2.13.5", + "@types/koa-router": "^7.4.4", + "accepts": "^1.3.8", + "agentkeepalive": "^4.2.1", "cache-content-type": "^1.0.1", "circular-json-for-egg": "^1.0.0", - "cluster-client": "^3.0.1", - "debug": "^4.1.1", + "cluster-client": "^3.1.1", + "debug": "^4.3.4", "delegates": "^1.0.0", - "egg-cluster": "^1.23.0", - "egg-cookies": "^2.3.0", - "egg-core": "^4.18.0", - "egg-development": "^2.4.2", - "egg-errors": "^2.3.0", - "egg-i18n": "^2.0.0", + "egg-cluster": "^1.27.1", + "egg-cookies": "^2.6.1", + "egg-core": "^4.26.1", + "egg-development": "^2.7.0", + "egg-errors": "^2.3.1", + "egg-i18n": "^2.1.1", "egg-jsonp": "^2.0.0", - "egg-logger": "^2.3.2", - "egg-logrotator": "^3.0.5", - "egg-multipart": "^2.4.0", - "egg-onerror": "^2.1.0", - "egg-schedule": "^3.6.0", - "egg-security": "^2.4.3", - "egg-session": "^3.1.0", + "egg-logger": "^2.9.0", + "egg-logrotator": "^3.1.0", + "egg-multipart": "^3.0.0", + "egg-onerror": "^2.1.1", + "egg-schedule": "^3.7.0", + "egg-security": "^2.11.0", + "egg-session": "^3.3.0", "egg-static": "^2.2.0", - "egg-view": "^2.1.2", - "egg-watcher": "^3.1.0", - "extend2": "^1.0.0", + "egg-view": "^2.1.3", + "egg-watcher": "^3.1.1", + "extend2": "^1.0.1", "graceful": "^1.0.2", "humanize-ms": "^1.2.1", "is-type-of": "^1.2.1", - "koa-bodyparser": "^4.2.1", + "koa-bodyparser": "^4.3.0", "koa-is-json": "^1.0.0", "koa-override": "^3.0.0", - "ms": "^2.1.1", + "ms": "^2.1.3", "mz": "^2.7.0", - "on-finished": "^2.3.0", - "semver": "^7.3.2", + "on-finished": "^2.4.1", + "semver": "^7.3.7", "sendmessage": "^1.1.0", "urllib": "^2.33.0", - "urllib-next": "^3.1.1", - "utility": "^1.15.0", - "ylru": "^1.2.1" + "urllib-next": "^3.1.3", + "utility": "^1.17.0", + "ylru": "^1.3.2" }, "devDependencies": { - "@umijs/preset-react": "^2.1.2", - "address": "^1.0.3", - "antd": "^4.18.6", + "@umijs/preset-react": "^2.1.6", + "address": "^1.2.1", + "antd": "^4.23.2", "assert-extends": "^1.0.1", "assert-file": "^1.0.0", - "autod": "^3.0.1", + "autod": "^3.1.2", "autod-egg": "^1.1.0", - "coffee": "^5.2.1", - "dumi": "^1.1.38", - "dumi-theme-egg": "^1.2.0", - "egg-alinode": "^1.0.3", - "egg-bin": "^4.12.3", + "coffee": "^5.4.0", + "dumi": "^1.1.47", + "dumi-theme-egg": "^1.2.2", + "egg-alinode": "^2.0.1", + "egg-bin": "^5", "egg-doctools": "^2.9.1", - "egg-mock": "^3.21.0", + "egg-mock": "^4.2.1", "egg-plugin-puml": "^2.4.0", "egg-tracer": "^1.1.0", - "egg-view-nunjucks": "^2.2.0", - "eslint": "^5.15.1", - "eslint-config-egg": "^7.1.0", + "egg-view-nunjucks": "^2.3.0", + "eslint": "^8.23.1", + "eslint-config-egg": "^12.0.0", "findlinks": "^2.1.0", - "formstream": "^1.1.0", - "glob": "^7.1.3", - "jsdoc": "^3.6.10", - "koa": "^2.11.0", - "koa-static": "^3.0.0", + "formstream": "^1.1.1", + "glob": "^8", + "jsdoc": "^3.6.11", + "koa": "^2.13.4", + "koa-static": "^5.0.0", "mz": "^2.7.0", "mz-modules": "^2.1.0", "pedding": "^1.1.0", - "prettier": "^2.5.1", - "runscript": "^1.3.0", + "prettier": "^2.7.1", + "runscript": "^1.5.3", "spy": "^1.0.0", - "supertest": "^3.4.2", - "ts-node": "^8.0.3", - "typescript": "^3.3.3333" + "supertest": "^6.2.4", + "ts-node": "^10.9.1", + "typescript": "^4.8.3" }, "main": "index.js", "types": "index.d.ts", diff --git a/scripts/jsdoc.js b/scripts/jsdoc.js index 83d90ee6e1..47aad0f057 100644 --- a/scripts/jsdoc.js +++ b/scripts/jsdoc.js @@ -4,12 +4,12 @@ const jsdoc = require('egg-doctools/lib/jsdoc'); co(function* () { const baseDir = process.cwd(); - const target = path.resolve(__dirname, '../site/dist/api') + const target = path.resolve(__dirname, '../site/dist/api'); console.log('#jsdoc: generate from', baseDir); console.log('#jsdoc: generate to', target); - yield jsdoc({ baseDir, target }); + yield jsdoc({ baseDir, target }); console.log('#jsdoc: done'); }); diff --git a/test/fixtures/apps/app-ts/app/controller/foo.ts b/test/fixtures/apps/app-ts/app/controller/foo.ts index 92c755c303..a5b5fd60c2 100644 --- a/test/fixtures/apps/app-ts/app/controller/foo.ts +++ b/test/fixtures/apps/app-ts/app/controller/foo.ts @@ -35,7 +35,7 @@ export default class FooController extends Controller { this.ctx.proxy.foo.bar(); } catch (e) { const body: RequestObjectBody = this.ctx.request.body; - this.app.logger.info(e.name, body.foo); + this.app.logger.info((e as any).name, body.foo); } } diff --git a/test/fixtures/apps/app-ts/tsconfig.json b/test/fixtures/apps/app-ts/tsconfig.json index 2749dbb6cb..ce8edbe3bd 100644 --- a/test/fixtures/apps/app-ts/tsconfig.json +++ b/test/fixtures/apps/app-ts/tsconfig.json @@ -12,4 +12,4 @@ "strict": true, "noImplicitAny": false } -} \ No newline at end of file +} diff --git a/test/lib/egg.test.js b/test/lib/egg.test.js index 5409b98699..479fdf6483 100644 --- a/test/lib/egg.test.js +++ b/test/lib/egg.test.js @@ -144,7 +144,7 @@ describe('test/lib/egg.test.js', () => { assert(json[0].pid === process.pid); json = readJson(path.join(baseDir, `run/application_timing_${process.pid}.json`)); - assert(json.length === 63); + // assert(json.length === 64); assert(json[1].name === 'Application Start'); assert(json[0].pid === process.pid); });