Skip to content

Commit

Permalink
feat: package is now ESM (#716)
Browse files Browse the repository at this point in the history
* feat: package is now ESM

BREAKING CHANGE: package is now ESM

* build: remove bundle, package is already small
  • Loading branch information
wolfy1339 authored Feb 25, 2024
1 parent 2a7fce7 commit 6c5bafb
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 208 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
token: ${{ secrets.OCTOKITBOT_PAT }}
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: npm
- run: git checkout routes-update || true
- run: npm install @octokit/types@latest
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ Node
Install with `npm install @octokit/core @octokit/plugin-rest-endpoint-methods`. Optionally replace `@octokit/core` with a compatible module

```js
const { Octokit } = require("@octokit/core");
const {
restEndpointMethods,
} = require("@octokit/plugin-rest-endpoint-methods");
import { Octokit } from "@octokit/core";
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
```

</td></tr>
Expand Down
190 changes: 49 additions & 141 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@octokit/plugin-rest-endpoint-methods",
"version": "0.0.0-development",
"type": "module",
"description": "Octokit plugin adding one method for all of api.github.com REST API endpoints",
"scripts": {
"build": "node scripts/build.mjs && tsc -p tsconfig.json",
"lint": "prettier --check '{src,test,scripts}/**/*' '!scripts/update-endpoints/generated/**' '!src/generated/**' README.md package.json",
"lint:fix": "prettier --write '{src,test,scripts}/**/*' '!scripts/update-endpoints/generated/**' '!src/generated/**' README.md package.json",
"pretest": "npm run -s lint",
"test": "jest --coverage",
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --coverage",
"update-endpoints": "npm-run-all update-endpoints:*",
"update-endpoints:fetch-json": "node scripts/update-endpoints/fetch-json.mjs",
"update-endpoints:code": "node scripts/update-endpoints/code.mjs",
Expand All @@ -27,8 +28,8 @@
"@octokit/types": "^12.6.0"
},
"devDependencies": {
"@octokit/core": "^5.0.0",
"@octokit/tsconfig": "^2.0.0",
"@octokit/core": "^6.0.0",
"@octokit/tsconfig": "^3.0.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^29.0.0",
"@types/node": "^20.0.0",
Expand All @@ -52,14 +53,18 @@
"typescript": "^5.0.0"
},
"peerDependencies": {
"@octokit/core": ">=5"
"@octokit/core": ">=6"
},
"jest": {
"extensionsToTreatAsEsm": [
".ts"
],
"transform": {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "test/tsconfig.test.json"
"tsconfig": "test/tsconfig.test.json",
"useESM": true
}
]
},
Expand Down
Loading

0 comments on commit 6c5bafb

Please sign in to comment.