@midwayjs/core 3.1.0 → 3.1.1

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.
@@ -13,8 +13,7 @@ exports.default = (appInfo) => {
13
13
  dir: (0, path_1.join)(logRoot, 'logs', appInfo.name),
14
14
  level: isDevelopment ? 'info' : 'warn',
15
15
  consoleLevel: isDevelopment ? 'info' : 'warn',
16
- auditFileDir: (0, path_1.join)(logRoot, 'logs', appInfo.name, '.audit'),
17
- errorDir: (0, path_1.join)(logRoot, 'logs', appInfo.name),
16
+ auditFileDir: '.audit',
18
17
  },
19
18
  clients: {
20
19
  coreLogger: {
@@ -79,7 +79,7 @@ class ContainerConfiguration {
79
79
  }
80
80
  }
81
81
  addImports(imports = []) {
82
- var _a, _b, _c;
82
+ var _a;
83
83
  // 处理 imports
84
84
  for (let importPackage of imports) {
85
85
  if (!importPackage)
@@ -92,8 +92,8 @@ class ContainerConfiguration {
92
92
  this.load(importPackage);
93
93
  }
94
94
  else if ('component' in importPackage) {
95
- if ((_a = importPackage) === null || _a === void 0 ? void 0 : _a.enabledEnvironment) {
96
- if ((_c = (_b = importPackage) === null || _b === void 0 ? void 0 : _b.enabledEnvironment) === null || _c === void 0 ? void 0 : _c.includes(this.container
95
+ if (importPackage === null || importPackage === void 0 ? void 0 : importPackage.enabledEnvironment) {
96
+ if ((_a = importPackage === null || importPackage === void 0 ? void 0 : importPackage.enabledEnvironment) === null || _a === void 0 ? void 0 : _a.includes(this.container
97
97
  .get(environmentService_1.MidwayEnvironmentService)
98
98
  .getCurrentEnvironment())) {
99
99
  this.load(importPackage.component);
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -94,12 +94,6 @@ let MidwayFrameworkService = class MidwayFrameworkService {
94
94
  }
95
95
  // init aspect module
96
96
  await this.aspectService.loadAspect();
97
- // some preload module init
98
- const modules = (0, decorator_1.listPreloadModule)();
99
- for (const module of modules) {
100
- // preload init context
101
- await this.applicationContext.getAsync(module);
102
- }
103
97
  }
104
98
  getMainApp() {
105
99
  var _a;
@@ -1,13 +1,13 @@
1
1
  import { MidwayConfigService } from './configService';
2
2
  import { ServiceFactory } from '../common/serviceFactory';
3
- import { ILogger } from '@midwayjs/logger';
3
+ import { ILogger, LoggerOptions } from '@midwayjs/logger';
4
4
  import { IMidwayContainer } from '../interface';
5
5
  export declare class MidwayLoggerService extends ServiceFactory<ILogger> {
6
6
  readonly applicationContext: IMidwayContainer;
7
7
  configService: MidwayConfigService;
8
8
  constructor(applicationContext: IMidwayContainer);
9
9
  protected init(): void;
10
- protected createClient(config: any, name?: string): void;
10
+ protected createClient(config: LoggerOptions, name?: string): void;
11
11
  getName(): string;
12
12
  createLogger(name: any, config: any): ILogger;
13
13
  getLogger(name: string): ILogger;
package/dist/setup.js CHANGED
@@ -104,6 +104,12 @@ async function initializeGlobalApplicationContext(globalOptions) {
104
104
  await applicationContext.getAsync(_1.MidwayLifeCycleService, [
105
105
  applicationContext,
106
106
  ]);
107
+ // some preload module init
108
+ const modules = (0, decorator_1.listPreloadModule)();
109
+ for (const module of modules) {
110
+ // preload init context
111
+ await applicationContext.getAsync(module);
112
+ }
107
113
  }
108
114
  return applicationContext;
109
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
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": "2074c838e454a9673a044dbe065631dd9f944005"
48
+ "gitHead": "b7a5c817d2316b93967367c34cff20a98b1ce4b7"
49
49
  }