From 2a5869dd80f635ab95351b84dde1db6f79165ce1 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Fri, 8 Aug 2025 14:28:55 +0800 Subject: [PATCH] feat(package): add patch for windows-system-proxy to improve http proxy (#8957) --- ...ws-system-proxy-npm-1.0.0-ff2a828eec.patch | 23 +++++++++++++++++++ package.json | 3 ++- yarn.lock | 11 ++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch diff --git a/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch b/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch new file mode 100644 index 0000000000..354f806148 --- /dev/null +++ b/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch @@ -0,0 +1,23 @@ +diff --git a/dist/index.js b/dist/index.js +index b54962b2d332c1a3affadbdb37d39fdf90ab9f82..7906b4ea3bf9dffe60d74c279e9cfe885489c9f9 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -36,12 +36,12 @@ async function getWindowsSystemProxy() { + const proxies = Object.fromEntries(proxyConfigString + .split(';') + .map((proxyPair) => proxyPair.split('='))); +- const proxyUrl = proxies['https'] +- ? `https://${proxies['https']}` +- : proxies['http'] +- ? `http://${proxies['http']}` +- : proxies['socks'] +- ? `socks://${proxies['socks']}` ++ const proxyUrl = proxies['http'] ++ ? `http://${proxies['http']}` ++ : proxies['socks'] ++ ? `socks://${proxies['socks']}` ++ : proxies['https'] ++ ? `https://${proxies['https']}` + : undefined; + if (!proxyUrl) { + throw new Error(`Could not get usable proxy URL from ${proxyConfigString}`); diff --git a/package.json b/package.json index 495a9bb327..c2c9f71458 100644 --- a/package.json +++ b/package.json @@ -284,7 +284,8 @@ "undici": "6.21.2", "vite": "npm:rolldown-vite@latest", "atomically@npm:^1.7.0": "patch:atomically@npm%3A1.7.0#~/.yarn/patches/atomically-npm-1.7.0-e742e5293b.patch", - "file-stream-rotator@npm:^0.6.1": "patch:file-stream-rotator@npm%3A0.6.1#~/.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch" + "file-stream-rotator@npm:^0.6.1": "patch:file-stream-rotator@npm%3A0.6.1#~/.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch", + "windows-system-proxy@npm:^1.0.0": "patch:windows-system-proxy@npm%3A1.0.0#~/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch" }, "packageManager": "yarn@4.9.1", "lint-staged": { diff --git a/yarn.lock b/yarn.lock index 661482a4b2..7dd043f515 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21468,7 +21468,7 @@ __metadata: languageName: node linkType: hard -"windows-system-proxy@npm:^1.0.0": +"windows-system-proxy@npm:1.0.0": version: 1.0.0 resolution: "windows-system-proxy@npm:1.0.0" dependencies: @@ -21477,6 +21477,15 @@ __metadata: languageName: node linkType: hard +"windows-system-proxy@patch:windows-system-proxy@npm%3A1.0.0#~/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch": + version: 1.0.0 + resolution: "windows-system-proxy@patch:windows-system-proxy@npm%3A1.0.0#~/.yarn/patches/windows-system-proxy-npm-1.0.0-ff2a828eec.patch::version=1.0.0&hash=bc3cd7" + dependencies: + registry-js: "npm:^1.15.1" + checksum: 10c0/4941a22109ced18bece1aa7eacb828a1b4364d031c8528fc76a0a76509ef431f70886574d8629d5086ef7dbfb9595815996489acaa9468c63b337551847761fd + languageName: node + linkType: hard + "winston-daily-rotate-file@npm:^5.0.0": version: 5.0.0 resolution: "winston-daily-rotate-file@npm:5.0.0"