Skip to content

Replace tsc with tsgo for type checking in subprojects#801

Merged
yamadashy merged 4 commits intomainfrom
chore/tsgo-website
Aug 24, 2025
Merged

Replace tsc with tsgo for type checking in subprojects#801
yamadashy merged 4 commits intomainfrom
chore/tsgo-website

Conversation

@yamadashy
Copy link
Owner

This PR replaces tsc with tsgo for TypeScript type checking in all subprojects to align with the main package.json configuration and improve type checking performance.

Changes

  • browser/package.json: Updated lint-tsc script from tsc --noEmit to tsgo --noEmit
  • website/client/package.json: Updated lint-tsc script from tsc --noEmit to tsgo --noEmit
  • website/server/package.json: Updated lint-tsc script from tsc --noEmit to tsgo --noEmit
  • All subprojects: Added @typescript/native-preview dependency required for tsgo compatibility

Benefits

  • Consistent tooling across all packages in the monorepo
  • Faster TypeScript type checking with tsgo's native performance improvements
  • Reduced maintenance overhead by using the same type checking approach everywhere

Checklist

  • Run npm run test
  • Run npm run lint

Copilot AI review requested due to automatic review settings August 24, 2025 09:41
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Replaces TypeScript lint script from tsc --noEmit to tsgo --noEmit and adds @typescript/native-preview as a devDependency across browser and website client/server package.json files.

Changes

Cohort / File(s) Summary
TS lint script switch
browser/package.json, website/.../client/package.json, website/.../server/package.json
Updated script: lint-tsc now runs tsgo --noEmit instead of tsc --noEmit.
DevDependency addition
browser/package.json, website/*/package.json
Added @typescript/native-preview with version ^7.0.0-dev.20250708.1 to devDependencies.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/tsgo-website

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@claude
Copy link
Contributor

claude bot commented Aug 24, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to standardize and enhance the TypeScript type checking process across all subprojects by replacing the tsc command with tsgo. This change ensures consistent tooling within the monorepo, leverages tsgo's native performance improvements for faster type checking, and reduces overall maintenance overhead.

Highlights

  • Type Checker Migration: The lint-tsc script in browser, website/client, and website/server package.json files has been updated to use tsgo --noEmit instead of tsc --noEmit.
  • Dependency Addition: The @typescript/native-preview dependency has been added to the devDependencies section of all affected subprojects to ensure compatibility with tsgo.
  • Performance and Consistency: This migration aims to improve type checking performance and establish consistent tooling across the monorepo, reducing maintenance overhead.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the TypeScript compiler (tsc) with tsgo for type checking across all subprojects to standardize tooling and improve performance. The change updates lint scripts and adds the required dependency for tsgo compatibility.

  • Updates lint-tsc scripts from tsc --noEmit to tsgo --noEmit across all subprojects
  • Adds @typescript/native-preview dependency to enable tsgo functionality
  • Aligns type checking approach with the main package configuration

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
browser/package.json Updated lint script to use tsgo and added native-preview dependency
website/client/package.json Updated lint script to use tsgo and added native-preview dependency
website/server/package.json Updated lint script to use tsgo and added native-preview dependency

@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.41%. Comparing base (94669a0) to head (48035c2).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   87.41%   87.41%           
=======================================
  Files         113      113           
  Lines        6493     6493           
  Branches     1331     1331           
=======================================
  Hits         5676     5676           
  Misses        817      817           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully replaces tsc with tsgo for TypeScript type checking across the browser, website/client, and website/server subprojects. The changes are consistent and align with the goal of standardizing tooling and improving performance. I have one suggestion regarding dependency versioning to enhance build stability. By pinning the version of the @typescript/native-preview package, you can ensure that all developers and CI environments use the exact same version, preventing potential issues from updates to this pre-release package.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
website/server/package.json (1)

5-13: Type-Check Script Panics in browser Package

The end-to-end type-check verification is currently failing because the tsgo binary panics with a VFS error (failed to get executable path: readlink /proc/self/exe: no such file or directory) when running in the browser folder. This prevents any of the subprojects from successfully passing the lint-tsc check. Please address the following:

• Fix the lint-tsc script in each package’s package.json (e.g.
browser/package.json
website/client/package.json
website/server/package.json)
Change from:

"lint-tsc": "tsgo --noEmit"

To either a direct tsc invocation:

"lint-tsc": "tsc --noEmit"

or ensure the tsgo binary can locate its executable (for example, installing via npm install --save-dev @microsoft/typescript-go and invoking with npx tsgo --noEmit).

• Once updated, re-run the full verification across all subprojects:

#!/bin/bash
set -euo pipefail
for pkg in browser website/client website/server; do
  echo "=== $pkg ==="
  pushd "$pkg" >/dev/null
  npm ci
  echo "[type-check]"; npm run -s lint-tsc
  popd >/dev/null
done
echo "Done."

This will ensure that type-checks no longer crash and that exit codes remain stable across all subprojects.

🧹 Nitpick comments (6)
browser/package.json (2)

11-11: Switching to tsgo for type-checking: OK; consider explicit project/CI flags.

Non-blocking: for stability and CI log hygiene, consider passing an explicit project and disabling ANSI output.

Apply if you want tighter parity and cleaner CI:

-    "lint-tsc": "tsgo --noEmit",
+    "lint-tsc": "tsgo -p tsconfig.json --noEmit --pretty false",

30-30: Pin dev-preview to an exact version to avoid surprise upgrades.

Using a caret with a dev-preview tag can pull breaking changes. Prefer an exact pin, or centralize via root overrides for consistency across the monorepo.

Option A — exact pin in this package:

-    "@typescript/native-preview": "^7.0.0-dev.20250708.1",
+    "@typescript/native-preview": "7.0.0-dev.20250708.1",

Option B — keep the current spec here but enforce via root package.json overrides:

"overrides": {
  "@typescript/native-preview": "7.0.0-dev.20250708.1"
}
website/client/package.json (2)

10-10: tsgo replacement looks good; align flags across packages for consistency.

Optional: mirror any flags you adopt in other packages (e.g., -p tsconfig.json, --pretty false) so all subprojects behave the same in CI.

-    "lint-tsc": "tsgo --noEmit"
+    "lint-tsc": "tsgo -p tsconfig.json --noEmit --pretty false"

19-19: Pin the dev-preview version to reduce churn in docs site CI.

Same reasoning as other packages—dev previews can shift quickly; an exact pin keeps docs builds predictable.

-    "@typescript/native-preview": "^7.0.0-dev.20250708.1",
+    "@typescript/native-preview": "7.0.0-dev.20250708.1",
website/server/package.json (2)

9-9: Type-check with tsgo; keep tsc for emit: good separation.

Nice: lint uses tsgo, build still uses tsc for emission. Optionally, enforce type-check before build to fail fast.

   "scripts": {
     "dev": "PORT=8080 tsx watch src/index.ts",
     "build": "tsc",
     "lint": "npm run lint-tsc",
-    "lint-tsc": "tsgo --noEmit",
+    "lint-tsc": "tsgo -p tsconfig.json --noEmit --pretty false",
+    "prebuild": "npm run lint-tsc",

25-25: Pin dev-preview dependency for server, or manage centrally via overrides.

To avoid unexpected CI failures on new dev drops, prefer an exact version or a repo-wide override.

-    "@typescript/native-preview": "^7.0.0-dev.20250708.1",
+    "@typescript/native-preview": "7.0.0-dev.20250708.1",
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b562099 and b029eae.

📒 Files selected for processing (3)
  • browser/package.json (2 hunks)
  • website/client/package.json (2 hunks)
  • website/server/package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test (windows-latest, 23.x)
  • GitHub Check: Test (windows-latest, 20.x)
  • GitHub Check: Build and run (windows-latest, 21.x)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
browser/package.json (1)

11-11: tsgo invocation is failing in this environment; please verify manually

It looks like the sandbox CI environment can’t resolve the tsgo executable (no /proc/self/exe), so our automated check panicked and couldn’t confirm that tsgo --noEmit behaves like tsc --noEmit. Please run the following locally and ensure there are no diagnostic regressions:

  • cd browser
  • npm install
  • npx tsgo --version — confirm it prints a version without error
  • npm run lint-tsc (i.e. tsgo --noEmit) — confirm it completes without panic
  • Compare the number and content of diagnostics against a baseline tsc --noEmit run to ensure parity
website/client/package.json (1)

10-10: Manual Verification Required for tsgo Integration

I attempted to run the new lint-tsc script in our sandbox and saw the following panic:

panic: vfs: failed to get executable path: readlink /proc/self/exe: no such file or directory

This suggests that tsgo’s virtual‐FS layer can’t resolve its own binary path in this environment. Please manually verify in your development/CI environment that:

  • In website/client/package.json (line 10), running npm run lint-tsc (i.e. tsgo --noEmit)
    • correctly locates the project’s tsconfig.json
    • surfaces the same diagnostics you expect (matching tsc --noEmit)
    • does not panic under typical Linux/CI setups
  • If the panic persists, consider:
    • wrapping the call to expose /proc/self/exe or setting an explicit executable path
    • falling back to tsc --noEmit for linting in unsupported environments

- Update browser/package.json to use tsgo instead of tsc for lint-tsc script
- Update website/client/package.json to use tsgo instead of tsc for lint-tsc script
- Update website/server/package.json to use tsgo instead of tsc for lint-tsc script
- Add @typescript/native-preview dependency to all subprojects for tsgo compatibility

This aligns with the main package.json which already uses tsgo for faster TypeScript type checking.
- Update @typescript/native-preview from 7.0.0-dev.20250708.1 to 7.0.0-dev.20250824.1
- Update package-lock.json files for all subprojects to reflect the latest version
- Ensures compatibility with latest TypeScript native performance improvements

This keeps all packages in sync with the latest tsgo release for consistent type checking performance.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 24, 2025

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 48035c2
Status: ✅  Deploy successful!
Preview URL: https://aec025fd.repomix.pages.dev
Branch Preview URL: https://chore-tsgo-website.repomix.pages.dev

View logs

- Replace "baseUrl": "." with "paths": {"*": ["./*"]} in website/client/tsconfig.json
- Fixes TypeScript error TS5102: Option 'baseUrl' has been removed
- Ensures compatibility with tsgo which requires the new paths configuration

This resolves the linting error when using tsgo for type checking.
- Add @types/node dependency to website/client/package.json
- Fixes TS2688 error: Cannot find type definition file for 'node'
- Required for tsgo to properly resolve Node.js types used by vite and vitepress

This resolves TypeScript compilation errors when using tsgo for type checking.
@yamadashy yamadashy merged commit 3d07cfd into main Aug 24, 2025
55 checks passed
@yamadashy yamadashy deleted the chore/tsgo-website branch August 24, 2025 10:43
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