react-native-update-cli 2.9.5 → 2.9.6

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.
@@ -1,4 +1,3 @@
1
- // From https://github.com/openstf/adbkit-apkreader
2
1
  "use strict";
3
2
  Object.defineProperty(exports, "__esModule", {
4
3
  value: true
@@ -9,6 +8,7 @@ Object.defineProperty(exports, "BinaryXmlParser", {
9
8
  return BinaryXmlParser;
10
9
  }
11
10
  });
11
+ // From https://github.com/openstf/adbkit-apkreader
12
12
  const NodeType = {
13
13
  ELEMENT_NODE: 1,
14
14
  ATTRIBUTE_NODE: 2,
@@ -136,6 +136,7 @@ class BinaryXmlParser {
136
136
  return len;
137
137
  }
138
138
  readDimension() {
139
+ var _dimension_value;
139
140
  this.debug && console.group('readDimension');
140
141
  const dimension = {
141
142
  value: null,
@@ -143,7 +144,6 @@ class BinaryXmlParser {
143
144
  rawUnit: null
144
145
  };
145
146
  const value = this.readU32();
146
- var _dimension_value;
147
147
  const unit = ((_dimension_value = dimension.value) != null ? _dimension_value : 0) & 0xff;
148
148
  dimension.value = value >> 8;
149
149
  dimension.rawUnit = unit;
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- runAsCommandResult: function() {
12
+ get runAsCommandResult () {
13
13
  return runAsCommandResult;
14
14
  },
15
- toErrorMessage: function() {
15
+ get toErrorMessage () {
16
16
  return toErrorMessage;
17
17
  }
18
18
  });
@@ -5,35 +5,35 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- IS_CRESC: function() {
12
+ get IS_CRESC () {
13
13
  return IS_CRESC;
14
14
  },
15
- credentialFile: function() {
15
+ get credentialFile () {
16
16
  return credentialFile;
17
17
  },
18
- defaultEndpoints: function() {
18
+ get defaultEndpoints () {
19
19
  return defaultEndpoints;
20
20
  },
21
- isPPKBundleFileName: function() {
21
+ get isPPKBundleFileName () {
22
22
  return isPPKBundleFileName;
23
23
  },
24
- ppkBundleFileNames: function() {
24
+ get ppkBundleFileNames () {
25
25
  return ppkBundleFileNames;
26
26
  },
27
- pricingPageUrl: function() {
27
+ get pricingPageUrl () {
28
28
  return pricingPageUrl;
29
29
  },
30
- scriptName: function() {
30
+ get scriptName () {
31
31
  return scriptName;
32
32
  },
33
- tempDir: function() {
33
+ get tempDir () {
34
34
  return tempDir;
35
35
  },
36
- updateJson: function() {
36
+ get updateJson () {
37
37
  return updateJson;
38
38
  }
39
39
  });
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getBaseUrl: function() {
12
+ get getBaseUrl () {
13
13
  return getBaseUrl;
14
14
  },
15
- ping: function() {
15
+ get ping () {
16
16
  return ping;
17
17
  },
18
- promiseAny: function() {
18
+ get promiseAny () {
19
19
  return promiseAny;
20
20
  },
21
- testUrls: function() {
21
+ get testUrls () {
22
22
  return testUrls;
23
23
  }
24
24
  });
@@ -5,35 +5,35 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- checkPlugins: function() {
12
+ get checkPlugins () {
13
13
  return _checkplugin.checkPlugins;
14
14
  },
15
- getAabInfo: function() {
15
+ get getAabInfo () {
16
16
  return getAabInfo;
17
17
  },
18
- getApkInfo: function() {
18
+ get getApkInfo () {
19
19
  return getApkInfo;
20
20
  },
21
- getAppInfo: function() {
21
+ get getAppInfo () {
22
22
  return getAppInfo;
23
23
  },
24
- getIpaInfo: function() {
24
+ get getIpaInfo () {
25
25
  return getIpaInfo;
26
26
  },
27
- printVersionCommand: function() {
27
+ get printVersionCommand () {
28
28
  return printVersionCommand;
29
29
  },
30
- question: function() {
30
+ get question () {
31
31
  return question;
32
32
  },
33
- saveToLocal: function() {
33
+ get saveToLocal () {
34
34
  return saveToLocal;
35
35
  },
36
- translateOptions: function() {
36
+ get translateOptions () {
37
37
  return translateOptions;
38
38
  }
39
39
  });
@@ -254,7 +254,7 @@ const checkVersions = async (packages, skipMissing, options = {
254
254
  }
255
255
  if (skipMissing) {
256
256
  latestVersionPackages = latestVersionPackages.filter((pkg)=>{
257
- var _pkg_local, _ref;
257
+ var _ref, _pkg_local;
258
258
  return (_ref = (_pkg_local = pkg.local) != null ? _pkg_local : pkg.globalNpm) != null ? _ref : pkg.globalYarn;
259
259
  });
260
260
  }
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- ONE_DAY: function() {
12
+ get ONE_DAY () {
13
13
  return ONE_DAY;
14
14
  },
15
- default: function() {
15
+ get default () {
16
16
  return _default;
17
17
  }
18
18
  });
@@ -36,10 +36,10 @@ const isPackageJson = (obj)=>{
36
36
  };
37
37
  const downloadMetadata = (pkgName, options)=>{
38
38
  return new Promise((resolve, reject)=>{
39
+ var _ref;
39
40
  const i = pkgName.indexOf('/');
40
41
  const pkgScope = i !== -1 ? pkgName.slice(0, i) : '';
41
- var _options_registryUrl;
42
- const registryUrl = (_options_registryUrl = options == null ? void 0 : options.registryUrl) != null ? _options_registryUrl : (0, _registryurl.default)(pkgScope);
42
+ const registryUrl = (_ref = options == null ? void 0 : options.registryUrl) != null ? _ref : (0, _registryurl.default)(pkgScope);
43
43
  const pkgUrl = new _url.URL(encodeURIComponent(pkgName).replace(/^%40/, '@'), registryUrl);
44
44
  let requestOptions = {
45
45
  headers: {
@@ -132,8 +132,8 @@ const saveMetadataToCache = (pkg)=>{
132
132
  (0, _fs.writeFileSync)(filePath, JSON.stringify(pkg));
133
133
  };
134
134
  const getMetadataFromCache = (pkgName, options)=>{
135
- var _options_cacheMaxAge;
136
- const maxAge = (_options_cacheMaxAge = options == null ? void 0 : options.cacheMaxAge) != null ? _options_cacheMaxAge : ONE_DAY;
135
+ var _ref;
136
+ const maxAge = (_ref = options == null ? void 0 : options.cacheMaxAge) != null ? _ref : ONE_DAY;
137
137
  if (maxAge !== 0) {
138
138
  const pkgCacheFilePath = (0, _path.join)(getCacheDir(), `${pkgName}.json`);
139
139
  if ((0, _fs.existsSync)(pkgCacheFilePath)) {
@@ -205,7 +205,7 @@ const getInstalledVersion = (pkgName, location = 'local')=>{
205
205
  }
206
206
  }
207
207
  return undefined;
208
- } catch (e) {
208
+ } catch (unused) {
209
209
  return undefined;
210
210
  }
211
211
  };
@@ -233,8 +233,8 @@ const getInfo = async (pkg, options)=>{
233
233
  globalYarn
234
234
  } : false;
235
235
  } catch (err) {
236
- var _err_message;
237
- pkgInfo.error = (_err_message = err == null ? void 0 : err.message) != null ? _err_message : err;
236
+ var _ref;
237
+ pkgInfo.error = (_ref = err == null ? void 0 : err.message) != null ? _ref : err;
238
238
  }
239
239
  return pkgInfo;
240
240
  };
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getBooleanOption: function() {
12
+ get getBooleanOption () {
13
13
  return getBooleanOption;
14
14
  },
15
- getOptionalStringOption: function() {
15
+ get getOptionalStringOption () {
16
16
  return getOptionalStringOption;
17
17
  },
18
- getStringOption: function() {
18
+ get getStringOption () {
19
19
  return getStringOption;
20
20
  },
21
- toObjectState: function() {
21
+ get toObjectState () {
22
22
  return toObjectState;
23
23
  }
24
24
  });
@@ -25,11 +25,11 @@ const plugins = [
25
25
  try {
26
26
  await _fsextra.default.access('ios/sentry.properties');
27
27
  return true;
28
- } catch (e) {
28
+ } catch (unused) {
29
29
  try {
30
30
  await _fsextra.default.access('android/sentry.properties');
31
31
  return true;
32
- } catch (e) {
32
+ } catch (unused) {
33
33
  return false;
34
34
  }
35
35
  }
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- enumZipEntries: function() {
12
+ get enumZipEntries () {
13
13
  return enumZipEntries;
14
14
  },
15
- readEntry: function() {
15
+ get readEntry () {
16
16
  return readEntry;
17
17
  },
18
- readEntryPrefix: function() {
18
+ get readEntryPrefix () {
19
19
  return readEntryPrefix;
20
20
  }
21
21
  });
22
+ const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
22
23
  const _os = /*#__PURE__*/ _interop_require_default(require("os"));
23
24
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
24
- const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
25
25
  const _yauzl = require("yauzl");
26
26
  const _i18n = require("./i18n");
27
27
  function _interop_require_default(obj) {
@@ -74,6 +74,12 @@ function readEntry(entry, zipFile) {
74
74
  const buffers = [];
75
75
  return new Promise((resolve, reject)=>{
76
76
  zipFile.openReadStream(entry, (err, stream)=>{
77
+ if (err) {
78
+ return reject(err);
79
+ }
80
+ if (!stream) {
81
+ return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
82
+ }
77
83
  stream.on('data', (chunk)=>{
78
84
  buffers.push(chunk);
79
85
  });
@@ -101,36 +107,47 @@ function readEntryPrefix(entry, zipFile, maxBytes) {
101
107
  return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
102
108
  }
103
109
  let settled = false;
110
+ let expectedDestroyError;
104
111
  const cleanup = ()=>{
105
112
  stream.off('data', onData);
106
113
  stream.off('end', onEnd);
107
114
  stream.off('error', onError);
108
115
  };
109
- const finish = ()=>{
116
+ const finish = (destroyStream = false)=>{
110
117
  if (settled) {
111
118
  return;
112
119
  }
113
120
  settled = true;
114
- cleanup();
121
+ stream.off('data', onData);
122
+ stream.off('end', onEnd);
123
+ if (!destroyStream) {
124
+ stream.off('error', onError);
125
+ }
115
126
  resolve(Buffer.concat(buffers, length));
127
+ if (destroyStream) {
128
+ expectedDestroyError = new Error('zip entry prefix read complete');
129
+ stream.destroy(expectedDestroyError);
130
+ }
116
131
  };
117
132
  const onData = (chunk)=>{
118
133
  const remaining = maxBytes - length;
119
134
  if (remaining <= 0) {
120
- finish();
121
- stream.destroy();
135
+ finish(true);
122
136
  return;
123
137
  }
124
138
  const slice = chunk.length > remaining ? chunk.subarray(0, remaining) : chunk;
125
139
  buffers.push(slice);
126
140
  length += slice.length;
127
141
  if (length >= maxBytes) {
128
- finish();
129
- stream.destroy();
142
+ finish(true);
130
143
  }
131
144
  };
132
145
  const onEnd = ()=>finish();
133
146
  const onError = (error)=>{
147
+ if (settled && error === expectedDestroyError) {
148
+ cleanup();
149
+ return;
150
+ }
134
151
  if (settled) {
135
152
  return;
136
153
  }
@@ -5,28 +5,28 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- ZIP_ENTRY_SNIFF_BYTES: function() {
12
+ get ZIP_ENTRY_SNIFF_BYTES () {
13
13
  return ZIP_ENTRY_SNIFF_BYTES;
14
14
  },
15
- zipOptionsForManifestEntry: function() {
15
+ get zipOptionsForManifestEntry () {
16
16
  return zipOptionsForManifestEntry;
17
17
  },
18
- zipOptionsForPatchEntry: function() {
18
+ get zipOptionsForPatchEntry () {
19
19
  return zipOptionsForPatchEntry;
20
20
  },
21
- zipOptionsForPayloadEntry: function() {
21
+ get zipOptionsForPayloadEntry () {
22
22
  return zipOptionsForPayloadEntry;
23
23
  },
24
- zipOptionsForPayloadFile: function() {
24
+ get zipOptionsForPayloadFile () {
25
25
  return zipOptionsForPayloadFile;
26
26
  }
27
27
  });
28
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
29
28
  const _fs = /*#__PURE__*/ _interop_require_wildcard(require("fs"));
29
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
30
30
  function _interop_require_default(obj) {
31
31
  return obj && obj.__esModule ? obj : {
32
32
  default: obj
package/lib/versions.js CHANGED
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- bindVersionToPackages: function() {
12
+ get bindVersionToPackages () {
13
13
  return bindVersionToPackages;
14
14
  },
15
- versionCommands: function() {
15
+ get versionCommands () {
16
16
  return versionCommands;
17
17
  }
18
18
  });
@@ -377,12 +377,8 @@ const versionCommands = {
377
377
  let packageVersionRange = options.packageVersionRange;
378
378
  let rollout = undefined;
379
379
  if (options.rollout !== undefined) {
380
- try {
381
- rollout = Number.parseInt(options.rollout);
382
- } catch (e) {
383
- throw new Error((0, _i18n.t)('rolloutRangeError'));
384
- }
385
- if (rollout < 1 || rollout > 100) {
380
+ rollout = Number.parseInt(options.rollout, 10);
381
+ if (Number.isNaN(rollout) || rollout < 1 || rollout > 100) {
386
382
  throw new Error((0, _i18n.t)('rolloutRangeError'));
387
383
  }
388
384
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "2.9.5",
3
+ "version": "2.9.6",
4
4
  "description": "command line tool for react-native-update (remote updates for react native)",
5
5
  "main": "lib/exports.js",
6
6
  "types": "lib/exports.d.ts",
@@ -70,12 +70,12 @@
70
70
  "commander": "^13",
71
71
  "compare-versions": "^6.1.1",
72
72
  "filesize-parser": "^1.5.1",
73
- "form-data": "^4.0.2",
73
+ "form-data": "^4.0.5",
74
74
  "fs-extra": "8",
75
75
  "global-dirs": "^4.0.0",
76
76
  "gradle-to-js": "^2.0.1",
77
77
  "i18next": "^24.2.3",
78
- "isomorphic-git": "^1.30.1",
78
+ "isomorphic-git": "^1.37.5",
79
79
  "isomorphic-unzip": "^1.1.5",
80
80
  "node-fetch": "^2.6.1",
81
81
  "plist": "^3.1.0",
@@ -83,31 +83,31 @@
83
83
  "properties": "^1.2.1",
84
84
  "protobufjs": "^7.5.4",
85
85
  "read": "^4.1.0",
86
- "registry-auth-token": "^5.1.0",
87
- "semver": "^7.7.2",
86
+ "registry-auth-token": "^5.1.1",
87
+ "semver": "^7.7.4",
88
88
  "tcp-ping": "^0.1.1",
89
89
  "tty-table": "4.2",
90
- "yauzl": "^3.2.0",
90
+ "yauzl": "^3.3.0",
91
91
  "yazl": "3.3.1"
92
92
  },
93
93
  "engines": {
94
94
  "node": ">= 14"
95
95
  },
96
96
  "devDependencies": {
97
- "@biomejs/biome": "^1.9.4",
98
- "@swc/cli": "0.7.7",
99
- "@swc/core": "^1.11.24",
100
- "@types/bun": "^1.3.8",
97
+ "@biomejs/biome": "^2.4.11",
98
+ "@swc/cli": "0.8.1",
99
+ "@swc/core": "^1.15.24",
100
+ "@types/bun": "^1.3.12",
101
101
  "@types/filesize-parser": "^1.5.3",
102
102
  "@types/fs-extra": "^11.0.4",
103
- "@types/node": "^22.15.18",
104
- "@types/node-fetch": "^2.6.12",
103
+ "@types/node": "^25.6.0",
104
+ "@types/node-fetch": "^2.6.13",
105
105
  "@types/progress": "^2.0.7",
106
- "@types/semver": "^7.7.0",
106
+ "@types/semver": "^7.7.1",
107
107
  "@types/tcp-ping": "^0.1.6",
108
108
  "@types/yauzl": "^2.10.3",
109
109
  "@types/yazl": "^2.4.6",
110
- "typescript": "^5.8.3"
110
+ "typescript": "^6.0.2"
111
111
  },
112
112
  "trustedDependencies": [
113
113
  "@biomejs/biome",
package/src/api.ts CHANGED
@@ -98,7 +98,13 @@ async function query(url: string, options: fetch.RequestInit) {
98
98
  let json: any;
99
99
  try {
100
100
  json = JSON.parse(text);
101
- } catch (e) {}
101
+ } catch (e) {
102
+ if (resp.status === 200 && text) {
103
+ console.warn(
104
+ `Warning: API returned 200 with non-JSON body (${text.length} bytes)`,
105
+ );
106
+ }
107
+ }
102
108
 
103
109
  if (resp.status !== 200) {
104
110
  const message = json?.message || resp.statusText || `HTTP ${resp.status}`;
package/src/app.ts CHANGED
@@ -112,7 +112,7 @@ export const appCommands = {
112
112
  options: { platform: Platform };
113
113
  }) => {
114
114
  const { platform } = options;
115
- const id = args[0] || chooseApp(platform);
115
+ const id = args[0] || (await chooseApp(platform)).id;
116
116
  if (!id) {
117
117
  console.log(t('cancelled'));
118
118
  }
@@ -139,7 +139,9 @@ export const appCommands = {
139
139
  Record<Platform, { appId: number; appKey: string }>
140
140
  > = {};
141
141
  try {
142
- updateInfo = JSON.parse(await fs.promises.readFile('update.json', 'utf8'));
142
+ updateInfo = JSON.parse(
143
+ await fs.promises.readFile('update.json', 'utf8'),
144
+ );
143
145
  } catch (e: any) {
144
146
  if (e.code !== 'ENOENT') {
145
147
  console.error(t('failedToParseUpdateJson'));