forked from silverwind/updates
Revert "always use the built-in fetch - fixes #70"
This reverts commit 0ab1b07b960d03d97beff751220b4ac0f9575faa.
This commit is contained in:
parent
0ab1b07b96
commit
d602afb2cd
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@ -11,8 +11,8 @@ jobs:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{matrix.node}}
|
||||
- run: make lint test
|
||||
|
141
package-lock.json
generated
141
package-lock.json
generated
@ -19,10 +19,12 @@
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-silverwind": "82.0.3",
|
||||
"execa": "8.0.1",
|
||||
"fetch-enhanced": "12.0.1",
|
||||
"glowie": "1.2.0",
|
||||
"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",
|
||||
@ -1657,6 +1659,15 @@
|
||||
"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",
|
||||
@ -2359,6 +2370,51 @@
|
||||
"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",
|
||||
"integrity": "sha512-qSxG3lcpr+rdBnD3p92Gcg/txojDmI9EW9XokSmGh1GjZORQbqboDLYKJkq0nBZvH4sM+bZn/oOYAgzG5gpLTA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"hpagent": "1.2.0",
|
||||
"proxy-from-env": "1.1.0",
|
||||
"quick-lru": "7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"undici": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"undici": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
@ -2419,6 +2475,18 @@
|
||||
"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",
|
||||
@ -2617,6 +2685,15 @@
|
||||
"node": "^16.14.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hpagent": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/hpagent/-/hpagent-1.2.0.tgz",
|
||||
"integrity": "sha512-A91dYTeIB6NoXG+PxTQpCCDDnfHsW9kc06Lvpu1TEe9gnd6ZFeiBoRO9JvzEv6xK7EX97/dUE8g/vBMTqTS3CA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz",
|
||||
@ -3132,6 +3209,43 @@
|
||||
"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",
|
||||
@ -3505,6 +3619,12 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||
@ -3534,6 +3654,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/quick-lru": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-7.0.0.tgz",
|
||||
"integrity": "sha512-MX8gB7cVYTrYcFfAnfLlhRd0+Toyl8yX8uBx1MrX7K0jegiz9TumwOK27ldXrgDlHRdVi+MqU9Ssw6dr4BNreg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/rc": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
||||
@ -4854,6 +4986,15 @@
|
||||
"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",
|
||||
|
@ -21,10 +21,12 @@
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-silverwind": "82.0.3",
|
||||
"execa": "8.0.1",
|
||||
"fetch-enhanced": "12.0.1",
|
||||
"glowie": "1.2.0",
|
||||
"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",
|
||||
|
11
updates.js
11
updates.js
@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
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";
|
||||
import textTable from "text-table";
|
||||
import {cwd, stdout, argv, env, exit} from "node:process";
|
||||
import {cwd, stdout, argv, env, exit, versions} from "node:process";
|
||||
import hostedGitInfo from "hosted-git-info";
|
||||
import {join, dirname, basename, resolve} from "node:path";
|
||||
import {lstatSync, readFileSync, truncateSync, writeFileSync, accessSync} from "node:fs";
|
||||
@ -17,6 +19,13 @@ import pAll from "p-all";
|
||||
import memize from "memize";
|
||||
import picomatch from "picomatch";
|
||||
|
||||
let fetch;
|
||||
if (globalThis.fetch && !versions?.node) { // avoid node experimental warning
|
||||
fetch = globalThis.fetch;
|
||||
} else {
|
||||
fetch = fetchEnhanced(nodeFetch, {undici: false});
|
||||
}
|
||||
|
||||
const MAX_SOCKETS = 96;
|
||||
const sep = "\0";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user