From 2b4e1f1ba198aaa7290bef06d9fead563ead73ab Mon Sep 17 00:00:00 2001 From: maclane Date: Mon, 27 Jul 2026 15:09:43 -0400 Subject: [PATCH] build(solidity): raise TypeScript to 6.0.3 in both packages 6.0.3 is the last release with a JavaScript API. TypeScript 7 ships only a launcher for the Go binary -- no `lib/typescript.js`, and `transpileModule`, `createProgram` and `createLanguageService` are all undefined -- so ts-node, @typescript-eslint and typechain cannot drive it. 6.x is the end of the line until those ship tsgo support. Three defaults changed, pinned back in both packages so the bump is behaviour-preserving rather than a silent tightening: - `strict` now defaults on. Pinned off. random-beacon keeps the `noImplicitAny` it had already opted into. - `@types/*` are no longer all included automatically, which quietly removed the mocha and chai globals -- 1 732 diagnostics in ecdsa alone. `types` now names the packages that actually contribute globals. - `rootDir` must be stated once a project spans several top-level directories. `--noEmit` does not care; ts-node's emit path does, so hardhat would not start without it. Both packages also publish an `export/` bundle built at `target: es5`, and in TypeScript 6 both that target and `downlevelIteration` are deprecated. Silencing them via `ignoreDeprecations` keeps `prepack` working -- and in ecdsa, `prepare`, which runs the same build on install. Raising the export target is required before TypeScript 7 and is its own change; guessing the options are inert would alter an artifact that downstream packages consume. Verified on 6.0.3, both packages: `tsc --noEmit` 0 errors, `tsc -p tsconfig.export.json` builds, `yarn lint` 0 errors. random-beacon 955 passing / 0 failing; ecdsa 673 passing / 0 failing. Co-Authored-By: Claude Opus 5 (1M context) --- solidity/ecdsa/package.json | 2 +- solidity/ecdsa/tsconfig.json | 16 ++++++++++++++++ solidity/ecdsa/yarn.lock | 18 +++++++++--------- solidity/random-beacon/package.json | 2 +- solidity/random-beacon/tsconfig.json | 20 ++++++++++++++++++++ solidity/random-beacon/yarn.lock | 18 +++++++++--------- 6 files changed, 56 insertions(+), 20 deletions(-) diff --git a/solidity/ecdsa/package.json b/solidity/ecdsa/package.json index e1743eb8e4..d7435ac26a 100644 --- a/solidity/ecdsa/package.json +++ b/solidity/ecdsa/package.json @@ -69,7 +69,7 @@ "solidity-docgen": "^0.6.0-beta.35", "ts-node": "^10.4.0", "typechain": "^6.1.0", - "typescript": "^5.9.3" + "typescript": "^6.0.3" }, "dependencies": { "@keep-network/random-beacon": "development", diff --git a/solidity/ecdsa/tsconfig.json b/solidity/ecdsa/tsconfig.json index 14c885c43b..3ab398d722 100644 --- a/solidity/ecdsa/tsconfig.json +++ b/solidity/ecdsa/tsconfig.json @@ -2,6 +2,22 @@ "files": ["./hardhat.config.ts"], "include": ["./deploy", "./tasks", "./test", "./typechain", "./types"], "compilerOptions": { + // TypeScript 6 turns `strict` on by default. Pinned off so the bump stays + // behaviour-preserving; this package has not been through strict yet. + "strict": false, + // TypeScript 6 stopped including every `node_modules/@types` package + // automatically, which silently drops the mocha and chai globals. These + // are the four that contribute globals here. + "types": ["mocha", "chai", "chai-as-promised", "node"], + // Required by TypeScript 6 once a project spans several top-level + // directories. `--noEmit` does not need it, but ts-node's emit path does, + // so hardhat will not start without it. + "rootDir": ".", + // `target: es5` is deprecated in 6 and removed in 7. tsconfig.export.json + // builds the published `export/` bundle at that target, and `prepare` runs + // it on install, so silencing it here keeps both working. Raising the + // export target is required before TypeScript 7 and is its own change. + "ignoreDeprecations": "6.0", "esModuleInterop": true, "skipLibCheck": true } diff --git a/solidity/ecdsa/yarn.lock b/solidity/ecdsa/yarn.lock index fa9dd59a01..f4561486d3 100644 --- a/solidity/ecdsa/yarn.lock +++ b/solidity/ecdsa/yarn.lock @@ -1297,7 +1297,7 @@ __metadata: solidity-docgen: "npm:^0.6.0-beta.35" ts-node: "npm:^10.4.0" typechain: "npm:^6.1.0" - typescript: "npm:^5.9.3" + typescript: "npm:^6.0.3" languageName: unknown linkType: soft @@ -11136,23 +11136,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.9.3": - version: 5.9.3 - resolution: "typescript@npm:5.9.3" +"typescript@npm:^6.0.3": + version: 6.0.3 + resolution: "typescript@npm:6.0.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/6bd7552ce39f97e711db5aa048f6f9995b53f1c52f7d8667c1abdc1700c68a76a308f579cd309ce6b53646deb4e9a1be7c813a93baaf0a28ccd536a30270e1c5 + checksum: 10c0/4a25ff5045b984370f48f196b3a0120779b1b343d40b9a68d114ea5e5fff099809b2bb777576991a63a5cd59cf7bffd96ff6fe10afcefbcb8bd6fb96ad4b6606 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.9.3#optional!builtin": - version: 5.9.3 - resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" +"typescript@patch:typescript@npm%3A^6.0.3#optional!builtin": + version: 6.0.3 + resolution: "typescript@patch:typescript@npm%3A6.0.3#optional!builtin::version=6.0.3&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/ad09fdf7a756814dce65bc60c1657b40d44451346858eea230e10f2e95a289d9183b6e32e5c11e95acc0ccc214b4f36289dcad4bf1886b0adb84d711d336a430 + checksum: 10c0/2f25c74e65663c248fa1ade2b8459d9ce5372ff9dad07067310f132966ebec1d93f6c42f0baf77a6b6a7a91460463f708e6887013aaade22111037457c6b25df languageName: node linkType: hard diff --git a/solidity/random-beacon/package.json b/solidity/random-beacon/package.json index 95747df7a6..f4046a977c 100644 --- a/solidity/random-beacon/package.json +++ b/solidity/random-beacon/package.json @@ -71,7 +71,7 @@ "solidity-docgen": "^0.6.0-beta.35", "ts-node": "^10.2.1", "typechain": "^8.3.2", - "typescript": "^5.9.3" + "typescript": "^6.0.3" }, "engines": { "node": ">=22.0.0" diff --git a/solidity/random-beacon/tsconfig.json b/solidity/random-beacon/tsconfig.json index 721a0a2caf..2edb145ab9 100644 --- a/solidity/random-beacon/tsconfig.json +++ b/solidity/random-beacon/tsconfig.json @@ -10,6 +10,26 @@ "./tasks" ], "compilerOptions": { + // TypeScript 6 turns `strict` on by default. Pinned off so the bump stays + // behaviour-preserving. `noImplicitAny` below is the one strict flag this + // package had already opted into, and it is kept. + "strict": false, + // TypeScript 6 stopped including every `node_modules/@types` package + // automatically, which silently drops the mocha and chai globals. These + // are the three that contribute globals here. + "types": ["mocha", "chai", "node"], + // Required by TypeScript 6 once a project spans several top-level + // directories. `--noEmit` does not need it, but ts-node's emit path does, + // so hardhat will not start without it. + "rootDir": ".", + // Two deprecations are silenced here, both belonging to the published + // `export/` bundle that `prepack` builds through tsconfig.export.json: + // `target: es5` itself, and `downlevelIteration`, which still changes + // emit at that target. Both are removed in TypeScript 7, so the export + // target has to be raised before then; doing it is its own change, and + // guessing that the option is inert would alter an artifact downstream + // packages consume. + "ignoreDeprecations": "6.0", "esModuleInterop": true, "noImplicitAny": true, "downlevelIteration": true, diff --git a/solidity/random-beacon/yarn.lock b/solidity/random-beacon/yarn.lock index 6ae0aa40e1..39ec33bdb9 100644 --- a/solidity/random-beacon/yarn.lock +++ b/solidity/random-beacon/yarn.lock @@ -1206,7 +1206,7 @@ __metadata: solidity-docgen: "npm:^0.6.0-beta.35" ts-node: "npm:^10.2.1" typechain: "npm:^8.3.2" - typescript: "npm:^5.9.3" + typescript: "npm:^6.0.3" languageName: unknown linkType: soft @@ -13560,23 +13560,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.9.3": - version: 5.9.3 - resolution: "typescript@npm:5.9.3" +"typescript@npm:^6.0.3": + version: 6.0.3 + resolution: "typescript@npm:6.0.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/6bd7552ce39f97e711db5aa048f6f9995b53f1c52f7d8667c1abdc1700c68a76a308f579cd309ce6b53646deb4e9a1be7c813a93baaf0a28ccd536a30270e1c5 + checksum: 10c0/4a25ff5045b984370f48f196b3a0120779b1b343d40b9a68d114ea5e5fff099809b2bb777576991a63a5cd59cf7bffd96ff6fe10afcefbcb8bd6fb96ad4b6606 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.9.3#optional!builtin": - version: 5.9.3 - resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" +"typescript@patch:typescript@npm%3A^6.0.3#optional!builtin": + version: 6.0.3 + resolution: "typescript@patch:typescript@npm%3A6.0.3#optional!builtin::version=6.0.3&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/ad09fdf7a756814dce65bc60c1657b40d44451346858eea230e10f2e95a289d9183b6e32e5c11e95acc0ccc214b4f36289dcad4bf1886b0adb84d711d336a430 + checksum: 10c0/2f25c74e65663c248fa1ade2b8459d9ce5372ff9dad07067310f132966ebec1d93f6c42f0baf77a6b6a7a91460463f708e6887013aaade22111037457c6b25df languageName: node linkType: hard