Skip to content

Commit e694af3

Browse files
committed
feat: port tsconfck (find tsconfig files)
1 parent cfa2279 commit e694af3

File tree

149 files changed

+1137
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1137
-70
lines changed

Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ name = "resolver"
7878

7979
[dependencies]
8080
cfg-if = "1"
81+
fast-glob = "1"
8182
indexmap = { version = "2", features = ["serde"] }
8283
json-strip-comments = "3.1"
8384
once_cell = "1" # Use `std::sync::OnceLock::get_or_try_init` when it is stable.

README.md

Lines changed: 10 additions & 7 deletions

benches/resolver.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,19 @@ fn bench_resolver_memory(c: &mut Criterion) {
224224
});
225225
},
226226
);
227+
228+
group.bench_with_input(BenchmarkId::from_parameter("find tsconfig"), &data, |b, data| {
229+
let oxc_resolver = oxc_resolver_memory();
230+
let paths = data
231+
.iter()
232+
.map(|(path, request)| oxc_resolver.resolve(path, request).unwrap().into_path_buf())
233+
.collect::<Vec<_>>();
234+
b.iter(|| {
235+
for path in &paths {
236+
let _ = oxc_resolver.find_tsconfig(path);
237+
}
238+
});
239+
});
227240
}
228241

229242
fn bench_resolver_real(c: &mut Criterion) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!node_modules

fixtures/tsconfck/find/a/b/bar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const bar = 'bar';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

fixtures/tsconfck/find/a/b/c/x.ts

Whitespace-only changes.

fixtures/tsconfck/find/a/b/c/y.js

Whitespace-only changes.

fixtures/tsconfck/find/a/b/qoox.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const qoox = "qoox";

0 commit comments

Comments
 (0)