egg-core
Advanced tools
Comparing version 4.30.1 to 5.0.0
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
const EggCore = require('./lib/egg'); | ||
@@ -4,0 +2,0 @@ const EggLoader = require('./lib/loader/egg_loader'); |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
const assert = require('assert'); | ||
@@ -10,8 +8,7 @@ const fs = require('fs'); | ||
const co = require('co'); | ||
const Router = require('@eggjs/router').EggRouter; | ||
const BaseContextClass = require('./utils/base_context_class'); | ||
const utils = require('./utils'); | ||
const Router = require('@eggjs/router').EggRouter; | ||
const Timing = require('./utils/timing'); | ||
const Lifecycle = require('./lifecycle'); | ||
const enableAsyncLocalStorage = !!require('async_hooks').AsyncLocalStorage; | ||
@@ -44,3 +41,3 @@ const DEPRECATE = Symbol('EggCore#deprecate'); | ||
// https://github.com/koajs/koa/pull/1721 | ||
super({ asyncLocalStorage: enableAsyncLocalStorage }); | ||
super({ asyncLocalStorage: true }); | ||
@@ -77,3 +74,3 @@ this.timing = new Timing(); | ||
* @class Controller | ||
* @extends BaseContextClass | ||
* @augments BaseContextClass | ||
* @example | ||
@@ -94,3 +91,3 @@ * class UserController extends app.Controller {} | ||
* @class Service | ||
* @extends BaseContextClass | ||
* @augments BaseContextClass | ||
* @example | ||
@@ -97,0 +94,0 @@ * class UserService extends app.Service {} |
@@ -38,3 +38,3 @@ 'use strict'; | ||
* Same as {@link FileLoader}, but it will attach file to `inject[fieldClass]`. The exports will be lazy loaded, such as `ctx.group.repository`. | ||
* @extends FileLoader | ||
* @augments FileLoader | ||
* @since 1.0.0 | ||
@@ -41,0 +41,0 @@ */ |
@@ -7,3 +7,2 @@ 'use strict'; | ||
const assert = require('assert'); | ||
const { Console } = require('console'); | ||
@@ -124,3 +123,3 @@ module.exports = { | ||
// ignore console | ||
if (key === 'console' && val && typeof val.Console === 'function' && val.Console === Console) { | ||
if (key === 'console' && val && typeof val.Console === 'function' && val.Console === console.Console) { | ||
obj[key] = filepath; | ||
@@ -127,0 +126,0 @@ continue; |
@@ -26,4 +26,4 @@ 'use strict'; | ||
* // options == app.config.status | ||
* return function*(next) { | ||
* yield next; | ||
* return async next => { | ||
* await next(); | ||
* } | ||
@@ -30,0 +30,0 @@ * } |
{ | ||
"name": "egg-core", | ||
"version": "4.30.1", | ||
"version": "5.0.0", | ||
"description": "A core Pluggable framework based on koa", | ||
@@ -15,4 +15,4 @@ "main": "index.js", | ||
"test": "npm run lint -- --fix && npm run test-local", | ||
"test-local": "egg-bin test", | ||
"cov": "egg-bin cov", | ||
"test-local": "egg-bin test -p", | ||
"cov": "egg-bin cov -p", | ||
"ci": "npm run lint && npm run cov", | ||
@@ -36,27 +36,25 @@ "contributor": "git-contributor" | ||
"engines": { | ||
"node": ">= 8.9.0" | ||
"node": ">= 14.17.0" | ||
}, | ||
"devDependencies": { | ||
"@types/depd": "^1.1.32", | ||
"@types/koa": "^2.0.48", | ||
"await-event": "^2.1.0", | ||
"coffee": "^5.2.1", | ||
"egg-bin": "^4.20.0", | ||
"egg-bin": "^5.9.0", | ||
"egg-utils": "^2.4.1", | ||
"eslint": "^5.16.0", | ||
"eslint-config-egg": "^7.4.1", | ||
"eslint": "^8.31.0", | ||
"eslint-config-egg": "^12.1.0", | ||
"git-contributor": "^1.0.10", | ||
"jest": "^24.8.0", | ||
"js-yaml": "^3.13.1", | ||
"mm": "^2.5.0", | ||
"mz-modules": "^2.1.0", | ||
"mm": "^3.2.1", | ||
"pedding": "^1.1.0", | ||
"rimraf": "^2.6.3", | ||
"spy": "^1.0.0", | ||
"supertest": "^4.0.2", | ||
"ts-node": "^8.0.3", | ||
"typescript": "^3.3.3333" | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.4", | ||
"urllib": "^3.10.0" | ||
}, | ||
"dependencies": { | ||
"@eggjs/router": "^2.0.0", | ||
"@types/depd": "^1.1.32", | ||
"@types/koa": "^2.0.48", | ||
"co": "^4.6.0", | ||
@@ -63,0 +61,0 @@ "debug": "^4.1.1", |
@@ -200,11 +200,12 @@ # egg-core | ||
constructor(ctx) { | ||
super(ctx); | ||
// get the ctx | ||
} | ||
get() {} | ||
async get() {} | ||
}; | ||
// use the service in app/controller/home.js | ||
module.exports = function*() { | ||
this.body = this.service.query.get(); | ||
module.exports = async ctx => { | ||
ctx.body = await ctx.service.query.get(); | ||
}; | ||
@@ -211,0 +212,0 @@ ``` |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
16
292
24
111813
3015
- Removed@types/depd@^1.1.32
- Removed@types/koa@^2.0.48
- Removed@types/accepts@1.3.7(transitive)
- Removed@types/body-parser@1.19.5(transitive)
- Removed@types/connect@3.4.38(transitive)
- Removed@types/content-disposition@0.5.8(transitive)
- Removed@types/cookies@0.9.0(transitive)
- Removed@types/depd@1.1.36(transitive)
- Removed@types/express@4.17.21(transitive)
- Removed@types/express-serve-static-core@4.19.5(transitive)
- Removed@types/http-assert@1.5.5(transitive)
- Removed@types/http-errors@2.0.4(transitive)
- Removed@types/keygrip@1.0.6(transitive)
- Removed@types/koa@2.15.0(transitive)
- Removed@types/koa-compose@3.2.8(transitive)
- Removed@types/mime@1.3.5(transitive)
- Removed@types/qs@6.9.15(transitive)
- Removed@types/range-parser@1.2.7(transitive)
- Removed@types/send@0.17.4(transitive)
- Removed@types/serve-static@1.15.7(transitive)