Skip to content

Commit bd224a1

Browse files
authored
feat: v13 (#967)
BREAKING CHANGE: use GitHub's OpenAPI spec BREAKING CHANGE: Output ESM instead of CJS
1 parent 1e59916 commit bd224a1

25 files changed

+1182
-276
lines changed

README.md

Lines changed: 80 additions & 71 deletions
Large diffs are not rendered by default.

jest.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ const config: Config.InitialOptions = {
1010
lines: 100,
1111
},
1212
},
13+
extensionsToTreatAsEsm: ['.ts'],
1314
transform: {
1415
"^.+\\.tsx?$": [
1516
"ts-jest",
1617
{
1718
tsconfig: "test/tsconfig.json",
19+
useESM: true,
1820
},
1921
],
2022
},
@@ -27,5 +29,4 @@ const config: Config.InitialOptions = {
2729
testRegex: /test\/.*\/.*.test.ts/u.source,
2830
};
2931

30-
// We have to use a CommonJS export here due to `verbatimModuleSyntax`
31-
module.exports = config;
32+
export default config;

package-lock.json

Lines changed: 67 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@octokit/webhooks",
33
"version": "0.0.0-development",
4+
"type": "module",
45
"description": "GitHub webhook events toolset for Node.js",
56
"keywords": [],
67
"repository": "github:octokit/webhooks.js",
@@ -9,11 +10,11 @@
910
"scripts": {
1011
"build": "node scripts/build.mjs && tsc -p tsconfig.json",
1112
"coverage": "jest --coverage && open coverage/lcov-report/index.html",
12-
"generate-types": "ts-node --transpile-only scripts/generate-types.ts",
13+
"generate-types": "node --loader=ts-node/esm scripts/generate-types.ts",
1314
"lint": "prettier --check 'src/**/*.{ts,json}' 'scripts/**/*' 'test/**/*.ts' README.md package.json",
1415
"lint:fix": "prettier --write 'src/**/*.{ts,json}' 'scripts/**/*' 'test/**/*.ts' README.md package.json",
1516
"pretest": "npm run -s lint",
16-
"test": "jest --coverage",
17+
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --coverage",
1718
"validate:ts": "tsc --noEmit --noImplicitAny --target es2020 --esModuleInterop --moduleResolution node16 --module node16 --allowImportingTsExtensions test/typescript-validate.ts"
1819
},
1920
"prettier": {},
@@ -40,19 +41,17 @@
4041
]
4142
},
4243
"dependencies": {
43-
"@octokit/request-error": "^5.0.0",
44-
"@octokit/webhooks-methods": "^4.1.0",
45-
"@octokit/webhooks-types": "7.3.2",
46-
"aggregate-error": "^3.1.0"
44+
"@octokit/openapi-webhooks-types": "5.3.2",
45+
"@octokit/request-error": "^6.0.1",
46+
"@octokit/webhooks-methods": "^5.0.0",
47+
"aggregate-error": "^5.0.0"
4748
},
4849
"devDependencies": {
4950
"@jest/types": "^29.0.0",
50-
"@octokit/tsconfig": "^2.0.0",
51-
"@octokit/webhooks-schemas": "7.3.2",
51+
"@octokit/openapi-webhooks": "5.3.2",
52+
"@octokit/tsconfig": "^3.0.0",
5253
"@types/jest": "^29.0.0",
53-
"@types/json-schema": "^7.0.7",
5454
"@types/node": "^20.0.0",
55-
"@types/prettier": "^2.0.0",
5655
"axios": "^1.0.0",
5756
"esbuild": "^0.20.0",
5857
"express": "^4.17.1",

scripts/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function main() {
4343
bundle: true,
4444
platform: "node",
4545
target: "node18",
46-
format: "cjs",
46+
format: "esm",
4747
...sharedOptions,
4848
}),
4949
// Build an ESM browser bundle

0 commit comments

Comments
 (0)