Skip to content

build(js-legacy): upgrade TypeScript to 6.0#104

Merged
joncinque merged 1 commit into
solana-program:mainfrom
clankmaxxing-clod:build/js-legacy-upgrade-typescript-6
Jun 30, 2026
Merged

build(js-legacy): upgrade TypeScript to 6.0#104
joncinque merged 1 commit into
solana-program:mainfrom
clankmaxxing-clod:build/js-legacy-upgrade-typescript-6

Conversation

@clankmaxxing-clod

Copy link
Copy Markdown
Contributor

Upgrades the clients/js-legacy client to TypeScript 6.0. This client uses the tsc --build (project references) setup, so the changes differ from the modern clients/js clients.

Changes

  • Bump typescript ^5.7.2^6.0.3.
  • tsconfig.base.json: add "ignoreDeprecations": "6.0" and "types": ["node"].
  • tsconfig.cjs.json / tsconfig.esm.json: add "rootDir": "./src".
  • tsconfig.json: set "types": ["node", "mocha"].

Why each change (the actual TS6 breaks)

Building unmodified under typescript@6.0.3 fails with:

  • TS5107node10/"Node" module resolution is deprecated → ignoreDeprecations: "6.0".
  • TS5011 — the cjs/esm composite projects need an explicit rootDirrootDir: "./src".
  • TS2591Buffer/http/https globals can't be found (@types/node@26 doesn't auto-resolve under the classic resolver) → types: ["node"] in the base.

Narrowing the base types to ["node"] then hides mocha's globals from the test build, so tsconfig.json (which includes test) re-adds ["node", "mocha"].

Module resolution is intentionally left as Node and no lib override is added — only the options TS6 actually requires were touched.

Verification

Locally with typescript@6.0.3:

  • pnpm build (tsc --build tsconfig.all.json) — cjs/esm/types all emit
  • pnpm lint (eslint, clean tree) — clean
  • pnpm test (mocha) — 7 passing

🤖 Generated with Claude Code

Bump typescript to ^6.0.3 in clients/js-legacy and adjust the tsc-based
build for TS6:

- tsconfig.base.json: add "ignoreDeprecations": "6.0" (the node10/"Node"
  module resolution is deprecated in TS6, TS5107) and "types": ["node"]
  so Buffer/http/https globals from @types/node resolve (TS2591 under the
  classic resolver).
- tsconfig.cjs.json / tsconfig.esm.json: add "rootDir": "./src" — TS6
  requires an explicit rootDir for these composite projects (TS5011).
- tsconfig.json: set "types": ["node", "mocha"] so the test build still
  sees mocha's globals after the base "types" narrowing.

Module resolution is left as-is and no lib override is added; only the
options TS6 actually requires were changed.

Verified locally with typescript@6.0.3: `pnpm build` (tsc --build),
`pnpm lint` (eslint), and `pnpm test` (mocha, 7 passing) all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joncinque joncinque merged commit c1ee5c1 into solana-program:main Jun 30, 2026
22 checks passed
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.

2 participants