feat: add TypeScript resolveRoot option#111
Conversation
|
Warning Review limit reached
More reviews will be available in 46 minutes and 6 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/unit/typescript/type-script-worker-config.spec.ts (1)
43-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a
resolveRoottest for thenative-previewfallback.The new suite covers default
typescriptresolution and TS 7 auto-detection, but it never exercises thetsgo: truefallback throughresolveDefaultPreviewPackageJsonPath(options.resolveRoot). A small@typescript/native-previewfixture (or a parameterized package helper) plus a{ tsgo: true, resolveRoot }case would lock down the third code path this PR changes.Also applies to: 185-247
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/unit/typescript/type-script-worker-config.spec.ts` around lines 43 - 78, The type-script worker config tests miss coverage for the native-preview fallback path, so add a case in the typeScript worker config spec that uses a resolveRoot fixture and sets tsgo: true to exercise resolveDefaultPreviewPackageJsonPath(options.resolveRoot). Reuse the existing createResolveRoot and createTypeScriptPackage helpers, or extend them to create an `@typescript/native-preview` package fixture, then assert the resolved package path/version for this third branch alongside the existing default typescript and TS 7 detection cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/unit/typescript/type-script-worker-config.spec.ts`:
- Around line 43-78: The type-script worker config tests miss coverage for the
native-preview fallback path, so add a case in the typeScript worker config spec
that uses a resolveRoot fixture and sets tsgo: true to exercise
resolveDefaultPreviewPackageJsonPath(options.resolveRoot). Reuse the existing
createResolveRoot and createTypeScriptPackage helpers, or extend them to create
an `@typescript/native-preview` package fixture, then assert the resolved package
path/version for this third branch alongside the existing default typescript and
TS 7 detection cases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f1a0cedd-8570-454e-a1b9-ddf293281243
📒 Files selected for processing (4)
README.mdsrc/typescript/type-script-worker-config.tssrc/typescript/type-script-worker-options.tstest/unit/typescript/type-script-worker-config.spec.ts
Summary
This PR adds
typescript.resolveRootso projects can choose the root used to resolve the default TypeScript package without hard-codingtypescriptPath. It applies to normal TypeScript loading, TypeScript 7+ tsgo auto-detection, and the native-preview fallback, while explicittypescriptPathcontinues to take precedence.