npmlock2nix icon indicating copy to clipboard operation
npmlock2nix copied to clipboard

Support git+http(s) versions

Open Sohalt opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. Some projects have dependencies that are not part of the npm registry and are not hosted on GitHub, but instead are specified using the git+http(s) scheme. An example would be https://gitlab.com/openengiadina/geopub/-/blob/v0.2.0/package-lock.json#L769 It's currently not possible to use npmlock2nix with these lockfiles.

Describe the solution you'd like Support git+http(s) urls for specifying versions.

Describe alternatives you've considered both not very practical:

  • Mirror the dependency on GitHub
  • upload the dependency on npm

Sohalt avatar Aug 09 '21 14:08 Sohalt

I think we are hallf way there with #88 being merged. We will have to write a bit more elaborate URL parsing/handling code. In this case we probably want to use git with the HTTPS protocol as seen in the URI. This means the URL check has to become smarter and we will have different flavors of it.

The makeGithubSource function has to be generalized into handling generic git+http(s) URLs while keeping the GitHub specific code for that special GitHub syntax.

Does NPM have a gitlab: prefix for GitLab sources just as they have one for GitHub?

andir avatar Aug 11 '21 12:08 andir

Does NPM have a gitlab: prefix for GitLab sources just as they have one for GitHub?

Doesn't look like it https://docs.npmjs.com/cli/v7/configuring-npm/package-json#dependencies

Sohalt avatar Aug 11 '21 12:08 Sohalt