fix: prefer DSH packages in npm repository lookup - #90
Merged
Merged
Conversation
Owner
|
Thanks for the fix, @fwerkor! Nice catch — the npm search endpoint is relevance-ranked, so relying on The three offline tests (monorepo prefers the DSH package, single-package fallback, and ignoring non-target repos) are well chosen and keep the selector covered. Merged into |
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.
Summary
dsh-pluginkeywordProblem
The npm reverse lookup currently uses
size=10and returns the first exact-repository match. npm's search endpoint is relevance-ranked rather than a repository index, so an exact match can be far outside the first 10 results. A repository can also legitimately publish multiple packages; in that case the first result may be a CLI/helper package rather than the DSH plugin.A concrete example is
fwerkor/local-shell-mcp: it publishes an npm CLI launcher and is adding a separate DSH package. The launcher is not a DSH plugin, but the current lookup can select it solely because both packages belong to the same repository. This led to install reports fwerkor/local-shell-mcp#260 and #261.Validation
npm run typecheck:servernode --test tests/npm-resolve.test.ts(6/6 passed)npm run check(103 tests, 101 passed / 2 skipped; typecheck and full build passed)