Repository navigation
fix(kit): improve TS extension stripping/substitutions - #35233
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR improves TypeScript path substitution resolution by replacing a simple extension-stripping regex with a filesystem-aware helper. The new getPathSubstitution function detects specific extension patterns and checks disk for corresponding TypeScript declaration files (.d.ts, .d.mts, .d.cts), rewrites paths accordingly, and falls back to relative paths when no matches exist. Two existing callsites in alias and config path resolution are updated to use this helper. A new test with multiple fixture files validates that _generateTypes correctly rewrites compilerOptions.paths entries for Nitro aliases, including scenarios with injected -hooked targets and declaration file availability. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
a360ce9 to
10caaa0
Compare
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
Merging this PR will improve performance by 14.23%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | loadNuxt in the basic test fixture |
445.3 ms | 389.8 ms | +14.23% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/tsconfig-paths-mts (10caaa0) with main (2bab300)2
Footnotes
-
3 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. ↩
-
No successful run was found on
main(a2138f1) during the generation of this report, so 2bab300 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
(cherry picked from commit ad3c88e)
(cherry picked from commit ad3c88e)
🔗 Linked issue
nitrojs/nitro#4297
📚 Description
spotted this when testing nuxt v5 nightly -
../node_modules/nitro/h3isn't valid whenh3.mjsandh3.d.mtsare the extensionshttps://stackblitz.com/edit/node-4mtandbr