Conversation
|
WalkthroughThe workspace updates TypeScript catalog versions and adds a legacy TypeScript API alias for selected compiler consumers. Several packages upgrade tshy, while plugin and Redis worker builds migrate from tsup to tsdown. The Redis worker receives a new tsdown configuration, and the obsolete tsup patch is removed. A declaration portability test now invokes the TypeScript CLI. The webapp search parameter parser accepts unknown input without changing runtime behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: |
| dts: { | ||
| // The TypeScript 7 declaration emitter consumes referenced package declarations. | ||
| neverBundle: [/^@internal/], | ||
| }, |
There was a problem hiding this comment.
🔍 redis-worker published .d.ts may now reference private @internal packages
The old tsup config bundled @internal/* into both the JS output AND the declaration output (noExternal: [/^@internal/] + dts: true, where rollup-plugin-dts inlines those types). The new tsdown config keeps JS bundling (deps.alwaysBundle: [/^@internal/]) but explicitly disables it for declarations (deps.dts.neverBundle: [/^@internal/] at packages/redis-worker/tsdown.config.ts:22-25). The public surface of @trigger.dev/redis-worker leaks @internal/redis types (Redis, RedisOptions in packages/redis-worker/src/worker.ts:1) and @internal/tracing types (Span, Tracer, Meter in packages/redis-worker/src/fair-queue/types.ts:1-3). Since @internal/* are private workspace packages (devDependencies, never published), a published dist/index.d.ts that references them via import("@internal/redis") would be unresolvable for any external npm consumer, regressing type portability that the old build provided. The inline comment indicates this is a deliberate TS7-driven choice, so it may be intentional / acceptable if the package is effectively internal-only — worth confirming whether external consumers rely on these types resolving.
Was this helpful? React with 👍 or 👎 to provide feedback.
| const result = spawnSync( | ||
| process.execPath, | ||
| [join(typescriptRoot, "bin", "tsc"), "-p", consumerDir], | ||
| { | ||
| encoding: "utf8", | ||
| } | ||
| ); | ||
| expect(formatted).toEqual([]); | ||
| const compilerOutput = [result.stdout, result.stderr].filter(Boolean).join("\n"); | ||
| expect(result.error, compilerOutput).toBeUndefined(); | ||
| expect(result.status, compilerOutput).toBe(0); | ||
|
|
||
| const dts = [...emitted.entries()].find(([name]) => name.endsWith("agent.d.ts"))?.[1]; | ||
| expect(dts).toBeDefined(); | ||
| const dts = readFileSync(join(consumerDir, "out", "agent.d.ts"), "utf8"); |
There was a problem hiding this comment.
🔍 declaration-emit test now shells out to the TS CLI instead of the in-process API
The test was rewritten to write a tsconfig.json and spawn bin/tsc via process.execPath (packages/trigger-sdk/test/declaration-emit.test.ts:103-111) rather than constructing an in-memory ts.Program. This relies on the resolved typescript package (now catalog TS 7.0.2, and newly added to trigger-sdk devDependencies) exposing a node-runnable bin/tsc. If TS7's CLI is delivered as a native binary rather than a JS entry, invoking it through node would fail. The output path mapping (rootDir ., outDir out, files: ["agent.ts"] → reading out/agent.d.ts) is consistent. Worth confirming the TS7 CLI packaging supports node bin/tsc in CI.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Upgrade the monorepo to TypeScript 7.0.2 and update package build tooling for compatibility with the native compiler.
Design
Package builds now use
tshy4, while the packages still usingtsupmove totsdown. The few scripts that depend on the legacy TypeScript compiler API use an explicit TypeScript 6 alias; declaration portability coverage invokes the TypeScript 7 CLI directly.Turbo is updated so workspace tasks can read the regenerated pnpm lockfile.