aiot-toolkit 2.0.3-beta.8 → 2.0.3
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.
|
@@ -11,7 +11,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
11
11
|
* AndroidUxBuilder
|
|
12
12
|
*/
|
|
13
13
|
class AndroidUxBuilder extends _UxBuilderBase.default {
|
|
14
|
-
params = [
|
|
14
|
+
params = [{
|
|
15
|
+
type: 'string',
|
|
16
|
+
name: 'devtool',
|
|
17
|
+
description: 'source map config'
|
|
18
|
+
}];
|
|
15
19
|
match(projectPath) {
|
|
16
20
|
return _sharedUtils.ProjectType.getProjectType(projectPath) === _sharedUtils.ProjectType.ANDDROID_UX;
|
|
17
21
|
}
|
|
@@ -3,7 +3,7 @@ import IBuilder from './IBuilder';
|
|
|
3
3
|
import UxBuilderBase, { IUxBuildOption } from './UxBuilderBase';
|
|
4
4
|
export interface IVelaUxBuilderOption extends IUxBuildOption {
|
|
5
5
|
watch?: boolean;
|
|
6
|
-
enableJsc
|
|
6
|
+
enableJsc?: boolean;
|
|
7
7
|
enableE2e?: boolean;
|
|
8
8
|
enableStats?: boolean;
|
|
9
9
|
optimizeCssAttr?: boolean;
|
|
@@ -32,6 +32,9 @@ class VelaUxStarter extends _IStarter.default {
|
|
|
32
32
|
this.event = new _events.default();
|
|
33
33
|
this.builder = new _VelaUxBuilder.default({
|
|
34
34
|
onBuildSuccess: data => {
|
|
35
|
+
_sharedUtils.ColorConsole.success({
|
|
36
|
+
word: 'build success: '
|
|
37
|
+
}, `${data.costTime}ms`);
|
|
35
38
|
this.lastRpk = data.info?.rpk;
|
|
36
39
|
this.event.emit('buildSuccess', data);
|
|
37
40
|
}
|
|
@@ -126,7 +129,7 @@ class VelaUxStarter extends _IStarter.default {
|
|
|
126
129
|
const projectInfo = _aiotpack.UxFileUtils.getMainfestInfo(projectPath, compilerOption.sourceRoot);
|
|
127
130
|
if (this.lastRpk && _fsExtra.default.existsSync(this.lastRpk)) {
|
|
128
131
|
const targetPath = await this.emulatorInstance?.pushRpk(this.lastRpk, projectInfo.package);
|
|
129
|
-
await this.emulatorInstance?.install(targetPath);
|
|
132
|
+
await this.emulatorInstance?.install(targetPath, projectInfo.package);
|
|
130
133
|
await this.emulatorInstance?.startApp(projectInfo.package, options.devtool);
|
|
131
134
|
}
|
|
132
135
|
this.event.on('buildSuccess', async data => {
|
|
@@ -137,7 +140,7 @@ class VelaUxStarter extends _IStarter.default {
|
|
|
137
140
|
await this.emulatorInstance?.reloadApp(projectInfo.package);
|
|
138
141
|
} else if (data.info?.trigger === _FileLaneTriggerType.default.START && data.info.rpk) {
|
|
139
142
|
const targetPath = await this.emulatorInstance?.pushRpk(data.info.rpk, projectInfo.package);
|
|
140
|
-
await this.emulatorInstance?.install(targetPath);
|
|
143
|
+
await this.emulatorInstance?.install(targetPath, projectInfo.package);
|
|
141
144
|
await this.emulatorInstance?.startApp(projectInfo.package, options.devtool);
|
|
142
145
|
}
|
|
143
146
|
});
|
|
@@ -57,7 +57,7 @@ class VelaVvdUtils {
|
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
// skin或者size
|
|
60
|
-
let skin
|
|
60
|
+
let skin;
|
|
61
61
|
let width = '466';
|
|
62
62
|
let height = '466';
|
|
63
63
|
// vela4.0不允许自定义分辨率
|
|
@@ -73,7 +73,7 @@ class VelaVvdUtils {
|
|
|
73
73
|
choices: skinList.map(item => {
|
|
74
74
|
return {
|
|
75
75
|
name: item.name,
|
|
76
|
-
value: item
|
|
76
|
+
value: item,
|
|
77
77
|
description: item.name
|
|
78
78
|
};
|
|
79
79
|
})
|
|
@@ -92,23 +92,26 @@ class VelaVvdUtils {
|
|
|
92
92
|
const vvdManager = new _emulator.VvdManager({
|
|
93
93
|
sdkHome: VelaVvdUtils.sdkHome
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
if ((await vvdManager.hasSDKPartUpdate()).length > 0) {
|
|
96
|
+
const downloder = await vvdManager.downloadSDK({
|
|
97
|
+
force: false,
|
|
98
|
+
cliProgress: true,
|
|
99
|
+
parallelDownloads: 6
|
|
100
|
+
});
|
|
101
|
+
await downloder.downlodPromise;
|
|
102
|
+
}
|
|
103
|
+
const imageDir = _path.default.resolve(VelaVvdUtils.sdkHome, _emulator.SDKParts.SYSTEM_IMAGES, velaImage);
|
|
102
104
|
|
|
103
105
|
// 创建vvd文本文件
|
|
104
106
|
const vvdParams = {
|
|
105
107
|
name,
|
|
106
|
-
skin,
|
|
108
|
+
skin: skin?.name,
|
|
107
109
|
width,
|
|
108
110
|
height,
|
|
109
111
|
arch: _emulator.IVvdArchType.arm,
|
|
110
112
|
imageDir,
|
|
111
113
|
imageType: velaImage,
|
|
114
|
+
'skin.path': skin?.path,
|
|
112
115
|
customLcdRadius: ''
|
|
113
116
|
};
|
|
114
117
|
VelaVvdUtils.vvdManager.createVvd(vvdParams);
|
|
@@ -118,7 +121,7 @@ class VelaVvdUtils {
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
static async checkEmulatorEnv() {
|
|
121
|
-
return (await this.vvdManager.
|
|
124
|
+
return (await this.vvdManager.hasSDKPartUpdate()).length === 0;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
/** 初始化/重置模拟器环境 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiot-toolkit",
|
|
3
|
-
"version": "2.0.3
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Tools for creating, developing, and packaging aiot applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aiot"
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"test": "node ./__tests__/aiot-toolkit.test.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aiot-toolkit/aiotpack": "2.0.3
|
|
26
|
-
"@aiot-toolkit/commander": "2.0.3
|
|
27
|
-
"@aiot-toolkit/emulator": "2.0.3
|
|
28
|
-
"@aiot-toolkit/shared-utils": "2.0.3
|
|
25
|
+
"@aiot-toolkit/aiotpack": "2.0.3",
|
|
26
|
+
"@aiot-toolkit/commander": "2.0.3",
|
|
27
|
+
"@aiot-toolkit/emulator": "2.0.3",
|
|
28
|
+
"@aiot-toolkit/shared-utils": "2.0.3",
|
|
29
29
|
"@inquirer/prompts": "^5.3.0",
|
|
30
30
|
"@miwt/adb": "^0.9.0",
|
|
31
31
|
"axios": "^1.7.4",
|
|
32
|
-
"file-lane": "2.0.3
|
|
32
|
+
"file-lane": "2.0.3",
|
|
33
33
|
"fs-extra": "^11.2.0",
|
|
34
34
|
"koa-router": "^13.0.1",
|
|
35
35
|
"lodash": "^4.17.21",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@types/qr-image": "^3.2.9",
|
|
44
44
|
"@types/semver": "^7.5.8"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e29e61eb89c2559eb9f3a18c51fd5ce4c4196cc2"
|
|
47
47
|
}
|