Skip to content

Commit

Permalink
feat: package is now ESM (#545)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: package is now ESM
  • Loading branch information
wolfy1339 committed May 9, 2024
1 parent 62110ae commit 20cf836
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 310 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Node
Install with `npm install @octokit/core @octokit/plugin-enterprise-cloud`. Optionally replace `@octokit/core` with a core-compatible module

```js
const { Octokit } = require("@octokit/core");
const { enterpriseCloud } = require("@octokit/plugin-enterprise-cloud");
import { Octokit } from "@octokit/core";
import { enterpriseCloud } from "@octokit/plugin-enterprise-cloud";
```

</td></tr>
Expand All @@ -49,6 +49,12 @@ octokit.scim.listProvisionedIdentities({
});
```

> [!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)
## How it works

The GitHub Enterprise Cloud route definitions are build automatically from [`@octokit/routes`](https://github.com/octokit/routes). Each time there is a new `@octokit/routes` release, the [`.github/workflows/routes-update.yml`](.github/workflows/routes-update.yml) workflow is triggered. If an update to [`routes.json`](routes.json) is found, a pull request is created.
Expand Down
Loading

0 comments on commit 20cf836

Please sign in to comment.