From cbb86492fe3011d49e1ec1a7dbe686e9adb18c24 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 24 Oct 2024 12:44:09 -0700 Subject: [PATCH] build: drop node-fetch dependency (#15) --- package.json | 5 +++-- src/chromium-review.ts | 8 ++++---- src/crbug.ts | 1 - src/crissue.ts | 1 - src/crsource.ts | 1 - yarn.lock | 42 ------------------------------------------ 6 files changed, 7 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index ff6c728..ae96b1a 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,12 @@ "main": "dist/index.js", "license": "MIT", "private": true, + "engines": { + "node": ">=18" + }, "dependencies": { "@slack/bolt": "^3.4.0", "cockatiel": "^2.0.2", - "node-fetch": "^2.6.1", "pg": "^8.6.0" }, "scripts": { @@ -23,7 +25,6 @@ "@babel/preset-typescript": "^7.14.5", "@types/jest": "^29.0.0", "@types/node": "^14.14.37", - "@types/node-fetch": "^2.5.10", "@types/pg": "^8.6.0", "babel-jest": "^29.0.0", "husky": "^6.0.0", diff --git a/src/chromium-review.ts b/src/chromium-review.ts index e8141cd..56c3af9 100644 --- a/src/chromium-review.ts +++ b/src/chromium-review.ts @@ -1,10 +1,10 @@ import { MessageAttachment } from '@slack/bolt'; -import fetch from 'node-fetch'; export async function handleChromiumReviewUnfurl(url: string): Promise { - const match = /^https:\/\/chromium-review\.googlesource\.com\/c\/([a-z0-9]+)\/([a-z0-9]+)\/\+\/([0-9]+)/g.exec( - url, - ); + const match = + /^https:\/\/chromium-review\.googlesource\.com\/c\/([a-z0-9]+)\/([a-z0-9]+)\/\+\/([0-9]+)/g.exec( + url, + ); if (!match) return null; const repo = `${match[1]}%2F${match[2]}`; diff --git a/src/crbug.ts b/src/crbug.ts index 2fba7be..25a26ce 100644 --- a/src/crbug.ts +++ b/src/crbug.ts @@ -1,5 +1,4 @@ import { MessageAttachment } from '@slack/bolt'; -import fetch from 'node-fetch'; import { Policy, ConstantBackoff } from 'cockatiel'; import { notNull } from './utils'; diff --git a/src/crissue.ts b/src/crissue.ts index c4d0a32..96110be 100644 --- a/src/crissue.ts +++ b/src/crissue.ts @@ -1,5 +1,4 @@ import { MessageAttachment } from '@slack/bolt'; -import fetch from 'node-fetch'; import { escapeSlackMessage } from './escape'; diff --git a/src/crsource.ts b/src/crsource.ts index d2fc905..9886f8e 100644 --- a/src/crsource.ts +++ b/src/crsource.ts @@ -1,5 +1,4 @@ import { MessageAttachment } from '@slack/bolt'; -import fetch from 'node-fetch'; type GrimoireMeta = { token: string; diff --git a/yarn.lock b/yarn.lock index c5497f4..1034a03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1684,14 +1684,6 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== -"@types/node-fetch@^2.5.10": - version "2.5.10" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" - integrity sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*", "@types/node@>=12", "@types/node@>=12.0.0", "@types/node@^14.14.37": version "14.14.37" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e" @@ -2718,15 +2710,6 @@ form-data@^2.5.0: combined-stream "^1.0.6" mime-types "^2.1.12" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -3826,13 +3809,6 @@ negotiator@0.6.3: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -node-fetch@^2.6.1: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -4699,11 +4675,6 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -4827,19 +4798,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"