From 6f959f752e256ac4dd3c02414ce8e4107c2c4d5c Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 17 Oct 2023 10:51:24 -0400 Subject: [PATCH] update node-fetch to 3.2.0 --- integration/messaging/package.json | 2 +- .../messaging/test/utils/sendMessage.js | 2 +- packages/auth/package.json | 2 +- packages/firestore/package.json | 2 +- packages/functions/package.json | 2 +- packages/rules-unit-testing/package.json | 2 +- packages/storage/package.json | 2 +- repo-scripts/changelog-generator/index.ts | 22 ++++--- repo-scripts/changelog-generator/package.json | 5 +- yarn.lock | 58 ++++++++++++++----- 10 files changed, 67 insertions(+), 32 deletions(-) diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 588abb8f373..cf7c4994331 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -15,7 +15,7 @@ "express": "4.18.2", "geckodriver": "2.0.4", "mocha": "9.2.2", - "node-fetch": "2.6.7", + "node-fetch": "3.2.0", "selenium-assistant": "6.1.1" } } diff --git a/integration/messaging/test/utils/sendMessage.js b/integration/messaging/test/utils/sendMessage.js index 9d3b93986f1..eb61534e8e3 100644 --- a/integration/messaging/test/utils/sendMessage.js +++ b/integration/messaging/test/utils/sendMessage.js @@ -15,7 +15,7 @@ * limitations under the License. */ -const fetch = require('node-fetch'); +import { fetch } from 'node-fetch'; const FCM_SEND_ENDPOINT = 'https://fcm.googleapis.com/fcm/send'; // Rotatable fcm server key. It's generally a bad idea to expose server keys. The reason is to // simplify testing process (no need to implement server side decryption of git secret). The diff --git a/packages/auth/package.json b/packages/auth/package.json index 66f79cff118..eb3dff9e002 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -115,7 +115,7 @@ "@firebase/component": "0.6.4", "@firebase/logger": "0.4.0", "@firebase/util": "1.9.3", - "node-fetch": "2.6.7", + "node-fetch": "3.2.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 986fdd4ed61..db44d936ce2 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -102,7 +102,7 @@ "@firebase/webchannel-wrapper": "0.10.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", - "node-fetch": "2.6.7", + "node-fetch": "3.2.0", "tslib": "^2.1.0" }, "peerDependencies": { diff --git a/packages/functions/package.json b/packages/functions/package.json index 6627c05c796..80cfc542480 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -71,7 +71,7 @@ "@firebase/auth-interop-types": "0.2.1", "@firebase/app-check-interop-types": "0.3.0", "@firebase/util": "1.9.3", - "node-fetch": "2.6.7", + "node-fetch": "3.2.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index a06f128a547..8479d7fedbf 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -54,6 +54,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "3.2.0" } } diff --git a/packages/storage/package.json b/packages/storage/package.json index 2dbc2be3c27..84a8e3fa79e 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -48,7 +48,7 @@ "dependencies": { "@firebase/util": "1.9.3", "@firebase/component": "0.6.4", - "node-fetch": "2.6.7", + "node-fetch": "3.2.0", "tslib": "^2.1.0" }, "peerDependencies": { diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 7c0ab341af0..49f3c52f3e6 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -95,7 +95,8 @@ async function getFixedIssueLink( prNumber: number, repo: string ): Promise { - const { body }: { body: string } = await fetch( + var body:string; + await fetch( `https://api.github.com/repos/${repo}/pulls/${prNumber}`, { method: 'GET', @@ -103,14 +104,17 @@ async function getFixedIssueLink( 'Authorization': `Bearer ${process.env.GITHUB_TOKEN}` } } - ).then(data => data.json()); - - const match = fixedIssueRegex.exec(body); - if (!match) { - return ''; - } - const issueNumber = match[3]; - return `(fixes [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber}))`; + ).then(response => { + response.text().then(text => { + const match = fixedIssueRegex.exec(text); + if (!match) { + return ''; + } + const issueNumber = match[3]; + return `(fixes [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber}))`; + }); + }); + return ''; } exports.default = changelogFunctions; diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index ad262cee395..65a7b6c48b3 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -2,6 +2,7 @@ "name": "@firebase/changelog-generator", "version": "0.1.0", "private": true, + "type": "module", "description": "A package for generating changelog", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -18,8 +19,8 @@ "dependencies": { "@changesets/types": "3.3.0", "@changesets/get-github-info": "0.5.2", - "node-fetch": "2.6.7", - "@types/node-fetch": "2.6.4" + "node-fetch": "3.2.0", + "@types/node-fetch": "2.6.6" }, "license": "Apache-2.0", "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 23e5715084b..ef1e1777d84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3466,13 +3466,13 @@ dependencies: "@types/node" "*" -"@types/node-fetch@2.6.4": - version "2.6.4" - resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== +"@types/node-fetch@2.6.6": + version "2.6.6" + resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*", "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "16.9.6" @@ -6430,6 +6430,11 @@ data-uri-to-buffer@3: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + dataloader@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" @@ -7818,6 +7823,14 @@ fecha@^4.2.0: resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz#0a83ad8f86ef62a091e22bb5a039cd03d23eecce" integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q== +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + figures@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -8183,15 +8196,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.npmjs.org/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.npmjs.org/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -8210,6 +8214,13 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -12469,6 +12480,11 @@ node-addon-api@^4.2.0: resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + node-emoji@^1.11.0: version "1.11.0" resolved "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" @@ -12483,6 +12499,15 @@ node-fetch@2.6.7, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.0.tgz#59390db4e489184fa35d4b74caf5510e8dfbaf3b" + integrity sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + node-fetch@^2.5.0, node-fetch@^2.6.1: version "2.6.5" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" @@ -17345,6 +17370,11 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-streams-polyfill@^3.0.3: + version "3.2.1" + resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== + webdriver-js-extender@2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz#57d7a93c00db4cc8d556e4d3db4b5db0a80c3bb7"