@zeppos/zeus-cli 1.7.10 → 1.8.0

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 (39) hide show
  1. package/bin/main.js +85 -30
  2. package/bin/post-command.js +1 -1
  3. package/index.js +1 -1
  4. package/modules/bridge.js +43 -33
  5. package/modules/build.js +72 -36
  6. package/modules/create.js +213 -216
  7. package/modules/help.js +21 -11
  8. package/modules/prune.js +1 -1
  9. package/modules/run.js +29 -17
  10. package/modules/version.js +5 -6
  11. package/modules/yargsCmdBuilders.js +3 -3
  12. package/package.json +6 -4
  13. package/private-modules/zeppos-app-utils/dist/api/index.js +18 -20
  14. package/private-modules/zeppos-app-utils/dist/config/device.js +19 -17
  15. package/private-modules/zeppos-app-utils/dist/config/index.js +1 -1
  16. package/private-modules/zeppos-app-utils/dist/config/project.js +14 -14
  17. package/private-modules/zeppos-app-utils/dist/hm-analytics.js +14 -13
  18. package/private-modules/zeppos-app-utils/dist/index.js +18 -8
  19. package/private-modules/zeppos-app-utils/dist/logger/index.js +5 -5
  20. package/private-modules/zeppos-app-utils/dist/logger/my-logger.js +1 -1
  21. package/private-modules/zeppos-app-utils/dist/modules/build.js +73 -46
  22. package/private-modules/zeppos-app-utils/dist/modules/config.js +14 -12
  23. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +71 -39
  24. package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +82 -66
  25. package/private-modules/zeppos-app-utils/dist/modules/create/yeoman-app.js +6 -6
  26. package/private-modules/zeppos-app-utils/dist/modules/fetchDevices.js +73 -40
  27. package/private-modules/zeppos-app-utils/dist/modules/index.js +1 -1
  28. package/private-modules/zeppos-app-utils/dist/modules/login.js +16 -15
  29. package/private-modules/zeppos-app-utils/dist/modules/open/index.js +62 -50
  30. package/private-modules/zeppos-app-utils/dist/modules/prune.js +5 -5
  31. package/private-modules/zeppos-app-utils/dist/modules/status.js +12 -12
  32. package/private-modules/zeppos-app-utils/dist/simulator.js +3 -3
  33. package/private-modules/zeppos-app-utils/dist/storage/index.js +7 -7
  34. package/private-modules/zeppos-app-utils/dist/tools/index.js +24 -14
  35. package/private-modules/zeppos-app-utils/dist/tools/tools.js +3 -3
  36. package/private-modules/zeppos-app-utils/dist/websocket.js +9 -9
  37. package/private-modules/zeppos-app-utils/package.json +2 -1
  38. package/utils/pre-check.js +52 -29
  39. package/utils/tools.js +4 -4
package/modules/run.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,8 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
45
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
47
  function verb(n) { return function (v) { return step([n, v]); }; }
38
48
  function step(op) {
39
49
  if (f) throw new TypeError("Generator is already executing.");
@@ -61,7 +71,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
61
71
  var __importDefault = (this && this.__importDefault) || function (mod) {
62
72
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
73
  };
64
- exports.__esModule = true;
74
+ Object.defineProperty(exports, "__esModule", { value: true });
65
75
  exports.run = void 0;
66
76
  var inquirer_1 = __importDefault(require("inquirer"));
67
77
  var build_1 = require("./build");
@@ -81,7 +91,7 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
81
91
  simulatorHost = zeppos_app_utils_1.instanceStorage.getStorage()[simulatorStorageKey.simulatorHost];
82
92
  simulatorPort = zeppos_app_utils_1.instanceStorage.getStorage()[simulatorStorageKey.simulatorPort] || DEFAULT_PORT;
83
93
  }
84
- return [4, inquirer_1["default"].prompt([
94
+ return [4, inquirer_1.default.prompt([
85
95
  {
86
96
  name: 'host',
87
97
  type: 'input',
@@ -91,8 +101,8 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
91
101
  }
92
102
  return !promptSimulatorHost && !simulatorHost;
93
103
  },
94
- "default": DEFAULT_HOST,
95
- message: "simulator host (".concat(DEFAULT_HOST, "):")
104
+ default: DEFAULT_HOST,
105
+ message: "simulator host (".concat(DEFAULT_HOST, "):"),
96
106
  },
97
107
  {
98
108
  name: 'port',
@@ -103,9 +113,9 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
103
113
  }
104
114
  return !promptSimulatorPort && !simulatorPort;
105
115
  },
106
- "default": DEFAULT_PORT,
107
- message: "simulator port (".concat(DEFAULT_PORT, "):")
108
- }
116
+ default: DEFAULT_PORT,
117
+ message: "simulator port (".concat(DEFAULT_PORT, "):"),
118
+ },
109
119
  ])];
110
120
  case 1:
111
121
  answer = _g.sent();
@@ -125,7 +135,9 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
125
135
  _d.apply(_c, _e.concat([_g.sent()]));
126
136
  simulatorWebSocketURL = "http://".concat(simulatorHost, ":").concat(simulatorPort);
127
137
  root = path.resolve('./');
128
- zeppos_app_utils_1.modules.runX(root, args, simulatorWebSocketURL);
138
+ return [4, zeppos_app_utils_1.modules.runX(root, args, simulatorWebSocketURL)];
139
+ case 3:
140
+ _g.sent();
129
141
  return [2];
130
142
  }
131
143
  });
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
- exports.__esModule = true;
4
- exports.zeusCurrentVersion = exports.version = void 0;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.version = version;
5
+ exports.zeusCurrentVersion = zeusCurrentVersion;
5
6
  var node_child_process_1 = require("node:child_process");
6
7
  var appUtilPkg = require('zeppos-app-utils/package.json');
7
8
  var zeusVersion = require('../package.json').version;
@@ -12,7 +13,7 @@ function getNodeVersions() {
12
13
  var npmVersion = (0, node_child_process_1.execSync)('npm -v').toString().trim();
13
14
  return {
14
15
  node: nodeVersion,
15
- npm: npmVersion
16
+ npm: npmVersion,
16
17
  };
17
18
  }
18
19
  catch (error) {
@@ -30,11 +31,9 @@ function version() {
30
31
  "node: ".concat(green(nodeVersion.node)),
31
32
  "npm: ".concat(green(nodeVersion.npm)),
32
33
  "zeus: ".concat(green(zeusVersion)),
33
- "zpm: ".concat(green(versionNum))
34
+ "zpm: ".concat(green(versionNum)),
34
35
  ].join('\n');
35
36
  }
36
- exports.version = version;
37
37
  function zeusCurrentVersion() {
38
38
  return zeusVersion;
39
39
  }
40
- exports.zeusCurrentVersion = zeusCurrentVersion;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsCmdBuilders = void 0;
4
4
  exports.yargsCmdBuilders = {
5
5
  dev: function (yargs) {
@@ -8,8 +8,8 @@ exports.yargsCmdBuilders = {
8
8
  .option('target', {
9
9
  alias: 't',
10
10
  type: 'string',
11
- describe: 'Setting the preview target'
11
+ describe: 'Setting the preview target',
12
12
  })
13
13
  .help();
14
- }
14
+ },
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeppos/zeus-cli",
3
- "version": "1.7.10",
3
+ "version": "1.8.0",
4
4
  "description": "zeus mini-program tools",
5
5
  "main": "index.ts",
6
6
  "author": "zepp",
@@ -17,11 +17,12 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "dayjs": "^1.11.13",
20
+ "fs-extra": "^10.1.0",
20
21
  "package-json": "^7.0.0",
21
22
  "qrcode-terminal": "^0.12.0",
22
23
  "vorpal": "^1.12.0",
23
24
  "yargs": "^17.7.2",
24
- "@zeppos/zpm": "^3.2.8",
25
+ "@zeppos/zpm": "^3.3.0",
25
26
  "axios": "1.8.2",
26
27
  "chalk": "^4.1.2",
27
28
  "chokidar": "^3.6.0",
@@ -29,12 +30,12 @@
29
30
  "dotenv": "^16.4.5",
30
31
  "findup-sync": "^5.0.0",
31
32
  "form-data": "^4.0.1",
32
- "fs-extra": "^10.1.0",
33
33
  "get-port": "5.1.1",
34
34
  "inquirer": "^8.2.6",
35
35
  "is-docker": "^2.2.1",
36
36
  "is-wsl": "^2.2.0",
37
37
  "lodash": "^4.17.21",
38
+ "ora": "^9.0.0",
38
39
  "parse-gitignore": "^2.0.0",
39
40
  "qs": "^6.13.1",
40
41
  "rd": "^2.0.1",
@@ -51,11 +52,12 @@
51
52
  "module-alias": "^2.2.2"
52
53
  },
53
54
  "devDependencies": {
55
+ "@types/fs-extra": "^9.0.13",
56
+ "@types/node": "^24.10.1",
54
57
  "@types/qrcode-terminal": "^0.12.2",
55
58
  "@types/yargs": "^17.0.33",
56
59
  "rimraf": "^6.0.1",
57
60
  "@types/findup-sync": "^4.0.5",
58
- "@types/fs-extra": "^9.0.13",
59
61
  "@types/parse-gitignore": "^1.0.2",
60
62
  "@types/stoppable": "^1.1.3",
61
63
  "@types/update-notifier": "5.0.0",
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -49,13 +49,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
- exports.__esModule = true;
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.downloadPackage = exports.uploadPackage = exports.getUserInfo = exports.getConnectDevServerWebSocketCode = void 0;
54
54
  var axios_1 = __importDefault(require("axios"));
55
55
  var storage_1 = require("../storage");
56
- var project_1 = require("../config/project");
56
+ var config_1 = require("../config");
57
57
  var logger_1 = require("../logger");
58
- var loginStorageKey = (0, project_1.getLocalConfig)().loginStorageKey;
58
+ var loginStorageKey = (0, config_1.getLocalConfig)().loginStorageKey;
59
59
  var getConnectDevServerWebSocketCode = function () { return __awaiter(void 0, void 0, void 0, function () {
60
60
  var _a, _subRegionalHost, _b, _loginAppToken, thisUrl, url, error_1, message;
61
61
  var _c, _d;
@@ -71,10 +71,10 @@ var getConnectDevServerWebSocketCode = function () { return __awaiter(void 0, vo
71
71
  _e.trys.push([1, 3, , 4]);
72
72
  _a = process.env, _subRegionalHost = _a._subRegionalHost, _b = _a._loginAppToken, _loginAppToken = _b === void 0 ? '' : _b;
73
73
  thisUrl = "https://".concat(_subRegionalHost, "/developerbridge/client/relay");
74
- return [4, axios_1["default"].get(thisUrl, {
74
+ return [4, axios_1.default.get(thisUrl, {
75
75
  headers: {
76
- apptoken: _loginAppToken
77
- }
76
+ apptoken: _loginAppToken,
77
+ },
78
78
  })];
79
79
  case 2:
80
80
  url = (_e.sent()).data.url;
@@ -104,13 +104,13 @@ var getUserInfo = function (url, token) { return __awaiter(void 0, void 0, void
104
104
  case 0:
105
105
  headers = {
106
106
  apptoken: token,
107
- 'Content-Type': 'application/json'
107
+ 'Content-Type': 'application/json',
108
108
  };
109
109
  _a.label = 1;
110
110
  case 1:
111
111
  _a.trys.push([1, 3, , 4]);
112
- return [4, axios_1["default"].get(url, {
113
- headers: headers
112
+ return [4, axios_1.default.get(url, {
113
+ headers: headers,
114
114
  })];
115
115
  case 2:
116
116
  userInfo = _a.sent();
@@ -138,10 +138,10 @@ var uploadPackage = function (form, length) { return __awaiter(void 0, void 0, v
138
138
  _d.label = 1;
139
139
  case 1:
140
140
  _d.trys.push([1, 3, , 4]);
141
- return [4, axios_1["default"].post("https://".concat(_subRegionalHost, "/custom/tools/app-dial/upload?userid=").concat(_loginUserId), form, {
141
+ return [4, axios_1.default.post("https://".concat(_subRegionalHost, "/custom/tools/app-dial/upload?userid=").concat(_loginUserId), form, {
142
142
  headers: __assign(__assign({}, form.getHeaders()), { 'content-length': "".concat(length), apptoken: _loginAppToken }),
143
143
  maxContentLength: Infinity,
144
- maxBodyLength: Infinity
144
+ maxBodyLength: Infinity,
145
145
  })];
146
146
  case 2:
147
147
  packageInfo = _d.sent();
@@ -161,7 +161,7 @@ var uploadPackage = function (form, length) { return __awaiter(void 0, void 0, v
161
161
  }); };
162
162
  exports.uploadPackage = uploadPackage;
163
163
  var downloadPackage = function (code, deviceSource, appType) { return __awaiter(void 0, void 0, void 0, function () {
164
- var _a, _subRegionalHost, _b, _loginAppToken, _loginUserId, host, packageInfo, error_4, message;
164
+ var _a, _subRegionalHost, _b, _loginAppToken, _loginUserId, host, error_4, message;
165
165
  return __generator(this, function (_c) {
166
166
  switch (_c.label) {
167
167
  case 0:
@@ -171,14 +171,12 @@ var downloadPackage = function (code, deviceSource, appType) { return __awaiter(
171
171
  if (appType === 'app') {
172
172
  return [2, host];
173
173
  }
174
- return [4, axios_1["default"].get("".concat(host, "?userid=").concat(_loginUserId, "&deviceSource=").concat(deviceSource), {
174
+ return [4, axios_1.default.get("".concat(host, "?userid=").concat(_loginUserId, "&deviceSource=").concat(deviceSource), {
175
175
  headers: {
176
- apptoken: _loginAppToken
177
- }
176
+ apptoken: _loginAppToken,
177
+ },
178
178
  })];
179
- case 1:
180
- packageInfo = _c.sent();
181
- return [2, packageInfo];
179
+ case 1: return [2, _c.sent()];
182
180
  case 2:
183
181
  error_4 = _c.sent();
184
182
  message = typeof error_4 === 'object' ? error_4.message : error_4;
@@ -2,7 +2,7 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getDeviceConf = exports.DeviceScreenType = void 0;
7
7
  var lodash_1 = require("lodash");
8
8
  var tweetnacl_util_1 = require("tweetnacl-util");
@@ -12,8 +12,8 @@ var os_1 = __importDefault(require("os"));
12
12
  var fs_1 = __importDefault(require("fs"));
13
13
  var fs_extra_1 = __importDefault(require("fs-extra"));
14
14
  var tools_1 = require("../tools/tools");
15
- var LOCAL_CACHE_DEVICE_PATH = path_1["default"].resolve(os_1["default"].homedir(), ".zepp/.zeus_devices");
16
- var pkgInfo = require(path_1["default"].join(__dirname, '../../package.json'));
15
+ var LOCAL_CACHE_DEVICE_PATH = path_1.default.resolve(os_1.default.homedir(), ".zepp/.zeus_devices");
16
+ var pkgInfo = require(path_1.default.join(__dirname, '../../package.json'));
17
17
  var isBeta = pkgInfo.dependencies['@zeppos/zpm'].indexOf('-beta') !== -1;
18
18
  var u8Array = function (str) { return new Uint8Array(str.split(',').map(function (s) { return parseInt(s, 10); })); };
19
19
  var sharedKey = '18,53,81,26,124,228,216,202,47,58,73,19,245,186,86,169,180,116,161,250,36,203,127,120,133,126,203,121,143,100,17,44';
@@ -32,11 +32,11 @@ var DeviceScreenType;
32
32
  DeviceScreenType["R"] = "r";
33
33
  DeviceScreenType["S"] = "s";
34
34
  DeviceScreenType["B"] = "b";
35
- })(DeviceScreenType = exports.DeviceScreenType || (exports.DeviceScreenType = {}));
35
+ })(DeviceScreenType || (exports.DeviceScreenType = DeviceScreenType = {}));
36
36
  var shapeMap = {
37
37
  square: DeviceScreenType.S,
38
38
  round: DeviceScreenType.R,
39
- bar: DeviceScreenType.B
39
+ bar: DeviceScreenType.B,
40
40
  };
41
41
  function getDeviceList(localContent) {
42
42
  var deviceChannel = isBeta ? 'devices_beta' : 'devices';
@@ -47,9 +47,9 @@ function getDeviceList(localContent) {
47
47
  }
48
48
  function getDeviceInfo() {
49
49
  var localContent = {};
50
- if (fs_1["default"].existsSync(LOCAL_CACHE_DEVICE_PATH)) {
50
+ if (fs_1.default.existsSync(LOCAL_CACHE_DEVICE_PATH)) {
51
51
  try {
52
- localContent = fs_extra_1["default"].readJsonSync(LOCAL_CACHE_DEVICE_PATH);
52
+ localContent = fs_extra_1.default.readJsonSync(LOCAL_CACHE_DEVICE_PATH);
53
53
  }
54
54
  catch (_e) { }
55
55
  }
@@ -64,11 +64,11 @@ function getDeviceInfo() {
64
64
  screen: {
65
65
  type: DeviceScreenType.R,
66
66
  width: 0,
67
- height: 0
67
+ height: 0,
68
68
  },
69
69
  apiLevelLimit: {
70
- min: '1.0.0'
71
- }
70
+ min: '1.0.0',
71
+ },
72
72
  };
73
73
  var deviceInnerName = devices.reduce(function (acc, cur) {
74
74
  !info.deviceName && (info.deviceName = cur.productName);
@@ -83,18 +83,19 @@ function getDeviceInfo() {
83
83
  }
84
84
  info.platforms.push({
85
85
  name: cur.code,
86
- deviceSource: cur.deviceSource
86
+ deviceSource: cur.deviceSource,
87
87
  });
88
88
  Object.assign(info.apiLevelLimit, {
89
89
  min: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMin', '1.0.0'),
90
- max: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMax') || (0, lodash_1.get)(cur, 'value.os.version', '')
90
+ max: (0, lodash_1.get)(cur, 'value.os.apiLevel', '') || (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMax'),
91
91
  });
92
92
  return cur.code.length < acc.length ? cur.code : acc;
93
93
  }, devices[0].code);
94
94
  var lowerName = (0, lodash_1.toLower)(deviceInnerName.replace(/[^a-zA-Z]/g, ''));
95
- lowerName && Object.assign(deviceInfo, (_a = {},
96
- _a[lowerName] = info,
97
- _a));
95
+ lowerName &&
96
+ Object.assign(deviceInfo, (_a = {},
97
+ _a[lowerName] = info,
98
+ _a));
98
99
  });
99
100
  return deviceInfo;
100
101
  }
@@ -105,7 +106,8 @@ var getDeviceConf = function () {
105
106
  var min = apiLevelLimit.min, max = apiLevelLimit.max;
106
107
  if (!(0, lodash_1.isEmpty)(platforms) &&
107
108
  (0, tools_1.compareVersion)(min || '1.0.0', '2.0.0') >= 0 &&
108
- max && (0, tools_1.compareVersion)(max, '2.0.0') <= 0) {
109
+ max &&
110
+ (0, tools_1.compareVersion)(max, '2.0.0') <= 0) {
109
111
  targetDevices.push.apply(targetDevices, platforms.reduce(function (list, o) { return (0, lodash_1.compact)(list.concat([o.deviceSource])); }, []));
110
112
  }
111
113
  return targetDevices;
@@ -139,7 +141,7 @@ var getDeviceConf = function () {
139
141
  deviceTargets: deviceTargets,
140
142
  OSV2Devices: OSV2Devices,
141
143
  OSV2DeviceTargetNames: OSV2DeviceTargetNames,
142
- deviceInternalCodeName: deviceInternalCodeName
144
+ deviceInternalCodeName: deviceInternalCodeName,
143
145
  };
144
146
  };
145
147
  exports.getDeviceConf = getDeviceConf;
@@ -13,6 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
- exports.__esModule = true;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./device"), exports);
18
18
  __exportStar(require("./project"), exports);
@@ -2,7 +2,7 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getLocalConfig = exports.getLocalStorage = exports.simulatorStorageKey = exports.updateVersion = exports.zeppFontIcon = exports.ACCOUNT_ENV_KEY = exports.DEFAULT_PORT = exports.DEFAULT_HOST = exports.TemplateCopyType = exports.AppSourceType = exports.AppType = void 0;
7
7
  var dotenv_1 = __importDefault(require("dotenv"));
8
8
  var fs_1 = __importDefault(require("fs"));
@@ -14,28 +14,28 @@ var AppType;
14
14
  AppType["APP"] = "app";
15
15
  AppType["WORKOUT_EXTENSION"] = "workout_extension";
16
16
  AppType["WATCHFACE"] = "watchface";
17
- })(AppType = exports.AppType || (exports.AppType = {}));
17
+ })(AppType || (exports.AppType = AppType = {}));
18
18
  var AppSourceType;
19
19
  (function (AppSourceType) {
20
20
  AppSourceType["LOCAL"] = "local";
21
21
  AppSourceType["YEOMAN"] = "yeoman";
22
- })(AppSourceType = exports.AppSourceType || (exports.AppSourceType = {}));
22
+ })(AppSourceType || (exports.AppSourceType = AppSourceType = {}));
23
23
  var TemplateCopyType;
24
24
  (function (TemplateCopyType) {
25
25
  TemplateCopyType["CLONE"] = "clone";
26
26
  TemplateCopyType["EDIT"] = "edit";
27
- })(TemplateCopyType = exports.TemplateCopyType || (exports.TemplateCopyType = {}));
27
+ })(TemplateCopyType || (exports.TemplateCopyType = TemplateCopyType = {}));
28
28
  exports.DEFAULT_HOST = '127.0.0.1';
29
29
  exports.DEFAULT_PORT = '7650';
30
30
  exports.ACCOUNT_ENV_KEY = 'account_env';
31
- var localStoragePath = path_1["default"].resolve(os_1["default"].homedir(), ".zepp/.zeus");
31
+ var localStoragePath = path_1.default.resolve(os_1.default.homedir(), ".zepp/.zeus");
32
32
  var getLoginURL = {
33
33
  production: 'https://user.zepp.com/universalLogin/index.html#/login',
34
- test: 'https://user-testing.zepp.com/universalLogin/index.html#/login'
34
+ test: 'https://user-testing.zepp.com/universalLogin/index.html#/login',
35
35
  };
36
36
  var getAnalyticsHost = {
37
37
  production: 'https://api-analytics.zepp.com',
38
- test: 'https://api-analytics-test.zepp.com'
38
+ test: 'https://api-analytics-test.zepp.com',
39
39
  };
40
40
  exports.zeppFontIcon = [
41
41
  '',
@@ -63,11 +63,11 @@ exports.updateVersion = [
63
63
  exports.simulatorStorageKey = {
64
64
  simulatorHost: 'simulator_host',
65
65
  simulatorPort: 'simulator_port',
66
- simulatorConnectStatus: "____simulator_connect_status"
66
+ simulatorConnectStatus: "____simulator_connect_status",
67
67
  };
68
68
  var getLocalStorage = function () {
69
- fs_extra_1["default"].ensureFileSync(localStoragePath);
70
- return dotenv_1["default"].parse(fs_1["default"].readFileSync(localStoragePath));
69
+ fs_extra_1.default.ensureFileSync(localStoragePath);
70
+ return dotenv_1.default.parse(fs_1.default.readFileSync(localStoragePath));
71
71
  };
72
72
  exports.getLocalStorage = getLocalStorage;
73
73
  var getLocalConfig = function () {
@@ -79,16 +79,16 @@ var getLocalConfig = function () {
79
79
  var loginConfig = {
80
80
  LOGIN_URL: LOGIN_URL,
81
81
  PROJECT_NAME: 'zeppos_zeus_cli',
82
- PLATFORM_APP: 'com.huami.webapp'
82
+ PLATFORM_APP: 'com.huami.webapp',
83
83
  };
84
84
  var loginStorageKey = {
85
85
  accountToken: "".concat(accountPrefix, "token"),
86
86
  account: "".concat(accountPrefix, "account"),
87
87
  userid: "".concat(accountPrefix, "userid"),
88
- cname: "".concat(accountPrefix, "cname")
88
+ cname: "".concat(accountPrefix, "cname"),
89
89
  };
90
90
  var analyticsKey = {
91
- id: "".concat(accountPrefix, "analyticsId")
91
+ id: "".concat(accountPrefix, "analyticsId"),
92
92
  };
93
93
  return {
94
94
  zeusStorageInfo: zeusStorageInfo,
@@ -99,7 +99,7 @@ var getLocalConfig = function () {
99
99
  loginConfig: loginConfig,
100
100
  analyticsKey: analyticsKey,
101
101
  loginStorageKey: loginStorageKey,
102
- simulatorStorageKey: exports.simulatorStorageKey
102
+ simulatorStorageKey: exports.simulatorStorageKey,
103
103
  };
104
104
  };
105
105
  exports.getLocalConfig = getLocalConfig;
@@ -2,7 +2,7 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HM_Analytics = void 0;
7
7
  var os_1 = __importDefault(require("os"));
8
8
  var uuid_1 = require("uuid");
@@ -26,30 +26,31 @@ var HM_Analytics = function (event_id, options) {
26
26
  var eventPackage = {
27
27
  ltp: 'devops',
28
28
  c: {
29
- uid: getAnalyticsID()
29
+ uid: getAnalyticsID(),
30
30
  },
31
31
  e: [
32
32
  {
33
33
  ei: event_id,
34
34
  ep: Object.assign({
35
- platform: os_1["default"].platform(),
36
- release: os_1["default"].release(),
37
- arch: os_1["default"].arch(),
38
- node: process.version
35
+ platform: os_1.default.platform(),
36
+ release: os_1.default.release(),
37
+ arch: os_1.default.arch(),
38
+ node: process.version,
39
39
  }, options),
40
40
  et: new Date().getTime(),
41
- etp: 'cnt'
41
+ etp: 'cnt',
42
42
  },
43
- ]
43
+ ],
44
44
  };
45
45
  var eventPackageStr = Buffer.from(JSON.stringify(eventPackage)).toString('base64');
46
- axios_1["default"].post("".concat(ANALYTICS_HOST, "/api/v5/server/collect"), eventPackageStr, {
46
+ axios_1.default
47
+ .post("".concat(ANALYTICS_HOST, "/api/v5/server/collect"), eventPackageStr, {
47
48
  headers: {
48
49
  appid: analytics_app_id,
49
- 'content-type': 'text/plain'
50
+ 'content-type': 'text/plain',
50
51
  },
51
- timeout: 300
52
- })["catch"](function (_error) {
53
- });
52
+ timeout: 300,
53
+ })
54
+ .catch(function (_error) { });
54
55
  };
55
56
  exports.HM_Analytics = HM_Analytics;
@@ -18,14 +18,24 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- exports.__esModule = true;
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
29
39
  exports.modules = exports.config = exports.api = void 0;
30
40
  __exportStar(require("./storage/index"), exports);
31
41
  __exportStar(require("./logger/index"), exports);
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
- exports.__esModule = true;
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.logger = exports.LoggerInstance = void 0;
21
21
  var chalk_1 = __importDefault(require("chalk"));
22
22
  var LoggerInstance = (function () {
@@ -36,16 +36,16 @@ var LoggerInstance = (function () {
36
36
  console.log.apply(console, args);
37
37
  };
38
38
  LoggerInstance.prototype.info = function (msg) {
39
- console.log(chalk_1["default"].blue('[ℹ]'), msg);
39
+ console.log(chalk_1.default.blue('[ℹ]'), msg);
40
40
  };
41
41
  LoggerInstance.prototype.warn = function (msg) {
42
- console.log(chalk_1["default"].keyword('orange')('[⚠]'), msg);
42
+ console.log(chalk_1.default.keyword('orange')('[⚠]'), msg);
43
43
  };
44
44
  LoggerInstance.prototype.success = function (msg) {
45
- console.log(chalk_1["default"].green('[✔]'), msg);
45
+ console.log(chalk_1.default.green('[✔]'), msg);
46
46
  };
47
47
  LoggerInstance.prototype.error = function (msg) {
48
- console.log(chalk_1["default"].red('[✘]'), msg);
48
+ console.log(chalk_1.default.red('[✘]'), msg);
49
49
  };
50
50
  return LoggerInstance;
51
51
  }());
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MyLogger = void 0;
4
4
  var Methods = ['log', 'info', 'warn', 'error'];
5
5
  var MyLogger = (function () {