diff --git a/.changeset/hungry-rabbits-learn.md b/.changeset/hungry-rabbits-learn.md new file mode 100644 index 000000000..cf63485bd --- /dev/null +++ b/.changeset/hungry-rabbits-learn.md @@ -0,0 +1,7 @@ +--- +"@rnx-kit/build": minor +--- + +Bumped `@octokit/core` to 5.0, and dropped support for Node 14 and 16. + +Testing shows that at least Node 16 still works if you import `node-fetch`, so technically, if your setup does not enforce Node version, you can still use this package. diff --git a/incubator/build/package.json b/incubator/build/package.json index 41db04ef5..cdbfd81d3 100644 --- a/incubator/build/package.json +++ b/incubator/build/package.json @@ -39,13 +39,14 @@ "test": "rnx-kit-scripts test" }, "dependencies": { - "@octokit/core": "^4.2.4", - "@octokit/plugin-rest-endpoint-methods": "7.2.1", - "@octokit/request-error": "^3.0.0", + "@octokit/core": "^5.0.0", + "@octokit/plugin-rest-endpoint-methods": "^9.0.0", + "@octokit/request-error": "^5.0.0", "@rnx-kit/config": "^0.6.0", "env-paths": "^3.0.0", "fast-xml-parser": "^4.0.0", "find-up": "^6.3.0", + "node-fetch": "^3.3.2", "ora": "^6.1.2", "pkg-dir": "^7.0.0", "qrcode": "^1.5.0", @@ -60,7 +61,7 @@ "typescript": "^5.0.0" }, "engines": { - "node": ">=14.18" + "node": ">=18.12" }, "eslintConfig": { "extends": "@rnx-kit/eslint-config" diff --git a/incubator/build/src/remotes/github.ts b/incubator/build/src/remotes/github.ts index f0c8a59b5..74f44db88 100644 --- a/incubator/build/src/remotes/github.ts +++ b/incubator/build/src/remotes/github.ts @@ -2,6 +2,7 @@ import { Octokit } from "@octokit/core"; import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods"; import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods"; import { RequestError } from "@octokit/request-error"; +import fetch from "node-fetch"; import * as fs from "node:fs"; import * as path from "node:path"; import * as readline from "node:readline"; @@ -35,7 +36,7 @@ const workflowRunCache: Record = {}; const octokit = once(() => { const RestClient = Octokit.plugin(restEndpointMethods); - return new RestClient({ auth: getPersonalAccessToken() }); + return new RestClient({ auth: getPersonalAccessToken(), request: { fetch } }); }); async function downloadArtifact( diff --git a/yarn.lock b/yarn.lock index 4d9f1e25f..82901f31e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2767,49 +2767,47 @@ __metadata: languageName: node linkType: hard -"@octokit/auth-token@npm:^3.0.0": - version: 3.0.3 - resolution: "@octokit/auth-token@npm:3.0.3" - dependencies: - "@octokit/types": ^9.0.0 - checksum: 9b3f569cec1b7e0aa88ab6da68aed4b49b6652261bd957257541fabaf6a4d4ed99f908153cc3dd2fe15b8b0ccaff8caaafaa50bb1a4de3925b0954a47cca1900 +"@octokit/auth-token@npm:^4.0.0": + version: 4.0.0 + resolution: "@octokit/auth-token@npm:4.0.0" + checksum: d78f4dc48b214d374aeb39caec4fdbf5c1e4fd8b9fcb18f630b1fe2cbd5a880fca05445f32b4561f41262cb551746aeb0b49e89c95c6dd99299706684d0cae2f languageName: node linkType: hard -"@octokit/core@npm:^4.2.4": - version: 4.2.4 - resolution: "@octokit/core@npm:4.2.4" +"@octokit/core@npm:^5.0.0": + version: 5.0.0 + resolution: "@octokit/core@npm:5.0.0" dependencies: - "@octokit/auth-token": ^3.0.0 - "@octokit/graphql": ^5.0.0 - "@octokit/request": ^6.0.0 - "@octokit/request-error": ^3.0.0 - "@octokit/types": ^9.0.0 + "@octokit/auth-token": ^4.0.0 + "@octokit/graphql": ^7.0.0 + "@octokit/request": ^8.0.2 + "@octokit/request-error": ^5.0.0 + "@octokit/types": ^11.0.0 before-after-hook: ^2.2.0 universal-user-agent: ^6.0.0 - checksum: ac8ab47440a31b0228a034aacac6994b64d6b073ad5b688b4c5157fc5ee0d1af1c926e6087bf17fd7244ee9c5998839da89065a90819bde4a97cb77d4edf58a6 + checksum: 1a5d1112a2403d146aa1db7aaf81a31192ef6b0310a1e6f68c3e439fded22bd4b3a930f5071585e6ca0f2f5e7fc4a1aac68910525b71b03732c140e362d26a33 languageName: node linkType: hard -"@octokit/endpoint@npm:^7.0.0": - version: 7.0.5 - resolution: "@octokit/endpoint@npm:7.0.5" +"@octokit/endpoint@npm:^9.0.0": + version: 9.0.0 + resolution: "@octokit/endpoint@npm:9.0.0" dependencies: - "@octokit/types": ^9.0.0 + "@octokit/types": ^11.0.0 is-plain-object: ^5.0.0 universal-user-agent: ^6.0.0 - checksum: 81c9e9eabf50e48940cceff7c4d7fbc9327190296507cfe8a199ea00cd492caf8f18a841caf4e3619828924b481996eb16091826db6b5a649bee44c8718ecaa9 + checksum: 0e402c4d0fbe5b8053630cedb30dde5074bb6410828a05dc93d7e0fdd6c17f9a44b66586ef1a4e4ee0baa8d34ef7d6f535e2f04d9ea42909b7fc7ff55ce56a48 languageName: node linkType: hard -"@octokit/graphql@npm:^5.0.0": - version: 5.0.5 - resolution: "@octokit/graphql@npm:5.0.5" +"@octokit/graphql@npm:^7.0.0": + version: 7.0.1 + resolution: "@octokit/graphql@npm:7.0.1" dependencies: - "@octokit/request": ^6.0.0 - "@octokit/types": ^9.0.0 + "@octokit/request": ^8.0.1 + "@octokit/types": ^11.0.0 universal-user-agent: ^6.0.0 - checksum: eb2d1a6305a3d1f55ff0ce92fb88b677f0bb789757152d58a79ef61171fb65ecf6fe18d6c27e236c0cee6a0c2600c2cb8370f5ac7184f8e9361c085aa4555bb1 + checksum: 7ee907987b1b8312c6f870c44455cbd3eed805bb1a4095038f4e7e62ee2e006bd766f2a71dfbe56b870cd8f7558309c602f00d3e252fe59578f4acf6249a4f17 languageName: node linkType: hard @@ -2820,48 +2818,47 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:7.2.1": - version: 7.2.1 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.2.1" +"@octokit/plugin-rest-endpoint-methods@npm:^9.0.0": + version: 9.0.0 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:9.0.0" dependencies: - "@octokit/types": ^9.3.1 + "@octokit/types": ^11.0.0 peerDependencies: - "@octokit/core": ">=3" - checksum: 069e52305f9d2e85fb83819a80860e526b9da2e0936640975f749a2c63020674053e6f4b5af771651a93320172579b0779bf3d663c8adcd090f152aac29f4ad4 + "@octokit/core": ">=5" + checksum: 8795cb29be042c839098886a03c2ec6051e3fd7a29f16f4f8a487aa2d85ceb00df8a4432499a43af550369bd730ce9b1b9d7eeff768745b80a3e67698ca9a5dd languageName: node linkType: hard -"@octokit/request-error@npm:^3.0.0": - version: 3.0.3 - resolution: "@octokit/request-error@npm:3.0.3" +"@octokit/request-error@npm:^5.0.0": + version: 5.0.0 + resolution: "@octokit/request-error@npm:5.0.0" dependencies: - "@octokit/types": ^9.0.0 + "@octokit/types": ^11.0.0 deprecation: ^2.0.0 once: ^1.4.0 - checksum: 5db0b514732686b627e6ed9ef1ccdbc10501f1b271a9b31f784783f01beee70083d7edcfeb35fbd7e569fa31fdd6762b1ff6b46101700d2d97e7e48e749520d0 + checksum: 2012eca66f6b8fa4038b3bfe81d65a7134ec58e2caf45d229aca13b9653ab260abd95229bd1a8c11180ee0bcf738e2556831a85de28f39b175175653c3b79fdd languageName: node linkType: hard -"@octokit/request@npm:^6.0.0": - version: 6.2.3 - resolution: "@octokit/request@npm:6.2.3" +"@octokit/request@npm:^8.0.1, @octokit/request@npm:^8.0.2": + version: 8.1.1 + resolution: "@octokit/request@npm:8.1.1" dependencies: - "@octokit/endpoint": ^7.0.0 - "@octokit/request-error": ^3.0.0 - "@octokit/types": ^9.0.0 + "@octokit/endpoint": ^9.0.0 + "@octokit/request-error": ^5.0.0 + "@octokit/types": ^11.1.0 is-plain-object: ^5.0.0 - node-fetch: ^2.6.7 universal-user-agent: ^6.0.0 - checksum: fef4097be8375d20bb0b3276d8a3adf866ec628f2b0664d334f3c29b92157da847899497abdc7a5be540053819b55564990543175ad48f04e9e6f25f0395d4d3 + checksum: dec3ba2cba14739159cd8d1653ad8ac6d58095e4ac294d312d20ce2c63c60c3cad2e5499137244dba3d681fd5cd7f74b4b5d4df024a19c0ee1831204e5a3a894 languageName: node linkType: hard -"@octokit/types@npm:^9.0.0, @octokit/types@npm:^9.3.1": - version: 9.3.2 - resolution: "@octokit/types@npm:9.3.2" +"@octokit/types@npm:^11.0.0, @octokit/types@npm:^11.1.0": + version: 11.1.0 + resolution: "@octokit/types@npm:11.1.0" dependencies: "@octokit/openapi-types": ^18.0.0 - checksum: f55d096aaed3e04b8308d4422104fb888f355988056ba7b7ef0a4c397b8a3e54290d7827b06774dbe0c9ce55280b00db486286954f9c265aa6b03091026d9da8 + checksum: 72627a94ddaf7bc14db06572bcde67649aad608cd86548818380db9305f4c0ca9ca078a62dd883858a267e8ec8fd596a0fce416aa04197c439b9548efef609a7 languageName: node linkType: hard @@ -3441,9 +3438,9 @@ __metadata: version: 0.0.0-use.local resolution: "@rnx-kit/build@workspace:incubator/build" dependencies: - "@octokit/core": ^4.2.4 - "@octokit/plugin-rest-endpoint-methods": 7.2.1 - "@octokit/request-error": ^3.0.0 + "@octokit/core": ^5.0.0 + "@octokit/plugin-rest-endpoint-methods": ^9.0.0 + "@octokit/request-error": ^5.0.0 "@rnx-kit/config": ^0.6.0 "@rnx-kit/scripts": "*" "@types/qrcode": ^1.4.2 @@ -3452,6 +3449,7 @@ __metadata: fast-xml-parser: ^4.0.0 find-up: ^6.3.0 jest: ^29.2.1 + node-fetch: ^3.3.2 ora: ^6.1.2 pkg-dir: ^7.0.0 prettier: ^3.0.0 @@ -6273,6 +6271,13 @@ __metadata: languageName: node linkType: hard +"data-uri-to-buffer@npm:^4.0.0": + version: 4.0.1 + resolution: "data-uri-to-buffer@npm:4.0.1" + checksum: 0d0790b67ffec5302f204c2ccca4494f70b4e2d940fea3d36b09f0bb2b8539c2e86690429eb1f1dc4bcc9e4df0644193073e63d9ee48ac9fce79ec1506e4aa4c + languageName: node + linkType: hard + "dayjs@npm:^1.8.15": version: 1.10.4 resolution: "dayjs@npm:1.10.4" @@ -7376,6 +7381,16 @@ __metadata: languageName: node linkType: hard +"fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4": + version: 3.2.0 + resolution: "fetch-blob@npm:3.2.0" + dependencies: + node-domexception: ^1.0.0 + web-streams-polyfill: ^3.0.3 + checksum: f19bc28a2a0b9626e69fd7cf3a05798706db7f6c7548da657cbf5026a570945f5eeaedff52007ea35c8bcd3d237c58a20bf1543bc568ab2422411d762dd3d5bf + languageName: node + linkType: hard + "figures@npm:3.2.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -7574,6 +7589,15 @@ __metadata: languageName: node linkType: hard +"formdata-polyfill@npm:^4.0.10": + version: 4.0.10 + resolution: "formdata-polyfill@npm:4.0.10" + dependencies: + fetch-blob: ^3.1.2 + checksum: 82a34df292afadd82b43d4a740ce387bc08541e0a534358425193017bf9fb3567875dc5f69564984b1da979979b70703aa73dee715a17b6c229752ae736dd9db + languageName: node + linkType: hard + "fresh@npm:0.5.2": version: 0.5.2 resolution: "fresh@npm:0.5.2" @@ -10665,6 +10689,13 @@ __metadata: languageName: node linkType: hard +"node-domexception@npm:^1.0.0": + version: 1.0.0 + resolution: "node-domexception@npm:1.0.0" + checksum: ee1d37dd2a4eb26a8a92cd6b64dfc29caec72bff5e1ed9aba80c294f57a31ba4895a60fd48347cf17dd6e766da0ae87d75657dfd1f384ebfa60462c2283f5c7f + languageName: node + linkType: hard + "node-fetch@npm:^2.2.0, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" @@ -10679,6 +10710,17 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^3.3.2": + version: 3.3.2 + resolution: "node-fetch@npm:3.3.2" + dependencies: + data-uri-to-buffer: ^4.0.0 + fetch-blob: ^3.1.4 + formdata-polyfill: ^4.0.10 + checksum: 06a04095a2ddf05b0830a0d5302699704d59bda3102894ea64c7b9d4c865ecdff2d90fd042df7f5bc40337266961cb6183dcc808ea4f3000d024f422b462da92 + languageName: node + linkType: hard + "node-gyp-build@npm:^4.3.0": version: 4.6.0 resolution: "node-gyp-build@npm:4.6.0" @@ -13844,6 +13886,13 @@ __metadata: languageName: node linkType: hard +"web-streams-polyfill@npm:^3.0.3": + version: 3.2.1 + resolution: "web-streams-polyfill@npm:3.2.1" + checksum: b119c78574b6d65935e35098c2afdcd752b84268e18746606af149e3c424e15621b6f1ff0b42b2676dc012fc4f0d313f964b41a4b5031e525faa03997457da02 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1"