Skip to content

Commit e911b26

Browse files
committed
Avoid TS DOM library from @whatwg-node/fetch
`@types/node` provides `globalThis.fetch`, etc. There's no need to pull in _all_ of the DOM library just for these types.
1 parent 084e820 commit e911b26

File tree

3 files changed

+43
-20
lines changed

3 files changed

+43
-20
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/dist/index.d.ts b/dist/index.d.ts
2+
index d16ddf2f4e30e75c5b04044af34e8286b2e8b0a5..9f56feb61efa75a40c815fd56f11642719d41737 100644
3+
--- a/dist/index.d.ts
4+
+++ b/dist/index.d.ts
5+
@@ -1,5 +1,3 @@
6+
-/// <reference lib="dom" />
7+
-/// <reference lib="dom.iterable" />
8+
/// <reference types="urlpattern-polyfill" />
9+
10+
declare type _URLPattern = typeof URLPattern

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"sanitize-filename": "^1.6.3",
111111
"title-case": "^4.3.1",
112112
"ts-essentials": "^9.4.1",
113+
"urlpattern-polyfill": "^10.0.0",
113114
"uuid": "^10.0.0",
114115
"winston": "^3.11.0",
115116
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz",
@@ -130,7 +131,7 @@
130131
"@types/jsonwebtoken": "^9.0.4",
131132
"@types/lodash": "^4.14.200",
132133
"@types/luxon": "^3.4.2",
133-
"@types/node": "^20.12.5",
134+
"@types/node": "^22.7.8",
134135
"@types/prismjs": "^1.26.2",
135136
"@types/react": "^18.2.33",
136137
"@types/stack-trace": "^0.0.32",
@@ -166,6 +167,7 @@
166167
"@types/express": "npm:@types/stack-trace@*",
167168
"@types/express-serve-static-core": "npm:@types/stack-trace@*",
168169
"@types/koa": "npm:@types/stack-trace@*",
170+
"@whatwg-node/fetch": "patch:@whatwg-node/fetch@npm%3A0.9.22#~/.yarn/patches/@whatwg-node-fetch-npm-0.9.22-a60314fb39.patch",
169171
"subscriptions-transport-ws": "npm:empty-npm-package@*"
170172
},
171173
"dependenciesMeta": {

yarn.lock

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3891,12 +3891,12 @@ __metadata:
38913891
languageName: node
38923892
linkType: hard
38933893

3894-
"@types/node@npm:*, @types/node@npm:^20.12.5":
3895-
version: 20.12.5
3896-
resolution: "@types/node@npm:20.12.5"
3894+
"@types/node@npm:*, @types/node@npm:^22.7.8":
3895+
version: 22.7.8
3896+
resolution: "@types/node@npm:22.7.8"
38973897
dependencies:
3898-
undici-types: "npm:~5.26.4"
3899-
checksum: 10c0/2da65516fba98f0417620e42bddbe53e144d4782d69cd37f99df2537c6850b9cfbdb8a017f02c61e9a074bcac84f9f3f221b250474ac8c6b95d507a47e8d53f9
3898+
undici-types: "npm:~6.19.2"
3899+
checksum: 10c0/3d3b3a2ec5a57ca4fd37b34dce415620993ca5f87cea2c728ffe73aa31446dbfe19c53171c478447bd7d78011ef4845a46ab2f0dc38e699cc75b3d100a60c690
39003900
languageName: node
39013901
linkType: hard
39023902

@@ -4180,25 +4180,35 @@ __metadata:
41804180
languageName: node
41814181
linkType: hard
41824182

4183-
"@whatwg-node/fetch@npm:^0.9.18, @whatwg-node/fetch@npm:^0.9.21":
4184-
version: 0.9.21
4185-
resolution: "@whatwg-node/fetch@npm:0.9.21"
4183+
"@whatwg-node/fetch@npm:0.9.22":
4184+
version: 0.9.22
4185+
resolution: "@whatwg-node/fetch@npm:0.9.22"
41864186
dependencies:
4187-
"@whatwg-node/node-fetch": "npm:^0.5.23"
4187+
"@whatwg-node/node-fetch": "npm:^0.5.27"
41884188
urlpattern-polyfill: "npm:^10.0.0"
4189-
checksum: 10c0/c0727e32673fa0596aff9786995b308fc92c33290807c72333af2a5c7a7e38ca6e236ec641bb4caded25e30127bee4b9df2e15d47c064970c2f7df58b084ca8d
4189+
checksum: 10c0/67a8668b2dd491b24a20a03ba23b6463481e209b16e2ffc9444ed9f52fb82de744a6076278499cea60737985204fca44f68dccea7e2af1a5fb68c2721e3bb1a6
41904190
languageName: node
41914191
linkType: hard
41924192

4193-
"@whatwg-node/node-fetch@npm:^0.5.23":
4194-
version: 0.5.26
4195-
resolution: "@whatwg-node/node-fetch@npm:0.5.26"
4193+
"@whatwg-node/fetch@patch:@whatwg-node/fetch@npm%3A0.9.22#~/.yarn/patches/@whatwg-node-fetch-npm-0.9.22-a60314fb39.patch":
4194+
version: 0.9.22
4195+
resolution: "@whatwg-node/fetch@patch:@whatwg-node/fetch@npm%3A0.9.22#~/.yarn/patches/@whatwg-node-fetch-npm-0.9.22-a60314fb39.patch::version=0.9.22&hash=a19453"
4196+
dependencies:
4197+
"@whatwg-node/node-fetch": "npm:^0.5.27"
4198+
urlpattern-polyfill: "npm:^10.0.0"
4199+
checksum: 10c0/95d423aa4449bbaeb01e2784fcd1fc0b064b0d6cc99ded6169f832a763e701647362498813cc03eff98c8620daf6516f42272efd7734e24695e3659bfcdb78af
4200+
languageName: node
4201+
linkType: hard
4202+
4203+
"@whatwg-node/node-fetch@npm:^0.5.27":
4204+
version: 0.5.27
4205+
resolution: "@whatwg-node/node-fetch@npm:0.5.27"
41964206
dependencies:
41974207
"@kamilkisiela/fast-url-parser": "npm:^1.1.4"
41984208
busboy: "npm:^1.6.0"
41994209
fast-querystring: "npm:^1.1.1"
42004210
tslib: "npm:^2.6.3"
4201-
checksum: 10c0/32e7b230e7d1ead507f44b49dfb91bacdef2c89cf7a10b95f2b996e15786fcbfc8dc4b21ef8b56e2fd39bd8491f8a01b216b33d7e30af8291778777811de325e
4211+
checksum: 10c0/1cd036e1ef36bfc71436a3e7438b180b94c33d7958c02e33540c35d37db19fb598f2ab09f0aef538a3bbc771c32d34c5728a596ffabf8be7961435a80fcb8f62
42024212
languageName: node
42034213
linkType: hard
42044214

@@ -5623,7 +5633,7 @@ __metadata:
56235633
"@types/jsonwebtoken": "npm:^9.0.4"
56245634
"@types/lodash": "npm:^4.14.200"
56255635
"@types/luxon": "npm:^3.4.2"
5626-
"@types/node": "npm:^20.12.5"
5636+
"@types/node": "npm:^22.7.8"
56275637
"@types/prismjs": "npm:^1.26.2"
56285638
"@types/react": "npm:^18.2.33"
56295639
"@types/stack-trace": "npm:^0.0.32"
@@ -5698,6 +5708,7 @@ __metadata:
56985708
type-fest: "npm:^4.15.0"
56995709
typescript: "npm:^5.2.2"
57005710
typescript-transform-paths: "npm:^3.4.6"
5711+
urlpattern-polyfill: "npm:^10.0.0"
57015712
uuid: "npm:^10.0.0"
57025713
winston: "npm:^3.11.0"
57035714
xlsx: "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz"
@@ -13318,10 +13329,10 @@ __metadata:
1331813329
languageName: node
1331913330
linkType: hard
1332013331

13321-
"undici-types@npm:~5.26.4":
13322-
version: 5.26.5
13323-
resolution: "undici-types@npm:5.26.5"
13324-
checksum: 10c0/bb673d7876c2d411b6eb6c560e0c571eef4a01c1c19925175d16e3a30c4c428181fb8d7ae802a261f283e4166a0ac435e2f505743aa9e45d893f9a3df017b501
13332+
"undici-types@npm:~6.19.2":
13333+
version: 6.19.8
13334+
resolution: "undici-types@npm:6.19.8"
13335+
checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344
1332513336
languageName: node
1332613337
linkType: hard
1332713338

0 commit comments

Comments
 (0)