Skip to content

chore: upgrade to TypeScript 7#4318

Open
carderne wants to merge 2 commits into
mainfrom
ts7
Open

chore: upgrade to TypeScript 7#4318
carderne wants to merge 2 commits into
mainfrom
ts7

Conversation

@carderne

Copy link
Copy Markdown
Collaborator

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 tshy 4, while the packages still using tsup move to tsdown. 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.

@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 55b7acf

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 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description misses the required template sections, including issue closure, checklist, testing, changelog, and screenshots. Fill in the repository template sections: issue reference, checklist items, testing steps, changelog, and screenshots or explicit N/A notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 summarizes the main change: upgrading the monorepo to TypeScript 7.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts7

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 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

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

trigger.dev

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

@trigger.dev/core

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

@trigger.dev/python

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

@trigger.dev/react-hooks

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

@trigger.dev/redis-worker

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

@trigger.dev/rsc

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

@trigger.dev/schema-to-json

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

@trigger.dev/sdk

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

commit: 55b7acf

coderabbitai[bot]

This comment was marked as resolved.

@carderne
carderne marked this pull request as ready for review July 21, 2026 15:41

@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 found 2 potential issues.

Open in Devin Review

Comment on lines +22 to +25
dts: {
// The TypeScript 7 declaration emitter consumes referenced package declarations.
neverBundle: [/^@internal/],
},

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.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +103 to +114
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");

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.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant