build(solidity): raise TypeScript to 6.0.3 in both packages - #4208
Open
mswilkison wants to merge 1 commit into
Open
build(solidity): raise TypeScript to 6.0.3 in both packages#4208mswilkison wants to merge 1 commit into
mswilkison wants to merge 1 commit into
Conversation
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) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4207.
6.0.3 is the last TypeScript release with a JavaScript API. I checked what 7.x actually ships:
There is no
lib/typescript.js— the 7.x package is a launcher for the Go binary. ts-node (which hardhat 2 uses to runhardhat.config.tsand the tests),@typescript-eslint, typechain and prettier's TS parser all drive that API, so installing 7 today would break the build, the linter and codegen at once. 6.x is where this stops until those ship tsgo support.Three defaults changed, all pinned back
This is a version bump, not a tightening, so each new default is pinned to what the packages already do:
strictnow on"strict": false(random-beacon keeps its existingnoImplicitAny)@types/*no longer auto-included"types": [...]naming the packages that contribute globalsrootDirrequired for multi-directory projects"rootDir": "."The
rootDirone is the reason to run more than the type checker:tsc --noEmitstays perfectly green whilehardhat testdies withTS5011.Turning
stricton is real work and belongs in its own PR.The ES5 export bundle is on borrowed time
Both packages publish an
export/bundle built throughtsconfig.export.jsonattarget: es5. In TypeScript 6, both that target (TS5107) anddownlevelIteration(TS5101) are deprecated, and both are removed in TypeScript 7.They are silenced here with
"ignoreDeprecations": "6.0"rather than removed, because attarget: es5downlevelIterationgenuinely changes emit forfor…ofover non-array iterables, and that bundle is consumed by downstream packages. Inecdsathis also matters forprepare, which runs the same build on install — so getting it wrong breaksyarn install, not just publishing.Raising the export target off ES5 is a prerequisite for TypeScript 7 and is tracked separately.
Verification
Both packages, on 6.0.3:
tsc --noEmittsc -p tsconfig.export.jsonyarn lintyarn testLockfile churn is 18 lines per package, all
typescript.