hasundue / molt

Update dependencies the Deno way
https://jsr.io/@molt
MIT License
78 stars 5 forks source link

Update github raw imports #83

Closed sigmaSd closed 9 months ago

sigmaSd commented 10 months ago

Maybe its a good feature, I have currently a dependency that I'm importing like that.

udd: https://github.com/hayd/deno-udd/blob/09f9994e2588a0744b8983f91122932b494eb176/registry.ts#L556

sigmaSd commented 10 months ago

udd have many registries, is it in the scope of molt to support those ?

hasundue commented 10 months ago

udd have many registries, is it in the scope of molt to support those ?

No. As mentioned in the readme, not implementing registry-specific logic is one of the main concept of molt. We only want to support registries that has the same behavior as Deno's official registries about redirect of unversioned import specifiers.

However, I don't mind having a few exceptions, since we already have a special logic for npm specifiers. And the raw github specifier seems worth considering.

hasundue commented 10 months ago

Or we may have a plugin-like system where users can pass custom resolvers to molt.

hasundue commented 10 months ago

You may also check out https://github.com/boywithkeyboard/updater, which does support github imports and is developed actively.

sigmaSd commented 10 months ago

A plugin system sounds cool, it would be built on top molt interface of using deno graph, while keeping the core as it is

anyhow feel free to close the issue, if you think it's not that much important

hasundue commented 9 months ago

I got an idea to handle a wider range of URLs in a unified way. That should solve this issue as well as https://github.com/hasundue/molt/issues/86.

hasundue commented 9 months ago

@sigmaSd The latest release adds support of non-semver version specifiers lead by "@", so now you can use jsdelivr to get your raw github imports updated by molt:

import { collect } from "https://cdn.jsdelivr.net/gh/hasundue/molt@e4509a9/mod.ts"

Slash-separated version specifiers, like in imports from raw.githubusercontent.com, will be also supported soon.

hasundue commented 9 months ago

I decided not to support slash-separated version specifiers for now. Let me close this issue, suggesting to use jsdelivr. See also #97.

hasundue commented 9 months ago

Apparently molt still doesn't work with jsdelivr because they doesn't accept HEAD request method? I'll try implementing a compat mode using GET method instead.

hasundue commented 9 months ago

Found that denopkg https://denopkg.com/ works with molt. Documentation is comming with the next feat release.

hasundue commented 9 months ago

Nah it just redirects to master branch... Let me give up the feature for now