@zeppos/zeus-cli 1.6.0 → 1.6.7-beta2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeppos/zeus-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.7-beta2",
4
4
  "description": "zeus mini-program tools",
5
5
  "main": "index.ts",
6
6
  "author": "zepp",
@@ -21,13 +21,13 @@
21
21
  "qrcode-terminal": "^0.12.0",
22
22
  "vorpal": "^1.12.0",
23
23
  "yargs": "^17.5.1",
24
- "@zeppos/form-data": "^4.0.0",
25
- "@zeppos/zpm": "^3.1.0",
24
+ "@zeppos/zpm": "^3.1.13-beta1",
26
25
  "axios": "^0.27.2",
27
26
  "chalk": "^4.1.2",
28
27
  "chokidar": "^3.5.3",
29
28
  "dotenv": "^16.0.1",
30
29
  "findup-sync": "^5.0.0",
30
+ "form-data": "^4.0.1",
31
31
  "fs-extra": "^10.1.0",
32
32
  "get-port": "5.1.1",
33
33
  "inquirer": "^8.1.2",
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -68,7 +79,7 @@ var rd = __importStar(require("rd"));
68
79
  var fs_1 = __importDefault(require("fs"));
69
80
  var path = __importStar(require("path"));
70
81
  var fs_extra_1 = __importDefault(require("fs-extra"));
71
- var form_data_1 = __importDefault(require("@zeppos/form-data"));
82
+ var form_data_1 = __importDefault(require("form-data"));
72
83
  var index_1 = require("../index");
73
84
  var lodash_1 = require("lodash");
74
85
  var lodash_2 = require("lodash");
@@ -111,11 +122,15 @@ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
111
122
  if (mode === void 0) { mode = BuildMode.PROD; }
112
123
  if (buildConfigOption === void 0) { buildConfigOption = {}; }
113
124
  return __awaiter(void 0, void 0, void 0, function () {
114
- var _a, targets, _b, sources, buildOptions, _c, js2c, _d, js2bin, _e, png2vg, _f, prune, _g, compress, _h, ip, zabName_1, distDir_1, name_1, newName_1, error_1;
115
- return __generator(this, function (_j) {
116
- switch (_j.label) {
125
+ var _a, sources_1, _b, targets, _c, sources, buildOptions, _d, js2c, _e, js2bin, _f, png2vg, _g, prune, _h, compress, _j, ip, zabName_1, distDir_1, name_1, newName_1, error_1;
126
+ return __generator(this, function (_k) {
127
+ switch (_k.label) {
117
128
  case 0:
118
- _a = buildConfigOption.targets, targets = _a === void 0 ? [] : _a, _b = buildConfigOption.sources, sources = _b === void 0 ? [] : _b;
129
+ if (buildConfigOption.sources) {
130
+ _a = buildConfigOption.sources, sources_1 = _a === void 0 ? [] : _a;
131
+ buildConfigOption = __assign(__assign({}, buildConfigOption), { sources: Array.isArray(sources_1) ? sources_1 : [sources_1] });
132
+ }
133
+ _b = buildConfigOption.targets, targets = _b === void 0 ? [] : _b, _c = buildConfigOption.sources, sources = _c === void 0 ? [] : _c;
119
134
  buildOptions = {
120
135
  path: workspace,
121
136
  buildMode: mode,
@@ -124,7 +139,7 @@ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
124
139
  jsc: TransformType.Default
125
140
  };
126
141
  if ([BuildMode.PROD, BuildMode.PREVIEW].includes(mode)) {
127
- _c = buildConfigOption || {}, js2c = _c.js2c, _d = _c.js2bin, js2bin = _d === void 0 ? true : _d, _e = _c.png2vg, png2vg = _e === void 0 ? true : _e, _f = _c.prune, prune = _f === void 0 ? true : _f, _g = _c.compress, compress = _g === void 0 ? true : _g, _h = _c.ip, ip = _h === void 0 ? BuildMode.PROD === mode : _h;
142
+ _d = buildConfigOption || {}, js2c = _d.js2c, _e = _d.js2bin, js2bin = _e === void 0 ? true : _e, _f = _d.png2vg, png2vg = _f === void 0 ? true : _f, _g = _d.prune, prune = _g === void 0 ? true : _g, _h = _d.compress, compress = _h === void 0 ? true : _h, _j = _d.ip, ip = _j === void 0 ? BuildMode.PROD === mode : _j;
128
143
  js2c = (0, tools_1.booleanString)(js2c);
129
144
  js2bin = (0, tools_1.booleanString)(js2bin);
130
145
  js2c && Object.assign(buildOptions, { jsc: TransformType.C });
@@ -136,9 +151,9 @@ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
136
151
  ip: (0, tools_1.booleanString)(ip)
137
152
  });
138
153
  }
139
- _j.label = 1;
154
+ _k.label = 1;
140
155
  case 1:
141
- _j.trys.push([1, 6, , 7]);
156
+ _k.trys.push([1, 6, , 7]);
142
157
  if (targets.length) {
143
158
  index_1.logger.info("Start building package, targets: ".concat(targets.join(', '), "."));
144
159
  }
@@ -147,10 +162,10 @@ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
147
162
  }
148
163
  if (!(mode === BuildMode.DEV && (0, lodash_1.get)(buildConfigOption, '_[0]') !== 'install')) return [3, 3];
149
164
  return [4, (0, zpm_1.startWithoutDist)(buildOptions)];
150
- case 2: return [2, _j.sent()];
165
+ case 2: return [2, _k.sent()];
151
166
  case 3: return [4, (0, zpm_1.start)(buildOptions)];
152
167
  case 4:
153
- zabName_1 = _j.sent();
168
+ zabName_1 = _k.sent();
154
169
  if (!zabName_1) {
155
170
  index_1.logger.error("Build package error, the package name is ".concat(zabName_1));
156
171
  process.exit(1);
@@ -174,7 +189,7 @@ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
174
189
  return [2, zabName_1];
175
190
  case 5: return [3, 7];
176
191
  case 6:
177
- error_1 = _j.sent();
192
+ error_1 = _k.sent();
178
193
  index_1.logger.error(error_1);
179
194
  return [3, 7];
180
195
  case 7: return [2];
@@ -138,7 +138,7 @@ var createX = function (cwdPath, args, func, beforeFiles) {
138
138
  return pre;
139
139
  }, {}); };
140
140
  localChoices = genChoices();
141
- watchfaceTemplateChoices = { v1: [], v2: [] };
141
+ watchfaceTemplateChoices = { v1: [], v2: [], 'v3': [], 'v3.5': [] };
142
142
  appTemplateChoices = genChoices();
143
143
  workoutExtTemplateChoices = { 'v3.5': [] };
144
144
  getTemplateChoices = function (appType) {
@@ -72,8 +72,8 @@ var lodash_1 = require("lodash");
72
72
  var config_1 = require("../config");
73
73
  var accountEnv = (0, config_1.getLocalConfig)().account_env;
74
74
  var LOCAL_CACHE_DEVICE_PATH = path.resolve(os.homedir(), ".zepp/.zeus_devices");
75
- var serverPath = accountEnv === 'test' ? 'https://upload-testing-cdn.huami.com/zeppos/devkit/zeus/devices.json' : 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.json';
76
- var serverPathBeta = 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.beta.json';
75
+ var serverPath = 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.json';
76
+ var serverPathBeta = 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.beta1.json';
77
77
  var DeviceScreenType;
78
78
  (function (DeviceScreenType) {
79
79
  DeviceScreenType["R"] = "r";
@@ -13,13 +13,13 @@
13
13
  "dev": "nodemon -e ts,tsx --exec \"rimraf dist && tsc && ts-node build.ts\" --ignore types/ --ignore dist/"
14
14
  },
15
15
  "dependencies": {
16
- "@zeppos/form-data": "^4.0.0",
17
- "@zeppos/zpm": "^3.1.0",
16
+ "@zeppos/zpm": "^3.1.13-beta1",
18
17
  "axios": "^0.27.2",
19
18
  "chalk": "^4.1.2",
20
19
  "chokidar": "^3.5.3",
21
20
  "dotenv": "^16.0.1",
22
21
  "findup-sync": "^5.0.0",
22
+ "form-data": "^4.0.1",
23
23
  "fs-extra": "^10.1.0",
24
24
  "get-port": "5.1.1",
25
25
  "inquirer": "^8.1.2",