react-native-update-cli 2.4.0 → 2.4.2
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/bundle.js +1 -7
- package/lib/utils/http-helper.js +7 -1
- package/package.json +4 -17
- package/src/bundle.ts +2 -9
- package/src/utils/http-helper.ts +1 -0
package/lib/bundle.js
CHANGED
|
@@ -509,7 +509,6 @@ async function diffFromPPK(origin, next, output) {
|
|
|
509
509
|
throw new Error((0, _i18n.t)('bundleFileNotFound'));
|
|
510
510
|
}
|
|
511
511
|
const copies = {};
|
|
512
|
-
const copiesv2 = {};
|
|
513
512
|
const zipfile = new _yazl.ZipFile();
|
|
514
513
|
const writePromise = new Promise((resolve, reject)=>{
|
|
515
514
|
zipfile.outputStream.on('error', (err)=>{
|
|
@@ -560,7 +559,6 @@ async function diffFromPPK(origin, next, output) {
|
|
|
560
559
|
addEntry(base);
|
|
561
560
|
}
|
|
562
561
|
copies[entry.fileName] = originMap[entry.crc32];
|
|
563
|
-
copiesv2[entry.crc32] = entry.fileName;
|
|
564
562
|
return;
|
|
565
563
|
}
|
|
566
564
|
// New file.
|
|
@@ -591,7 +589,6 @@ async function diffFromPPK(origin, next, output) {
|
|
|
591
589
|
//console.log({copies, deletes});
|
|
592
590
|
zipfile.addBuffer(Buffer.from(JSON.stringify({
|
|
593
591
|
copies,
|
|
594
|
-
copiesv2,
|
|
595
592
|
deletes
|
|
596
593
|
})), '__diff.json');
|
|
597
594
|
zipfile.end();
|
|
@@ -622,7 +619,6 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
622
619
|
throw new Error((0, _i18n.t)('bundleFileNotFound'));
|
|
623
620
|
}
|
|
624
621
|
const copies = {};
|
|
625
|
-
const copiesv2 = {};
|
|
626
622
|
const zipfile = new _yazl.ZipFile();
|
|
627
623
|
const writePromise = new Promise((resolve, reject)=>{
|
|
628
624
|
zipfile.outputStream.on('error', (err)=>{
|
|
@@ -652,7 +648,6 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
652
648
|
// If moved from other place
|
|
653
649
|
if (originMap[entry.crc32]) {
|
|
654
650
|
copies[entry.fileName] = originMap[entry.crc32];
|
|
655
|
-
copiesv2[entry.crc32] = entry.fileName;
|
|
656
651
|
return;
|
|
657
652
|
}
|
|
658
653
|
return new Promise((resolve, reject)=>{
|
|
@@ -670,8 +665,7 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
670
665
|
}
|
|
671
666
|
});
|
|
672
667
|
zipfile.addBuffer(Buffer.from(JSON.stringify({
|
|
673
|
-
copies
|
|
674
|
-
copiesv2
|
|
668
|
+
copies
|
|
675
669
|
})), '__diff.json');
|
|
676
670
|
zipfile.end();
|
|
677
671
|
await writePromise;
|
package/lib/utils/http-helper.js
CHANGED
|
@@ -23,6 +23,12 @@ _export(exports, {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
const _constants = require("./constants");
|
|
26
|
+
const _nodefetch = /*#__PURE__*/ _interop_require_default(require("node-fetch"));
|
|
27
|
+
function _interop_require_default(obj) {
|
|
28
|
+
return obj && obj.__esModule ? obj : {
|
|
29
|
+
default: obj
|
|
30
|
+
};
|
|
31
|
+
}
|
|
26
32
|
function promiseAny(promises) {
|
|
27
33
|
return new Promise((resolve, reject)=>{
|
|
28
34
|
let count = 0;
|
|
@@ -39,7 +45,7 @@ function promiseAny(promises) {
|
|
|
39
45
|
const ping = async (url)=>{
|
|
40
46
|
let pingFinished = false;
|
|
41
47
|
return Promise.race([
|
|
42
|
-
|
|
48
|
+
(0, _nodefetch.default)(url, {
|
|
43
49
|
method: 'HEAD'
|
|
44
50
|
}).then(({ status, statusText })=>{
|
|
45
51
|
pingFinished = true;
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-update-cli",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "command line tool for react-native-update (remote updates for react native)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"pushy": "lib/index.js",
|
|
8
8
|
"cresc": "lib/index.js"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
11
|
-
"lib",
|
|
12
|
-
"src",
|
|
13
|
-
"cli.json"
|
|
14
|
-
],
|
|
10
|
+
"files": ["lib", "src", "cli.json"],
|
|
15
11
|
"scripts": {
|
|
16
12
|
"build": "swc src -d lib --strip-leading-paths",
|
|
17
13
|
"prepublishOnly": "npm run build && chmod +x lib/index.js",
|
|
@@ -21,13 +17,7 @@
|
|
|
21
17
|
"type": "git",
|
|
22
18
|
"url": "git+https://github.com/reactnativecn/react-native-update-cli.git"
|
|
23
19
|
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"react-native",
|
|
26
|
-
"ios",
|
|
27
|
-
"android",
|
|
28
|
-
"harmony",
|
|
29
|
-
"update"
|
|
30
|
-
],
|
|
20
|
+
"keywords": ["react-native", "ios", "android", "harmony", "update"],
|
|
31
21
|
"author": "reactnativecn",
|
|
32
22
|
"license": "BSD-3-Clause",
|
|
33
23
|
"bugs": {
|
|
@@ -81,8 +71,5 @@
|
|
|
81
71
|
"@types/yazl": "^2.4.6",
|
|
82
72
|
"typescript": "^5.8.3"
|
|
83
73
|
},
|
|
84
|
-
"trustedDependencies": [
|
|
85
|
-
"@biomejs/biome",
|
|
86
|
-
"@swc/core"
|
|
87
|
-
]
|
|
74
|
+
"trustedDependencies": ["@biomejs/biome", "@swc/core"]
|
|
88
75
|
}
|
package/src/bundle.ts
CHANGED
|
@@ -578,7 +578,6 @@ async function diffFromPPK(origin: string, next: string, output: string) {
|
|
|
578
578
|
}
|
|
579
579
|
|
|
580
580
|
const copies = {};
|
|
581
|
-
const copiesv2 = {};
|
|
582
581
|
|
|
583
582
|
const zipfile = new YazlZipFile();
|
|
584
583
|
|
|
@@ -640,7 +639,6 @@ async function diffFromPPK(origin: string, next: string, output: string) {
|
|
|
640
639
|
addEntry(base);
|
|
641
640
|
}
|
|
642
641
|
copies[entry.fileName] = originMap[entry.crc32];
|
|
643
|
-
copiesv2[entry.crc32] = entry.fileName;
|
|
644
642
|
return;
|
|
645
643
|
}
|
|
646
644
|
|
|
@@ -673,7 +671,7 @@ async function diffFromPPK(origin: string, next: string, output: string) {
|
|
|
673
671
|
|
|
674
672
|
//console.log({copies, deletes});
|
|
675
673
|
zipfile.addBuffer(
|
|
676
|
-
Buffer.from(JSON.stringify({ copies,
|
|
674
|
+
Buffer.from(JSON.stringify({ copies, deletes })),
|
|
677
675
|
'__diff.json',
|
|
678
676
|
);
|
|
679
677
|
zipfile.end();
|
|
@@ -718,7 +716,6 @@ async function diffFromPackage(
|
|
|
718
716
|
}
|
|
719
717
|
|
|
720
718
|
const copies = {};
|
|
721
|
-
const copiesv2 = {};
|
|
722
719
|
|
|
723
720
|
const zipfile = new YazlZipFile();
|
|
724
721
|
|
|
@@ -754,7 +751,6 @@ async function diffFromPackage(
|
|
|
754
751
|
// If moved from other place
|
|
755
752
|
if (originMap[entry.crc32]) {
|
|
756
753
|
copies[entry.fileName] = originMap[entry.crc32];
|
|
757
|
-
copiesv2[entry.crc32] = entry.fileName;
|
|
758
754
|
return;
|
|
759
755
|
}
|
|
760
756
|
|
|
@@ -773,10 +769,7 @@ async function diffFromPackage(
|
|
|
773
769
|
}
|
|
774
770
|
});
|
|
775
771
|
|
|
776
|
-
zipfile.addBuffer(
|
|
777
|
-
Buffer.from(JSON.stringify({ copies, copiesv2 })),
|
|
778
|
-
'__diff.json',
|
|
779
|
-
);
|
|
772
|
+
zipfile.addBuffer(Buffer.from(JSON.stringify({ copies })), '__diff.json');
|
|
780
773
|
zipfile.end();
|
|
781
774
|
await writePromise;
|
|
782
775
|
}
|