Conversation
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughCentralizes 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)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
- 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.
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
baseUrloption during declaration builds.code, so deployment connection errors include it correctly.turbo run typecheckand the complete PR test suite are green.