Skip to content

Commit

Permalink
use native fetch everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Mar 16, 2024
1 parent 35beba6 commit e9327ab
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 157 deletions.
141 changes: 0 additions & 141 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
"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",
Expand Down
15 changes: 1 addition & 14 deletions updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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, versions} from "node:process";
import {cwd, stdout, argv, env, exit} 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";
Expand All @@ -17,19 +17,6 @@ import pAll from "p-all";
import memize from "memize";
import picomatch from "picomatch";

// bun and deno have built-in proxy support via environment while undici has not,
// so we fall back to node-fetch with fetch-enhanced wrapper to add it there.
let fetch;
if (globalThis.fetch && !versions?.node) {
fetch = globalThis.fetch;
} else {
const [{default: nodeFetch}, {default: fetchEnhanced}] = await Promise.all([
import("node-fetch"),
import("fetch-enhanced"),
]);
fetch = fetchEnhanced(nodeFetch, {undici: false});
}

const MAX_SOCKETS = 96;
const sep = "\0";

Expand Down

0 comments on commit e9327ab

Please sign in to comment.