diff --git a/package.json b/package.json index d034d581..9109aba0 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@graphql-codegen/typescript-operations": "4.6.0", "@octokit/graphql-schema": "15.26.0", "@octokit/webhooks-examples": "7.6.1", - "@tsconfig/recommended": "1.0.8", + "@tsconfig/node20": "^20.1.4", "@types/node": "20.17.32", "@types/proxy": "2.0.0", "@vercel/ncc": "0.38.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5fda6266..4163a004 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,9 +54,9 @@ importers: '@octokit/webhooks-examples': specifier: 7.6.1 version: 7.6.1 - '@tsconfig/recommended': - specifier: 1.0.8 - version: 1.0.8 + '@tsconfig/node20': + specifier: ^20.1.4 + version: 20.1.4 '@types/node': specifier: 20.17.32 version: 20.17.32 @@ -1090,8 +1090,8 @@ packages: cpu: [x64] os: [win32] - '@tsconfig/recommended@1.0.8': - resolution: {integrity: sha512-TotjFaaXveVUdsrXCdalyF6E5RyG6+7hHHQVZonQtdlk1rJZ1myDIvPUUKPhoYv+JAzThb2lQJh9+9ZfF46hsA==} + '@tsconfig/node20@20.1.4': + resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==} '@types/buffer-from@1.1.3': resolution: {integrity: sha512-2lq4YC9uLUMGHkl2IDtX4tCXSo2+hwMpOJcY1qiIk1kybc31rIlPyM1HCVJhkPFIo75a/pOVxqyvwuf5TpCG/w==} @@ -4020,7 +4020,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.40.0': optional: true - '@tsconfig/recommended@1.0.8': {} + '@tsconfig/node20@20.1.4': {} '@types/buffer-from@1.1.3': dependencies: diff --git a/tests/fixtures.ts b/tests/fixtures.ts index 02d1d5c7..83ad5485 100644 --- a/tests/fixtures.ts +++ b/tests/fixtures.ts @@ -1,7 +1,12 @@ -import WebhookDefinitions from '@octokit/webhooks-examples' +import fs from 'fs/promises' +import { WebhookDefinition } from '@octokit/webhooks-examples' import { PullRequestClosedEvent, PullRequestOpenedEvent, WorkflowRunCompletedEvent } from '@octokit/webhooks-types' -const examples = WebhookDefinitions.flatMap((definition) => definition.examples) +const examples = ( + JSON.parse( + await fs.readFile('node_modules/@octokit/webhooks-examples/api.github.com/index.json', 'utf-8'), + ) as WebhookDefinition[] +).flatMap((definition) => definition.examples) export const examplePullRequestClosedEvent: PullRequestClosedEvent = (() => { for (const example of examples) { diff --git a/tsconfig.json b/tsconfig.json index d4114945..92ebc1fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@tsconfig/recommended/tsconfig.json" + "extends": "@tsconfig/node20/tsconfig.json" }