Upgrade TypeScript to 7 (build failing — needs review) - #1084
Draft
woksin wants to merge 1 commit into
Draft
Conversation
Update Fundamentals to TypeScript 7 (the native compiler) for improved build/typecheck performance. Bump the pinned Yarn release from 4.5.3 to 4.17.1 as well: 4.17.1 is the first Yarn version whose builtin TypeScript compat patch caps its version range at <7.0.0-0, so installing typescript@7.0.2 no longer fails while Yarn tries to patch files (lib/_tsc.js) that the native compiler no longer ships. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
woksin
marked this pull request as draft
July 10, 2026 09:24
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.
Summary
Upgrades Fundamentals to TypeScript 7.0.2 (the native compiler). The pure typecheck/compile path (
tsc -b) works cleanly with TS7, but two third-party tools in the build/lint pipeline are not yet compatible with the TS7 native package, so the full CI (yarn ci) and publish (yarn build) currently fail. Opening for review — see Blockers below.Package changes (old → new)
package.json6.0.37.0.2package.jsonyarn@4.5.3yarn@4.17.1.yarnrc.ymlyarn-4.5.3.cjsyarn-4.17.1.cjsSource/ESLintConfig/package.jsondeclarestypescriptonly as a peerDependency (>=4.8.4) — left unchanged, as instructed (don't force consumers). No@types/*touched.Why Yarn was bumped
Installing
typescript@7.0.2with Yarn 4.5.3 fails outright: Yarn's builtin TypeScript compat patch has a catch-all hunk gated>=5.7.1-rc(no upper bound) that renameslib/_tsc.js— a file the native compiler no longer ships — causingENOENTduring the fetch step. Yarn 4.17.1 is the first release that caps this range at>=5.7.1-rc <7.0.0-0, making the patch a no-op for TS7 so install succeeds. This bump is a hard prerequisite for the version bump, not optional.Package manager
Yarn (workspaces,
nodeLinker: node-modules).yarn installsucceeds on 4.17.1.yarn.lockis gitignored in this repo, so it is not part of the diff.Verification
yarn install(Yarn 4.17.1): success.tsc --versionresolves to 7.0.2;ts.version === "7.0.2".tsc -bon@cratis/fundamentals(Source/JavaScript): passes — exit 0, 31.js+ 31.d.tsemitted. TS7 typechecking/compilation is clean.yarn ci/yarn build: fail at the lint and bundle steps (see Blockers).Blockers (build failing — needs review)
The TS7 native
typescriptnpm package is currently a thin wrapper over the Go binary and does not expose the full programmatic compiler API —ts.Extension,ts.ModuleKind,createDocumentRegistry, etc. areundefined. Tools that consume those internals break:@typescript-eslint/typescript-estree@8.62.0throwsTypeError: Cannot read properties of undefined (reading 'Cjs')(readsts.Extension.Cjs). typescript-eslint 8.x officially supportstypescript <6.1.0; no TS7-compatible release exists yet.rollup-plugin-typescript2@0.37.0(already the latest) throwsTypeError: tsModule.createDocumentRegistry is not a function. The plugin uses the TS LanguageService API, absent from the native package.Neither is fixable by a version bump today; both need upstream TS7 support (or a switch to different lint/bundle tooling), which is out of scope for a version bump. The
typescript@7.0.2+ Yarn4.17.1changes are kept so the work is ready to land once the ecosystem catches up.Workflow changes
None.
.github/workflows/was grepped for explicittypescriptversion pins andtscinstall steps — there are none (workflows only pinNODE_VERSIONand callyarn ci/yarn build). No workflow edits required.🤖 Generated with Claude Code