Skip to content

Commit 24855d4

Browse files
committed
Use node-fetch 3 to reduce bundle size
1 parent a311b99 commit 24855d4

File tree

8 files changed

+7063
-81225
lines changed

8 files changed

+7063
-81225
lines changed

.yarnrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packageExtensions:
2+
node-fetch-commonjs@*:
3+
dependencies:
4+
node-domexception: "*"

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package(default_visibility = ["//visibility:public"])
55

66
alias(
77
name = "gen",
8-
actual = "//workflow-dispatch:gen"
8+
actual = "//workflow-dispatch:gen",
99
)
1010

1111
alias(

WORKSPACE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel")
6565

6666
# Javascript
6767

68-
JAVASCRIPT_VERSION = "f467ebfec0a8705f8e80e752483ef4abd4c459aa"
68+
JAVASCRIPT_VERSION = "64f6da098abe8512aaee105b0cb43119289307aa"
6969

7070
http_archive(
7171
name = "better_rules_javascript",
72-
sha256 = "0d74720298e0c27828f6082b836c25f48c4cb9d89c8aab149757c926c29ac02c",
72+
sha256 = "aabb113c72cca3821e0a56b55e8a0408c08610920d4369581bc2cfafe2fb82cf",
7373
strip_prefix = "rules_javascript-%s" % JAVASCRIPT_VERSION,
7474
url = "https://github.com/hello-seer/rules_javascript/archive/%s.tar.gz" % JAVASCRIPT_VERSION,
7575
)

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"prettier-plugin-organize-imports": "^3.0.0",
1313
"rollup": "^3.0.0",
1414
"typescript": "^4.0.0"
15+
},
16+
"resolutions": {
17+
"node-fetch": "npm:node-fetch-commonjs@^3.0.0"
1518
}
1619
}

tools/file/files.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ filegroup(
1212

1313
filegroup(
1414
name = "prettier_files",
15-
srcs = glob(["files/**/*.md", "files/**/.*.js", "files/**/*.js", "files/**/*.json", "files/**/*.ts", "files/**/*.yml"]),
15+
srcs = glob(
16+
["files/**/*.md", "files/**/.*.js", "files/**/*.js", "files/**/*.json", "files/**/*.ts", "files/**/*.yml"],
17+
["files/**/dist/**/*"],
18+
),
1619
)

tools/javascript/npm.bzl

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ PACKAGES = {
398398
"id": "is-plain-object@5.0.0",
399399
},
400400
{
401-
"id": "node-fetch@2.6.7-25a5f538",
401+
"id": "node-fetch-commonjs@3.2.4",
402+
"name": "node-fetch",
402403
},
403404
{
404405
"id": "universal-user-agent@6.0.0",
@@ -425,7 +426,8 @@ PACKAGES = {
425426
"id": "is-plain-object@5.0.0",
426427
},
427428
{
428-
"id": "node-fetch@2.6.7-25a5f538",
429+
"id": "node-fetch-commonjs@3.2.4",
430+
"name": "node-fetch",
429431
},
430432
{
431433
"id": "universal-user-agent@6.0.0",
@@ -968,6 +970,33 @@ PACKAGES = {
968970
"name": "estree-walker",
969971
"url": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
970972
},
973+
"fetch-blob@3.2.0": {
974+
"deps": [
975+
{
976+
"id": "node-domexception@1.0.0",
977+
},
978+
{
979+
"id": "web-streams-polyfill@3.2.1",
980+
},
981+
],
982+
"extra_deps": {
983+
},
984+
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
985+
"name": "fetch-blob",
986+
"url": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
987+
},
988+
"formdata-polyfill@4.0.10": {
989+
"deps": [
990+
{
991+
"id": "fetch-blob@3.2.0",
992+
},
993+
],
994+
"extra_deps": {
995+
},
996+
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
997+
"name": "formdata-polyfill",
998+
"url": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
999+
},
9711000
"fs-minipass@2.1.0": {
9721001
"deps": [
9731002
{
@@ -1577,17 +1606,32 @@ PACKAGES = {
15771606
"name": "negotiator",
15781607
"url": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
15791608
},
1580-
"node-fetch@2.6.7-25a5f538": {
1609+
"node-domexception@1.0.0": {
15811610
"deps": [
1611+
],
1612+
"extra_deps": {
1613+
},
1614+
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
1615+
"name": "node-domexception",
1616+
"url": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
1617+
},
1618+
"node-fetch-commonjs@3.2.4": {
1619+
"deps": [
1620+
{
1621+
"id": "formdata-polyfill@4.0.10",
1622+
},
1623+
{
1624+
"id": "node-domexception@1.0.0",
1625+
},
15821626
{
1583-
"id": "whatwg-url@5.0.0",
1627+
"id": "web-streams-polyfill@3.2.1",
15841628
},
15851629
],
15861630
"extra_deps": {
15871631
},
1588-
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
1589-
"name": "node-fetch",
1590-
"url": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
1632+
"integrity": "sha512-bZW7+ldcuuMPLTJk8DufhT6qHDRdljYD0jqBjmrYfcInaYcReX5kK42SQsu/jvtit/tER28yYjnk63PEEmNPtg==",
1633+
"name": "node-fetch-commonjs",
1634+
"url": "https://registry.npmjs.org/node-fetch-commonjs/-/node-fetch-commonjs-3.2.4.tgz",
15911635
},
15921636
"node-gyp@9.3.0": {
15931637
"deps": [
@@ -2018,15 +2062,6 @@ PACKAGES = {
20182062
"name": "tar",
20192063
"url": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz",
20202064
},
2021-
"tr46@0.0.3": {
2022-
"deps": [
2023-
],
2024-
"extra_deps": {
2025-
},
2026-
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
2027-
"name": "tr46",
2028-
"url": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
2029-
},
20302065
"tunnel@0.0.6": {
20312066
"deps": [
20322067
],
@@ -2096,29 +2131,14 @@ PACKAGES = {
20962131
"name": "uuid",
20972132
"url": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
20982133
},
2099-
"webidl-conversions@3.0.1": {
2134+
"web-streams-polyfill@3.2.1": {
21002135
"deps": [
21012136
],
21022137
"extra_deps": {
21032138
},
2104-
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
2105-
"name": "webidl-conversions",
2106-
"url": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
2107-
},
2108-
"whatwg-url@5.0.0": {
2109-
"deps": [
2110-
{
2111-
"id": "tr46@0.0.3",
2112-
},
2113-
{
2114-
"id": "webidl-conversions@3.0.1",
2115-
},
2116-
],
2117-
"extra_deps": {
2118-
},
2119-
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
2120-
"name": "whatwg-url",
2121-
"url": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
2139+
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
2140+
"name": "web-streams-polyfill",
2141+
"url": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
21222142
},
21232143
"which@2.0.2": {
21242144
"deps": [

0 commit comments

Comments
 (0)