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

feat: v7 #580

Merged
merged 36 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dacadbe
feat: package is now ESM
wolfy1339 Feb 24, 2024
ff5d3c9
fix: remove deprecated code
wolfy1339 Feb 24, 2024
3a0e3f6
docs(README): use ESM for examples
wolfy1339 Feb 24, 2024
174b0b6
fix: adapt code for `universal-github-app-jwt@v2`
wolfy1339 Feb 24, 2024
ef1f6be
build: adapt for ESM
wolfy1339 Feb 24, 2024
3aa6dab
test: adapt for latest code
wolfy1339 Feb 24, 2024
964ccf6
fix: use full relative path import
wolfy1339 Feb 24, 2024
daf60fb
fix: bump packages
wolfy1339 Feb 25, 2024
e6c0c35
fix: update deps
wolfy1339 Feb 25, 2024
1775a77
fix(pkg): add `main` field
wolfy1339 Feb 27, 2024
c7939c6
Merge remote-tracking branch 'origin/main' into beta
wolfy1339 Mar 5, 2024
2cbf094
fix: bump `@octokit/request`
wolfy1339 Mar 5, 2024
93bb576
test: add type for `clock` variable
wolfy1339 Mar 5, 2024
3e150aa
fix: bump Octokit deps
wolfy1339 Mar 5, 2024
2ec5c30
Merge branch 'main' into beta
wolfy1339 Mar 5, 2024
b1038a8
build(deps): bump deps
wolfy1339 Mar 7, 2024
7aaf73f
Merge branch 'main' into beta
wolfy1339 Mar 12, 2024
b19ced5
docs: add notes on required typescript changes
wolfy1339 Apr 16, 2024
b9c243d
fix: add `default` fallback export
wolfy1339 Apr 16, 2024
97cd31b
Merge branch 'main' into beta
wolfy1339 Apr 16, 2024
6d40281
fix: upgrade octokit deps
wolfy1339 Apr 16, 2024
be87f63
build: package-lock update
wolfy1339 Apr 16, 2024
c968424
build(package): lock file
gr2m Apr 29, 2024
45b531c
Merge branch 'main' into beta
wolfy1339 Apr 29, 2024
7e86a9a
appease the TS overlords
gr2m Apr 29, 2024
1149b89
build(deps): remove `@sinonjs/fake-timers`
gr2m Apr 30, 2024
dffdb23
build(package): lock file
gr2m Apr 30, 2024
4acb051
test: use jest built-in fake timers API
gr2m Apr 30, 2024
fcce291
fix: mark import as type import
wolfy1339 Apr 30, 2024
09e6ab3
Merge branch 'main' into beta
wolfy1339 Apr 30, 2024
96ba70f
build: remove sinonjs types
wolfy1339 Apr 30, 2024
33c0aec
test: create separate file for flaky tests that use fake timers to ad…
gr2m Apr 30, 2024
0808b98
Revert "test: create separate file for flaky tests that use fake time…
gr2m Apr 30, 2024
623d28b
test: skip flaky tests, see #580
gr2m Apr 30, 2024
99eb4ec
test: ignore coverage for lines tested by skipped tsets
gr2m Apr 30, 2024
5e2b24d
docs(README): add note about `privateKey` argument that escaped new l…
gr2m Apr 30, 2024
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
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@ Node
Install with <code>npm install @octokit/auth-app</code>

```js
const { createAppAuth } = require("@octokit/auth-app");
// or: import { createAppAuth } from "@octokit/auth-app";
import { createAppAuth } from "@octokit/auth-app";
```

</td></tr>
</tbody>
</table>

> [!IMPORTANT]
> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`.
>
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)

### Authenticate as GitHub App (JSON Web Token)

```js
Expand Down Expand Up @@ -225,8 +230,8 @@ Node
Install with `npm install @octokit/core @octokit/auth-app`. Optionally replace `@octokit/core` with a compatible module

```js
const { Octokit } = require("@octokit/core");
const { createAppAuth, createOAuthUserAuth } = require("@octokit/auth-app");
import { Octokit } from "@octokit/core";
import { createAppAuth, createOAuthUserAuth } from "@octokit/auth-app";
```

</td></tr>
Expand Down Expand Up @@ -332,7 +337,7 @@ await installationOctokit.request("POST /repos/{owner}/{repo}/issues", {
<code>string</code>
</th>
<td>
<strong>Required</strong>. Content of the <code>*.pem</code> file you downloaded from the app’s about page. You can generate a new private key if needed.
<strong>Required</strong>. Content of the <code>*.pem</code> file you downloaded from the app’s about page. You can generate a new private key if needed. If your private key contains escaped newlines (`\\n`), they will be automatically replaced with actual newlines.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -382,7 +387,7 @@ Automatically set to `octokit.request` when using with an `Octokit` constructor.
For standalone usage, you can pass in your own [`@octokit/request`](https://github.com/octokit/request.js) instance. For usage with enterprise, set `baseUrl` to the hostname + `/api/v3`. Example:

```js
const { request } = require("@octokit/request");
import { request } from "@octokit/request";
createAppAuth({
appId: 1,
privateKey: "-----BEGIN PRIVATE KEY-----\n...",
Expand Down Expand Up @@ -431,10 +436,11 @@ createAppAuth({
You can pass in your preferred logging tool by passing <code>option.log</code> to the constructor. If you would like to make the log level configurable using an environment variable or external option, we recommend the console-log-level package. For example:

```js
import consoleLogLevel from "console-log-level";
createAppAuth({
appId: 1,
privateKey: "-----BEGIN PRIVATE KEY-----\n...",
log: require("console-log-level")({ level: "info" }),
log: consoleLogLevel({ level: "info" }),
});
```

Expand Down Expand Up @@ -674,10 +680,7 @@ The `auth({type: "oauth-user", factory })` call with resolve with whatever the f
For example, you can create a new `auth` instance for an installation which shares the internal state (especially the access token cache) with the calling `auth` instance:

```js
const {
createAppAuth,
createOAuthUserAuth,
} = require("@octokit/auth-oauth-app");
import { createAppAuth, createOAuthUserAuth } from "@octokit/auth-oauth-app";

const appAuth = createAppAuth({
appId: 1,
Expand Down Expand Up @@ -807,10 +810,7 @@ The `auth({type: "oauth-user", factory })` call with resolve with whatever the f
For example, you can create a new `auth` instance for an installation which shares the internal state (especially the access token cache) with the calling `auth` instance:

```js
const {
createAppAuth,
createOAuthUserAuth,
} = require("@octokit/auth-oauth-app");
import { createAppAuth, createOAuthUserAuth } from "@octokit/auth-oauth-app";

const appAuth = createAppAuth({
appId: 1,
Expand Down
Loading