react-native-update-cli 1.45.6 → 1.46.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.
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/bundle.js CHANGED
@@ -787,7 +787,7 @@ function diffArgsCheck(args, options, diffFn) {
787
787
  const commands = {
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/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.0",
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/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
 
@@ -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/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);