@midwayjs/core 3.1.1 → 3.1.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.
@@ -228,7 +228,6 @@ class MidwayContainer {
228
228
  }
229
229
  load(module) {
230
230
  var _a;
231
- this.isLoad = true;
232
231
  if (module) {
233
232
  // load configuration
234
233
  const configuration = new ContainerConfiguration(this);
@@ -242,6 +241,7 @@ class MidwayContainer {
242
241
  (0, extend_1.extend)(true, detectorOptionsMerged, detectorOptions);
243
242
  }
244
243
  (_a = this.fileDetector) === null || _a === void 0 ? void 0 : _a.setExtraDetectorOptions(detectorOptionsMerged);
244
+ this.isLoad = true;
245
245
  }
246
246
  }
247
247
  loadDefinitions() {
package/dist/setup.js CHANGED
@@ -72,7 +72,9 @@ async function initializeGlobalApplicationContext(globalOptions) {
72
72
  .concat(globalOptions.imports)
73
73
  .concat(globalOptions.configurationModule)) {
74
74
  // load configuration and component
75
- applicationContext.load(configurationModule);
75
+ if (configurationModule) {
76
+ applicationContext.load(configurationModule);
77
+ }
76
78
  }
77
79
  // bind user code module
78
80
  applicationContext.ready();
@@ -92,9 +94,11 @@ async function initializeGlobalApplicationContext(globalOptions) {
92
94
  // it will be delay framework initialize in egg cluster mode
93
95
  if (!globalOptions.lazyInitializeFramework) {
94
96
  // init logger
95
- await applicationContext.getAsync(_1.MidwayLoggerService, [
96
- applicationContext,
97
- ]);
97
+ const loggerService = await applicationContext.getAsync(_1.MidwayLoggerService, [applicationContext]);
98
+ if (loggerService.getLogger('appLogger')) {
99
+ // register global logger
100
+ applicationContext.registerObject('logger', loggerService.getLogger('appLogger'));
101
+ }
98
102
  // framework/config/plugin/logger/app decorator support
99
103
  await applicationContext.getAsync(_1.MidwayFrameworkService, [
100
104
  applicationContext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "midway core",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=12"
47
47
  },
48
- "gitHead": "b7a5c817d2316b93967367c34cff20a98b1ce4b7"
48
+ "gitHead": "4ff3aa892b76d016f0ea123c7f9520d054d5c96b"
49
49
  }