refactor: deduplicate cross-file helpers, drop stale lint allows#1269
Conversation
- Share one wasm-aware `push_normalized_component` from `path.rs` instead of maintaining a near-identical copy in `cached_path.rs`. The shared version keeps the uvwasi \0-trim, which `path.rs` callers previously lacked on wasm; on native targets the code is identical. - Add `manual_tsconfig()` for the identical "manually configured tsconfig, skipping Auto discovery" match duplicated in `lib.rs` and `dts_resolver.rs`; `find_tsconfig_manual` becomes private. - Drop lint allows that no longer suppress anything: `clippy::cognitive_complexity` on `extend_tsconfig` and `clippy::too_many_lines` on the dts resolver (the function shrank below the threshold).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1269 +/- ##
=======================================
Coverage 94.03% 94.04%
=======================================
Files 21 21
Lines 4277 4267 -10
=======================================
- Hits 4022 4013 -9
+ Misses 255 254 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 4.6%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | pm/pnpm-isolated |
1 ms | 1.1 ms | -5.6% |
| ❌ | pm/bun-isolated |
1.1 ms | 1.1 ms | -4.89% |
| ❌ | pm/bun-flat |
942.1 µs | 974.4 µs | -3.31% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing refactor/dedupe-cross-file-helpers (e9b5f18) with main (0fbd4a3)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
## 🤖 New release * `oxc_resolver`: 11.22.0 -> 11.23.0 * `oxc_resolver_napi`: 11.22.0 -> 11.23.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `oxc_resolver` <blockquote> ## [11.23.0](v11.22.0...v11.23.0) - 2026-07-02 ### <!-- 0 -->🚀 Features - *(tsconfig)* expose outDir, declarationDir, resolveJsonModule, checkJs ([#1257](#1257)) (by @Boshen) ### <!-- 1 -->🐛 Bug Fixes - *(exports)* propagate the last error in array target resolution ([#1267](#1267)) (by @Boshen) ### <!-- 2 -->🚜 Refactor - deduplicate cross-file helpers, drop stale lint allows ([#1269](#1269)) (by @Boshen) - *(dts)* deduplicate package entry selection and remove dead code ([#1266](#1266)) (by @Boshen) - *(tsconfig)* skip TsConfig deep clone for non-root configs ([#1265](#1265)) (by @Boshen) - *(alias)* compile fallback aliases once at construction ([#1264](#1264)) (by @Boshen) ### <!-- 4 -->⚡ Performance - *(alias)* scan a packed first-byte array instead of striding over alias entries ([#1260](#1260)) (by @Boshen) ### Contributors * @Boshen </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
Two cross-file dedups plus stale-allow removal:
push_normalized_componentexisted twice —path.rsandcache/cached_path.rs— identical except the cached-path copy trims the trailing\0that uvwasi appends to directory entries on wasm (nodejs/uvwasi#262). This keeps onepubwasm-aware version inpath.rs. Note this meanspath.rscallers (tsconfig path joins) now also get the\0-trim on wasm; on native targets the generated code is unchanged, and the helper stays#[inline]so the hotnormalize_withpath keeps its codegen.manual_tsconfig(): the "manually configured tsconfig, deliberately skippingAutodiscovery" match block was duplicated verbatim inlib.rs(resolve) anddts_resolver.rs(dts_resolve_tsconfig_paths). One helper intsconfig_resolver.rsnow owns it, andfind_tsconfig_manualdrops itspub(crate).clippy::cognitive_complexityonextend_tsconfigandclippy::too_many_linesondts_try_extensions' neighbor no longer suppress anything (verified by removing them and running the CI clippy command);extend_tsconfigkeepstoo_many_lines(139/100).Part of a second cleanup pass; follows #1264–#1268.