vona-core 5.0.92 → 5.0.94

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.
@@ -70,13 +70,13 @@ export class AppLogger extends BeanSimple {
70
70
  throw new Error(`Failed to create logger dir: ${dirname}`);
71
71
  }
72
72
  }
73
- const configRotate = this.app.config.logger.rotate;
73
+ const configRotate = this.app.config.logger.rotate.call(this, fileName, Winston, clientInfo);
74
74
  let optionsFile;
75
75
  if (configRotate.enable) {
76
- optionsFile = configRotate.options.call(this, fileName, Winston, clientInfo);
76
+ optionsFile = configRotate;
77
77
  }
78
78
  else {
79
- optionsFile = { filename: `${fileName}.log` };
79
+ optionsFile = Object.assign({}, { filename: `${fileName}.log` }, configRotate);
80
80
  }
81
81
  const _options = deepExtend({ dirname }, optionsFile, options);
82
82
  if (configRotate.enable) {
@@ -15,7 +15,6 @@ export interface IExecuteBeanCallback {
15
15
  (params: IExecuteBeanCallbackParams): Promise<any>;
16
16
  }
17
17
  export interface IModuleAssetSceneRecord {
18
- cli: never;
19
18
  static: never;
20
19
  templates: never;
21
20
  site: never;
@@ -95,7 +95,7 @@ export class AppUtil extends BeanSimple {
95
95
  const module = this.app.meta.modules[moduleName];
96
96
  if (!module)
97
97
  throw new Error('module not found');
98
- return combineFilePathSafe(path.join(module.root, scene), assetPath || '');
98
+ return combineFilePathSafe(path.join(module.root, 'assets', scene), assetPath || '');
99
99
  }
100
100
  }
101
101
  createError(data, returnObject) {
@@ -5,21 +5,20 @@ export interface ILoggerOptionsClientInfo {
5
5
  level: () => (LoggerLevel | false);
6
6
  }
7
7
  export type TypeLoggerOptions = Winston.LoggerOptions | ((clientInfo: ILoggerOptionsClientInfo, winston: typeof Winston) => Winston.LoggerOptions);
8
- export type TypeLoggerRotateOptions = (fileName: string, winston: typeof Winston, clientInfo: ILoggerOptionsClientInfo) => DailyRotateFile.DailyRotateFileTransportOptions;
8
+ export type TypeLoggerRotateOptions = DailyRotateFile.DailyRotateFileTransportOptions & {
9
+ enable: boolean;
10
+ };
11
+ export type TypeLoggerRotateOptionsFn = (fileName: string, winston: typeof Winston, clientInfo: ILoggerOptionsClientInfo) => TypeLoggerRotateOptions;
9
12
  export interface ILoggerClientRecord {
10
13
  default: never;
11
14
  }
12
15
  export interface ILoggerChildRecord {
13
16
  }
14
- export interface ILoggerRotateConfig {
15
- enable: boolean;
16
- options: TypeLoggerRotateOptions;
17
- }
18
17
  export interface ConfigLogger {
19
18
  baseDir: string;
20
19
  base: TypeLoggerOptions;
21
20
  clients: Record<keyof ILoggerClientRecord, TypeLoggerOptions>;
22
- rotate: ILoggerRotateConfig;
21
+ rotate: TypeLoggerRotateOptionsFn;
23
22
  }
24
23
  export type LoggerLevel = 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly';
25
24
  declare module 'winston' {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-core",
3
3
  "type": "module",
4
- "version": "5.0.92",
4
+ "version": "5.0.94",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"