Skip to content

fix: update getDntVersion function to support JSR registry URLs - #484

Merged
dsherret merged 9 commits into
denoland:mainfrom
amyssnippet:main
Jul 25, 2026
Merged

fix: update getDntVersion function to support JSR registry URLs#484
dsherret merged 9 commits into
denoland:mainfrom
amyssnippet:main

Conversation

@amyssnippet

@amyssnippet amyssnippet commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

This PR updates the getDntVersion function in utils.ts to correctly extract version numbers from JSR URLs, as mentioned in the issue #481 , in addition to the existing Deno Land URLs. The regex has been modified to match both /dnt@version/ (legacy) and /@deno/dnt/version/ (JSR) patterns.

Previously, when dnt was imported from JSR, getDntVersion() would always return "dev" because the URL format wasn't recognized. Now it properly extracts the version (e.g., "1.2.3") from JSR URLs like https://jsr.io/@deno/dnt/1.2.3/mod.ts.

Testing:

  • All existing tests pass
  • New test validates JSR URL version extraction
  • Full test suite runs successfully (except for unrelated yarn dependency test as i havent downloaded yarn, still if issues came up, i will check that too.)

@CLAassistant

CLAassistant commented Jan 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@amyssnippet

Copy link
Copy Markdown
Contributor Author

@dsherret i have fixed the issue #484 . and thats only the regex issue, i have solved that. even after that some linting errors popped up, i solved by changing deno.jsonc file, and all errors were solved.

check my code updates from your side, if (any issue) then update me on that, else lets merge;

@amyssnippet

Copy link
Copy Markdown
Contributor Author

after that issue, i have tried to solve the issue #454 too. you may check the updates, any recommendation, or updates, then let me know

@amyssnippet

Copy link
Copy Markdown
Contributor Author

Hi @dsherret , following up on this.

I realized I bundled two distinct changes here: the JSR URL fix (#481 ) and the globalThis/shim options (#454 ).

If you prefer, I can strictly revert this PR to just the JSR fix and open a separate PR for the shim options to keep the history clean. Just let me know your preference!

@dsherret

Copy link
Copy Markdown
Collaborator

This has a bunch of unrelated changes. Can you keep it focused to the fix?

@dsherret dsherret changed the title feat: Update getDntVersion function to support JSR registry URLs fix: update getDntVersion function to support JSR registry URLs Jul 25, 2026
@dsherret

dsherret commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

I went ahead and updated. I'll see about landing your other changes in other focused PRs (with attribution).

@dsherret
dsherret merged commit bd5726c into denoland:main Jul 25, 2026
5 checks passed
@amyssnippet

Copy link
Copy Markdown
Contributor Author

@dsherret Thank You!

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.

3 participants