@aiot-toolkit/aiotpack 2.0.2 → 2.0.3-beta.10

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 (63) hide show
  1. package/lib/afterCompile/ux/UxAfterCompile.d.ts +1 -1
  2. package/lib/afterCompile/ux/UxAfterCompile.js +295 -243
  3. package/lib/afterCompile/xts/entryTemplate.js +111 -113
  4. package/lib/afterCompile/xts/generateRpk.js +25 -54
  5. package/lib/afterCompile/xts/ts2wasm.js +62 -63
  6. package/lib/afterWorks/ux/UxAfterWorks.js +12 -19
  7. package/lib/beforeCompile/ux/UxBeforeCompile.js +26 -28
  8. package/lib/beforeCompile/xts/preInstall.js +50 -55
  9. package/lib/beforeWorks/ux/UxBeforeWorks.js +12 -19
  10. package/lib/compiler/enum/CompileMode.js +16 -23
  11. package/lib/compiler/interface/ICompileParam.js +1 -2
  12. package/lib/compiler/interface/ICompiler.js +1 -2
  13. package/lib/compiler/interface/ISignConfig.js +1 -2
  14. package/lib/compiler/javascript/JavascriptCompiler.js +147 -154
  15. package/lib/compiler/javascript/JavascriptDefaultCompileOption.js +20 -16
  16. package/lib/compiler/javascript/android/AndroidWebpackConfigurator.js +13 -11
  17. package/lib/compiler/javascript/android/plugin/WrapPlugin.js +53 -49
  18. package/lib/compiler/javascript/interface/IJavascriptCompileOption.js +1 -2
  19. package/lib/compiler/javascript/interface/IWebpackConfigurator.js +4 -1
  20. package/lib/compiler/javascript/vela/VelaWebpackConfigurator.js +78 -75
  21. package/lib/compiler/javascript/vela/enum/BuildNameFormatType.js +30 -41
  22. package/lib/compiler/javascript/vela/enum/EntryType.js +15 -29
  23. package/lib/compiler/javascript/vela/interface/IChunk.js +4 -1
  24. package/lib/compiler/javascript/vela/interface/IManifest.js +1 -2
  25. package/lib/compiler/javascript/vela/interface/IQuickAppConfig.js +1 -2
  26. package/lib/compiler/javascript/vela/model/Package.js +80 -51
  27. package/lib/compiler/javascript/vela/plugin/WrapPlugin.js +31 -27
  28. package/lib/compiler/javascript/vela/utils/Jsc.js +30 -33
  29. package/lib/compiler/javascript/vela/utils/UxCompileUtil.js +152 -130
  30. package/lib/compiler/javascript/vela/utils/ZipUtil.d.ts +10 -2
  31. package/lib/compiler/javascript/vela/utils/ZipUtil.js +282 -267
  32. package/lib/compiler/javascript/vela/utils/signature/Base64.js +65 -67
  33. package/lib/compiler/javascript/vela/utils/signature/CRC32.js +37 -35
  34. package/lib/compiler/javascript/vela/utils/signature/SignUtil.js +755 -731
  35. package/lib/compiler/javascript/vela/utils/signature/Signer.js +24 -22
  36. package/lib/compiler/javascript/vela/utils/webpackLoader/addColSourceMap.js +47 -52
  37. package/lib/compiler/javascript/vela/utils/webpackLoader/extractMapData.js +21 -17
  38. package/lib/config/UxConfig.js +145 -173
  39. package/lib/config/XtsConfig.d.ts +2 -0
  40. package/lib/config/XtsConfig.js +30 -39
  41. package/lib/index.js +88 -41
  42. package/lib/interface/ICompileOptions.js +5 -2
  43. package/lib/interface/IDeviceList.js +1 -2
  44. package/lib/loader/ux/JsLoader.js +32 -30
  45. package/lib/loader/ux/PngLoader.js +47 -53
  46. package/lib/loader/ux/android/UxLoader.d.ts +2 -0
  47. package/lib/loader/ux/android/UxLoader.js +30 -32
  48. package/lib/loader/ux/vela/AppUxLoader.d.ts +2 -0
  49. package/lib/loader/ux/vela/AppUxLoader.js +23 -25
  50. package/lib/loader/ux/vela/HmlLoader.js +59 -55
  51. package/lib/loader/ux/vela/UxLoader.d.ts +2 -0
  52. package/lib/loader/ux/vela/UxLoader.js +29 -37
  53. package/lib/loader/xts/XtsLoader.js +55 -41
  54. package/lib/utils/BeforeCompileUtils.js +100 -95
  55. package/lib/utils/PngUtils.js +42 -36
  56. package/lib/utils/ux/ManifestSchema.js +198 -194
  57. package/lib/utils/ux/UxFileUtils.d.ts +3 -3
  58. package/lib/utils/ux/UxFileUtils.js +130 -125
  59. package/lib/utils/ux/UxLoaderUtils.js +292 -307
  60. package/lib/utils/ux/android/AndroidUx.js +88 -90
  61. package/lib/utils/xts/XtsFileLaneUtils.js +58 -65
  62. package/lib/utils/xts/XtsFollowWorks.js +122 -129
  63. package/package.json +6 -6
@@ -1,207 +1,211 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
3
7
  const ManifestSchema = {
4
- type: 'object',
5
- required: ['package', 'name', 'icon', 'versionCode', 'config', 'router'],
6
- properties: {
7
- package: {
8
+ type: 'object',
9
+ required: ['package', 'name', 'icon', 'versionCode', 'config', 'router'],
10
+ properties: {
11
+ package: {
12
+ type: 'string'
13
+ },
14
+ name: {
15
+ type: 'string'
16
+ },
17
+ icon: {
18
+ type: 'string'
19
+ },
20
+ banner: {
21
+ type: 'string'
22
+ },
23
+ versionName: {
24
+ type: 'string'
25
+ },
26
+ versionCode: {
27
+ type: ['number']
28
+ },
29
+ minPlatformVersion: {
30
+ type: ['number']
31
+ },
32
+ features: {
33
+ type: 'array',
34
+ items: {
35
+ type: 'object',
36
+ properties: {
37
+ name: {
8
38
  type: 'string'
39
+ }
40
+ }
41
+ }
42
+ },
43
+ config: {
44
+ type: 'object',
45
+ properties: {
46
+ logLevel: {
47
+ enum: ['off', 'error', 'warn', 'info', 'log', 'debug']
9
48
  },
10
- name: {
11
- type: 'string'
49
+ designWidth: {
50
+ type: ['number', 'string']
12
51
  },
13
- icon: {
14
- type: 'string'
52
+ data: {
53
+ // TODO 全局数据对象,属性名不能以$或_开头,
54
+ type: 'object'
15
55
  },
16
- banner: {
17
- type: 'string'
56
+ background: {
57
+ // TODO 更详细的后台运行配置信息,
58
+ type: 'object'
18
59
  },
19
- versionName: {
20
- type: 'string'
60
+ network: {
61
+ // TODO 更详细的网络配置信息,
62
+ type: 'object'
63
+ }
64
+ }
65
+ },
66
+ router: {
67
+ // TODO 更详细的后台运行配置信息,
68
+ type: 'object',
69
+ required: ['entry', 'pages'],
70
+ properties: {
71
+ entry: {
72
+ type: 'string'
73
+ },
74
+ // TODO 看下 key 不确定能否校验值,
75
+ pages: {
76
+ type: 'object'
77
+ },
78
+ errorPage: {
79
+ type: 'string'
80
+ },
81
+ // TODO 看下 key 不确定能否校验值,
82
+ widgets: {
83
+ type: 'object'
84
+ }
85
+ }
86
+ },
87
+ display: {
88
+ type: 'object',
89
+ properties: {
90
+ backgroundColor: {
91
+ // TODO HEXColor
92
+ type: 'string'
93
+ },
94
+ fullScreen: {
95
+ type: 'boolean'
96
+ },
97
+ titleBar: {
98
+ type: 'boolean'
99
+ },
100
+ titleBarBackgroundColor: {
101
+ // TODO HEXColor
102
+ type: 'string'
103
+ },
104
+ titleBarTextColor: {
105
+ // TODO HEXColor
106
+ type: 'string'
107
+ },
108
+ menu: {
109
+ type: 'boolean'
110
+ },
111
+ windowSoftInputMode: {
112
+ enum: ['adjustPan', 'adjustResize']
113
+ },
114
+ pages: {
115
+ type: 'object'
116
+ },
117
+ orientation: {
118
+ enum: ['portrait', 'landscape']
119
+ },
120
+ statusBarImmersive: {
121
+ type: 'boolean'
21
122
  },
22
- versionCode: {
23
- type: ['number']
24
- },
25
- minPlatformVersion: {
26
- type: ['number']
27
- },
28
- features: {
29
- type: 'array',
30
- items: {
31
- type: 'object',
32
- properties: {
33
- name: {
34
- type: 'string'
35
- }
36
- }
37
- }
38
- },
39
- config: {
40
- type: 'object',
41
- properties: {
42
- logLevel: {
43
- enum: ['off', 'error', 'warn', 'info', 'log', 'debug']
44
- },
45
- designWidth: {
46
- type: ['number', 'string']
47
- },
48
- data: {
49
- // TODO 全局数据对象,属性名不能以$或_开头,
50
- type: 'object'
51
- },
52
- background: {
53
- // TODO 更详细的后台运行配置信息,
54
- type: 'object'
55
- },
56
- network: {
57
- // TODO 更详细的网络配置信息,
58
- type: 'object'
59
- }
60
- }
61
- },
62
- router: {
63
- // TODO 更详细的后台运行配置信息,
64
- type: 'object',
65
- required: ['entry', 'pages'],
66
- properties: {
67
- entry: {
68
- type: 'string'
69
- },
70
- // TODO 看下 key 不确定能否校验值,
71
- pages: {
72
- type: 'object'
73
- },
74
- errorPage: {
75
- type: 'string'
76
- },
77
- // TODO 看下 key 不确定能否校验值,
78
- widgets: {
79
- type: 'object'
80
- }
81
- }
82
- },
83
- display: {
84
- type: 'object',
85
- properties: {
86
- backgroundColor: {
87
- // TODO HEXColor
88
- type: 'string'
89
- },
90
- fullScreen: {
91
- type: 'boolean'
92
- },
93
- titleBar: {
94
- type: 'boolean'
95
- },
96
- titleBarBackgroundColor: {
97
- // TODO HEXColor
98
- type: 'string'
99
- },
100
- titleBarTextColor: {
101
- // TODO HEXColor
102
- type: 'string'
103
- },
104
- menu: {
105
- type: 'boolean'
106
- },
107
- windowSoftInputMode: {
108
- enum: ['adjustPan', 'adjustResize']
109
- },
110
- pages: {
111
- type: 'object'
112
- },
113
- orientation: {
114
- enum: ['portrait', 'landscape']
115
- },
116
- statusBarImmersive: {
117
- type: 'boolean'
118
- },
119
- statusBarTextStyle: {
120
- enum: ['light', 'dark', 'auto']
121
- },
122
- statusBarBackgroundColor: {
123
- type: 'string'
124
- },
125
- statusBarBackgroundOpacity: {
126
- type: 'number'
127
- },
128
- fitCutout: {
129
- enum: ['none', 'portrait', 'landscape']
130
- },
131
- textSizeAdjust: {
132
- enum: ['none', 'auto']
133
- },
134
- themeMode: {
135
- enum: [-1, 0, 1]
136
- },
137
- menuBarData: {
138
- // TODO 详细校验
139
- type: 'object'
140
- },
141
- forceDark: {
142
- type: 'boolean'
143
- },
144
- pageCache: {
145
- type: 'boolean'
146
- },
147
- cacheDuration: {
148
- type: 'number'
149
- }
150
- }
151
- },
152
- subpackages: {
153
- // TODO 与后面的分包校验融合
154
- type: 'array',
155
- items: {
156
- type: 'object',
157
- properties: {
158
- name: {
159
- type: 'string'
160
- },
161
- // TODO 详细的规则校验
162
- resource: {
163
- type: 'string'
164
- }
165
- },
166
- // 是否必须?
167
- required: ['name', 'resource']
168
- }
123
+ statusBarTextStyle: {
124
+ enum: ['light', 'dark', 'auto']
125
+ },
126
+ statusBarBackgroundColor: {
127
+ type: 'string'
128
+ },
129
+ statusBarBackgroundOpacity: {
130
+ type: 'number'
131
+ },
132
+ fitCutout: {
133
+ enum: ['none', 'portrait', 'landscape']
134
+ },
135
+ textSizeAdjust: {
136
+ enum: ['none', 'auto']
137
+ },
138
+ themeMode: {
139
+ enum: [-1, 0, 1]
169
140
  },
170
141
  menuBarData: {
171
- type: 'object',
172
- properties: {
173
- menuBar: {
174
- type: 'boolean'
175
- },
176
- menuBarStyle: {
177
- enum: ['dark', 'light']
178
- },
179
- shareTitle: {
180
- type: 'string'
181
- },
182
- shareDescription: {
183
- type: 'string'
184
- },
185
- shareIcon: {
186
- type: 'string'
187
- },
188
- shareCurrentPage: {
189
- type: 'string'
190
- },
191
- shareParams: {
192
- type: 'string'
193
- },
194
- shareUrl: {
195
- type: 'string'
196
- }
197
- }
198
- },
199
- deviceTypeList: {
200
- type: 'array',
201
- items: {
202
- type: 'string'
203
- }
142
+ // TODO 详细校验
143
+ type: 'object'
144
+ },
145
+ forceDark: {
146
+ type: 'boolean'
147
+ },
148
+ pageCache: {
149
+ type: 'boolean'
150
+ },
151
+ cacheDuration: {
152
+ type: 'number'
153
+ }
154
+ }
155
+ },
156
+ subpackages: {
157
+ // TODO 与后面的分包校验融合
158
+ type: 'array',
159
+ items: {
160
+ type: 'object',
161
+ properties: {
162
+ name: {
163
+ type: 'string'
164
+ },
165
+ // TODO 详细的规则校验
166
+ resource: {
167
+ type: 'string'
168
+ }
169
+ },
170
+ // 是否必须?
171
+ required: ['name', 'resource']
172
+ }
173
+ },
174
+ menuBarData: {
175
+ type: 'object',
176
+ properties: {
177
+ menuBar: {
178
+ type: 'boolean'
179
+ },
180
+ menuBarStyle: {
181
+ enum: ['dark', 'light']
182
+ },
183
+ shareTitle: {
184
+ type: 'string'
185
+ },
186
+ shareDescription: {
187
+ type: 'string'
188
+ },
189
+ shareIcon: {
190
+ type: 'string'
191
+ },
192
+ shareCurrentPage: {
193
+ type: 'string'
194
+ },
195
+ shareParams: {
196
+ type: 'string'
197
+ },
198
+ shareUrl: {
199
+ type: 'string'
204
200
  }
201
+ }
202
+ },
203
+ deviceTypeList: {
204
+ type: 'array',
205
+ items: {
206
+ type: 'string'
207
+ }
205
208
  }
209
+ }
206
210
  };
207
- exports.default = ManifestSchema;
211
+ var _default = exports.default = ManifestSchema;
@@ -28,11 +28,11 @@ export declare class UxFileUtils {
28
28
  * @param sourceRoot 源码路径--相对项目根目录
29
29
  * @returns
30
30
  */
31
- static validateManifest(projectPath: string, sourceRoot?: string): Error[] | undefined;
31
+ static validateManifest(projectPath: string, sourceRoot?: string): void;
32
32
  /**
33
33
  * 检查 sitemap.json 文件,并显示错误信息
34
34
  *
35
- * 1. 当sitemap.json的 rules 中配置的page 不存在于 manifest.json 中时,报错并终止程序
35
+ * 1. 当sitemap.json的 rules 中配置的page 不存在于 manifest.json 中时,报错
36
36
  * @param projectPath
37
37
  * @param sourceRoot
38
38
  */
@@ -47,6 +47,6 @@ export declare class UxFileUtils {
47
47
  * @param newFileList 新文件列表
48
48
  * @returns
49
49
  */
50
- static getDiffJSON(compilation: FileLaneCompilation, newFileList: string[], buildPath: string): void;
50
+ static getDiffJSON(compilation: FileLaneCompilation, newFileList: string[], buildPath: string): string[];
51
51
  }
52
52
  export default UxFileUtils;