Skip to content

Fix parsing npm: specifiers with paths - #59

Open
alexgleason wants to merge 1 commit into
denoland:mainfrom
alexgleason:npm-at-fix
Open

alexgleason wants to merge 1 commit into
denoland:mainfrom
alexgleason:npm-at-fix

Conversation

@alexgleason

Copy link
Copy Markdown

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:/react@19.1.0/jsx-runtime",
  "npmPackage": "react@19.1.0"
}

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