build: run typechecks with native TypeScript 7 - #59
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds the @typescript/native dependency and introduces a check:typescript-version script to package.json. The reviewer feedback correctly identifies a portability issue with using grep on Windows environments and suggests a cross-platform Bun one-liner to verify the TypeScript version instead.
| "setup": "bash scripts/setup.sh", | ||
| "deploy": "bun run --filter '@statusbeam/worker' deploy && bun run --filter '@statusbeam/web' deploy" | ||
| "deploy": "bun run --filter '@statusbeam/worker' deploy && bun run --filter '@statusbeam/web' deploy", | ||
| "check:typescript-version": "tsc --version | grep -E '^Version 7\\.'" |
There was a problem hiding this comment.
[MEDIUM] Non-portable grep command in package.json script
Problem: The check:typescript-version script uses grep, which is not natively available on Windows environments, leading to potential failures for Windows contributors.
Rationale: To ensure cross-platform compatibility and a consistent developer experience, scripts in package.json should avoid platform-specific shell utilities like grep.
Suggestion: Use a cross-platform Bun/Node.js one-liner to verify the TypeScript version.
| "check:typescript-version": "tsc --version | grep -E '^Version 7\\.'" | |
| "check:typescript-version": "bun -e \"if (!require('child_process').execSync('tsc --version').toString().startsWith('Version 7.')) process.exit(1)\"" |
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryAdds a side-by-side TypeScript toolchain that preserves TypeScript 6 for JavaScript API consumers while selecting the native TypeScript 7 compiler for direct
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable issues identified. The dependency layout preserves TypeScript 6 under its normal package name, exposes TypeScript 7 through the alias for direct compiler invocations, and adds a CI guard to detect incorrect binary selection.
|
| Filename | Overview |
|---|---|
| package.json | Adds the native TypeScript 7 alias and a compiler-version guard while retaining TypeScript 6 for API consumers. |
| .github/workflows/ci.yml | Runs the new TypeScript version guard before the existing typecheck job. |
| bun.lock | Locks TypeScript 7.0.2 and its optional platform-specific native compiler packages. |
Reviews (1): Last reviewed commit: "build: run typechecks with native TypeSc..." | Re-trigger Greptile



Summary
@typescript/nativealias so Bun links directtscinvocations to the faster native compilertypescriptpackage for API consumers such astypescript-eslinttscbinary remains TypeScript 7Motivation
TypeScript 7 provides substantially faster native compilation, but it does not expose the JavaScript compiler API required by
typescript-eslint. The TypeScript team recommends running TypeScript 6 and 7 side-by-side during this transition:The documented
@typescript/typescript6alias layout currently resolves circularly under Bun 1.3.14. This PR uses the Bun-compatible equivalent: normaltypescript@^6.0for imports and@typescript/nativeas an alias totypescript@^7.0.2for thetscbinary.Verification
bun install --frozen-lockfilebun run lintbun run check:typescript-version→Version 7.0.2bun run typecheck --force→ 9 successful tasks, 0 cachedtscworkspaces (worker, core, CLI, and create-statusbeam) each resolveVersion 7.0.2Version 6.0.3with a non-zero exit codeCaveats
tsserverAPI.@typescript/nativedependency.typescript-eslintsupports the TypeScript 7.1 API.bun.lockrebase.Summary by cubic
Run typechecks with the native TypeScript 7 compiler for faster
tsc, while keepingtypescript@^6for tools that use the JS API liketypescript-eslint. Adds the@typescript/nativealias totypescript@^7.0.2and a CI check (bun run check:typescript-version) to ensuretscstays on 7.x.Written for commit 0119243. Summary will update on new commits.