file-lane 2.0.6-beta.9 → 2.1.0-prender.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.
package/lib/FileLane.js CHANGED
@@ -186,6 +186,9 @@ class FileLane {
186
186
  } = this.events || {};
187
187
  const timeStart = Date.now();
188
188
  this.initCompilation(trigger);
189
+ if (this.compilation) {
190
+ this.compilation.changedFiles = fileList;
191
+ }
189
192
  this.building = true;
190
193
  onBuildStart?.();
191
194
  try {
@@ -303,7 +306,11 @@ class FileLane {
303
306
  }
304
307
  const hasError = logs.find(item => item.level && [_sharedUtils.Loglevel.ERROR, _sharedUtils.Loglevel.THROW].includes(item.level));
305
308
  if (hasError) {
306
- onError?.();
309
+ if (onError) {
310
+ onError();
311
+ } else {
312
+ throw new Error('');
313
+ }
307
314
  }
308
315
  }
309
316
  async writeFiles(fileList) {
@@ -395,7 +402,8 @@ class FileLane {
395
402
  context: this.context,
396
403
  config: this.config,
397
404
  compilerOption: this.compilerOption,
398
- compilation: this.compilation
405
+ compilation: this.compilation,
406
+ onLog: logs => this.handlerLogs(logs)
399
407
  });
400
408
  }
401
409
  }
@@ -538,7 +546,7 @@ class FileLane {
538
546
  }
539
547
  }
540
548
  // 2. 忽略.开头的隐藏文件夹
541
- ignoreList.push(/(^|[\/\\])\../);
549
+ ignoreList.push('**/.*/**', '**/.*');
542
550
 
543
551
  // 3. 忽略output目录
544
552
  ignoreList.push(_path.default.join(this.context.projectPath, this.config.output));
@@ -5,6 +5,10 @@ import AsyncEventDispatcher from './event/asyncEvent/AsyncEventDispatcher';
5
5
  */
6
6
  declare class FileLaneCompilation extends AsyncEventDispatcher {
7
7
  buildFileList: string[];
8
+ /**
9
+ * 变更的文件列表(watch 模式下由 build 填充)
10
+ */
11
+ changedFiles: string[];
8
12
  /**
9
13
  * 存放ux页面路由
10
14
  */
@@ -12,6 +12,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  */
13
13
  class FileLaneCompilation extends _AsyncEventDispatcher.default {
14
14
  buildFileList = [];
15
+ /**
16
+ * 变更的文件列表(watch 模式下由 build 填充)
17
+ */
18
+ changedFiles = [];
15
19
  /**
16
20
  * 存放ux页面路由
17
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-lane",
3
- "version": "2.0.6-beta.9",
3
+ "version": "2.1.0-prender.2",
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.9",
23
+ "@aiot-toolkit/shared-utils": "2.1.0-prender.2",
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": "18718f09f1ee7f1d7361022c5fb7858c87cee2bd"
30
+ "gitHead": "a0849da638ea3a9a6abb95a9cbcad400cbb6903a"
31
31
  }