@midwayjs/web 4.0.0-beta.11 → 4.0.0-beta.12
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/dist/base.js +2 -3
- package/dist/framework/web.js +0 -1
- package/dist/logger.js +6 -5
- package/index.d.ts +1 -2
- package/package.json +5 -5
package/dist/base.js
CHANGED
|
@@ -135,7 +135,8 @@ const createAppWorkerLoader = () => {
|
|
|
135
135
|
// 这里生命周期走到 onReady
|
|
136
136
|
this.lifecycleService = await applicationContext.getAsync(lifecycle_1.MidwayWebLifeCycleService, [applicationContext]);
|
|
137
137
|
// 执行加载框架初始化
|
|
138
|
-
this.framework =
|
|
138
|
+
this.framework =
|
|
139
|
+
await applicationContext.getAsync(web_1.MidwayWebFramework);
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
}
|
|
@@ -265,7 +266,6 @@ const createEggApplication = () => {
|
|
|
265
266
|
const Application = require(getFramework())?.Application || require('egg').Application;
|
|
266
267
|
class EggApplication extends Application {
|
|
267
268
|
constructor(options) {
|
|
268
|
-
// eslint-disable-next-line constructor-super
|
|
269
269
|
super(options);
|
|
270
270
|
}
|
|
271
271
|
get [EGG_LOADER]() {
|
|
@@ -300,7 +300,6 @@ const createEggAgent = () => {
|
|
|
300
300
|
const Agent = require(getFramework())?.Agent || require('egg').Agent;
|
|
301
301
|
class EggAgent extends Agent {
|
|
302
302
|
constructor(options) {
|
|
303
|
-
// eslint-disable-next-line constructor-super
|
|
304
303
|
super(options);
|
|
305
304
|
}
|
|
306
305
|
get [EGG_LOADER]() {
|
package/dist/framework/web.js
CHANGED
|
@@ -240,7 +240,6 @@ let MidwayWebFramework = class MidwayWebFramework extends core_1.BaseFramework {
|
|
|
240
240
|
return this.loggerService.getLogger(this.frameworkLoggerName);
|
|
241
241
|
}
|
|
242
242
|
setContextLoggerClass() {
|
|
243
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
244
243
|
const contextFormat = this.configService.getConfiguration('midwayLogger.clients.appLogger.contextFormat');
|
|
245
244
|
class MidwayEggContextLogger extends logger_1.MidwayContextLogger {
|
|
246
245
|
constructor(ctx, appLogger) {
|
package/dist/logger.js
CHANGED
|
@@ -86,11 +86,10 @@ class MidwayLoggers extends Map {
|
|
|
86
86
|
configService.addObject(eggLoggerConfig);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
let loggerConfig = configService.getConfiguration('midwayLogger');
|
|
90
89
|
// 这里属于 hack 了,cluster 模式下会先走这里,找不到默认值
|
|
91
90
|
// 先合并一遍默认配置
|
|
92
91
|
configService.addObject(logger_1.loggers.getDefaultMidwayLoggerConfig(configService.getAppInfo()), true);
|
|
93
|
-
loggerConfig = configService.getConfiguration('midwayLogger');
|
|
92
|
+
const loggerConfig = configService.getConfiguration('midwayLogger');
|
|
94
93
|
// 这里利用了 loggers 缓存的特性,提前初始化 logger
|
|
95
94
|
if (loggerConfig) {
|
|
96
95
|
for (const id of Object.keys(loggerConfig.clients)) {
|
|
@@ -144,9 +143,11 @@ class MidwayLoggers extends Map {
|
|
|
144
143
|
}
|
|
145
144
|
else if (isV3Logger) {
|
|
146
145
|
// v3
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
const v3Logger = value;
|
|
147
|
+
const consoleLogger = v3Logger.get?.('console');
|
|
148
|
+
if (consoleLogger) {
|
|
149
|
+
consoleLogger.level = 'none';
|
|
150
|
+
}
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
}
|
package/index.d.ts
CHANGED
|
@@ -20,8 +20,7 @@ declare module 'egg' {
|
|
|
20
20
|
|
|
21
21
|
// 这里再次覆盖和 egg 不同的定义,不然 egg 插件里可能会报错
|
|
22
22
|
interface Application
|
|
23
|
-
extends IMidwayBaseApplication<EggContext>,
|
|
24
|
-
IMidwayWebBaseApplication {
|
|
23
|
+
extends IMidwayBaseApplication<EggContext>, IMidwayWebBaseApplication {
|
|
25
24
|
createAnonymousContext(...args: any[]): EggContext;
|
|
26
25
|
getCoreLogger(): EggLogger & ILogger;
|
|
27
26
|
getLogger(name?: string): EggLogger & ILogger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/web",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.12",
|
|
4
4
|
"description": "Midway Web Framework for Egg.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@midwayjs/logger": "^4.0.0",
|
|
32
|
-
"@midwayjs/mock": "^4.0.0-beta.
|
|
32
|
+
"@midwayjs/mock": "^4.0.0-beta.12",
|
|
33
33
|
"@types/koa": "2.15.0",
|
|
34
34
|
"dayjs": "1.11.19",
|
|
35
35
|
"egg-logger": "3.6.1",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@eggjs/router": "^2.0.0",
|
|
52
|
-
"@midwayjs/core": "^4.0.0-beta.
|
|
52
|
+
"@midwayjs/core": "^4.0.0-beta.12",
|
|
53
53
|
"egg": "^2.28.0",
|
|
54
54
|
"egg-cluster": "^1.27.1",
|
|
55
55
|
"egg-path-matching": "^2.1.0",
|
|
56
56
|
"find-up": "5.0.0",
|
|
57
57
|
"mkdirp": "1.0.4",
|
|
58
|
-
"qs": "6.14.
|
|
58
|
+
"qs": "6.14.2"
|
|
59
59
|
},
|
|
60
60
|
"author": "Harry Chen <czy88840616@gmail.com>",
|
|
61
61
|
"repository": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=20"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "1c48179b7c827ba8ec9351e9b6c36ec1726d3e11"
|
|
69
69
|
}
|