@aiot-toolkit/aiotpack 2.0.3-beta.1 → 2.0.3-beta.11
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/afterCompile/ux/UxAfterCompile.js +292 -266
- package/lib/afterCompile/xts/entryTemplate.js +111 -113
- package/lib/afterCompile/xts/generateRpk.js +25 -54
- package/lib/afterCompile/xts/ts2wasm.js +62 -63
- package/lib/afterWorks/ux/UxAfterWorks.js +12 -19
- package/lib/beforeCompile/ux/UxBeforeCompile.js +26 -28
- package/lib/beforeCompile/xts/preInstall.js +50 -55
- package/lib/beforeWorks/ux/UxBeforeWorks.js +12 -19
- package/lib/compiler/enum/CompileMode.js +16 -23
- package/lib/compiler/interface/ICompileParam.js +1 -2
- package/lib/compiler/interface/ICompiler.js +1 -2
- package/lib/compiler/interface/ISignConfig.js +1 -2
- package/lib/compiler/javascript/JavascriptCompiler.js +147 -154
- package/lib/compiler/javascript/JavascriptDefaultCompileOption.js +20 -16
- package/lib/compiler/javascript/android/AndroidWebpackConfigurator.js +13 -11
- package/lib/compiler/javascript/android/plugin/WrapPlugin.js +53 -49
- package/lib/compiler/javascript/interface/IJavascriptCompileOption.js +1 -2
- package/lib/compiler/javascript/interface/IWebpackConfigurator.js +4 -1
- package/lib/compiler/javascript/vela/VelaWebpackConfigurator.js +78 -75
- package/lib/compiler/javascript/vela/enum/BuildNameFormatType.js +30 -41
- package/lib/compiler/javascript/vela/enum/EntryType.js +15 -29
- package/lib/compiler/javascript/vela/interface/IChunk.js +4 -1
- package/lib/compiler/javascript/vela/interface/IManifest.js +1 -2
- package/lib/compiler/javascript/vela/interface/IQuickAppConfig.js +1 -2
- package/lib/compiler/javascript/vela/model/Package.js +80 -51
- package/lib/compiler/javascript/vela/plugin/WrapPlugin.js +31 -27
- package/lib/compiler/javascript/vela/utils/Jsc.js +30 -33
- package/lib/compiler/javascript/vela/utils/UxCompileUtil.js +152 -130
- package/lib/compiler/javascript/vela/utils/ZipUtil.js +282 -276
- package/lib/compiler/javascript/vela/utils/signature/Base64.js +65 -67
- package/lib/compiler/javascript/vela/utils/signature/CRC32.js +37 -35
- package/lib/compiler/javascript/vela/utils/signature/SignUtil.js +755 -731
- package/lib/compiler/javascript/vela/utils/signature/Signer.js +24 -22
- package/lib/compiler/javascript/vela/utils/webpackLoader/addColSourceMap.js +47 -52
- package/lib/compiler/javascript/vela/utils/webpackLoader/extractMapData.js +21 -17
- package/lib/config/UxConfig.js +145 -173
- package/lib/config/XtsConfig.js +30 -40
- package/lib/index.js +88 -41
- package/lib/interface/ICompileOptions.js +5 -2
- package/lib/interface/IDeviceList.js +1 -2
- package/lib/loader/ux/JsLoader.js +32 -30
- package/lib/loader/ux/PngLoader.js +47 -53
- package/lib/loader/ux/android/UxLoader.js +30 -31
- package/lib/loader/ux/vela/AppUxLoader.js +23 -24
- package/lib/loader/ux/vela/HmlLoader.js +59 -55
- package/lib/loader/ux/vela/UxLoader.js +29 -35
- package/lib/loader/xts/XtsLoader.js +55 -41
- package/lib/utils/BeforeCompileUtils.js +100 -95
- package/lib/utils/PngUtils.js +42 -36
- package/lib/utils/ux/ManifestSchema.js +198 -194
- package/lib/utils/ux/UxFileUtils.d.ts +2 -2
- package/lib/utils/ux/UxFileUtils.js +130 -128
- package/lib/utils/ux/UxLoaderUtils.d.ts +2 -1
- package/lib/utils/ux/UxLoaderUtils.js +295 -307
- package/lib/utils/ux/android/AndroidUx.js +88 -90
- package/lib/utils/xts/XtsFileLaneUtils.js +58 -65
- package/lib/utils/xts/XtsFollowWorks.js +122 -129
- package/package.json +6 -6
|
@@ -1,207 +1,211 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
3
7
|
const ManifestSchema = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
11
|
-
|
|
49
|
+
designWidth: {
|
|
50
|
+
type: ['number', 'string']
|
|
12
51
|
},
|
|
13
|
-
|
|
14
|
-
|
|
52
|
+
data: {
|
|
53
|
+
// TODO 全局数据对象,属性名不能以$或_开头,
|
|
54
|
+
type: 'object'
|
|
15
55
|
},
|
|
16
|
-
|
|
17
|
-
|
|
56
|
+
background: {
|
|
57
|
+
// TODO 更详细的后台运行配置信息,
|
|
58
|
+
type: 'object'
|
|
18
59
|
},
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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):
|
|
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
|
*/
|