From 335f4ebf7f46425ba6e40f9edd9e88892bb674d5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 20 Jul 2021 21:05:10 +0000 Subject: [PATCH 1/2] fix(deps): update dependency javascript-plugin-architecture-with-typescript-definitions to v4 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d69e8a0..f356494 100644 --- a/package-lock.json +++ b/package-lock.json @@ -736,9 +736,9 @@ } }, "javascript-plugin-architecture-with-typescript-definitions": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/javascript-plugin-architecture-with-typescript-definitions/-/javascript-plugin-architecture-with-typescript-definitions-3.3.0.tgz", - "integrity": "sha512-NAskSOGGgAQKmhhb6SVxdt0pWv8VvzAu0Z3nv6gRpxdSAo1QHOmeqTaBLHcJmmdR2/2rB4ylsR7MFJYHye2t+Q==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/javascript-plugin-architecture-with-typescript-definitions/-/javascript-plugin-architecture-with-typescript-definitions-4.0.0.tgz", + "integrity": "sha512-mHETgDTbBSXY+VixZ6tc4VO+/1bsN5ityh0+VearejuEU+7RutR6W+B3/N6qn2on1Zp77fvZyjZ4CtKSQkyArQ==" }, "js-tokens": { "version": "4.0.0", diff --git a/package.json b/package.json index 60ec786..6988201 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "MIT", "repository": "github:octokit/octokit-next.js", "dependencies": { - "javascript-plugin-architecture-with-typescript-definitions": "3.3.0", + "javascript-plugin-architecture-with-typescript-definitions": "4.0.0", "node-fetch": "3.0.0-beta.10" }, "types": "./index.d.ts", From 6fb3a8b6c77a3df5ddfd69c0fde9b99204d28623 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:11:06 -0700 Subject: [PATCH 2/2] fix: adapt for `javascript-plugin-architecture-with-typescript-definitions` v4 --- index.d.ts | 5 +++++ index.js | 2 +- test.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index e4839eb..f76edab 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,6 +7,11 @@ type Constructor = new (...args: any[]) => T; export namespace Octokit { interface Options extends Base.Options { + /** + * GitHub API Version. Defaults to "api.github.com" + */ + version?: string; + /** * GitHub's REST API base URL. Defaults to https://api.github.com */ diff --git a/index.js b/index.js index 0a8edb3..bac358a 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import { Base } from "javascript-plugin-architecture-with-typescript-definitions"; import { requestPlugin } from "./plugins/request/index.js"; -export const Octokit = Base.plugin(requestPlugin).defaults({ +export const Octokit = Base.withPlugins([requestPlugin]).withDefaults({ baseUrl: "https://api.github.com", }); diff --git a/test.js b/test.js index 17ccdbf..13c3d33 100644 --- a/test.js +++ b/test.js @@ -9,7 +9,7 @@ test("octokit.request is a function", () => { }); test("myOctokit.request is a function", () => { - const MyOctokit = Octokit.defaults({}); + const MyOctokit = Octokit.withDefaults({}); const myOctokit = new MyOctokit(); assert.equal(typeof myOctokit.request, "function"); });