Skip to content

Commit

Permalink
streamline
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Oct 3, 2023
1 parent 7ceaf08 commit 2cdd817
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/manifest-creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import yaml from "js-yaml";
import path from "path";
import updateDotenv from "update-dotenv";
import { ProbotOctokit } from "./octokit/probot-octokit";

type OctokitOptions = NonNullable<
ConstructorParameters<typeof ProbotOctokit>[0]
>;
import type { OctokitOptions } from "./types";

export class ManifestCreation {
get pkg() {
Expand Down
3 changes: 2 additions & 1 deletion src/octokit/get-authenticated-octokit.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { State } from "../types";
import { ProbotOctokit } from "./probot-octokit";
import type { OctokitOptions } from "../types";

type FactoryOptions = {
octokit: InstanceType<typeof ProbotOctokit>;
octokitOptions: ConstructorParameters<typeof ProbotOctokit> & {
octokitOptions: OctokitOptions & {
throttle?: Record<string, unknown>;
auth?: Record<string, unknown>;
};
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ export type MiddlewareOptions = {
webhooksPath?: string;
[key: string]: unknown;
};

export type OctokitOptions = NonNullable<
ConstructorParameters<typeof ProbotOctokit>[0]
>;
7 changes: 3 additions & 4 deletions test/probot-octokit.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import fetchMock from "fetch-mock";
import { ProbotOctokit } from "../src/octokit/probot-octokit";
import { Headers } from "undici";
import { RequestError } from "@octokit/types";

type Options = ConstructorParameters<typeof ProbotOctokit>[0];
import type { RequestError } from "@octokit/types";
import type { OctokitOptions } from "../src/types";

describe("ProbotOctokit", () => {
const defaultOptions: Options = {
const defaultOptions: OctokitOptions = {
retry: {
// disable retries to test error states
enabled: false,
Expand Down

0 comments on commit 2cdd817

Please sign in to comment.