Skip to content

build(js): upgrade TypeScript to 6.0#719

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

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

Conversation

@clankmaxxing-clod

Copy link
Copy Markdown
Contributor

Upgrades both JS clients — clients/js and clients/js-legacy — to typescript@^6.0.3. Because the two packages share a single workspace-root pnpm-lock.yaml, they're upgraded together in one PR (splitting them would mean conflicting edits to the same lockfile).

Changes

clients/js (tsc ESM + tsc CJS build)

  • tsconfig-base.json: add "ignoreDeprecations": "6.0".
    • Covers TS5101 (baseUrl deprecated in TS6) and TS5107 (node10/"node" module resolution deprecated in TS6).
    • rootDir and types are already set, so nothing else was needed.

clients/js-legacy (tsup + tsc declaration emit)

  • tsconfig.declarations.json: add "ignoreDeprecations": "6.0" and "rootDir": "./src".
    • ignoreDeprecations covers the inherited TS5107 (node10 module resolution).
    • rootDir covers TS5011 — TS6 requires an explicit rootDir when emitting declarations to outDir. As a bonus this corrects the declaration layout from dist/types/src/index.d.ts to dist/types/index.d.ts, matching the package's "types" field.
  • tsconfig.json: add "types": ["node"].
    • Under TS6 the declaration build no longer auto-resolves @types/node for import { Buffer } from 'buffer' (TS2591). This mirrors the sibling clients/js base config, which already sets "types": ["node"].

Verification (local, typescript@6.0.3)

  • clients/js — ✅ pnpm build, ✅ pnpm test (tsc typecheck), ✅ pnpm lint, ✅ pnpm format
  • clients/js-legacy — ✅ pnpm build (tsup + tsc declarations), ✅ pnpm lint, ✅ pnpm format

The clients/js-legacy ava suite drives litesvm. Its compiled test output is byte-identical before and after this change (same sha256), and the same subset of stake-heavy tests hits a litesvm native std::bad_alloc under both typescript@5.9.3 and @6.0.3 in the test environment — so this is pre-existing and unaffected by the upgrade.

🤖 Generated with Claude Code

Bumps `typescript` to ^6.0.3 in both the `clients/js` and
`clients/js-legacy` packages and adjusts their tsconfigs for TS6. The
shared workspace `pnpm-lock.yaml` is re-resolved onto typescript@6.0.3.

clients/js (tsc -> tsc-cjs build):
- add "ignoreDeprecations": "6.0" to tsconfig-base.json — both "baseUrl"
  (TS5101) and the node10/"node" module resolution (TS5107) are
  deprecated in TS6. "rootDir" and "types" are already set, so no other
  changes were needed.

clients/js-legacy (tsup + tsc declaration emit):
- add "ignoreDeprecations": "6.0" and "rootDir": "./src" to
  tsconfig.declarations.json — TS6 deprecates the inherited node10
  module resolution (TS5107) and requires an explicit rootDir when
  emitting declarations to outDir (TS5011). Setting rootDir also
  corrects the declaration layout to dist/types/index.d.ts, matching
  the package's "types" field.
- add "types": ["node"] to tsconfig.json — under TS6 the declaration
  build no longer auto-resolves @types/node for the `import { Buffer }
  from 'buffer'` statements (TS2591); this mirrors the sibling
  clients/js base config which already sets it.

Verified locally with typescript@6.0.3:
- clients/js: `pnpm build`, `pnpm test` (tsc typecheck), `pnpm lint`,
  `pnpm format` all pass.
- clients/js-legacy: `pnpm build` (tsup + tsc declarations), `pnpm lint`,
  `pnpm format` all pass.

The clients/js-legacy `ava` suite drives litesvm; its compiled test
output is byte-identical before and after this change, and the same
subset of stake-heavy tests hits a litesvm native std::bad_alloc under
both typescript@5.9.3 and @6.0.3, so behavior is unchanged.

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