react-native-update-cli 1.45.6 → 1.46.1

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/cli.json CHANGED
@@ -57,6 +57,27 @@
57
57
  },
58
58
  "metaInfo": {
59
59
  "hasValue": true
60
+ },
61
+ "packageId": {
62
+ "hasValue": true
63
+ },
64
+ "packageVersion": {
65
+ "hasValue": true
66
+ },
67
+ "minPackageVersion": {
68
+ "hasValue": true
69
+ },
70
+ "maxPackageVersion": {
71
+ "hasValue": true
72
+ },
73
+ "packageVersionRange": {
74
+ "hasValue": true
75
+ },
76
+ "rollout": {
77
+ "hasValue": true
78
+ },
79
+ "dryRun": {
80
+ "default": false
60
81
  }
61
82
  }
62
83
  },
@@ -175,6 +196,27 @@
175
196
  "metaInfo": {
176
197
  "hasValue": true,
177
198
  "description": "Meta information for publishing"
199
+ },
200
+ "packageId": {
201
+ "hasValue": true
202
+ },
203
+ "packageVersion": {
204
+ "hasValue": true
205
+ },
206
+ "minPackageVersion": {
207
+ "hasValue": true
208
+ },
209
+ "maxPackageVersion": {
210
+ "hasValue": true
211
+ },
212
+ "packageVersionRange": {
213
+ "hasValue": true
214
+ },
215
+ "rollout": {
216
+ "hasValue": true
217
+ },
218
+ "dryRun": {
219
+ "default": false
178
220
  }
179
221
  }
180
222
  },
package/lib/app.js CHANGED
@@ -9,15 +9,15 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ appCommands: function() {
13
+ return appCommands;
14
+ },
12
15
  assertPlatform: function() {
13
16
  return assertPlatform;
14
17
  },
15
18
  chooseApp: function() {
16
19
  return chooseApp;
17
20
  },
18
- commands: function() {
19
- return commands;
20
- },
21
21
  getPlatform: function() {
22
22
  return getPlatform;
23
23
  },
@@ -108,7 +108,7 @@ async function chooseApp(platform) {
108
108
  }
109
109
  }
110
110
  }
111
- const commands = {
111
+ const appCommands = {
112
112
  createApp: async function({ options }) {
113
113
  const name = options.name || await (0, _utils.question)((0, _i18n.t)('appNameQuestion'));
114
114
  const { downloadUrl } = options;
package/lib/bundle.js CHANGED
@@ -9,8 +9,8 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- commands: function() {
13
- return commands;
12
+ bundleCommands: function() {
13
+ return bundleCommands;
14
14
  },
15
15
  enumZipEntries: function() {
16
16
  return enumZipEntries;
@@ -784,10 +784,10 @@ function diffArgsCheck(args, options, diffFn) {
784
784
  realOutput: output.replace(/\$\{time\}/g, `${Date.now()}`)
785
785
  };
786
786
  }
787
- const commands = {
787
+ const bundleCommands = {
788
788
  bundle: async ({ options })=>{
789
789
  const platform = await (0, _app.getPlatform)(options.platform);
790
- const { bundleName, entryFile, intermediaDir, output, dev, sourcemap, taro, expo, rncli, disableHermes, name, description, metaInfo } = (0, _utils.translateOptions)({
790
+ const { bundleName, entryFile, intermediaDir, output, dev, sourcemap, taro, expo, rncli, disableHermes, name, description, metaInfo, packageId, packageVersion, minPackageVersion, maxPackageVersion, packageVersionRange, rollout, dryRun } = (0, _utils.translateOptions)({
791
791
  ...options,
792
792
  tempDir: _constants.tempDir,
793
793
  platform
@@ -819,7 +819,7 @@ const commands = {
819
819
  });
820
820
  await pack(_path.default.resolve(intermediaDir), realOutput);
821
821
  if (name) {
822
- const versionName = await _versions.commands.publish({
822
+ const versionName = await _versions.versionCommands.publish({
823
823
  args: [
824
824
  realOutput
825
825
  ],
@@ -827,7 +827,14 @@ const commands = {
827
827
  platform,
828
828
  name,
829
829
  description,
830
- metaInfo
830
+ metaInfo,
831
+ packageId,
832
+ packageVersion,
833
+ minPackageVersion,
834
+ maxPackageVersion,
835
+ packageVersionRange,
836
+ rollout,
837
+ dryRun: Boolean(dryRun)
831
838
  }
832
839
  });
833
840
  if (isSentry) {
@@ -837,7 +844,7 @@ const commands = {
837
844
  } else if (!options['no-interactive']) {
838
845
  const v = await (0, _utils.question)((0, _i18n.t)('uploadBundlePrompt'));
839
846
  if (v.toLowerCase() === 'y') {
840
- const versionName = await _versions.commands.publish({
847
+ const versionName = await _versions.versionCommands.publish({
841
848
  args: [
842
849
  realOutput
843
850
  ],
package/lib/index.js CHANGED
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  const _api = require("./api");
7
7
  const _utils = require("./utils");
8
8
  const _i18n = require("./utils/i18n");
9
+ const _bundle = require("./bundle");
10
+ const _versions = require("./versions");
11
+ const _user = require("./user");
12
+ const _app = require("./app");
13
+ const _package = require("./package");
9
14
  function printUsage() {
10
15
  // const commandName = args[0];
11
16
  // TODO: print usage of commandName, or print global usage.
@@ -13,11 +18,11 @@ function printUsage() {
13
18
  process.exit(1);
14
19
  }
15
20
  const commands = {
16
- ...require('./user').commands,
17
- ...require('./bundle').commands,
18
- ...require('./app').commands,
19
- ...require('./package').commands,
20
- ...require('./versions').commands,
21
+ ..._user.userCommands,
22
+ ..._bundle.bundleCommands,
23
+ ..._app.appCommands,
24
+ ..._package.packageCommands,
25
+ ..._versions.versionCommands,
21
26
  help: printUsage
22
27
  };
23
28
  async function run() {
package/lib/package.js CHANGED
@@ -12,11 +12,11 @@ _export(exports, {
12
12
  choosePackage: function() {
13
13
  return choosePackage;
14
14
  },
15
- commands: function() {
16
- return commands;
17
- },
18
15
  listPackage: function() {
19
16
  return listPackage;
17
+ },
18
+ packageCommands: function() {
19
+ return packageCommands;
20
20
  }
21
21
  });
22
22
  const _api = require("./api");
@@ -80,7 +80,7 @@ async function choosePackage(appId) {
80
80
  }
81
81
  }
82
82
  }
83
- const commands = {
83
+ const packageCommands = {
84
84
  uploadIpa: async ({ args })=>{
85
85
  const fn = args[0];
86
86
  if (!fn || !fn.endsWith('.ipa')) {
package/lib/user.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "commands", {
5
+ Object.defineProperty(exports, "userCommands", {
6
6
  enumerable: true,
7
7
  get: function() {
8
- return commands;
8
+ return userCommands;
9
9
  }
10
10
  });
11
11
  const _utils = require("./utils");
@@ -20,7 +20,7 @@ function _interop_require_default(obj) {
20
20
  function md5(str) {
21
21
  return _crypto.default.createHash('md5').update(str).digest('hex');
22
22
  }
23
- const commands = {
23
+ const userCommands = {
24
24
  login: async ({ args })=>{
25
25
  const email = args[0] || await (0, _utils.question)('email:');
26
26
  const pwd = args[1] || await (0, _utils.question)('password:', true);
package/lib/versions.js CHANGED
@@ -12,8 +12,8 @@ _export(exports, {
12
12
  bindVersionToPackages: function() {
13
13
  return bindVersionToPackages;
14
14
  },
15
- commands: function() {
16
- return commands;
15
+ versionCommands: function() {
16
+ return versionCommands;
17
17
  }
18
18
  });
19
19
  const _api = require("./api");
@@ -137,7 +137,7 @@ const bindVersionToPackages = async ({ appId, versionId, pkgs, rollout, dryRun }
137
137
  count: pkgs.length
138
138
  }));
139
139
  };
140
- const commands = {
140
+ const versionCommands = {
141
141
  publish: async function({ args, options }) {
142
142
  const fn = args[0];
143
143
  const { name, description, metaInfo } = options;
@@ -161,15 +161,31 @@ const commands = {
161
161
  console.log((0, _i18n.t)('packageUploadSuccess', {
162
162
  id
163
163
  }));
164
- const v = await (0, _utils.question)((0, _i18n.t)('updateNativePackageQuestion'));
165
- if (v.toLowerCase() === 'y') {
164
+ const { packageId, packageVersion, packageVersionRange, minPackageVersion, maxPackageVersion, rollout, dryRun } = options;
165
+ if (packageId || packageVersion || packageVersionRange || minPackageVersion || maxPackageVersion) {
166
166
  await this.update({
167
- args: [],
168
167
  options: {
169
168
  versionId: id,
170
- platform
169
+ platform,
170
+ packageId,
171
+ packageVersion,
172
+ packageVersionRange,
173
+ minPackageVersion,
174
+ maxPackageVersion,
175
+ rollout,
176
+ dryRun
171
177
  }
172
178
  });
179
+ } else {
180
+ const q = await (0, _utils.question)((0, _i18n.t)('updateNativePackageQuestion'));
181
+ if (q.toLowerCase() === 'y') {
182
+ await this.update({
183
+ options: {
184
+ versionId: id,
185
+ platform
186
+ }
187
+ });
188
+ }
173
189
  }
174
190
  return versionName;
175
191
  },
@@ -178,9 +194,9 @@ const commands = {
178
194
  const { appId } = await (0, _app.getSelectedApp)(platform);
179
195
  await listVersions(appId);
180
196
  },
181
- update: async ({ args, options })=>{
197
+ update: async ({ options })=>{
182
198
  const platform = await (0, _app.getPlatform)(options.platform);
183
- const { appId } = await (0, _app.getSelectedApp)(platform);
199
+ const appId = options.appId || (await (0, _app.getSelectedApp)(platform)).appId;
184
200
  let versionId = options.versionId || (await chooseVersion(appId)).id;
185
201
  if (versionId === 'null') {
186
202
  versionId = undefined;
@@ -270,7 +286,7 @@ const commands = {
270
286
  dryRun: options.dryRun
271
287
  });
272
288
  },
273
- updateVersionInfo: async ({ args, options })=>{
289
+ updateVersionInfo: async ({ options })=>{
274
290
  const platform = await (0, _app.getPlatform)(options.platform);
275
291
  const { appId } = await (0, _app.getSelectedApp)(platform);
276
292
  const versionId = options.versionId || (await chooseVersion(appId)).id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "1.45.6",
3
+ "version": "1.46.1",
4
4
  "description": "command line tool for react-native-update (remote updates for react native)",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/app.ts CHANGED
@@ -66,7 +66,7 @@ export async function chooseApp(platform: Platform) {
66
66
  }
67
67
  }
68
68
 
69
- export const commands = {
69
+ export const appCommands = {
70
70
  createApp: async function ({
71
71
  options,
72
72
  }: {
package/src/bundle.ts CHANGED
@@ -19,7 +19,7 @@ import { t } from './utils/i18n';
19
19
  import { tempDir } from './utils/constants';
20
20
  import { checkLockFiles } from './utils/check-lockfile';
21
21
  import { addGitIgnore } from './utils/add-gitignore';
22
- import { commands as versionCommands } from './versions';
22
+ import { versionCommands } from './versions';
23
23
 
24
24
  type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
25
25
 
@@ -908,7 +908,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) {
908
908
  };
909
909
  }
910
910
 
911
- export const commands = {
911
+ export const bundleCommands = {
912
912
  bundle: async ({ options }) => {
913
913
  const platform = await getPlatform(options.platform);
914
914
 
@@ -926,6 +926,13 @@ export const commands = {
926
926
  name,
927
927
  description,
928
928
  metaInfo,
929
+ packageId,
930
+ packageVersion,
931
+ minPackageVersion,
932
+ maxPackageVersion,
933
+ packageVersionRange,
934
+ rollout,
935
+ dryRun,
929
936
  } = translateOptions({
930
937
  ...options,
931
938
  tempDir,
@@ -974,6 +981,13 @@ export const commands = {
974
981
  name,
975
982
  description,
976
983
  metaInfo,
984
+ packageId,
985
+ packageVersion,
986
+ minPackageVersion,
987
+ maxPackageVersion,
988
+ packageVersionRange,
989
+ rollout,
990
+ dryRun: Boolean(dryRun),
977
991
  },
978
992
  });
979
993
 
package/src/index.ts CHANGED
@@ -3,6 +3,11 @@
3
3
  import { loadSession } from './api';
4
4
  import { printVersionCommand } from './utils';
5
5
  import { t } from './utils/i18n';
6
+ import { bundleCommands } from './bundle';
7
+ import { versionCommands } from './versions';
8
+ import { userCommands } from './user';
9
+ import { appCommands } from './app';
10
+ import { packageCommands } from './package';
6
11
 
7
12
  function printUsage() {
8
13
  // const commandName = args[0];
@@ -15,11 +20,11 @@ function printUsage() {
15
20
  }
16
21
 
17
22
  const commands = {
18
- ...require('./user').commands,
19
- ...require('./bundle').commands,
20
- ...require('./app').commands,
21
- ...require('./package').commands,
22
- ...require('./versions').commands,
23
+ ...userCommands,
24
+ ...bundleCommands,
25
+ ...appCommands,
26
+ ...packageCommands,
27
+ ...versionCommands,
23
28
  help: printUsage,
24
29
  };
25
30
 
package/src/package.ts CHANGED
@@ -52,7 +52,7 @@ export async function choosePackage(appId: string) {
52
52
  }
53
53
  }
54
54
 
55
- export const commands = {
55
+ export const packageCommands = {
56
56
  uploadIpa: async ({ args }: { args: string[] }) => {
57
57
  const fn = args[0];
58
58
  if (!fn || !fn.endsWith('.ipa')) {
package/src/user.ts CHANGED
@@ -7,7 +7,7 @@ function md5(str: string) {
7
7
  return crypto.createHash('md5').update(str).digest('hex');
8
8
  }
9
9
 
10
- export const commands = {
10
+ export const userCommands = {
11
11
  login: async ({ args }: { args: string[] }) => {
12
12
  const email = args[0] || (await question('email:'));
13
13
  const pwd = args[1] || (await question('password:', true));
package/src/versions.ts CHANGED
@@ -10,7 +10,8 @@ import type { Package, Platform, Version } from 'types';
10
10
  import { satisfies } from 'compare-versions';
11
11
  import chalk from 'chalk';
12
12
 
13
- interface CommandOptions {
13
+ interface VersionCommandOptions {
14
+ appId?: string;
14
15
  name?: string;
15
16
  description?: string;
16
17
  metaInfo?: string;
@@ -156,13 +157,13 @@ export const bindVersionToPackages = async ({
156
157
  console.log(t('operationComplete', { count: pkgs.length }));
157
158
  };
158
159
 
159
- export const commands = {
160
+ export const versionCommands = {
160
161
  publish: async function ({
161
162
  args,
162
163
  options,
163
164
  }: {
164
165
  args: string[];
165
- options: CommandOptions;
166
+ options: VersionCommandOptions;
166
167
  }) {
167
168
  const fn = args[0];
168
169
  const { name, description, metaInfo } = options;
@@ -191,26 +192,52 @@ export const commands = {
191
192
  saveToLocal(fn, `${appId}/ppk/${id}.ppk`);
192
193
  console.log(t('packageUploadSuccess', { id }));
193
194
 
194
- const v = await question(t('updateNativePackageQuestion'));
195
- if (v.toLowerCase() === 'y') {
196
- await this.update({ args: [], options: { versionId: id, platform } });
195
+ const {
196
+ packageId,
197
+ packageVersion,
198
+ packageVersionRange,
199
+ minPackageVersion,
200
+ maxPackageVersion,
201
+ rollout,
202
+ dryRun,
203
+ } = options;
204
+
205
+ if (
206
+ packageId ||
207
+ packageVersion ||
208
+ packageVersionRange ||
209
+ minPackageVersion ||
210
+ maxPackageVersion
211
+ ) {
212
+ await this.update({
213
+ options: {
214
+ versionId: id,
215
+ platform,
216
+ packageId,
217
+ packageVersion,
218
+ packageVersionRange,
219
+ minPackageVersion,
220
+ maxPackageVersion,
221
+ rollout,
222
+ dryRun,
223
+ },
224
+ });
225
+ } else {
226
+ const q = await question(t('updateNativePackageQuestion'));
227
+ if (q.toLowerCase() === 'y') {
228
+ await this.update({ options: { versionId: id, platform } });
229
+ }
197
230
  }
198
231
  return versionName;
199
232
  },
200
- versions: async ({ options }: { options: CommandOptions }) => {
233
+ versions: async ({ options }: { options: VersionCommandOptions }) => {
201
234
  const platform = await getPlatform(options.platform);
202
235
  const { appId } = await getSelectedApp(platform);
203
236
  await listVersions(appId);
204
237
  },
205
- update: async ({
206
- args,
207
- options,
208
- }: {
209
- args: string[];
210
- options: CommandOptions;
211
- }) => {
238
+ update: async ({ options }: { options: VersionCommandOptions }) => {
212
239
  const platform = await getPlatform(options.platform);
213
- const { appId } = await getSelectedApp(platform);
240
+ const appId = options.appId || (await getSelectedApp(platform)).appId;
214
241
  let versionId = options.versionId || (await chooseVersion(appId)).id;
215
242
  if (versionId === 'null') {
216
243
  versionId = undefined;
@@ -309,11 +336,9 @@ export const commands = {
309
336
  });
310
337
  },
311
338
  updateVersionInfo: async ({
312
- args,
313
339
  options,
314
340
  }: {
315
- args: string[];
316
- options: CommandOptions;
341
+ options: VersionCommandOptions;
317
342
  }) => {
318
343
  const platform = await getPlatform(options.platform);
319
344
  const { appId } = await getSelectedApp(platform);