fix(deps): correctly resolve root @types packages for dts deep imports#852
Merged
sxzz merged 4 commits intorolldown:mainfrom Mar 25, 2026
Merged
fix(deps): correctly resolve root @types packages for dts deep imports#852sxzz merged 4 commits intorolldown:mainfrom
@types packages for dts deep imports#852sxzz merged 4 commits intorolldown:mainfrom
Conversation
Resolve @types package names from the package root instead of the full import specifier. This fixes d.ts deep imports like markdown-it/lib/token.mjs being checked as @types/markdown-it__lib__token.mjs instead of @types/markdown-it, and adds regression coverage for both helper logic and the end-to-end build output.
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
@tsdown/css
@tsdown/exe
tsdown-migrate
commit: |
@types packages for deep imports@types packages for dts deep imports
verbose117
approved these changes
Mar 24, 2026
- Extract shared `parsePackageSpecifier` from `parseDepPath` and `getPackageName` - Rename functions for clarity: `parseDepPath` → `parseNodeModulesPath`, `parseBundledDep` → `readBundledDepInfo`, `resolveDepPath` → `resolveDepSubpath` - Replace magic number with `NODE_MODULES` constant - Guard scoped package parsing against missing second segment - Add unit tests for `parsePackageSpecifier` and `parseNodeModulesPath`
sxzz
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow up to 0be7c6d / PR #755 for issue #745.
PR #755 fixed externalizing type-only packages declared as
@types/*, but it still derived the DefinitelyTyped package name from the full import specifier. That caused deep imports likemarkdown-it/lib/token.mjsto be checked as@types/markdown-it__lib__token.mjsinstead of@types/markdown-it.Linked Issues
Additional context