Skip to content

Commit 2e8e242

Browse files
committed
fix latestverion timeout
1 parent 0cfb1a9 commit 2e8e242

File tree

4 files changed

+58
-32
lines changed

4 files changed

+58
-32
lines changed

bun.lock

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "1.44.2",
3+
"version": "1.44.3",
44
"description": "command line tool for react-native-update (remote updates for react native)",
55
"main": "index.js",
66
"bin": {
@@ -14,7 +14,7 @@
1414
],
1515
"scripts": {
1616
"build": "swc src -d lib --strip-leading-paths",
17-
"prepare": "npm run build && chmod +x lib/index.js",
17+
"prepublishOnly": "npm run build && chmod +x lib/index.js",
1818
"lint": "tsc --noEmit & biome check --write ."
1919
},
2020
"repository": {
@@ -35,7 +35,7 @@
3535
},
3636
"homepage": "https://github.com/reactnativecn/react-native-pushy/tree/master/react-native-pushy-cli",
3737
"dependencies": {
38-
"@badisi/latest-version": "^7.0.13",
38+
"@badisi/latest-version": "^7.0.14",
3939
"bplist-parser": "^0.3.2",
4040
"bytebuffer": "^5.0.1",
4141
"cgbi-to-png": "^1.0.7",
@@ -66,8 +66,8 @@
6666
},
6767
"devDependencies": {
6868
"@biomejs/biome": "^1.9.4",
69-
"@swc/cli": "^0.7.2",
70-
"@swc/core": "^1.11.21",
69+
"@swc/cli": "0.7.3",
70+
"@swc/core": "^1.11.24",
7171
"@types/filesize-parser": "^1.5.3",
7272
"@types/fs-extra": "^11.0.4",
7373
"@types/node": "^22.14.1",
@@ -82,5 +82,8 @@
8282
"trustedDependencies": [
8383
"@biomejs/biome",
8484
"@swc/core"
85-
]
85+
],
86+
"patchedDependencies": {
87+
"@badisi/latest-version@7.0.14": "patches/@badisi%2Flatest-version@7.0.14.patch"
88+
}
8689
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/index.js b/index.js
2+
index a7af7990160fa54a549cbb6245017d55e6b150f5..74b3372c53b9c693af5b571722bafd97e448a34b 100644
3+
--- a/index.js
4+
+++ b/index.js
5+
@@ -100,7 +100,7 @@ var downloadMetadata = (pkgName, options) => {
6+
}
7+
});
8+
const abort = (error) => {
9+
- request.removeAllListeners();
10+
+ // request.removeAllListeners();
11+
request.destroy();
12+
reject(error);
13+
};
14+
@@ -110,6 +110,9 @@ var downloadMetadata = (pkgName, options) => {
15+
request.once("error", (err) => {
16+
abort(err);
17+
});
18+
+ request.on("close", () => {
19+
+ request.removeAllListeners();
20+
+ });
21+
});
22+
};
23+
var getCacheDir = (name = "@badisi/latest-version") => {

src/utils/index.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export async function getAppInfo(fn: string) {
9898
const metaJsonFile = await appInfoParser.parser.getEntryFromHarmonyApp(
9999
/rawfile\/meta.json/,
100100
);
101-
let metaData = {};
101+
let metaData: Record<string, any> = {};
102102
if (metaJsonFile) {
103103
metaData = JSON.parse(metaJsonFile.toString());
104104
}
@@ -181,16 +181,13 @@ export async function printVersionCommand() {
181181
version: chalk.green(latestRnuCliVersion),
182182
})}`
183183
: '';
184-
console.log(
185-
`react-native-update-cli: ${pkg.version}${latestRnuCliVersion}`,
186-
);
187-
let rnuVersion = '';
188-
rnuVersion = depVersions['react-native-update'];
189-
latestRnuVersion = latestRnuVersion
190-
? ` ${t('latestVersionTag', { version: chalk.green(latestRnuVersion) })}`
191-
: '';
192-
console.log(`react-native-update: ${rnuVersion}${latestRnuVersion}`);
184+
console.log(`react-native-update-cli: ${pkg.version}${latestRnuCliVersion}`);
185+
const rnuVersion = depVersions['react-native-update'];
193186
if (rnuVersion) {
187+
latestRnuVersion = latestRnuVersion
188+
? ` ${t('latestVersionTag', { version: chalk.green(latestRnuVersion) })}`
189+
: '';
190+
console.log(`react-native-update: ${rnuVersion}${latestRnuVersion}`);
194191
if (IS_CRESC) {
195192
if (semverSatisfies(rnuVersion, '<10.27.0')) {
196193
console.error(

0 commit comments

Comments
 (0)