Skip to content

Commit

Permalink
Use node-fetch 3 to reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldraper committed Dec 2, 2022
1 parent a311b99 commit 24855d4
Show file tree
Hide file tree
Showing 8 changed files with 7,063 additions and 81,225 deletions.
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packageExtensions:
node-fetch-commonjs@*:
dependencies:
node-domexception: "*"
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package(default_visibility = ["//visibility:public"])

alias(
name = "gen",
actual = "//workflow-dispatch:gen"
actual = "//workflow-dispatch:gen",
)

alias(
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel")

# Javascript

JAVASCRIPT_VERSION = "f467ebfec0a8705f8e80e752483ef4abd4c459aa"
JAVASCRIPT_VERSION = "64f6da098abe8512aaee105b0cb43119289307aa"

http_archive(
name = "better_rules_javascript",
sha256 = "0d74720298e0c27828f6082b836c25f48c4cb9d89c8aab149757c926c29ac02c",
sha256 = "aabb113c72cca3821e0a56b55e8a0408c08610920d4369581bc2cfafe2fb82cf",
strip_prefix = "rules_javascript-%s" % JAVASCRIPT_VERSION,
url = "https://github.com/hello-seer/rules_javascript/archive/%s.tar.gz" % JAVASCRIPT_VERSION,
)
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"prettier-plugin-organize-imports": "^3.0.0",
"rollup": "^3.0.0",
"typescript": "^4.0.0"
},
"resolutions": {
"node-fetch": "npm:node-fetch-commonjs@^3.0.0"
}
}
5 changes: 4 additions & 1 deletion tools/file/files.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ filegroup(

filegroup(
name = "prettier_files",
srcs = glob(["files/**/*.md", "files/**/.*.js", "files/**/*.js", "files/**/*.json", "files/**/*.ts", "files/**/*.yml"]),
srcs = glob(
["files/**/*.md", "files/**/.*.js", "files/**/*.js", "files/**/*.json", "files/**/*.ts", "files/**/*.yml"],
["files/**/dist/**/*"],
),
)
90 changes: 55 additions & 35 deletions tools/javascript/npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ PACKAGES = {
"id": "[email protected]",
},
{
"id": "[email protected]",
"id": "[email protected]",
"name": "node-fetch",
},
{
"id": "[email protected]",
Expand All @@ -425,7 +426,8 @@ PACKAGES = {
"id": "[email protected]",
},
{
"id": "[email protected]",
"id": "[email protected]",
"name": "node-fetch",
},
{
"id": "[email protected]",
Expand Down Expand Up @@ -968,6 +970,33 @@ PACKAGES = {
"name": "estree-walker",
"url": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
},
"[email protected]": {
"deps": [
{
"id": "[email protected]",
},
{
"id": "[email protected]",
},
],
"extra_deps": {
},
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"name": "fetch-blob",
"url": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
},
"[email protected]": {
"deps": [
{
"id": "[email protected]",
},
],
"extra_deps": {
},
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"name": "formdata-polyfill",
"url": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
},
"[email protected]": {
"deps": [
{
Expand Down Expand Up @@ -1577,17 +1606,32 @@ PACKAGES = {
"name": "negotiator",
"url": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
},
"node-[email protected]": {
"node-[email protected]": {
"deps": [
],
"extra_deps": {
},
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"name": "node-domexception",
"url": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
},
"[email protected]": {
"deps": [
{
"id": "[email protected]",
},
{
"id": "[email protected]",
},
{
"id": "[email protected]",
"id": "[email protected]",
},
],
"extra_deps": {
},
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"name": "node-fetch",
"url": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-bZW7+ldcuuMPLTJk8DufhT6qHDRdljYD0jqBjmrYfcInaYcReX5kK42SQsu/jvtit/tER28yYjnk63PEEmNPtg==",
"name": "node-fetch-commonjs",
"url": "https://registry.npmjs.org/node-fetch-commonjs/-/node-fetch-commonjs-3.2.4.tgz",
},
"[email protected]": {
"deps": [
Expand Down Expand Up @@ -2018,15 +2062,6 @@ PACKAGES = {
"name": "tar",
"url": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz",
},
"[email protected]": {
"deps": [
],
"extra_deps": {
},
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
"name": "tr46",
"url": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
},
"[email protected]": {
"deps": [
],
Expand Down Expand Up @@ -2096,29 +2131,14 @@ PACKAGES = {
"name": "uuid",
"url": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
},
"webidl-conversions@3.0.1": {
"web-streams-polyfill@3.2.1": {
"deps": [
],
"extra_deps": {
},
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
"name": "webidl-conversions",
"url": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
},
"[email protected]": {
"deps": [
{
"id": "[email protected]",
},
{
"id": "[email protected]",
},
],
"extra_deps": {
},
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"name": "whatwg-url",
"url": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
"name": "web-streams-polyfill",
"url": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
},
"[email protected]": {
"deps": [
Expand Down
Loading

0 comments on commit 24855d4

Please sign in to comment.