Skip to content

Migrate to TypeScript 7 (native preview)#7377

Open
waldekmastykarz wants to merge 2 commits into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-typescript-7
Open

Migrate to TypeScript 7 (native preview)#7377
waldekmastykarz wants to merge 2 commits 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
@waldekmastykarz
waldekmastykarz marked this pull request as ready for review June 24, 2026 06:42
@waldekmastykarz
waldekmastykarz marked this pull request as draft June 24, 2026 06:58
@waldekmastykarz
waldekmastykarz marked this pull request as ready for review June 24, 2026 07:08
- Take sinon ^22.0.0 from main, keep tsc-watch removed (replaced by tsgo watch)
- Fix zod.ts type cast inconsistency after merge
- Regenerate npm-shrinkwrap.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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