Skip to content

Commit

Permalink
fix: update Octokit import to use rest module
Browse files Browse the repository at this point in the history
Replaces the core Octokit import with the rest module in octokit.ts for better feature support.
  • Loading branch information
gentlementlegen committed Nov 7, 2024
1 parent 91d3880 commit 02e39b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/knip.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["build/index.ts", ".github/empty-string-checker.ts"],
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignore: ["**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest", "@mswjs/data", "tsx"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest", "@mswjs/data", "tsx", "simple-git"],
eslint: true,
};

Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0",
"@octokit/core": "^6.1.2",
"@octokit/plugin-paginate-graphql": "^5.2.4",
"@octokit/plugin-paginate-rest": "^11.3.5",
"@octokit/plugin-rest-endpoint-methods": "^13.2.6",
"@octokit/plugin-retry": "^7.1.2",
"@octokit/plugin-throttling": "^9.3.2",
"@octokit/rest": "^21.0.2",
"@octokit/types": "^13.6.1",
"@octokit/webhooks": "^13.3.0",
"@sinclair/typebox": "^0.33.20",
"@ubiquity-os/ubiquity-os-logger": "^1.3.2",
Expand All @@ -59,7 +64,6 @@
"@eslint/js": "^9.14.0",
"@jest/globals": "29.7.0",
"@mswjs/data": "0.16.1",
"@octokit/rest": "^21.0.2",
"@types/jest": "29.5.12",
"@types/node": "^20.11.19",
"cspell": "^8.4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/octokit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Octokit } from "@octokit/core";
import { Octokit } from "@octokit/rest";
import { RequestOptions } from "@octokit/types";
import { paginateRest } from "@octokit/plugin-paginate-rest";
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
Expand All @@ -24,5 +24,5 @@ const defaultOptions = {
};

export const customOctokit = Octokit.plugin(throttling, retry, paginateRest, restEndpointMethods, paginateGraphQL).defaults((instanceOptions: object) => {
return Object.assign({}, defaultOptions, instanceOptions);
return { ...defaultOptions, ...instanceOptions};
});

0 comments on commit 02e39b1

Please sign in to comment.