Skip to content

chore: upgrade to typescript 6#4310

Merged
carderne merged 19 commits into
mainfrom
ts6
Jul 21, 2026
Merged

chore: upgrade to typescript 6#4310
carderne merged 19 commits into
mainfrom
ts6

Conversation

@carderne

@carderne carderne commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Upgrades the workspace to TypeScript 6.0.3 and applies the compiler, type, and build configuration changes required to preserve package layouts and existing runtime behavior, apart from correcting the HTTP status field used for deployment connection errors.

Compatibility

  • Centralizes TypeScript 6.0.3 through the pnpm workspace catalog.
  • Replaces compiler options and module resolution modes that TypeScript 6 no longer accepts.
  • Restores explicit Node types where TypeScript 6 no longer includes them transitively.
  • Adds explicit declaration build roots that preserve each package's existing output layout.
  • Patches tsup to stop injecting the removed baseUrl option during declaration builds.
  • Uses type-only assertions for stricter typed-array and stream definitions without changing runtime behavior.
  • Reads the EventSource v3 HTTP status from code, so deployment connection errors include it correctly.
  • Keeps standalone CLI compatibility fixtures pinned to their existing TypeScript version and lockfiles.

turbo run typecheck and the complete PR test suite are green.

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d1bd8a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Centralizes TypeScript 6.0.3 through the workspace catalog and updates related tooling. Adds dedicated TypeScript build configurations, Node typings, NodeNext or bundler resolution, output exclusions, and build script changes across packages. Removes selected compiler defaults, adjusts webapp configuration, and applies explicit runtime type casts for OTLP responses, realtime streams, random filling, and deployment error handling.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning It covers summary and compatibility, but misses required template parts like Closes #issue, checklist, testing steps, changelog, and screenshots. Add the missing template sections: Closes #issue, checklist items, testing steps, changelog, and screenshots (or note none).
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: upgrading the workspace to TypeScript 6.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@d1bd8a0

trigger.dev

npm i https://pkg.pr.new/trigger.dev@d1bd8a0

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@d1bd8a0

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@d1bd8a0

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@d1bd8a0

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@d1bd8a0

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@d1bd8a0

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@d1bd8a0

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@d1bd8a0

commit: d1bd8a0

@carderne
carderne marked this pull request as ready for review July 20, 2026 15:35

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

carderne added 19 commits July 21, 2026 13:02
- Remove downlevelIteration from the shared base config (no-op at target es2022,
  errors under TS6 as deprecated).
- Migrate moduleResolution node10 -> nodenext (+ module nodenext) in database,
  run-ops-database, emails, testcontainers.
- tsql pins antlr4ts@0.5.0-alpha.4 (deep-subpath imports + decorators that only
  resolve under legacy node10); keep node10 there via ignoreDeprecations: 6.0
  until the parser is migrated.
TS 5.7+ made TypedArrays generic over their backing buffer, so
crypto.getRandomValues now requires an ArrayBuffer-backed view
(ArrayBufferView<ArrayBuffer>). The callers already allocate
Uint8Array<ArrayBuffer> via new Uint8Array(n), so tighten the
RandomFiller param type to match.
TS6 no longer transitively includes @types/node via vitest/globals or
dependency type references, so Node globals (Buffer, process, http,
globalThis.*) stopped resolving. Add "node" to the types arrays (or an
explicit types: ["node"]) across the affected src/test/build configs.

TS6 also requires an explicit rootDir for declaration emit; give the
packages that emit .d.ts via plain tsc (database, run-ops-database, rbac,
sso) a dedicated tsconfig.build.json (include src, rootDir src, types node)
and point their build script at it, matching the existing pattern used by
clickhouse/run-store/etc. Add rootDir to those build configs too.

Also stop database's noEmit typecheck from picking up its freshly-built
dist/.
tsup's DTS build injects baseUrl into the compiler options, which TS6
flags as a deprecated option (removed in TS7). Set ignoreDeprecations:
6.0 on the tsconfig tsup reads so the .d.ts build succeeds.
…c/ prefix

The explicit rootDir added for TS6 declaration emit must match each
package's published layout. Packages whose types resolve to
dist/src/index.d.ts (rbac, sso, clickhouse, run-store, schedule-engine,
replication, run-engine) need rootDir '.' to preserve the src/ segment;
only database/run-ops-database emit to dist/index.d.ts (rootDir src).
Like database, their tsc --noEmit config has no include scoping, so once
dist is built it gets pulled into the program (TS6053). Exclude dist.
eventsource@3 exposes the HTTP status as ErrorEvent.code, not .status
(TS6's stricter check surfaces the wrong property access).
- protobufjs .finish() returns Uint8Array<ArrayBufferLike>; assert
  ArrayBuffer-backed (always true at runtime) so it satisfies BodyInit
  under TS6's tightened lib.
- Cast TextDecoderStream to ReadableWritablePair<string, Uint8Array> for
  pipeThrough's stricter TS6 typing.
- Exclude the orphaned, unreferenced test/setup-test-env.ts (imports the
  uninstalled @testing-library/jest-dom) from the typecheck.
tsup hard-codes baseUrl: compilerOptions.baseUrl || '.' when invoking
rollup-plugin-dts (still present in 8.5.1), which TS6 flags as deprecated.
ignoreDeprecations only bridges TS6.x and won't survive TS7, so patch tsup
to drop the injected baseUrl and remove the ignoreDeprecations shims from
redis-worker/plugins.
Drops the last ignoreDeprecations shim. node10 is removed in TS7;
nodenext duplicates antlr4ts's deep-import CJS types, but bundler
resolution keeps them consistent and tsql is always bundled downstream.
attw 0.15.4 bundles an older TypeScript that can't resolve TS6-emitted
declarations ("error while checking file: Expected resolution for
'./types.js'"), failing check-exports for core/build/sdk. 0.18.5 handles
them.
Same TS6 @types/node regression in two configs not exercised by
turbo typecheck: python's tshy build (tsconfig.src.json) and the
sdk-compat typescript fixture that compiles a process.exit() test with
tsc --noEmit.
The fixtures are standalone user-project simulations with their own
committed npm/pnpm/yarn lockfiles (all pinning 5.5.4). Bumping them to
6.0.3 without regenerating three lockfiles each broke the frozen/ci
installs; revert to 5.5.4 to match the lockfiles.
@carderne
carderne merged commit dc87b88 into main Jul 21, 2026
46 checks passed
@carderne
carderne deleted the ts6 branch July 21, 2026 12:57
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