file-lane 2.0.6-beta.2 → 2.0.6-beta.20

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/lib/FileLane.js CHANGED
@@ -326,6 +326,7 @@ class FileLane {
326
326
  async runLoader(fileList, loader) {
327
327
  loader.context = this.context;
328
328
  loader.compilerOption = this.compilerOption;
329
+ loader.compilation = this.compilation;
329
330
  return loader.parser(fileList);
330
331
  }
331
332
 
@@ -394,7 +395,7 @@ class FileLane {
394
395
  context: this.context,
395
396
  config: this.config,
396
397
  compilerOption: this.compilerOption,
397
- compalition: this.compilation
398
+ compilation: this.compilation
398
399
  });
399
400
  }
400
401
  }
@@ -408,23 +409,26 @@ class FileLane {
408
409
  afterCompile
409
410
  } = this.config;
410
411
  if (afterCompile) {
411
- for (let item of afterCompile) {
412
+ for (let [index, item] of afterCompile.entries()) {
413
+ const message = item.workerDescribe || `work ${index + 1}`;
412
414
  try {
413
- this.handlerLogs([{
414
- level: _sharedUtils.Loglevel.INFO,
415
- message: `afterCompile: ${item.workerDescribe}`
416
- }]);
415
+ if (item.workerDescribe) {
416
+ this.handlerLogs([{
417
+ level: _sharedUtils.Loglevel.INFO,
418
+ message: `afterCompile: ${item.workerDescribe}`
419
+ }]);
420
+ }
417
421
  await item.worker({
418
422
  context: this.context,
419
423
  config: this.config,
420
424
  compilerOption: this.compilerOption,
421
- compalition: this.compilation,
425
+ compilation: this.compilation,
422
426
  onLog: logs => this.handlerLogs(logs, () => {
423
- throw new Error(`${item.workerDescribe} error}`);
427
+ throw new Error(`${message} error}`);
424
428
  })
425
429
  });
426
430
  } catch (error) {
427
- throw new Error(`afterCompile: ${item.workerDescribe} error: ${error}`);
431
+ throw new Error(`afterCompile: ${message} error: ${error}`);
428
432
  }
429
433
  }
430
434
  }
@@ -534,7 +538,7 @@ class FileLane {
534
538
  }
535
539
  }
536
540
  // 2. 忽略.开头的隐藏文件夹
537
- ignoreList.push(/(^|[\/\\])\../);
541
+ ignoreList.push('**/.*/**', '**/.*');
538
542
 
539
543
  // 3. 忽略output目录
540
544
  ignoreList.push(_path.default.join(this.context.projectPath, this.config.output));
@@ -5,6 +5,18 @@ import AsyncEventDispatcher from './event/asyncEvent/AsyncEventDispatcher';
5
5
  */
6
6
  declare class FileLaneCompilation extends AsyncEventDispatcher {
7
7
  buildFileList: string[];
8
+ /**
9
+ * 存放ux页面路由
10
+ */
11
+ entries: string[];
12
+ /**
13
+ * 存放轻卡路由
14
+ */
15
+ liteCards: string[];
16
+ /**
17
+ * services 路由
18
+ */
19
+ services: Record<string, any>[];
8
20
  /**
9
21
  * 触发方式
10
22
  *
@@ -12,6 +12,20 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  */
13
13
  class FileLaneCompilation extends _AsyncEventDispatcher.default {
14
14
  buildFileList = [];
15
+ /**
16
+ * 存放ux页面路由
17
+ */
18
+ entries = [];
19
+ /**
20
+ * 存放轻卡路由
21
+ */
22
+ liteCards = [];
23
+
24
+ /**
25
+ * services 路由
26
+ */
27
+ services = [];
28
+
15
29
  /**
16
30
  * 触发方式
17
31
  *
@@ -111,7 +111,7 @@ type CompileParam<O = any> = {
111
111
  context: IFileLaneContext;
112
112
  config: IFileLaneConfig;
113
113
  compilerOption?: O;
114
- compalition?: FileLaneCompilation;
114
+ compilation?: FileLaneCompilation;
115
115
  onLog?: (log: ILog[]) => void;
116
116
  };
117
117
  export type BeforeWork = (context: IFileLaneContext) => Promise<any>;
@@ -1,12 +1,14 @@
1
1
  import { ILog } from '@aiot-toolkit/shared-utils/lib/interface/ILog';
2
2
  import IFileLaneContext from './IFileLaneContext';
3
3
  import IFileParam from './IFileParam';
4
+ import FileLaneCompilation from '../FileLaneCompilation';
4
5
  /**
5
6
  * ILoader
6
7
  */
7
8
  export default interface ILoader {
8
9
  context?: IFileLaneContext;
9
10
  compilerOption?: any;
11
+ compilation?: FileLaneCompilation;
10
12
  parser(files: IFileParam[]): Promise<IFileParam[]> | IFileParam[];
11
13
  /**
12
14
  * 日志列表
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-lane",
3
- "version": "2.0.6-beta.2",
3
+ "version": "2.0.6-beta.20",
4
4
  "description": "File conversion tool, can be one-to-one, one to N, N to one",
5
5
  "keywords": [
6
6
  "file",
@@ -20,12 +20,12 @@
20
20
  "test": "node ./__tests__/file-lane.test.js"
21
21
  },
22
22
  "dependencies": {
23
- "@aiot-toolkit/shared-utils": "2.0.6-beta.2",
23
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.20",
24
24
  "chokidar": "^3.6.0",
25
25
  "fs-extra": "^11.2.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/fs-extra": "^11.0.4"
29
29
  },
30
- "gitHead": "d0057f9e62ac191d21445787667217cfa4aff1e9"
30
+ "gitHead": "b2a85a11db9ff9e51e63bfca5643f3e6e0eeb15c"
31
31
  }