Skip to content

ci: typecheck with ts-rust (~10x faster) - #2531

Merged
richiemcilroy merged 1 commit into
CapSoftware:mainfrom
flamboh:ci/tsc-rs-typecheck
Oct 14, 2026
Merged

richiemcilroy merged 1 commit into
CapSoftware:mainfrom
flamboh:ci/tsc-rs-typecheck

Conversation

@flamboh

@flamboh flamboh commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Feel free to close. Mostly for the bit.

Note

🤖 Claude Opus 5.5 on behalf of Oliver

Why

The Typecheck CI job spends most of its time in bun run typecheck → tsc -b. On recent green main runs that step takes ~95–103 s on ubuntu-latest. tsc-rs is a Rust port of the TypeScript 7 compiler with the Effect language-service diagnostics built in, so it checks this workspace (Effect rules included) in a fraction of that.

What changed

  • typecheck now runs tsc-rs -b (pinned tsc-rs@0.6.0). typescript stays for Next, editors and the other tsc jobs.
  • TypeScript 7 config migrations. All of these still pass under the current tsc 5.9:
    • Removed baseUrl (removed in TS 7) from apps/web, apps/chrome-extension, packages/ui, packages/utils and packages/env, and made paths targets ./-relative. apps/web gets a hooks/* path for the 31 bare hooks/... imports that relied on baseUrl.
    • apps/chrome-extension: "types": ["chrome"], since TS 7 no longer auto-includes every @types/* package.
    • noUncheckedSideEffectImports: false where CSS side-effect imports are used (apps/web, apps/chrome-extension, packages/ui), since TS 7 enables the check by default.
    • packages/ui-solid: explicit rootDir: "./src" (TS5011 in TS 7), which is the value tsc already computed.
  • Effect diagnostics: ignoreEffectWarningsInTscExitCode: true in packages/config/base.tsconfig.json. CLI tsc never ran the Effect plugin, so its warnings now print in CI without failing it. Effect errors still fail.
  • VideosPolicy.ts: yield* Effect.fail(...) → return yield* Effect.fail(...) at the two sites flagged by Effect's missingReturnYieldStar error. Runtime behavior is unchanged because the failure already short-circuited.

Benchmarks

Full -b build from a clean state: every *.tsbuildinfo and emitted dist removed before each run. hyperfine, 1 warmup + 5 runs, same commit, after next typegen. Both checkers exit 0 with the same tree, and both report planted type errors in packages/web-domain and apps/web.

Machine tsc 5.9 tsc-rs tsc-rs --fast Speedup
Apple M4 Pro (macOS, arm64, 12 cores) 31.59 s ± 0.42 2.14 s ± 0.01 2.17 s ± 0.01 14.8×
AMD Ryzen 5 PRO 5650U (Ubuntu, x86_64, 12 threads) 67.56 s ± 0.46 6.24 s ± 0.03 6.33 s ± 0.03 10.8×
Same Ryzen pinned to 4 CPUs (taskset -c 0-3, ≈ ubuntu-latest) 69.59 s ± 0.92 9.30 s ± 0.13 — 7.5×

--fast doesn't help here because in build mode it keeps 4 checkers. --fast --checkers 8 on the M4 Pro got 1.99 s (~7%) for +15% memory, so this PR uses the default mode. Peak memory also drops: 3.6 GiB → 2.7 GiB on the M4 Pro.

Projected CI: the ~100 s Typecheck step should land around 15 s. This PR's own CI run will show the real number.

Caveats

  • tsc-rs is new: 0.6.0, released 2026-10-13. Its README lists known tsc -b / monorepo issues, and none of them reproduced here. If you'd rather be cautious, this can run as an extra non-blocking job next to tsc first.
  • It type-checks with TS 7 semantics while the repo stays on TS 5.9 for tooling, so the config changes above keep both happy.

Made with Claude Opus 5.5 in Claude Code (T3 Code).

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable regression was established.

Summary

Switches the root typecheck command to pinned tsc-rs@0.6.0 while keeping TypeScript for other tooling.

  • The workspace typecheck runs faster with tsc-rs.
  • The typecheck prints Effect warnings without failing on them.
  • Video access denials now return their failed Effect explicitly.

Acknowledgment: flamboh explicitly notes that the new compiler has known build-mode and monorepo caveats and that this workspace still uses TypeScript 5.9 for other tooling. These intentional trade-offs are not reported as findings.

Reviews (1) · Last reviewed commit: "ci: typecheck the workspace with tsc-rs" · Reviewed by Greptile

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@flamboh is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@flamboh flamboh changed the title ci: typecheck the workspace with tsc-rs (~10x faster) ci: typecheck with ts-rust (~10x faster) Oct 13, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​tsc-rs@​0.6.094100969390

View full report

@richiemcilroy
richiemcilroy marked this pull request as ready for review October 14, 2026 00:51
@richiemcilroy
richiemcilroy merged commit f6164c1 into CapSoftware:main Oct 14, 2026
7 of 9 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