Skip to content

Commit ea99071

Browse files
chore(deps): update dependency proxy to v4 (#726)
This PR updates `proxy` from `^1.0.2` to `^4.0.0`. Version `4` has no default export, so the previous import prevents the dispatcher tests from starting. The tests now use the named `createProxy` export. The change removes `@types/proxy` because `proxy` supplies its own TypeScript declarations. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: MK <fengmk2@gmail.com>
1 parent 222ae3e commit ea99071

3 files changed

Lines changed: 13 additions & 29 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"@types/busboy": "^1.5.4",
7171
"@types/mime-types": "^2.1.4",
7272
"@types/node": "^24.13.3",
73-
"@types/proxy": "^1.0.4",
7473
"@types/qs": "^6.15.0",
7574
"@types/selfsigned": "^2.1.0",
7675
"@types/tar-stream": "^2.2.3",
@@ -79,7 +78,7 @@
7978
"busboy": "^1.6.0",
8079
"cross-env": "^10.1.0",
8180
"iconv-lite": "^0.7.0",
82-
"proxy": "^1.0.2",
81+
"proxy": "^4.0.0",
8382
"selfsigned": "^3.0.1",
8483
"tar-stream": "^2.2.0",
8584
"typescript": "^7.0.0",

‎pnpm-lock.yaml‎

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

‎test/options.dispatcher.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { strict as assert } from 'node:assert';
22

3-
import setup from 'proxy';
3+
import { createProxy } from 'proxy';
44
import { describe, it, beforeAll, afterAll } from 'vite-plus/test';
55

66
import { request, ProxyAgent, getGlobalDispatcher, setGlobalDispatcher, Agent } from '../src/index.js';
@@ -16,7 +16,7 @@ describe('options.dispatcher.test.ts', () => {
1616
const { closeServer, url } = await startServer();
1717
close = closeServer;
1818
_url = url;
19-
proxyServer = setup();
19+
proxyServer = createProxy();
2020
await new Promise<void>((resolve) => {
2121
proxyServer.listen(0, () => {
2222
// console.log('HTTP proxy server listening on port %d', proxyServer.address().port);

0 commit comments

Comments
 (0)