react-native-update-cli 2.9.5 → 2.9.7
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/lib/api.js +22 -19
- package/lib/app.js +9 -9
- package/lib/bundle-pack.js +1 -1
- package/lib/bundle-runner.js +16 -16
- package/lib/diff.js +14 -91
- package/lib/exports.d.ts +8 -8
- package/lib/exports.js +23 -23
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/module-manager.js +3 -3
- package/lib/modules/app-module.js +1 -1
- package/lib/modules/index.d.ts +3 -3
- package/lib/modules/index.js +7 -7
- package/lib/package.js +9 -9
- package/lib/utils/app-info-parser/aab.js +8 -8
- package/lib/utils/app-info-parser/ipa.js +1 -1
- package/lib/utils/app-info-parser/resource-finder.js +7 -7
- package/lib/utils/app-info-parser/utils.d.ts +1 -1
- package/lib/utils/app-info-parser/utils.js +10 -10
- package/lib/utils/app-info-parser/xml-parser/binary.js +2 -2
- package/lib/utils/command-result.js +3 -3
- package/lib/utils/constants.js +10 -10
- package/lib/utils/git.js +1 -1
- package/lib/utils/http-helper.js +5 -5
- package/lib/utils/index.js +13 -13
- package/lib/utils/latest-version/cli.js +2 -2
- package/lib/utils/latest-version/index.d.ts +1 -1
- package/lib/utils/latest-version/index.js +12 -12
- package/lib/utils/options.js +5 -5
- package/lib/utils/plugin-config.js +2 -2
- package/lib/utils/zip-entries.js +28 -11
- package/lib/utils/zip-options.d.ts +2 -1
- package/lib/utils/zip-options.js +17 -8
- package/lib/versions.d.ts +1 -1
- package/lib/versions.js +9 -13
- package/package.json +22 -19
- package/src/api.ts +11 -6
- package/src/app.ts +5 -4
- package/src/bundle-pack.ts +1 -1
- package/src/bundle-runner.ts +2 -2
- package/src/diff.ts +9 -161
- package/src/exports.ts +17 -20
- package/src/index.ts +2 -2
- package/src/modules/index.ts +3 -3
- package/src/package.ts +1 -1
- package/src/utils/app-info-parser/aab.ts +1 -1
- package/src/utils/app-info-parser/ipa.ts +1 -1
- package/src/utils/app-info-parser/utils.ts +5 -5
- package/src/utils/git.ts +1 -1
- package/src/utils/index.ts +4 -5
- package/src/utils/latest-version/cli.ts +4 -4
- package/src/utils/latest-version/index.ts +5 -6
- package/src/utils/zip-entries.ts +26 -8
- package/src/utils/zip-options.ts +7 -7
- package/src/versions.ts +11 -18
package/lib/package.js
CHANGED
|
@@ -5,26 +5,26 @@ 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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
choosePackage
|
|
12
|
+
get choosePackage () {
|
|
13
13
|
return choosePackage;
|
|
14
14
|
},
|
|
15
|
-
listPackage
|
|
15
|
+
get listPackage () {
|
|
16
16
|
return listPackage;
|
|
17
17
|
},
|
|
18
|
-
normalizeUploadBuildTime
|
|
18
|
+
get normalizeUploadBuildTime () {
|
|
19
19
|
return normalizeUploadBuildTime;
|
|
20
20
|
},
|
|
21
|
-
packageCommands
|
|
21
|
+
get packageCommands () {
|
|
22
22
|
return packageCommands;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
25
26
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
26
27
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
27
|
-
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
28
28
|
const _ttytable = /*#__PURE__*/ _interop_require_default(require("tty-table"));
|
|
29
29
|
const _api = require("./api");
|
|
30
30
|
const _app = require("./app");
|
|
@@ -123,11 +123,11 @@ async function listPackage(appId) {
|
|
|
123
123
|
const { version } = pkg;
|
|
124
124
|
let versionInfo = '';
|
|
125
125
|
if (version) {
|
|
126
|
+
var _ref, _ref1;
|
|
126
127
|
const versionObj = getVersionBinding(version);
|
|
127
|
-
var _versionObj_name, _versionObj_id;
|
|
128
128
|
versionInfo = (0, _i18n.t)('boundTo', {
|
|
129
|
-
name: (
|
|
130
|
-
id: (
|
|
129
|
+
name: (_ref = versionObj == null ? void 0 : versionObj.name) != null ? _ref : version,
|
|
130
|
+
id: (_ref1 = versionObj == null ? void 0 : versionObj.id) != null ? _ref1 : version
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
let output = pkg.name;
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "AabParser", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _child_process = require("child_process");
|
|
12
|
+
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
12
13
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
13
14
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
|
-
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
15
15
|
const _yauzl = require("yauzl");
|
|
16
16
|
const _i18n = require("../i18n");
|
|
17
17
|
const _resourcefinder = require("./resource-finder");
|
|
@@ -70,7 +70,7 @@ class AabParser extends _zip.Zip {
|
|
|
70
70
|
'--version'
|
|
71
71
|
]);
|
|
72
72
|
return false;
|
|
73
|
-
} catch (
|
|
73
|
+
} catch (unused) {
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
@@ -174,9 +174,9 @@ class AabParser extends _zip.Zip {
|
|
|
174
174
|
apkInfo = (0, _utils.mapInfoResource)(apkInfo, resourceMap);
|
|
175
175
|
}
|
|
176
176
|
} catch (e) {
|
|
177
|
-
var
|
|
177
|
+
var _ref;
|
|
178
178
|
console.warn((0, _i18n.t)('aabParseResourcesWarning', {
|
|
179
|
-
error: (
|
|
179
|
+
error: (_ref = e == null ? void 0 : e.message) != null ? _ref : e
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
182
|
return apkInfo;
|
|
@@ -203,9 +203,9 @@ class AabParser extends _zip.Zip {
|
|
|
203
203
|
});
|
|
204
204
|
return parser.parse();
|
|
205
205
|
} catch (e) {
|
|
206
|
-
var
|
|
206
|
+
var _ref;
|
|
207
207
|
throw new Error((0, _i18n.t)('aabParseManifestError', {
|
|
208
|
-
error: (
|
|
208
|
+
error: (_ref = e == null ? void 0 : e.message) != null ? _ref : e
|
|
209
209
|
}));
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -216,9 +216,9 @@ class AabParser extends _zip.Zip {
|
|
|
216
216
|
try {
|
|
217
217
|
return new _resourcefinder.ResourceFinder().processResourceTable(buffer);
|
|
218
218
|
} catch (e) {
|
|
219
|
-
var
|
|
219
|
+
var _ref;
|
|
220
220
|
throw new Error((0, _i18n.t)('aabParseResourcesError', {
|
|
221
|
-
error: (
|
|
221
|
+
error: (_ref = e == null ? void 0 : e.message) != null ? _ref : e
|
|
222
222
|
}));
|
|
223
223
|
}
|
|
224
224
|
}
|
|
@@ -13,7 +13,7 @@ const _zip = require("./zip");
|
|
|
13
13
|
const parsePlist = require('plist').parse;
|
|
14
14
|
const parseBplist = require('bplist-parser').parseBuffer;
|
|
15
15
|
const cgbiToPng = require('cgbi-to-png');
|
|
16
|
-
const PlistName = /payload\/[
|
|
16
|
+
const PlistName = /payload\/[^/]+?.app\/info.plist$/i;
|
|
17
17
|
const ProvisionName = /payload\/.+?\.app\/embedded.mobileprovision/;
|
|
18
18
|
class IpaParser extends _zip.Zip {
|
|
19
19
|
parse() {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Code translated from a C# project https://github.com/hylander0/Iteedee.ApkReader/blob/master/Iteedee.ApkReader/ApkResourceFinder.cs
|
|
3
|
-
*
|
|
4
|
-
* Decode binary file `resources.arsc` from a .apk file to a JavaScript Object.
|
|
5
|
-
*/ "use strict";
|
|
1
|
+
"use strict";
|
|
6
2
|
Object.defineProperty(exports, "__esModule", {
|
|
7
3
|
value: true
|
|
8
4
|
});
|
|
@@ -12,7 +8,11 @@ Object.defineProperty(exports, "ResourceFinder", {
|
|
|
12
8
|
return ResourceFinder;
|
|
13
9
|
}
|
|
14
10
|
});
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Code translated from a C# project https://github.com/hylander0/Iteedee.ApkReader/blob/master/Iteedee.ApkReader/ApkResourceFinder.cs
|
|
13
|
+
*
|
|
14
|
+
* Decode binary file `resources.arsc` from a .apk file to a JavaScript Object.
|
|
15
|
+
*/ const ByteBuffer = require('bytebuffer');
|
|
16
16
|
const DEBUG = false;
|
|
17
17
|
const RES_STRING_POOL_TYPE = 0x0001;
|
|
18
18
|
const RES_TABLE_TYPE = 0x0002;
|
|
@@ -231,6 +231,7 @@ class ResourceFinder {
|
|
|
231
231
|
void entrySize;
|
|
232
232
|
const FLAG_COMPLEX = 0x0001;
|
|
233
233
|
if ((entryFlag & FLAG_COMPLEX) === 0) {
|
|
234
|
+
var _this_entryMap_key;
|
|
234
235
|
const valueSize = bb.readShort();
|
|
235
236
|
const valueRes0 = bb.readByte();
|
|
236
237
|
const valueDataType = bb.readByte();
|
|
@@ -244,7 +245,6 @@ class ResourceFinder {
|
|
|
244
245
|
console.log(`Entry 0x${idStr}, key: ${keyStr}, simple value type: `);
|
|
245
246
|
}
|
|
246
247
|
const key = Number.parseInt(idStr, 16);
|
|
247
|
-
var _this_entryMap_key;
|
|
248
248
|
const entryArr = (_this_entryMap_key = this.entryMap[key]) != null ? _this_entryMap_key : [];
|
|
249
249
|
entryArr.push(keyStr);
|
|
250
250
|
this.entryMap[key] = entryArr;
|
|
@@ -28,4 +28,4 @@ declare const getBase64FromBuffer: (buffer: Buffer | string) => string;
|
|
|
28
28
|
* @param {String} str
|
|
29
29
|
*/
|
|
30
30
|
declare const decodeNullUnicode: (value: string | RegExp) => string | RegExp;
|
|
31
|
-
export {
|
|
31
|
+
export { decodeNullUnicode, findApkIconPath, findIpaIconPath, getBase64FromBuffer, isArray, isBrowser, isObject, isPrimitive, mapInfoResource, };
|
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
decodeNullUnicode
|
|
12
|
+
get decodeNullUnicode () {
|
|
13
13
|
return decodeNullUnicode;
|
|
14
14
|
},
|
|
15
|
-
findApkIconPath
|
|
15
|
+
get findApkIconPath () {
|
|
16
16
|
return findApkIconPath;
|
|
17
17
|
},
|
|
18
|
-
findIpaIconPath
|
|
18
|
+
get findIpaIconPath () {
|
|
19
19
|
return findIpaIconPath;
|
|
20
20
|
},
|
|
21
|
-
getBase64FromBuffer
|
|
21
|
+
get getBase64FromBuffer () {
|
|
22
22
|
return getBase64FromBuffer;
|
|
23
23
|
},
|
|
24
|
-
isArray
|
|
24
|
+
get isArray () {
|
|
25
25
|
return isArray;
|
|
26
26
|
},
|
|
27
|
-
isBrowser
|
|
27
|
+
get isBrowser () {
|
|
28
28
|
return isBrowser;
|
|
29
29
|
},
|
|
30
|
-
isObject
|
|
30
|
+
get isObject () {
|
|
31
31
|
return isObject;
|
|
32
32
|
},
|
|
33
|
-
isPrimitive
|
|
33
|
+
get isPrimitive () {
|
|
34
34
|
return isPrimitive;
|
|
35
35
|
},
|
|
36
|
-
mapInfoResource
|
|
36
|
+
get mapInfoResource () {
|
|
37
37
|
return mapInfoResource;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
runAsCommandResult
|
|
12
|
+
get runAsCommandResult () {
|
|
13
13
|
return runAsCommandResult;
|
|
14
14
|
},
|
|
15
|
-
toErrorMessage
|
|
15
|
+
get toErrorMessage () {
|
|
16
16
|
return toErrorMessage;
|
|
17
17
|
}
|
|
18
18
|
});
|
package/lib/utils/constants.js
CHANGED
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
IS_CRESC
|
|
12
|
+
get IS_CRESC () {
|
|
13
13
|
return IS_CRESC;
|
|
14
14
|
},
|
|
15
|
-
credentialFile
|
|
15
|
+
get credentialFile () {
|
|
16
16
|
return credentialFile;
|
|
17
17
|
},
|
|
18
|
-
defaultEndpoints
|
|
18
|
+
get defaultEndpoints () {
|
|
19
19
|
return defaultEndpoints;
|
|
20
20
|
},
|
|
21
|
-
isPPKBundleFileName
|
|
21
|
+
get isPPKBundleFileName () {
|
|
22
22
|
return isPPKBundleFileName;
|
|
23
23
|
},
|
|
24
|
-
ppkBundleFileNames
|
|
24
|
+
get ppkBundleFileNames () {
|
|
25
25
|
return ppkBundleFileNames;
|
|
26
26
|
},
|
|
27
|
-
pricingPageUrl
|
|
27
|
+
get pricingPageUrl () {
|
|
28
28
|
return pricingPageUrl;
|
|
29
29
|
},
|
|
30
|
-
scriptName
|
|
30
|
+
get scriptName () {
|
|
31
31
|
return scriptName;
|
|
32
32
|
},
|
|
33
|
-
tempDir
|
|
33
|
+
get tempDir () {
|
|
34
34
|
return tempDir;
|
|
35
35
|
},
|
|
36
|
-
updateJson
|
|
36
|
+
get updateJson () {
|
|
37
37
|
return updateJson;
|
|
38
38
|
}
|
|
39
39
|
});
|
package/lib/utils/git.js
CHANGED
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "getCommitInfo", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
12
|
const _isomorphicgit = /*#__PURE__*/ _interop_require_default(require("isomorphic-git"));
|
|
13
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
14
|
function _interop_require_default(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
16
16
|
default: obj
|
package/lib/utils/http-helper.js
CHANGED
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getBaseUrl
|
|
12
|
+
get getBaseUrl () {
|
|
13
13
|
return getBaseUrl;
|
|
14
14
|
},
|
|
15
|
-
ping
|
|
15
|
+
get ping () {
|
|
16
16
|
return ping;
|
|
17
17
|
},
|
|
18
|
-
promiseAny
|
|
18
|
+
get promiseAny () {
|
|
19
19
|
return promiseAny;
|
|
20
20
|
},
|
|
21
|
-
testUrls
|
|
21
|
+
get testUrls () {
|
|
22
22
|
return testUrls;
|
|
23
23
|
}
|
|
24
24
|
});
|
package/lib/utils/index.js
CHANGED
|
@@ -5,49 +5,49 @@ 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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
checkPlugins
|
|
12
|
+
get checkPlugins () {
|
|
13
13
|
return _checkplugin.checkPlugins;
|
|
14
14
|
},
|
|
15
|
-
getAabInfo
|
|
15
|
+
get getAabInfo () {
|
|
16
16
|
return getAabInfo;
|
|
17
17
|
},
|
|
18
|
-
getApkInfo
|
|
18
|
+
get getApkInfo () {
|
|
19
19
|
return getApkInfo;
|
|
20
20
|
},
|
|
21
|
-
getAppInfo
|
|
21
|
+
get getAppInfo () {
|
|
22
22
|
return getAppInfo;
|
|
23
23
|
},
|
|
24
|
-
getIpaInfo
|
|
24
|
+
get getIpaInfo () {
|
|
25
25
|
return getIpaInfo;
|
|
26
26
|
},
|
|
27
|
-
printVersionCommand
|
|
27
|
+
get printVersionCommand () {
|
|
28
28
|
return printVersionCommand;
|
|
29
29
|
},
|
|
30
|
-
question
|
|
30
|
+
get question () {
|
|
31
31
|
return question;
|
|
32
32
|
},
|
|
33
|
-
saveToLocal
|
|
33
|
+
get saveToLocal () {
|
|
34
34
|
return saveToLocal;
|
|
35
35
|
},
|
|
36
|
-
translateOptions
|
|
36
|
+
get translateOptions () {
|
|
37
37
|
return translateOptions;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
41
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
42
40
|
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
43
41
|
const _compareversions = require("compare-versions");
|
|
44
42
|
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
43
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
44
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
45
|
+
const _read = require("read");
|
|
45
46
|
const _yauzl = require("yauzl");
|
|
46
47
|
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../package.json"));
|
|
47
48
|
const _latestversion = /*#__PURE__*/ _interop_require_default(require("./latest-version"));
|
|
48
49
|
const _appinfoparser = /*#__PURE__*/ _interop_require_default(require("./app-info-parser"));
|
|
49
50
|
const _checkplugin = require("./check-plugin");
|
|
50
|
-
const _read = require("read");
|
|
51
51
|
const _constants = require("./constants");
|
|
52
52
|
const _depversions = require("./dep-versions");
|
|
53
53
|
const _i18n = require("./i18n");
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
const _safe = require("@colors/colors/safe");
|
|
5
6
|
const _fs = require("fs");
|
|
6
7
|
const _path = require("path");
|
|
7
|
-
const _safe = require("@colors/colors/safe");
|
|
8
8
|
const _diff = /*#__PURE__*/ _interop_require_default(require("semver/functions/diff"));
|
|
9
9
|
const _major = /*#__PURE__*/ _interop_require_default(require("semver/functions/major"));
|
|
10
10
|
const _ = /*#__PURE__*/ _interop_require_default(require("."));
|
|
@@ -254,7 +254,7 @@ const checkVersions = async (packages, skipMissing, options = {
|
|
|
254
254
|
}
|
|
255
255
|
if (skipMissing) {
|
|
256
256
|
latestVersionPackages = latestVersionPackages.filter((pkg)=>{
|
|
257
|
-
var
|
|
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
|
}
|
|
@@ -142,5 +142,5 @@ type PackageJson = Record<string, any> & ({
|
|
|
142
142
|
});
|
|
143
143
|
export declare const ONE_DAY: number;
|
|
144
144
|
declare const latestVersion: LatestVersion;
|
|
145
|
-
export type { LatestVersion,
|
|
145
|
+
export type { LatestVersion, LatestVersionOptions, LatestVersionPackage, Package, PackageJson, PackageJsonDependencies, PackageRange, RegistryVersions, RequestOptions, };
|
|
146
146
|
export default latestVersion;
|
|
@@ -5,26 +5,26 @@ 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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ONE_DAY
|
|
12
|
+
get ONE_DAY () {
|
|
13
13
|
return ONE_DAY;
|
|
14
14
|
},
|
|
15
|
-
default
|
|
15
|
+
get default () {
|
|
16
16
|
return _default;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _fs = require("fs");
|
|
20
|
+
const _globaldirs = require("global-dirs");
|
|
20
21
|
const _os = require("os");
|
|
21
22
|
const _path = require("path");
|
|
22
|
-
const _url = require("url");
|
|
23
|
-
const _globaldirs = require("global-dirs");
|
|
24
23
|
const _registryauthtoken = /*#__PURE__*/ _interop_require_default(require("registry-auth-token"));
|
|
25
24
|
const _registryurl = /*#__PURE__*/ _interop_require_default(require("registry-auth-token/registry-url"));
|
|
26
25
|
const _gt = /*#__PURE__*/ _interop_require_default(require("semver/functions/gt"));
|
|
27
26
|
const _maxsatisfying = /*#__PURE__*/ _interop_require_default(require("semver/ranges/max-satisfying"));
|
|
27
|
+
const _url = require("url");
|
|
28
28
|
function _interop_require_default(obj) {
|
|
29
29
|
return obj && obj.__esModule ? obj : {
|
|
30
30
|
default: obj
|
|
@@ -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
|
-
|
|
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
|
|
136
|
-
const maxAge = (
|
|
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 (
|
|
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
|
|
237
|
-
pkgInfo.error = (
|
|
236
|
+
var _ref;
|
|
237
|
+
pkgInfo.error = (_ref = err == null ? void 0 : err.message) != null ? _ref : err;
|
|
238
238
|
}
|
|
239
239
|
return pkgInfo;
|
|
240
240
|
};
|
package/lib/utils/options.js
CHANGED
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getBooleanOption
|
|
12
|
+
get getBooleanOption () {
|
|
13
13
|
return getBooleanOption;
|
|
14
14
|
},
|
|
15
|
-
getOptionalStringOption
|
|
15
|
+
get getOptionalStringOption () {
|
|
16
16
|
return getOptionalStringOption;
|
|
17
17
|
},
|
|
18
|
-
getStringOption
|
|
18
|
+
get getStringOption () {
|
|
19
19
|
return getStringOption;
|
|
20
20
|
},
|
|
21
|
-
toObjectState
|
|
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 (
|
|
28
|
+
} catch (unused) {
|
|
29
29
|
try {
|
|
30
30
|
await _fsextra.default.access('android/sentry.properties');
|
|
31
31
|
return true;
|
|
32
|
-
} catch (
|
|
32
|
+
} catch (unused) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
}
|
package/lib/utils/zip-entries.js
CHANGED
|
@@ -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
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
enumZipEntries
|
|
12
|
+
get enumZipEntries () {
|
|
13
13
|
return enumZipEntries;
|
|
14
14
|
},
|
|
15
|
-
readEntry
|
|
15
|
+
get readEntry () {
|
|
16
16
|
return readEntry;
|
|
17
17
|
},
|
|
18
|
-
readEntryPrefix
|
|
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
|
-
|
|
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
|
}
|
|
@@ -3,7 +3,8 @@ export type ZipEntryOptions = {
|
|
|
3
3
|
compressionLevel?: number;
|
|
4
4
|
};
|
|
5
5
|
export declare const ZIP_ENTRY_SNIFF_BYTES = 64;
|
|
6
|
+
export declare const MANIFEST_COMPRESSION_THRESHOLD_BYTES = 256;
|
|
6
7
|
export declare function zipOptionsForPatchEntry(): ZipEntryOptions;
|
|
7
|
-
export declare function zipOptionsForManifestEntry(): ZipEntryOptions;
|
|
8
|
+
export declare function zipOptionsForManifestEntry(byteLength?: number): ZipEntryOptions;
|
|
8
9
|
export declare function zipOptionsForPayloadEntry(fileName: string, prefix?: Buffer): ZipEntryOptions;
|
|
9
10
|
export declare function zipOptionsForPayloadFile(filePath: string, entryName?: string): ZipEntryOptions;
|