Skip to content

Upgrade TypeScript to 7 (lint tooling incompatible — needs review) - #7

Draft
woksin wants to merge 2 commits into
mainfrom
chore/typescript-7
Draft

Upgrade TypeScript to 7 (lint tooling incompatible — needs review)#7
woksin wants to merge 2 commits into
mainfrom
chore/typescript-7

Conversation

@woksin

@woksin woksin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades the Narrator VS Code extension to TypeScript 7.0.2 (the native/Go compiler, current latest on npm) for faster typecheck/build.

Changes

Package: narrator (Source/VSCodeExtension)

  • typescript: ^5.3.0^7.0.2 (devDependency; range prefix preserved)

Supporting changes required by the upgrade

  • Yarn: 4.14.1/4.5.34.17.1 (packageManager + .yarn/releases + .yarnrc.yml yarnPath). Required because the compat plugin bundled with yarn 4.5.3 unconditionally applies its TypeScript PnP patch and crashes on TS7's new package layout (ENOENT … lib/_tsc.js). Yarn 4.17.1's compat plugin caps that patch at <7.0.0-0, so it is correctly skipped for TS7. The yarn set version migration also added enableScripts, npmMinimalAgeGate: 0, and approvedGitRepositories to .yarnrc.yml to preserve prior behavior.
  • tsconfig.json: module: commonjspreserve and moduleResolution: nodebundler. TS7 removed the legacy node/node10 resolution. bundler is the correct modern equivalent for this esbuild-bundled project; node16 was rejected as it enforces strict CJS/ESM interop that breaks imports of the ESM @cratis/chronicle.contracts package.
  • @types/* were not touched.

Package manager

Yarn (detected via yarn.lock). Lockfile updated via yarn install; typescript now resolves to 7.0.2 (yarn tsc --versionVersion 7.0.2).

Verification

Step Command Result
Typecheck yarn typecheck (tsc --noEmit) pass (TS 7.0.2)
Compile yarn compile (esbuild) pass
Test yarn test (vitest) pass (no test files)
Lint yarn lint:ci (eslint) FAILS

The core TypeScript 7 verification passes: tsc --noEmit is clean and the extension bundles successfully.

Blocker — needs review

yarn lint:ci (and therefore the full yarn ci used by the JavaScript Build workflow) fails. @typescript-eslint 8.59.1 reads the classic TypeScript API via require('typescript') (e.g. ts.Extension.Cjs), but TS7's native package no longer exposes the compiler API at that entry point (only version; the API moved under typescript/unstable/*). This throws TypeError: Cannot read properties of undefined (reading 'Cjs').

No released typescript-eslint supports TS7 yet — even the latest (8.63.0) still declares peerDependency typescript >=4.8.4 <6.1.0. This is an upstream ecosystem gap, not a problem with the TS upgrade itself, so it was left unresolved pending a TS7-compatible typescript-eslint release. CI will be red on the lint step until then.

Workflow changes

None. .github/workflows/ contains no explicit typescript version pins or tsc install steps (grep found none). javascript-build.yml runs yarn ci, which will fail on lint as noted above.

🤖 Generated with Claude Code

Update Narrator to TypeScript 7 (the native compiler) for improved
build/typecheck performance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@woksin
woksin marked this pull request as draft July 10, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant