Replace tsc with tsgo for type checking in subprojects#801
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit 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 skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughReplaces 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
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-tscscript inbrowser,website/client, andwebsite/serverpackage.jsonfiles has been updated to usetsgo --noEmitinstead oftsc --noEmit. - Dependency Addition: The
@typescript/native-previewdependency has been added to thedevDependenciessection of all affected subprojects to ensure compatibility withtsgo. - 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
-
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. ↩
There was a problem hiding this comment.
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-tscscripts fromtsc --noEmittotsgo --noEmitacross all subprojects - Adds
@typescript/native-previewdependency to enabletsgofunctionality - 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 inbrowserPackageThe end-to-end type-check verification is currently failing because the
tsgobinary panics with a VFS error (failed to get executable path: readlink /proc/self/exe: no such file or directory) when running in thebrowserfolder. This prevents any of the subprojects from successfully passing thelint-tsccheck. Please address the following:• Fix the
lint-tscscript in each package’spackage.json(e.g.
–browser/package.json
–website/client/package.json
–website/server/package.json)
Change from:"lint-tsc": "tsgo --noEmit"To either a direct
tscinvocation:"lint-tsc": "tsc --noEmit"or ensure the
tsgobinary can locate its executable (for example, installing vianpm install --save-dev @microsoft/typescript-goand invoking withnpx 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.
📒 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 manuallyIt 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 thattsgo --noEmitbehaves liketsc --noEmit. Please run the following locally and ensure there are no diagnostic regressions:
cd browsernpm installnpx tsgo --version— confirm it prints a version without errornpm run lint-tsc(i.e.tsgo --noEmit) — confirm it completes without panic- Compare the number and content of diagnostics against a baseline
tsc --noEmitrun to ensure paritywebsite/client/package.json (1)
10-10: Manual Verification Required for tsgo IntegrationI attempted to run the new
lint-tscscript in our sandbox and saw the following panic:panic: vfs: failed to get executable path: readlink /proc/self/exe: no such file or directoryThis 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), runningnpm run lint-tsc(i.e.tsgo --noEmit)
• correctly locates the project’stsconfig.json
• surfaces the same diagnostics you expect (matchingtsc --noEmit)
• does not panic under typical Linux/CI setups- If the panic persists, consider:
• wrapping the call to expose/proc/self/exeor setting an explicit executable path
• falling back totsc --noEmitfor 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.
b029eae to
686f401
Compare
Deploying repomix with
|
| Latest commit: |
48035c2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://aec025fd.repomix.pages.dev |
| Branch Preview URL: | https://chore-tsgo-website.repomix.pages.dev |
- 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.
This PR replaces
tscwithtsgofor TypeScript type checking in all subprojects to align with the main package.json configuration and improve type checking performance.Changes
lint-tscscript fromtsc --noEmittotsgo --noEmitlint-tscscript fromtsc --noEmittotsgo --noEmitlint-tscscript fromtsc --noEmittotsgo --noEmit@typescript/native-previewdependency required for tsgo compatibilityBenefits
Checklist
npm run testnpm run lint