file-lane 2.0.6-beta.2 → 2.0.6-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.
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
|
-
|
|
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
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
-
|
|
425
|
+
compilation: this.compilation,
|
|
422
426
|
onLog: logs => this.handlerLogs(logs, () => {
|
|
423
|
-
throw new Error(`${
|
|
427
|
+
throw new Error(`${message} error}`);
|
|
424
428
|
})
|
|
425
429
|
});
|
|
426
430
|
} catch (error) {
|
|
427
|
-
throw new Error(`afterCompile: ${
|
|
431
|
+
throw new Error(`afterCompile: ${message} error: ${error}`);
|
|
428
432
|
}
|
|
429
433
|
}
|
|
430
434
|
}
|
|
@@ -5,6 +5,14 @@ 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[];
|
|
8
16
|
/**
|
|
9
17
|
* 触发方式
|
|
10
18
|
*
|
|
@@ -12,6 +12,14 @@ 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 = [];
|
|
15
23
|
/**
|
|
16
24
|
* 触发方式
|
|
17
25
|
*
|
|
@@ -111,7 +111,7 @@ type CompileParam<O = any> = {
|
|
|
111
111
|
context: IFileLaneContext;
|
|
112
112
|
config: IFileLaneConfig;
|
|
113
113
|
compilerOption?: O;
|
|
114
|
-
|
|
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.
|
|
3
|
+
"version": "2.0.6-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,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.
|
|
23
|
+
"@aiot-toolkit/shared-utils": "2.0.6-beta.4",
|
|
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": "
|
|
30
|
+
"gitHead": "1acc8279ba3c5995aebe3a97a6b33154086f09d6"
|
|
31
31
|
}
|