file-lane 2.0.3-beta.2 → 2.0.3-beta.4

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.
Files changed (2) hide show
  1. package/lib/FileLane.js +22 -6
  2. package/package.json +3 -3
package/lib/FileLane.js CHANGED
@@ -84,7 +84,14 @@ class FileLane {
84
84
  return __awaiter(this, void 0, void 0, function* () {
85
85
  const errorList = this.validateConfig();
86
86
  if (errorList && errorList.length) {
87
- shared_utils_1.ColorConsole.error(`### file-lane ### ${errorList.map((item, index) => `${index + 1}. ${item}`).join('\r\n')}`);
87
+ this.handlerLogs([
88
+ {
89
+ level: shared_utils_1.Loglevel.ERROR,
90
+ message: `### file-lane ### ${errorList.map((item, index) => `${index + 1}. ${item}`).join('\r\n')}`
91
+ }
92
+ ], () => {
93
+ throw new Error(`validate error`);
94
+ });
88
95
  return;
89
96
  }
90
97
  yield this.complyBeforeWorks();
@@ -272,7 +279,7 @@ class FileLane {
272
279
  }
273
280
  const hasError = logs.find((item) => item.level && [shared_utils_1.Loglevel.ERROR, shared_utils_1.Loglevel.THROW].includes(item.level));
274
281
  if (hasError) {
275
- onError();
282
+ onError === null || onError === void 0 ? void 0 : onError();
276
283
  }
277
284
  }
278
285
  writeFiles(fileList) {
@@ -378,17 +385,27 @@ class FileLane {
378
385
  if (afterCompile) {
379
386
  for (let item of afterCompile) {
380
387
  try {
381
- shared_utils_1.ColorConsole.info(`FollowWork: ${item.workerDescribe} start`);
388
+ this.handlerLogs([
389
+ {
390
+ level: shared_utils_1.Loglevel.INFO,
391
+ message: `FollowWork: ${item.workerDescribe} start`
392
+ }
393
+ ]);
382
394
  yield item.worker({
383
395
  context: this.context,
384
396
  config: this.config,
385
397
  compilerOption: this.compilerOption,
386
398
  compalition: this.compilation
387
399
  });
388
- shared_utils_1.ColorConsole.info(`FollowWork: ${item.workerDescribe} end`);
400
+ this.handlerLogs([
401
+ {
402
+ level: shared_utils_1.Loglevel.INFO,
403
+ message: `FollowWork: ${item.workerDescribe} end`
404
+ }
405
+ ]);
389
406
  }
390
407
  catch (error) {
391
- shared_utils_1.ColorConsole.throw(`FollowWork: ${item.workerDescribe} error, ${error}`);
408
+ throw new Error(`FollowWork: ${item.workerDescribe} error,`);
392
409
  }
393
410
  }
394
411
  }
@@ -455,7 +472,6 @@ class FileLane {
455
472
  };
456
473
  watcher
457
474
  .on('ready', () => {
458
- shared_utils_1.ColorConsole.log(`### file-lane ### Initial scan complete. Ready for Watch.`);
459
475
  watcher
460
476
  .on('add', (path) => {
461
477
  // 监听文件添加事件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-lane",
3
- "version": "2.0.3-beta.2",
3
+ "version": "2.0.3-beta.4",
4
4
  "description": "File conversion tool, can be one-to-one, one to N, N to one",
5
5
  "keywords": [
6
6
  "file",
@@ -20,7 +20,7 @@
20
20
  "test": "node ./__tests__/file-lane.test.js"
21
21
  },
22
22
  "dependencies": {
23
- "@aiot-toolkit/shared-utils": "2.0.3-beta.2",
23
+ "@aiot-toolkit/shared-utils": "2.0.3-beta.4",
24
24
  "chokidar": "^3.6.0",
25
25
  "fs-extra": "^11.2.0",
26
26
  "lodash": "^4.17.21"
@@ -28,5 +28,5 @@
28
28
  "devDependencies": {
29
29
  "@types/fs-extra": "^11.0.4"
30
30
  },
31
- "gitHead": "7776973f6a81d7f13eb330be8df5801d9143c83c"
31
+ "gitHead": "a79707d6a498ab01ac10ff3ba23d6271e2ac2ed8"
32
32
  }