Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): bump @octokit/core to 5.x #2543

Merged
merged 5 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/hungry-rabbits-learn.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion incubator/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ An experimental tool for building your apps in the cloud.

## Requirements

- [Node.js](https://nodejs.org/en/download/) LTS 14.18 or greater
- [Node.js](https://nodejs.org/en/download/) LTS 18.12 or greater

| Feature | Android | iOS | macOS | Windows |
| :--------------------------- | :-----: | :-: | :---: | :-----: |
Expand Down
11 changes: 6 additions & 5 deletions incubator/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@
"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",
"ora": "^6.1.2",
"node-fetch": "^3.3.2",
"ora": "^7.0.1",
"pkg-dir": "^7.0.0",
"qrcode": "^1.5.0",
"yargs": "^16.0.0"
Expand All @@ -60,7 +61,7 @@
"typescript": "^5.0.0"
},
"engines": {
"node": ">=14.18"
"node": ">=18.12"
},
"eslintConfig": {
"extends": "@rnx-kit/eslint-config"
Expand Down
8 changes: 7 additions & 1 deletion incubator/build/src/remotes/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -35,7 +36,12 @@ const workflowRunCache: Record<string, number> = {};

const octokit = once(() => {
const RestClient = Octokit.plugin(restEndpointMethods);
return new RestClient({ auth: getPersonalAccessToken() });
return new RestClient({
auth: getPersonalAccessToken(),
// Use `node-fetch` only if Node doesn't implement Fetch API:
// https://github.com/octokit/request.js/blob/v8.1.1/src/fetch-wrapper.ts#L28-L31
request: "fetch" in globalThis ? undefined : { fetch },
});
});

async function downloadArtifact(
Expand Down
Loading