Skip to content

Commit

Permalink
perf: replace node-fetch with node-fetch-native
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Feb 24, 2024
1 parent c5f54ac commit 5de73e7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
18 changes: 16 additions & 2 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"build": "npm run build:js && npm run build:dts",
"build:check": "tsc",
"build:js": "node scripts/build-js.mjs --format=esm --entry=src/*.ts && npm run build:vendor",
"build:vendor": "node scripts/build-js.mjs --format=esm --entry=src/vendor.ts --bundle=all --banner --minify",
"build:vendor": "node scripts/build-js.mjs --format=esm --entry=src/vendor.ts --bundle=all --banner",
"build:dts": "tsc --project tsconfig.prod.json && node scripts/build-dts.mjs",
"test": "npm run build && node ./test/all.test.js",
"test:types": "tsd",
Expand All @@ -58,12 +58,12 @@
"@types/node": ">=20.11.19"
},
"devDependencies": {
"@stryker-mutator/core": "^6.4.2",
"@types/fs-extra": "^11.0.4",
"@types/minimist": "^1.2.5",
"@types/node": ">=20.11.19",
"@types/ps-tree": "^1.1.6",
"@types/minimist": "^1.2.5",
"@types/which": "^3.0.3",
"@stryker-mutator/core": "^6.4.2",
"c8": "^7.13.0",
"chalk": "^5.3.0",
"dts-bundle-generator": "^9.3.1",
Expand All @@ -75,7 +75,7 @@
"globby": "^14.0.1",
"madge": "^6.1.0",
"minimist": "^1.2.8",
"node-fetch": "3.3.2",
"node-fetch-native": "^1.6.2",
"prettier": "^2.8.8",
"ps-tree": "^1.2.0",
"tsd": "^0.28.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-dts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const entry = {
'@nodelib/fs.walk',
'fast-glob',
'@types/jsonfile',
'node-fetch',
'node-fetch-native',
'chalk',
'globby',
'webpod',
Expand Down
9 changes: 4 additions & 5 deletions src/vendor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import {
} from 'globby'
import * as yaml from 'yaml'
import * as _fs from 'fs-extra'
import type { fetch } from 'node-fetch-native'

export {
default as nodeFetch,
type RequestInfo,
type RequestInit,
} from 'node-fetch'
export { fetch as nodeFetch } from 'node-fetch-native'
export type RequestInfo = Parameters<typeof fetch>[0]
export type RequestInit = Parameters<typeof fetch>[1]

export const globbyModule = {
globby,
Expand Down

0 comments on commit 5de73e7

Please sign in to comment.