mirror of
https://github.com/hanzoai/unrs-resolver.git
synced 2026-09-24 17:03:52 +00:00
## Summary - Add `resolve_dts()` method to `ResolverGeneric` implementing TypeScript's `ts.resolveModuleName` with `moduleResolution: "bundler"` algorithm - Two-pass `node_modules` walk: all ancestors for TS/DTS + `@types` before trying JS — fixes the fundamental algorithmic difference that JS workarounds can't address - `@types` scoped name mangling (`@babel/core` → `@types/babel__core`) - TypeScript extension substitution (`.js` → `.ts`, `.d.ts`) following TS priority order - `typesVersions` package.json field support - `exports` field absolute priority (blocks `types`/`typings`/`main` when present) - NAPI bindings: `resolveDtsSync` / `resolveDtsAsync` - 20 test cases covering relative resolution, extension substitution/priority, directory modules, `@types`, exports, `typesVersions`, `typings` field, and name mangling Closes #549 Co-authored-by: Hanzo Dev <[email protected]>