Skip to content

build(js): upgrade TypeScript to 6.0#457

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

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

Conversation

@clankmaxxing-clod

Copy link
Copy Markdown
Contributor

Upgrades the clients/js client to TypeScript 6.0.

Changes

  • Bump typescript ^5.9.3^6.0.3 (+ lockfile).
  • Add "rootDir": "./src" to tsconfig.declarations.json.

Why the rootDir

Under TS6, tsc -p ./tsconfig.declarations.json (the declaration-emit step of pnpm build) fails without an explicit rootDir:

error TS5011: The common source directory of 'tsconfig.declarations.json' is './src'.
The 'rootDir' setting must be explicitly set to this or another path...

Setting rootDir to ./src resolves it and keeps the dist/types layout unchanged. The client already uses moduleResolution: "bundler", so no resolver change or ignoreDeprecations suppression is needed.

Verification

Locally with typescript@6.0.3:

  • pnpm build — tsup bundle + tsc declaration emit both succeed; dist/types/index.d.ts generated
  • pnpm lint (oxlint) — clean
  • pnpm test not fully run here (LiteSVM needs the program's compiled .so, absent in a JS-only checkout); CI will cover it.

🤖 Generated with Claude Code

Bump typescript to ^6.0.3 in clients/js. TS6 requires an explicit
rootDir for declaration emit, so set "rootDir": "./src" in
tsconfig.declarations.json (without it, `tsc -p tsconfig.declarations.json`
fails with TS5011). The client already uses the modern "bundler" module
resolution, so no resolver change or deprecation suppression is needed.

Verified locally: `pnpm build` (tsup + tsc declarations) and `pnpm lint`
pass under typescript@6.0.3.

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