deno icon indicating copy to clipboard operation
deno copied to clipboard

`deno add` - support `http:` and `https:` specifiers

Open bartlomieju opened this issue 1 year ago • 9 comments

Currently deno add only works with jsr: and npm: specifiers.

We should add an ability to do deno add https://deno.land/x/foo/bar.ts.

To do this, we should leverage existing infer_name_from_url() helper, that is already used in deno install and deno compile https://github.com/denoland/deno/blob/d3d3582b1f1b71b18d8d89cdf8e14f112b8f40a7/cli/tools/installer.rs#L131-L185

bartlomieju avatar Apr 03 '24 22:04 bartlomieju

Note that there is #23144 for aliases

dsherret avatar Apr 03 '24 23:04 dsherret

This would require modifying https://github.com/denoland/deno_semver.

tristanisham avatar Apr 05 '24 21:04 tristanisham

@tristanisham why?

dsherret avatar Apr 05 '24 21:04 dsherret

@tristanisham why?

I believe that's where all the code for specifiers is. If the goal is to add "http(s):" that's the package where the actual structs and implementation details reside.

image

tristanisham avatar Apr 05 '24 22:04 tristanisham

For the record:

Had a discussion about adding the feature to the deno_semver crate, but concluded that it would be better implemented here.

tristanisham avatar Apr 05 '24 23:04 tristanisham

@bartlomieju @tristanisham Can I take this issue? I may have some questions regarding certain internals of the project but I would like to give it a shot c:

jmj0502 avatar May 10 '24 13:05 jmj0502

Be my guess. I haven't finished my PR.

tristanisham avatar May 11 '24 17:05 tristanisham

Hi @jmj0502, @tristanisham @bartlomieju , if you guys are not working on this then can I pick this up please.

bp7968h avatar Oct 26 '24 13:10 bp7968h

Sure, feel free to pick it up.

bartlomieju avatar Oct 26 '24 22:10 bartlomieju