switch to undici
This commit is contained in:
parent
d8211bff1a
commit
01f4a010f4
101
package-lock.json
generated
101
package-lock.json
generated
@ -24,7 +24,6 @@
|
||||
"hosted-git-info": "7.0.1",
|
||||
"memize": "2.1.0",
|
||||
"minimist": "1.2.8",
|
||||
"node-fetch": "3.3.2",
|
||||
"p-all": "5.0.0",
|
||||
"picomatch": "4.0.1",
|
||||
"rc": "1.2.8",
|
||||
@ -34,6 +33,7 @@
|
||||
"supports-color": "9.4.0",
|
||||
"text-table": "0.2.0",
|
||||
"timerel": "5.5.0",
|
||||
"undici": "6.7.1",
|
||||
"versions": "12.0.1",
|
||||
"vitest": "1.3.1",
|
||||
"vitest-config-silverwind": "5.1.2"
|
||||
@ -1659,15 +1659,6 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/data-uri-to-buffer": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
|
||||
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
@ -2370,29 +2361,6 @@
|
||||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-blob": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
||||
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"node-domexception": "^1.0.0",
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-enhanced": {
|
||||
"version": "12.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fetch-enhanced/-/fetch-enhanced-12.0.1.tgz",
|
||||
@ -2475,18 +2443,6 @@
|
||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/formdata-polyfill": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fetch-blob": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@ -3209,43 +3165,6 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
|
||||
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"fetch-blob": "^3.1.4",
|
||||
"formdata-polyfill": "^4.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.14",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
|
||||
@ -4371,6 +4290,15 @@
|
||||
"integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.7.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.7.1.tgz",
|
||||
"integrity": "sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.0.13",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
||||
@ -4986,15 +4914,6 @@
|
||||
"integrity": "sha512-P/74UAClfcOnL76KuHySCj+CR7op7ZciTCBGYICJ7hOcxsD2dQwvSFvDXBYjC4vQMCTJZsKLuDiuJR85apQwPA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
|
||||
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
|
@ -26,7 +26,6 @@
|
||||
"hosted-git-info": "7.0.1",
|
||||
"memize": "2.1.0",
|
||||
"minimist": "1.2.8",
|
||||
"node-fetch": "3.3.2",
|
||||
"p-all": "5.0.0",
|
||||
"picomatch": "4.0.1",
|
||||
"rc": "1.2.8",
|
||||
@ -36,6 +35,7 @@
|
||||
"supports-color": "9.4.0",
|
||||
"text-table": "0.2.0",
|
||||
"timerel": "5.5.0",
|
||||
"undici": "6.7.1",
|
||||
"versions": "12.0.1",
|
||||
"vitest": "1.3.1",
|
||||
"vitest-config-silverwind": "5.1.2"
|
||||
|
@ -2,7 +2,6 @@
|
||||
import ansiRegex from "ansi-regex";
|
||||
import fetchEnhanced from "fetch-enhanced";
|
||||
import minimist from "minimist";
|
||||
import nodeFetch from "node-fetch"; // seems twice as fast than undici for the 1500 deps case
|
||||
import rat from "registry-auth-token";
|
||||
import rc from "rc";
|
||||
import {parse, coerce, diff, gt, gte, lt, neq, valid, validRange} from "semver";
|
||||
@ -20,10 +19,10 @@ import memize from "memize";
|
||||
import picomatch from "picomatch";
|
||||
|
||||
let fetch;
|
||||
if (globalThis.fetch && !versions?.node) { // avoid node experimental warning
|
||||
if (globalThis.fetch && !versions.node) { // likely bun fetch
|
||||
fetch = globalThis.fetch;
|
||||
} else {
|
||||
fetch = fetchEnhanced(nodeFetch, {undici: false});
|
||||
} else { // node undici
|
||||
fetch = fetchEnhanced(globalThis.fetch, {undici: true});
|
||||
}
|
||||
|
||||
const MAX_SOCKETS = 96;
|
||||
|
Loading…
Reference in New Issue
Block a user