Skip to content

Fix parsing npm: specifiers with paths #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexgleason
Copy link

This is trying to solve the same problem as #58, but I think this time I pinpointed the actual issue.

Try running: deno info --json "npm:react@^19.1.0/jsx-runtime"

{
  "kind": "npm",
  "specifier": "npm:/[email protected]/jsx-runtime",
  "npmPackage": "[email protected]"
}

Notice how npmPackage is missing the /jsx-runtime path.

That explains exactly the problem I was having here: jsr-io/jsr#24 (comment)

So I changed it to cut the npm:/ off the front of the specifier instead, and then in the plugin I carefully remove the version from the middle of the string without impacting the path. This fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant