Upgrade TypeScript to 7 (build failing — needs review) - #569
Draft
woksin wants to merge 2 commits into
Draft
Conversation
Update Samples to TypeScript 7 (the native compiler) for improved build/typecheck performance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
woksin
marked this pull request as draft
July 10, 2026 09:24
Collaborator
Author
|
Draft: blocked only by |
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 the Samples repo to TypeScript 7.0.2 (the native compiler, current
lateston npm), a drop-in fortsc/tsserver.The TypeScript compiler/typecheck passes cleanly on both sample workspaces. However, the full
yarn build(Vite) currently fails because a framework dependency (@cratis/arc.vite) uses the classic TypeScript programmatic API, which TS7's native package no longer exposes from its main entry. This is a dependency/tooling incompatibility, not a Samples code issue — see Blocker below.Packages changed (old → new)
package.json6.0.37.0.2typescriptis declared only in the root workspace.@types/*,@typescript-eslint/*,typescript-eslint, androllup-plugin-typescript2were intentionally left untouched.Package manager
Yarn 4.5.3 (yarn workspaces,
nodeLinker: node-modules).yarn installcompletes successfully. Note:yarn.lockis gitignored in this repo, so no lockfile appears in the diff.Required accommodations for TS7 under Yarn
Two changes were needed for TS7 to install and typecheck — both are direct consequences of TS7's native packaging, not code changes:
compat/typescriptpatch bypass — Yarn 4 unconditionally rewrites thetypescriptdependency through its builtincompat/typescriptpatch, which editslib/_tsc.js/lib/tsserver.js/lib/typescript.js. The TS7 native package ships onlylib/tsc.js+bin/tsc, so the patch fails withENOENT. Added a tiny local Yarn plugin (.yarn/plugins/plugin-disable-typescript-compat.cjs, registered in.yarnrc.yml) that runs after the compat plugin and unwraps the builtin patch back to the plain npm descriptor.baseUrlremoval migration — TS7 removed thebaseUrlcompiler option (TS5102) and requirespathsvalues to be relative (TS5090). Migratedtsconfig.json,Library/Lending/.frontend/tsconfig.json, andLibrary/Members/.frontend/tsconfig.jsonaccordingly (removedbaseUrl, prefixedpathsvalues with../).Verification
typescriptresolves to 7.0.2 (native);node_modules/.bin/tsc --version→Version 7.0.2.tsc -b .frontend/tsconfig.json(full--forcerebuild): PASS, zero errors, on bothLibrary/LendingandLibrary/Members.yarn build(Vite): FAILS — see Blocker.Blocker (needs review)
yarn buildfails during Vite's transform step inside@cratis/arc.vite'sEmitMetadataPlugin:Root cause: TS7's native
typescriptpackage exports only{ version, versionMajorMinor }from its main entry — the classic programmatic API (ts.sys,ts.findConfigFile,ts.parseJsonConfigFileContent, …) moved totypescript/unstable/*.EmitMetadataPlugindoesimport ts from 'typescript'and callsts.sys.fileExists, sots.sysisundefinedunder TS7. This requires a TS7-native-compatible release of@cratis/arc.vite(and likely other TS-API consumers such asvite-tsconfig-pathsand@typescript-eslint); it cannot be fixed within the Samples repo. The TypeScript bump and typecheck are otherwise green.Workflow changes
None.
grepof.github/workflows/found no explicittypescriptversion pins ortscinstall steps, so no workflow files were modified.🤖 Generated with Claude Code