cli icon indicating copy to clipboard operation
cli copied to clipboard

fix(resolve): use nodejs implementation of url parse instead of WHATWG URL in case of support git+ssh protocol

Open Delagen opened this issue 3 years ago • 3 comments

Use nodejs implementation of url parse instead of WHATWG URL in case of support git+ssh protocol

References

Closes #5278

Delagen avatar Sep 09 '22 13:09 Delagen

@Delagen can you add a test to show this working with currently unsupported URL types?

fritzy avatar Sep 14 '22 21:09 fritzy

@fritzy I think I will spend too much time trying understand how tests work in this project

I found details it not work only with non github url For example: private Gitlab

#works npm i git+ssh://[email protected]:chalk/chalk.git#v5.0.1

#fail npm i git+ssh://[email protected]:group/repo.git#branch

npm ERR! code ERR_INVALID_URL npm ERR! Invalid URL

Seems it does not support colon inside npm i git+ssh://[email protected]/group/repo.git#branch Works

Delagen avatar Sep 14 '22 22:09 Delagen

@Delagen good point the npm project is since long time not in shape anymore i also did no pull requests for all the issues any more as i do not aggree with the overall project handling my suggestion is download .patch files from github and let this issue open then write that you need help with the pull request and some one who is familar with the project will jump in.

i created for my self a new npm package under my @scrope and there i put simply inside the package.json the git patches after install that is a good method to not be blocked by the npm project management it self. hope it helps you

frank-dspeed avatar Sep 15 '22 04:09 frank-dspeed

Thanks for the PR to fix this. We didn't want to land something using a deprecated Node API, so I was able to add a method to our package that we use for parsing git host shorthands, so it can also parse urls: https://github.com/npm/hosted-git-info/pull/176

This should land as part of #5758 which will fully close this bug.

lukekarrys avatar Oct 27 '22 01:10 lukekarrys

in general as this is needed i only want to leave a comment for the next generation. If you find such issues again never do a package for that rule of thumb if your package maintainance code is more then 200% of your own code create a new file in a existing repo most best create a folder that you call /modules/module-name/module-name.js

call it a day.

About the down voter

He has a other mindset then me you do not need to give that much attention it is his private war for keeping the things like there where in the 1970th he also is fame for the quote: treat ram as infinite in JS

frank-dspeed avatar Oct 27 '22 02:10 frank-dspeed