@aiot-toolkit/aiotpack 2.0.2-beta.3 → 2.0.2-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/compiler/javascript/interface/IJavascriptCompileOption.d.ts +5 -1
- package/lib/config/UxConfig.d.ts +5 -0
- package/lib/followWorks/ux/UxFollowWorks.js +1 -1
- package/lib/loader/ux/JsLoader.d.ts +2 -0
- package/lib/loader/ux/JsLoader.js +1 -1
- package/lib/utils/ux/UxLoaderUtils.js +3 -2
- package/package.json +5 -5
|
@@ -36,9 +36,13 @@ export default interface IJavascriptCompileOption extends ICompileParam {
|
|
|
36
36
|
/**
|
|
37
37
|
* 禁用 jsc
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
disabledJsc?: boolean;
|
|
40
40
|
/**
|
|
41
41
|
* 启用 protobuf
|
|
42
42
|
*/
|
|
43
43
|
enableProtobuf?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 启用应用自动化测试
|
|
46
|
+
*/
|
|
47
|
+
enableE2e?: boolean;
|
|
44
48
|
}
|
package/lib/config/UxConfig.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { IFileLaneConfig } from 'file-lane';
|
|
|
2
2
|
import IJavascriptCompileOption from '../compiler/javascript/interface/IJavascriptCompileOption';
|
|
3
3
|
import AppUxLoader from '../loader/ux/AppUxLoader';
|
|
4
4
|
import JsLoader from '../loader/ux/JsLoader';
|
|
5
|
+
import PngLoader from '../loader/ux/PngLoader';
|
|
5
6
|
import UxLoader from '../loader/ux/UxLoader';
|
|
6
7
|
declare class UxConfig implements IFileLaneConfig<IJavascriptCompileOption> {
|
|
7
8
|
readonly projectPath: string;
|
|
@@ -21,6 +22,10 @@ declare class UxConfig implements IFileLaneConfig<IJavascriptCompileOption> {
|
|
|
21
22
|
test: RegExp[];
|
|
22
23
|
loader: (typeof JsLoader)[];
|
|
23
24
|
exclude?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
test: RegExp[];
|
|
27
|
+
loader: (typeof PngLoader)[];
|
|
28
|
+
exclude?: undefined;
|
|
24
29
|
})[];
|
|
25
30
|
};
|
|
26
31
|
preWorks: import("file-lane/lib/interface/IFileLaneConfig").PreWork<IJavascriptCompileOption>[];
|
|
@@ -78,7 +78,7 @@ UxFollowWorks.protobuf = (context, config, compilerOption) => __awaiter(void 0,
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
UxFollowWorks.jsc = (context, config, compilerOption) => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
if (compilerOption && compilerOption.
|
|
81
|
+
if (compilerOption && compilerOption.disabledJsc === false) {
|
|
82
82
|
return new Jsc_1.default(context.projectPath, path_1.default.join(context.projectPath, context.output, compilerOption.outputPath)).jsc();
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IFileLaneContext, IFileParam, ILoader } from 'file-lane';
|
|
2
|
+
import IJavascriptCompileOption from '../../compiler/javascript/interface/IJavascriptCompileOption';
|
|
2
3
|
/**
|
|
3
4
|
* JsLoader
|
|
4
5
|
*/
|
|
5
6
|
declare class JsLoader implements ILoader {
|
|
6
7
|
context: IFileLaneContext;
|
|
8
|
+
compilerOption: IJavascriptCompileOption;
|
|
7
9
|
parser(files: IFileParam<any>[]): IFileParam<any>[] | Promise<IFileParam<any>[]>;
|
|
8
10
|
}
|
|
9
11
|
export default JsLoader;
|
|
@@ -27,7 +27,7 @@ class JsLoader {
|
|
|
27
27
|
};
|
|
28
28
|
return {
|
|
29
29
|
path: item.path,
|
|
30
|
-
content: new ScriptToTypescript_1.default(project, options)
|
|
30
|
+
content: new ScriptToTypescript_1.default(project, options, this.compilerOption)
|
|
31
31
|
.translate({
|
|
32
32
|
content: new ScriptParser_1.default(options).parser(item.content.toString()).ast.content
|
|
33
33
|
}, [])
|
|
@@ -74,10 +74,13 @@ class UxLoaderUtils {
|
|
|
74
74
|
logs
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
// 区分页面组件和子组件
|
|
78
|
+
const isPageUx = UxLoaderUtils.isPageUx(context, filePath);
|
|
77
79
|
// 配置转换参数
|
|
78
80
|
const options = {
|
|
79
81
|
projectPath: context.projectPath,
|
|
80
82
|
filePath,
|
|
83
|
+
fileType: isAppUx ? 'app' : isPageUx ? 'page' : '',
|
|
81
84
|
onLog: (log) => {
|
|
82
85
|
logs.push(log);
|
|
83
86
|
}
|
|
@@ -88,8 +91,6 @@ class UxLoaderUtils {
|
|
|
88
91
|
// 区分app.ux和一般ux
|
|
89
92
|
// app.ux解析结果中加上manifest.json的内容
|
|
90
93
|
const manifestJson = `require('./manifest.json')`;
|
|
91
|
-
// 区分页面组件和子组件
|
|
92
|
-
const isPageUx = UxLoaderUtils.isPageUx(context, filePath);
|
|
93
94
|
const integrateFunction = (appImport, appStyleTree, appTemplateTree, appScriptTree) => {
|
|
94
95
|
// script代码放在第三个位置不能变化,影响更新source map
|
|
95
96
|
return isAppUx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiot-toolkit/aiotpack",
|
|
3
|
-
"version": "2.0.2-beta.
|
|
3
|
+
"version": "2.0.2-beta.4",
|
|
4
4
|
"description": "The process tool for packaging aiot projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aiotpack"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"test": "node ./__tests__/aiotpack.test.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aiot-toolkit/generator": "2.0.2-beta.
|
|
23
|
-
"@aiot-toolkit/parser": "2.0.2-beta.
|
|
22
|
+
"@aiot-toolkit/generator": "2.0.2-beta.4",
|
|
23
|
+
"@aiot-toolkit/parser": "2.0.2-beta.4",
|
|
24
24
|
"@hap-toolkit/aaptjs": "^2.0.0",
|
|
25
25
|
"babel-loader": "^9.1.3",
|
|
26
26
|
"del": "^4.1.0",
|
|
27
27
|
"fast-glob": "^3.3.2",
|
|
28
|
-
"file-lane": "2.0.2-beta.
|
|
28
|
+
"file-lane": "2.0.2-beta.4",
|
|
29
29
|
"file-loader": "^6.2.0",
|
|
30
30
|
"fs-extra": "^11.2.0",
|
|
31
31
|
"jsrsasign": "^7.2.2",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@types/jsrsasign": "^10.5.12",
|
|
40
40
|
"@types/webpack-sources": "^3.2.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "656add8e64d8101b9f3886957c5b9ae23e2e854f"
|
|
43
43
|
}
|