@zeppos/zeus-cli 1.5.14 → 1.5.15
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/modules/create.js +28 -2
- package/package.json +2 -2
- package/private-modules/zeppos-app-utils/dist/config/project.js +1 -0
- package/private-modules/zeppos-app-utils/dist/modules/create/index.js +27 -9
- package/private-modules/zeppos-app-utils/dist/modules/fetchDevices.js +4 -1
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/app.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/app.json +365 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/assets/common.r/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/assets/common.r/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/global.d.ts +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/jsconfig.json +9 -0
- package/private-modules/zeppos-app-utils/dist/public/template/os3.5/workout-extension/running-pace-master/page/common/index.js +147 -0
- package/private-modules/zeppos-app-utils/package.json +1 -1
package/modules/create.js
CHANGED
|
@@ -55,7 +55,7 @@ var path_1 = require("path");
|
|
|
55
55
|
var zeppos_app_utils_1 = require("zeppos-app-utils");
|
|
56
56
|
var AppType = zeppos_app_utils_1.config.AppType, getDeviceConf = zeppos_app_utils_1.config.getDeviceConf;
|
|
57
57
|
var inquirerFunc = function (args, _a) {
|
|
58
|
-
var appTemplateChoices = _a.appTemplateChoices, watchfaceTemplateChoices = _a.watchfaceTemplateChoices;
|
|
58
|
+
var appTemplateChoices = _a.appTemplateChoices, workoutExtTemplateChoices = _a.workoutExtTemplateChoices, watchfaceTemplateChoices = _a.watchfaceTemplateChoices;
|
|
59
59
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
60
60
|
var _b, promptAppType, _c, promptOsVersion, _d, promptTemplate, _e, promptWithAppSide, _f, promptWithSettings, _g, promptBuildTargets, _h, configVersion, _j, deviceTargets, OSV2DeviceTargetNames;
|
|
61
61
|
return __generator(this, function (_k) {
|
|
@@ -81,11 +81,14 @@ var inquirerFunc = function (args, _a) {
|
|
|
81
81
|
name: 'OSVersion',
|
|
82
82
|
type: 'list',
|
|
83
83
|
when: function (args) {
|
|
84
|
+
var isWorkoutExtension = args.appType.toLowerCase() === AppType.WORKOUT_EXTENSION;
|
|
84
85
|
var bool = !promptOsVersion || !['v1', 'v2'].includes(promptOsVersion);
|
|
85
86
|
if (!bool) {
|
|
86
87
|
args.OSVersion = promptOsVersion;
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
if (isWorkoutExtension)
|
|
90
|
+
args.OSVersion = 'v3.5';
|
|
91
|
+
return bool && !isWorkoutExtension;
|
|
89
92
|
},
|
|
90
93
|
message: 'Which OS version API to develop with?',
|
|
91
94
|
choices: function (args) {
|
|
@@ -135,6 +138,29 @@ var inquirerFunc = function (args, _a) {
|
|
|
135
138
|
], val, true);
|
|
136
139
|
}
|
|
137
140
|
},
|
|
141
|
+
{
|
|
142
|
+
name: 'template',
|
|
143
|
+
type: 'list',
|
|
144
|
+
when: function (args) {
|
|
145
|
+
var isWorkoutExtension = args.appType.toLowerCase() === AppType.WORKOUT_EXTENSION;
|
|
146
|
+
var objMap = workoutExtTemplateChoices[args.OSVersion].find(function (val) {
|
|
147
|
+
var name = val.name === 'Hello World' ? 'Hello_World' : val.name;
|
|
148
|
+
return name === promptTemplate;
|
|
149
|
+
});
|
|
150
|
+
if (isWorkoutExtension && objMap) {
|
|
151
|
+
args.template = objMap.value;
|
|
152
|
+
}
|
|
153
|
+
return isWorkoutExtension && !objMap;
|
|
154
|
+
},
|
|
155
|
+
message: 'Which app template do you want to use?',
|
|
156
|
+
choices: function (args) {
|
|
157
|
+
var val = workoutExtTemplateChoices[args.OSVersion] || [];
|
|
158
|
+
return __spreadArray([
|
|
159
|
+
new inquirer_1["default"].Separator(),
|
|
160
|
+
new inquirer_1["default"].Separator('Choose a app template')
|
|
161
|
+
], val, true);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
138
164
|
{
|
|
139
165
|
name: 'template',
|
|
140
166
|
type: 'list',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeppos/zeus-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.15",
|
|
4
4
|
"description": "zeus mini-program tools",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"author": "zepp",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"qrcode-terminal": "^0.12.0",
|
|
22
22
|
"vorpal": "^1.12.0",
|
|
23
23
|
"yargs": "^17.5.1",
|
|
24
|
-
"@zeppos/zpm": "^3.0.
|
|
24
|
+
"@zeppos/zpm": "^3.0.25",
|
|
25
25
|
"axios": "^0.27.2",
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
27
|
"chokidar": "^3.5.3",
|
|
@@ -12,6 +12,7 @@ var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
12
12
|
var AppType;
|
|
13
13
|
(function (AppType) {
|
|
14
14
|
AppType["APP"] = "app";
|
|
15
|
+
AppType["WORKOUT_EXTENSION"] = "workout_extension";
|
|
15
16
|
AppType["WATCHFACE"] = "watchface";
|
|
16
17
|
})(AppType = exports.AppType || (exports.AppType = {}));
|
|
17
18
|
var AppSourceType;
|
|
@@ -101,7 +101,7 @@ var projectPreInstall = function (dir) {
|
|
|
101
101
|
var createX = function (cwdPath, args, func, beforeFiles) {
|
|
102
102
|
if (beforeFiles === void 0) { beforeFiles = []; }
|
|
103
103
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
104
|
-
var cmd, _a, projectName, _b, configVersion, workDir, templateDir, localTemplatesDirMap, localTemplates, allOS, appTypes, genChoices, localChoices, watchfaceTemplateChoices, appTemplateChoices, templatesInit, env, generatorMate, generatorMateKeys, choicesValueFormat, answer, choosePkg;
|
|
104
|
+
var cmd, _a, projectName, _b, configVersion, workDir, templateDir, localTemplatesDirMap, localTemplates, allOS, appTypes, genChoices, localChoices, watchfaceTemplateChoices, appTemplateChoices, workoutExtTemplateChoices, getTemplateChoices, templatesInit, env, generatorMate, generatorMateKeys, choicesValueFormat, answer, choosePkg;
|
|
105
105
|
return __generator(this, function (_c) {
|
|
106
106
|
switch (_c.label) {
|
|
107
107
|
case 0:
|
|
@@ -112,20 +112,23 @@ var createX = function (cwdPath, args, func, beforeFiles) {
|
|
|
112
112
|
localTemplatesDirMap = {
|
|
113
113
|
v1: (0, path_1.resolve)(templateDir, './os1.0'),
|
|
114
114
|
v2: (0, path_1.resolve)(templateDir, './os2.0'),
|
|
115
|
-
v3: (0, path_1.resolve)(templateDir, './os3.0')
|
|
115
|
+
v3: (0, path_1.resolve)(templateDir, './os3.0'),
|
|
116
|
+
'v3.5': (0, path_1.resolve)(templateDir, './os3.5')
|
|
116
117
|
};
|
|
117
118
|
localTemplates = Object.keys(localTemplatesDirMap).reduce(function (temps, osVersion) {
|
|
118
119
|
var dir = localTemplatesDirMap[osVersion];
|
|
119
120
|
var appDir = "".concat(dir, "/app");
|
|
120
121
|
var watchfaceDir = "".concat(dir, "/watchface");
|
|
122
|
+
var workoutExtensionDir = "".concat(dir, "/workout-extension");
|
|
121
123
|
temps[osVersion] = {
|
|
122
124
|
app: (0, fs_1.existsSync)(appDir) ? (0, fs_1.readdirSync)(appDir) : [],
|
|
123
|
-
watchface: (0, fs_1.existsSync)(watchfaceDir) ? (0, fs_1.readdirSync)(watchfaceDir) : []
|
|
125
|
+
watchface: (0, fs_1.existsSync)(watchfaceDir) ? (0, fs_1.readdirSync)(watchfaceDir) : [],
|
|
126
|
+
'workout-extension': (0, fs_1.existsSync)(workoutExtensionDir) ? (0, fs_1.readdirSync)(workoutExtensionDir) : []
|
|
124
127
|
};
|
|
125
128
|
return temps;
|
|
126
129
|
}, {});
|
|
127
|
-
allOS = ['v1', 'v2', 'v3'];
|
|
128
|
-
appTypes = ['watchface', 'app'];
|
|
130
|
+
allOS = ['v1', 'v2', 'v3', 'v3.5'];
|
|
131
|
+
appTypes = ['watchface', 'app', 'workout-extension'];
|
|
129
132
|
genChoices = function () { return allOS.reduce(function (pre, osVersion) {
|
|
130
133
|
pre[osVersion] = [];
|
|
131
134
|
return pre;
|
|
@@ -133,9 +136,17 @@ var createX = function (cwdPath, args, func, beforeFiles) {
|
|
|
133
136
|
localChoices = genChoices();
|
|
134
137
|
watchfaceTemplateChoices = { v1: [], v2: [] };
|
|
135
138
|
appTemplateChoices = genChoices();
|
|
139
|
+
workoutExtTemplateChoices = { 'v3.5': [] };
|
|
140
|
+
getTemplateChoices = function (appType) {
|
|
141
|
+
switch (appType) {
|
|
142
|
+
case 'app': return appTemplateChoices;
|
|
143
|
+
case 'watchface': return watchfaceTemplateChoices;
|
|
144
|
+
case 'workout-extension': return workoutExtTemplateChoices;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
136
147
|
templatesInit = function (os, dir) {
|
|
137
148
|
var initTemp = function (appType, dirPath, dirName) {
|
|
138
|
-
var tempChoices = appType
|
|
149
|
+
var tempChoices = getTemplateChoices(appType);
|
|
139
150
|
var tempName = (0, lodash_1.startCase)(dirName);
|
|
140
151
|
var chooseItem = {
|
|
141
152
|
name: tempName,
|
|
@@ -201,18 +212,25 @@ var createX = function (cwdPath, args, func, beforeFiles) {
|
|
|
201
212
|
};
|
|
202
213
|
choicesValueFormat(localChoices);
|
|
203
214
|
choicesValueFormat(appTemplateChoices);
|
|
215
|
+
choicesValueFormat(workoutExtTemplateChoices);
|
|
204
216
|
choicesValueFormat(watchfaceTemplateChoices);
|
|
205
217
|
return [4, func(args, {
|
|
206
218
|
appTemplateChoices: appTemplateChoices,
|
|
219
|
+
workoutExtTemplateChoices: workoutExtTemplateChoices,
|
|
207
220
|
watchfaceTemplateChoices: watchfaceTemplateChoices
|
|
208
221
|
})];
|
|
209
222
|
case 1:
|
|
210
223
|
answer = _c.sent();
|
|
211
224
|
answer.appType = answer.appType || AppType.APP;
|
|
212
225
|
answer.workDir = workDir;
|
|
213
|
-
choosePkg =
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
choosePkg = (function (appType) {
|
|
227
|
+
switch (appType.toLowerCase()) {
|
|
228
|
+
case AppType.APP: return appTemplateChoices[answer.OSVersion][answer.template];
|
|
229
|
+
case AppType.WORKOUT_EXTENSION: return workoutExtTemplateChoices[answer.OSVersion][answer.template];
|
|
230
|
+
case AppType.WATCHFACE: return watchfaceTemplateChoices[answer.OSVersion][answer.template];
|
|
231
|
+
default: return appTemplateChoices[answer.OSVersion][answer.template];
|
|
232
|
+
}
|
|
233
|
+
})(answer.appType || AppType.APP);
|
|
216
234
|
index_1.logger.info('fetching template...');
|
|
217
235
|
return [4, (0, index_1.sleep)(100)];
|
|
218
236
|
case 2:
|
|
@@ -87,7 +87,10 @@ var fetchDevicesData = function (cdnUrl) {
|
|
|
87
87
|
reject(new Error('CDN URL is missing'));
|
|
88
88
|
process.exit(1);
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
cdnUrl = cdnUrl + (cdnUrl.includes('?') ? '&' : '?') + 'no-cache=' + Date.now();
|
|
91
|
+
axios_1["default"].get(cdnUrl, {
|
|
92
|
+
headers: { 'Cache-Control': 'no-cache' }
|
|
93
|
+
}).then(function (res) {
|
|
91
94
|
if (res.status === 200) {
|
|
92
95
|
var data = res.data;
|
|
93
96
|
resolve(data);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "RunningPaceMaster",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "app.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@zeppos/device-types": "^3.0.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v3",
|
|
3
|
+
"app": {
|
|
4
|
+
"appId": 1047460,
|
|
5
|
+
"appName": "Running Pace Master",
|
|
6
|
+
"appType": "app",
|
|
7
|
+
"extType": "workout",
|
|
8
|
+
"version": {
|
|
9
|
+
"code": 1,
|
|
10
|
+
"name": "1.0.1"
|
|
11
|
+
},
|
|
12
|
+
"icon": "icon.png",
|
|
13
|
+
"vender": "huami",
|
|
14
|
+
"description": ""
|
|
15
|
+
},
|
|
16
|
+
"permissions": [],
|
|
17
|
+
"runtime": {
|
|
18
|
+
"apiVersion": {
|
|
19
|
+
"compatible": "3.6.0",
|
|
20
|
+
"target": "3.6.0",
|
|
21
|
+
"minVersion": "3.6.0"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"targets": {
|
|
25
|
+
"common": {
|
|
26
|
+
"module": {
|
|
27
|
+
"data-widget": {
|
|
28
|
+
"widgets": [
|
|
29
|
+
{
|
|
30
|
+
"path": "page/common/index",
|
|
31
|
+
"name": "Running Pace Master",
|
|
32
|
+
"icon": "icon.png",
|
|
33
|
+
"window": {
|
|
34
|
+
"isPinned": 1
|
|
35
|
+
},
|
|
36
|
+
"runtime": {
|
|
37
|
+
"ability": [
|
|
38
|
+
{
|
|
39
|
+
"type": 1,
|
|
40
|
+
"subType": []
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"platforms": [
|
|
49
|
+
{
|
|
50
|
+
"st": "r"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"designWidth": 480
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"i18n": {
|
|
57
|
+
"ar-EG": {
|
|
58
|
+
"data-widget": {
|
|
59
|
+
"widgets": [
|
|
60
|
+
{
|
|
61
|
+
"name": "Running Pace Master"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"ca-ES": {
|
|
67
|
+
"data-widget": {
|
|
68
|
+
"widgets": [
|
|
69
|
+
{
|
|
70
|
+
"name": "Running Pace Master"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"cs-CZ": {
|
|
76
|
+
"data-widget": {
|
|
77
|
+
"widgets": [
|
|
78
|
+
{
|
|
79
|
+
"name": "Running Pace Master"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"da-DK": {
|
|
85
|
+
"data-widget": {
|
|
86
|
+
"widgets": [
|
|
87
|
+
{
|
|
88
|
+
"name": "Running Pace Master"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"de-DE": {
|
|
94
|
+
"data-widget": {
|
|
95
|
+
"widgets": [
|
|
96
|
+
{
|
|
97
|
+
"name": "Running Pace Master"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"el-GR": {
|
|
103
|
+
"data-widget": {
|
|
104
|
+
"widgets": [
|
|
105
|
+
{
|
|
106
|
+
"name": "Running Pace Master"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"en-US": {
|
|
112
|
+
"data-widget": {
|
|
113
|
+
"widgets": [
|
|
114
|
+
{
|
|
115
|
+
"name": "Running Pace Master"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"es-ES": {
|
|
121
|
+
"data-widget": {
|
|
122
|
+
"widgets": [
|
|
123
|
+
{
|
|
124
|
+
"name": "Running Pace Master"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"fi-FI": {
|
|
130
|
+
"data-widget": {
|
|
131
|
+
"widgets": [
|
|
132
|
+
{
|
|
133
|
+
"name": "Running Pace Master"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"fr-FR": {
|
|
139
|
+
"data-widget": {
|
|
140
|
+
"widgets": [
|
|
141
|
+
{
|
|
142
|
+
"name": "Running Pace Master"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"iw-IL": {
|
|
148
|
+
"data-widget": {
|
|
149
|
+
"widgets": [
|
|
150
|
+
{
|
|
151
|
+
"name": "Running Pace Master"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"hi-IN": {
|
|
157
|
+
"data-widget": {
|
|
158
|
+
"widgets": [
|
|
159
|
+
{
|
|
160
|
+
"name": "Running Pace Master"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"hu-HU": {
|
|
166
|
+
"data-widget": {
|
|
167
|
+
"widgets": [
|
|
168
|
+
{
|
|
169
|
+
"name": "Running Pace Master"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"id-ID": {
|
|
175
|
+
"data-widget": {
|
|
176
|
+
"widgets": [
|
|
177
|
+
{
|
|
178
|
+
"name": "Running Pace Master"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"it-IT": {
|
|
184
|
+
"data-widget": {
|
|
185
|
+
"widgets": [
|
|
186
|
+
{
|
|
187
|
+
"name": "Running Pace Master"
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"ja-JP": {
|
|
193
|
+
"data-widget": {
|
|
194
|
+
"widgets": [
|
|
195
|
+
{
|
|
196
|
+
"name": "Running Pace Master"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"ko-KR": {
|
|
202
|
+
"data-widget": {
|
|
203
|
+
"widgets": [
|
|
204
|
+
{
|
|
205
|
+
"name": "Running Pace Master"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"ms-MY": {
|
|
211
|
+
"data-widget": {
|
|
212
|
+
"widgets": [
|
|
213
|
+
{
|
|
214
|
+
"name": "Running Pace Master"
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"nb-NO": {
|
|
220
|
+
"data-widget": {
|
|
221
|
+
"widgets": [
|
|
222
|
+
{
|
|
223
|
+
"name": "Running Pace Master"
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"nl-NL": {
|
|
229
|
+
"data-widget": {
|
|
230
|
+
"widgets": [
|
|
231
|
+
{
|
|
232
|
+
"name": "Running Pace Master"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"pl-PL": {
|
|
238
|
+
"data-widget": {
|
|
239
|
+
"widgets": [
|
|
240
|
+
{
|
|
241
|
+
"name": "Running Pace Master"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"pt-PT": {
|
|
247
|
+
"data-widget": {
|
|
248
|
+
"widgets": [
|
|
249
|
+
{
|
|
250
|
+
"name": "Running Pace Master"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"pt-BR": {
|
|
256
|
+
"data-widget": {
|
|
257
|
+
"widgets": [
|
|
258
|
+
{
|
|
259
|
+
"name": "Running Pace Master"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"ro-RO": {
|
|
265
|
+
"data-widget": {
|
|
266
|
+
"widgets": [
|
|
267
|
+
{
|
|
268
|
+
"name": "Running Pace Master"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"ru-RU": {
|
|
274
|
+
"data-widget": {
|
|
275
|
+
"widgets": [
|
|
276
|
+
{
|
|
277
|
+
"name": "Running Pace Master"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"sk-SK": {
|
|
283
|
+
"data-widget": {
|
|
284
|
+
"widgets": [
|
|
285
|
+
{
|
|
286
|
+
"name": "Running Pace Master"
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"sr-RS": {
|
|
292
|
+
"data-widget": {
|
|
293
|
+
"widgets": [
|
|
294
|
+
{
|
|
295
|
+
"name": "Running Pace Master"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"sv-SE": {
|
|
301
|
+
"data-widget": {
|
|
302
|
+
"widgets": [
|
|
303
|
+
{
|
|
304
|
+
"name": "Running Pace Master"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"th-TH": {
|
|
310
|
+
"data-widget": {
|
|
311
|
+
"widgets": [
|
|
312
|
+
{
|
|
313
|
+
"name": "Running Pace Master"
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"tr-TR": {
|
|
319
|
+
"data-widget": {
|
|
320
|
+
"widgets": [
|
|
321
|
+
{
|
|
322
|
+
"name": "Running Pace Master"
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"uk-UA": {
|
|
328
|
+
"data-widget": {
|
|
329
|
+
"widgets": [
|
|
330
|
+
{
|
|
331
|
+
"name": "Running Pace Master"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"vi-VN": {
|
|
337
|
+
"data-widget": {
|
|
338
|
+
"widgets": [
|
|
339
|
+
{
|
|
340
|
+
"name": "Running Pace Master"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"zh-CN": {
|
|
346
|
+
"data-widget": {
|
|
347
|
+
"widgets": [
|
|
348
|
+
{
|
|
349
|
+
"name": "跑步配速大师"
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"zh-TW": {
|
|
355
|
+
"data-widget": {
|
|
356
|
+
"widgets": [
|
|
357
|
+
{
|
|
358
|
+
"name": "跑步配速大師"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"defaultLanguage": "en-US"
|
|
365
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { createWidget, widget, align, text_style, sport_data, edit_widget_group_type } from '@zos/ui'
|
|
2
|
+
|
|
3
|
+
Page({
|
|
4
|
+
init() {
|
|
5
|
+
const bg = createWidget(widget.IMG, {
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0,
|
|
8
|
+
src: 'bg.png'
|
|
9
|
+
})
|
|
10
|
+
const text = createWidget(widget.TEXT, {
|
|
11
|
+
x: 240,
|
|
12
|
+
y: 82,
|
|
13
|
+
w: 150,
|
|
14
|
+
h: 85,
|
|
15
|
+
color: 0xffffff,
|
|
16
|
+
text_size: 30,
|
|
17
|
+
align_h: align.CENTER_H,
|
|
18
|
+
align_v: align.CENTER_V,
|
|
19
|
+
text_style: text_style.NONE,
|
|
20
|
+
text: 'BPM'
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
// Calorie
|
|
24
|
+
const widgetOptionalArray1 = [sport_data.CONSUME]
|
|
25
|
+
createWidget(widget.SPORT_DATA, {
|
|
26
|
+
edit_id: 1,
|
|
27
|
+
x: 60,
|
|
28
|
+
y: 310,
|
|
29
|
+
w: 104,
|
|
30
|
+
h: 120,
|
|
31
|
+
category: edit_widget_group_type.SPORTS,
|
|
32
|
+
default_type: sport_data.CONSUME,
|
|
33
|
+
optional_types: widgetOptionalArray1,
|
|
34
|
+
count: widgetOptionalArray1.length,
|
|
35
|
+
rect_visible: false,
|
|
36
|
+
line_color: 0x000000,
|
|
37
|
+
text_size: 50,
|
|
38
|
+
text_color: 0xffffff,
|
|
39
|
+
text_x: 0,
|
|
40
|
+
text_y: 0,
|
|
41
|
+
text_w: 170,
|
|
42
|
+
text_h: 85,
|
|
43
|
+
sub_text_visible: true,
|
|
44
|
+
sub_text_size: 24,
|
|
45
|
+
sub_text_color: 0x999999,
|
|
46
|
+
sub_text_x: 35,
|
|
47
|
+
sub_text_y: 80,
|
|
48
|
+
sub_text_w: 100,
|
|
49
|
+
sub_text_h: 30
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// Distance
|
|
53
|
+
const widgetOptionalArray2 = [sport_data.DISTANCE_TOTAL]
|
|
54
|
+
createWidget(widget.SPORT_DATA, {
|
|
55
|
+
edit_id: 2,
|
|
56
|
+
x: 195,
|
|
57
|
+
y: 310,
|
|
58
|
+
w: 104,
|
|
59
|
+
h: 120,
|
|
60
|
+
category: edit_widget_group_type.SPORTS,
|
|
61
|
+
default_type: sport_data.DISTANCE_TOTAL,
|
|
62
|
+
optional_types: widgetOptionalArray2,
|
|
63
|
+
count: widgetOptionalArray2.length,
|
|
64
|
+
line_color: 0x000000,
|
|
65
|
+
text_size: 50,
|
|
66
|
+
rect_visible: false,
|
|
67
|
+
text_color: 0xffffff,
|
|
68
|
+
text_x: 0,
|
|
69
|
+
text_y: 0,
|
|
70
|
+
text_w: 210,
|
|
71
|
+
text_h: 85,
|
|
72
|
+
sub_text_visible: true,
|
|
73
|
+
sub_text_size: 24,
|
|
74
|
+
sub_text_color: 0x999999,
|
|
75
|
+
sub_text_x: 60,
|
|
76
|
+
sub_text_y: 80,
|
|
77
|
+
sub_text_w: 100,
|
|
78
|
+
sub_text_h: 30
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// Pace
|
|
82
|
+
const widgetOptionalArray3 = [sport_data.PACE]
|
|
83
|
+
createWidget(widget.SPORT_DATA, {
|
|
84
|
+
edit_id: 3,
|
|
85
|
+
x: -5,
|
|
86
|
+
y: 170,
|
|
87
|
+
w: 168,
|
|
88
|
+
h: 135,
|
|
89
|
+
category: edit_widget_group_type.SPORTS,
|
|
90
|
+
default_type: sport_data.PACE,
|
|
91
|
+
optional_types: widgetOptionalArray3,
|
|
92
|
+
count: widgetOptionalArray3.length,
|
|
93
|
+
line_width: 0,
|
|
94
|
+
rect_visible: false,
|
|
95
|
+
line_color: 0xc1e002,
|
|
96
|
+
text_size: 90,
|
|
97
|
+
text_color: 0x000000,
|
|
98
|
+
text_x: 0,
|
|
99
|
+
text_y: 0,
|
|
100
|
+
text_w: 300,
|
|
101
|
+
text_h: 100,
|
|
102
|
+
sub_text_visible: true,
|
|
103
|
+
sub_text_size: 40,
|
|
104
|
+
sub_text_color: 0xffffff,
|
|
105
|
+
sub_text_x: 330,
|
|
106
|
+
sub_text_y: 15,
|
|
107
|
+
sub_text_w: 100,
|
|
108
|
+
sub_text_h: 100
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// Heartrate
|
|
112
|
+
const widgetOptionalArray = [sport_data.HR]
|
|
113
|
+
createWidget(widget.SPORT_DATA, {
|
|
114
|
+
edit_id: 4,
|
|
115
|
+
x: 160,
|
|
116
|
+
y: 82,
|
|
117
|
+
w: 89,
|
|
118
|
+
h: 84,
|
|
119
|
+
category: edit_widget_group_type.SPORTS,
|
|
120
|
+
default_type: sport_data.HR,
|
|
121
|
+
optional_types: widgetOptionalArray,
|
|
122
|
+
count: widgetOptionalArray.length,
|
|
123
|
+
rect_visible: false,
|
|
124
|
+
line_color: 0x000000,
|
|
125
|
+
text_size: 50,
|
|
126
|
+
text_color: 0xffffff,
|
|
127
|
+
text_x: 0,
|
|
128
|
+
text_y: 0,
|
|
129
|
+
text_w: 130,
|
|
130
|
+
text_h: 85,
|
|
131
|
+
sub_text_visible: false
|
|
132
|
+
})
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
build() {
|
|
136
|
+
this.init()
|
|
137
|
+
},
|
|
138
|
+
onInit() {},
|
|
139
|
+
|
|
140
|
+
onReady() {},
|
|
141
|
+
|
|
142
|
+
onShow() {},
|
|
143
|
+
|
|
144
|
+
onHide() {},
|
|
145
|
+
|
|
146
|
+
onDestroy() {}
|
|
147
|
+
})
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dev": "nodemon -e ts,tsx --exec \"rm -rf dist && tsc && ts-node build.ts\" --ignore types/ --ignore dist/"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@zeppos/zpm": "^3.0.
|
|
16
|
+
"@zeppos/zpm": "^3.0.25",
|
|
17
17
|
"axios": "^0.27.2",
|
|
18
18
|
"chalk": "^4.1.2",
|
|
19
19
|
"chokidar": "^3.5.3",
|