-
-
Notifications
You must be signed in to change notification settings - Fork 35
feat: add resolve_file API for tsconfig auto discovery to work
#860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add resolve_file API for tsconfig auto discovery to work
#860
Conversation
How to use the Graphite Merge QueueAdd the label merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #860 +/- ##
==========================================
+ Coverage 94.14% 94.28% +0.13%
==========================================
Files 17 17
Lines 3092 3218 +126
==========================================
+ Hits 2911 3034 +123
- Misses 181 184 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #860 will degrade performances by 3.08%Comparing Summary
Benchmarks breakdown
Footnotes
|
a0ff198 to
62c4497
Compare
b38832c to
24c9f80
Compare
aba0c5b to
0aed399
Compare
0aed399 to
f856d8c
Compare
Merge activity
|
Add a new API to make tsconfig paths work with the auto-discovered tsconfig.
```rust
/// Resolve `specifier` for an absolute path to a file.
///
/// NOTE: [TsconfigDiscovery::Auto] only work for this API, use `ResolverGeneric::resolve_file` instead.
///
/// # Errors
///
/// * See [ResolveError]
///
/// # Panics
///
/// * If the provided path is not a file.
pub fn resolve_file<P: AsRef<Path>>(
&self,
file: P,
specifier: &str,
) -> Result<Resolution, ResolveError> {
```
---
New concept:
Given an input file:
* There is always a tsconfig associated with this file, we call it the resolved tsconfig, or tsconfig solution (in tsconfck)
* When resolving path aliases, always use the resolved tsconfig.
f856d8c to
5b1ae7f
Compare

Add a new API to make tsconfig paths work with the auto-discovered tsconfig.
New concept:
Given an input file: