deps: upgrade tyepscript to 5.7 (#7160)

**Motivation**

Keep the deps updated.

**Description**

Use latest features provided by Typescript. See the comments below. 

**Steps to test or reproduce**

- Run all tests
This commit is contained in:
Nazar Hussain
2025-02-25 14:24:14 +01:00
committed by GitHub
parent d1f9f7b32a
commit b2ebe4921b
34 changed files with 93 additions and 45 deletions

View File

@@ -70,7 +70,7 @@
"stream-http": "^3.2.0", "stream-http": "^3.2.0",
"supertest": "^6.3.3", "supertest": "^6.3.3",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.4.2", "typescript": "^5.7.3",
"typescript-docs-verifier": "^2.5.3", "typescript-docs-verifier": "^2.5.3",
"vite": "^5.3.4", "vite": "^5.3.4",
"vite-plugin-dts": "^3.9.1", "vite-plugin-dts": "^3.9.1",

View File

@@ -3,5 +3,5 @@
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "lib" "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -227,7 +227,7 @@ export class Eth1DepositDataTracker {
// If remoteFollowBlock is not at or beyond deployBlock, there is no need to // If remoteFollowBlock is not at or beyond deployBlock, there is no need to
// fetch and track any deposit data yet // fetch and track any deposit data yet
if (remoteFollowBlock < this.eth1Provider.deployBlock ?? 0) return true; if (remoteFollowBlock < (this.eth1Provider.deployBlock ?? 0)) return true;
const hasCaughtUpDeposits = await this.updateDepositCache(remoteFollowBlock); const hasCaughtUpDeposits = await this.updateDepositCache(remoteFollowBlock);
const hasCaughtUpBlocks = await this.updateBlockCache(remoteFollowBlock); const hasCaughtUpBlocks = await this.updateBlockCache(remoteFollowBlock);

View File

@@ -2,7 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "lib", "outDir": "lib"
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"]
} }
} }

View File

@@ -1,7 +1,8 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"exclude": ["../../node_modules/it-pipe"], "exclude": ["../../node_modules/it-pipe"],
"include": ["src"],
"compilerOptions": { "compilerOptions": {
"typeRoots": ["../../node_modules/@types", "../../types"] "outDir": "lib"
} }
} }

View File

@@ -2,7 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "lib", "outDir": "lib"
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"]
} }
} }

View File

@@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": { "compilerOptions": {
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"] "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -1,5 +1,4 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"exclude": ["src/index.browser.ts", "test/unit/webEsmBundle.browser.test.ts"], "exclude": ["src/index.browser.ts", "test/unit/webEsmBundle.browser.test.ts"]
"compilerOptions": {}
} }

View File

@@ -2,6 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib" "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -2,6 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib" "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -2,8 +2,8 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "lib",
// Had to add it because compiling error `Duplicate identifier 'Buffer'` // Had to add it because compiling error `Duplicate identifier 'Buffer'`
"skipLibCheck": true "skipLibCheck": true,
"outDir": "lib"
} }
} }

View File

@@ -1,5 +1,6 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": { "compilerOptions": {
// To fix error "Duplicate identifier 'Buffer'" // To fix error "Duplicate identifier 'Buffer'"
// This can save time during compilation at the expense of type-system accuracy. // This can save time during compilation at the expense of type-system accuracy.
@@ -7,6 +8,7 @@
// Rather than doing a full check of all d.ts files, TypeScript will type check // Rather than doing a full check of all d.ts files, TypeScript will type check
// the code you specifically refer to in your apps source code. // the code you specifically refer to in your apps source code.
// https://www.typescriptlang.org/tsconfig#skipLibCheck // https://www.typescriptlang.org/tsconfig#skipLibCheck
"skipLibCheck": true "skipLibCheck": true,
"outDir": "lib"
} }
} }

View File

@@ -1,9 +1,11 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"exclude": [ "exclude": [
"../../node_modules/it-pipe" "../../node_modules/it-pipe"
], ],
"compilerOptions": { "compilerOptions": {
"outDir": "lib",
"typeRoots": [ "typeRoots": [
"../../node_modules/@types", "../../node_modules/@types",
"../../types" "../../types"

View File

@@ -2,7 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib", "outDir": "lib"
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"]
} }
} }

View File

@@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": { "compilerOptions": {
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"] "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -2,7 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib", "outDir": "lib"
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"]
} }
} }

View File

@@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": { "compilerOptions": {
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"] "outDir": "lib"
} }
} }

View File

@@ -2,6 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib" "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -2,6 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "./lib" "outDir": "lib"
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": {} "include": ["src"],
"compilerOptions": {
"outDir": "lib"
}
} }

View File

@@ -2,7 +2,6 @@
"extends": "../../tsconfig.build.json", "extends": "../../tsconfig.build.json",
"include": ["src"], "include": ["src"],
"compilerOptions": { "compilerOptions": {
"outDir": "lib", "outDir": "lib"
"typeRoots": ["../../node_modules/@types", "./node_modules/@types"]
} }
} }

View File

@@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": { "compilerOptions": {
"typeRoots": ["../../node_modules/@types", "./node_modules/@types", "../../types"] "outDir": "lib"
} }
} }

View File

@@ -24,9 +24,20 @@
"declarationMap": true, "declarationMap": true,
"incremental": true, "incremental": true,
"preserveWatchOutput": true, "preserveWatchOutput": true,
// Enable it when upgrade `vite-plugin-dts`
// "noUncheckedSideEffectImports": true,
// "noCheck": true,
// TODO: Investigate following errors: // TODO: Investigate following errors:
// - Cannot find module 'rollup/parseAst' or its corresponding type declarations // - Cannot find module 'rollup/parseAst' or its corresponding type declarations
"skipLibCheck": true, "skipLibCheck": true,
// Required to run benchmark command from root directory
"typeRoots": [
"node_modules/@types",
"./types",
"${configDir}/node_modules/@types",
"${configDir}/types"
],
} }
} }

View File

@@ -3,12 +3,11 @@
"compilerOptions": { "compilerOptions": {
"emitDeclarationOnly": false, "emitDeclarationOnly": false,
"incremental": false, "incremental": false,
// Required to run benchmark command from root directory // Enable it when upgrade `vite-plugin-dts`
"typeRoots": ["node_modules/@types", "./types"], // "noCheck": false,
"noEmit": true, "noEmit": true,
// To be used in the test fixtures // To be used in the test fixtures
"resolveJsonModule": true, "resolveJsonModule": true,
// We want to speed up the CI run for all tests, which require us to use the // We want to speed up the CI run for all tests, which require us to use the
// `transpileOnly` mode for the `ts-node`. This change requires to treat types for each module // `transpileOnly` mode for the `ts-node`. This change requires to treat types for each module
// independently, which is done by setting the `isolatedModules` flag to `true`. // independently, which is done by setting the `isolatedModules` flag to `true`.
@@ -17,4 +16,4 @@
"ts-node": { "ts-node": {
"transpileOnly": true "transpileOnly": true
} }
} }

View File

@@ -3418,9 +3418,9 @@
undici-types "~5.26.4" undici-types "~5.26.4"
"@types/node@^20.12.8": "@types/node@^20.12.8":
version "20.16.7" version "20.16.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.7.tgz#0a245bf5805add998a22b8b5adac612ee70190bc" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.11.tgz#9b544c3e716b1577ac12e70f9145193f32750b33"
integrity sha512-QkDQjAY3gkvJNcZOWwzy3BN34RweT0OQ9zJyvLCU0kSK22dO2QYh/NHGfbEAYylPYzRB1/iXcojS79wOg5gFSw== integrity sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==
dependencies: dependencies:
undici-types "~6.19.2" undici-types "~6.19.2"
@@ -12423,7 +12423,7 @@ typescript-docs-verifier@^2.5.3:
tsconfig "^7.0.0" tsconfig "^7.0.0"
yargs "^17.5.1" yargs "^17.5.1"
typescript@5.4.2, typescript@^5.4.2: typescript@5.4.2:
version "5.4.2" version "5.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372"
integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ== integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==
@@ -12438,6 +12438,11 @@ typescript@^3.9:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8"
integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==
typescript@^5.7.3:
version "5.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
uglify-js@^3.1.4: uglify-js@^3.1.4:
version "3.17.2" version "3.17.2"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.2.tgz#f55f668b9a64b213977ae688703b6bbb7ca861c6" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.2.tgz#f55f668b9a64b213977ae688703b6bbb7ca861c6"