Skip to content

Migrate to TypeScript 7 (native preview)#7377

Draft
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-typescript-7
Draft

Migrate to TypeScript 7 (native preview)#7377
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-typescript-7

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Member

Summary

Migrates the project to compile with TypeScript 7 (@typescript/native-preview beta, Go-based compiler).

Changes

  • tsconfig.json: moduleResolution: "Node""bundler" (node10 strategy removed in TS7); added types: ["mocha", "node"]
  • src/Command.ts: Cast global to any for .it access (globalThis no longer has implicit index signature)
  • src/utils/zod.ts: Replaced deep import zod/v4/core/util.cjs with inline EnumLike type; added cast for stricter type inference on coercedEnum
  • package.json: Added @typescript/native-preview as dev dependency

Verification

  • ✅ Build passes (npm run build)
  • ✅ Lint passes
  • ✅ All 15,722 tests pass
  • ✅ Coverage: 99.99% (pre-existing gap in fsUtil.ts, unrelated)
  • tsgo --noEmit reports 0 errors

@waldekmastykarz waldekmastykarz force-pushed the waldekmastykarz/migrate-typescript-7 branch from f808fcd to af12783 Compare May 29, 2026 12:13
- Replace typescript@5.9.3 with @typescript/native-preview (tsgo)
- Remove tsc-watch dependency (tsgo has built-in --watch)
- Update build script to use tsgo instead of tsc
- Update watch script to use tsgo --watch
- Update moduleResolution from 'Node' to 'bundler' (node10 removed in TS7)
- Add explicit types for mocha and node in tsconfig
- Fix globalThis index access in Command.ts
- Fix zod EnumLike import (not in exports map with bundler resolution)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz waldekmastykarz force-pushed the waldekmastykarz/migrate-typescript-7 branch from af12783 to eabf404 Compare May 29, 2026 12:16
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