Support nodejs modules from github
npm supports installing directly from github repos, which comes in handy as sometimes, maintainers take a long time to publish new versions to npm
perhaps the structure in the package-lock changes a bit, causing makes to fail when installing the deps

error: attribute 'integrity' missing
at /nix/store/hawaw7ivjjrq228iak21lvcjq7nxpax2-source/src/args/make-node-js-modules/default.nix:77:34:
76| value = {
77| dist.integrity = versionAttrs.integrity;
| ^
78| dist.tarball = versionAttrs.resolvedName;
… while evaluating anonymous lambda
at /nix/store/hawaw7ivjjrq228iak21lvcjq7nxpax2-source/src/args/make-derivation/default.nix:27:9:
26| builtins.mapAttrs
27| (k: v: (
| ^
28| if (hasPrefix "__" k) || (hasPrefix "env" k)
… from call site
… while evaluating the attribute 'envAll' of the derivation 'gatsby-source-cloudinary.json'
at /nix/store/hawaw7ivjjrq228iak21lvcjq7nxpax2-source/src/args/make-derivation/default.nix:92:7:
91| builder = "${__nixpkgs__.bash}/bin/bash";
92| name = toDerivationName name;
| ^
93| outputs = ["out"];
… while evaluating 'escapeShellArg'
Tested with npm i --save https://github.com/cloudinary-devs/gatsby-source-cloudinary#19a2115fdf876c55ff74756e6dfd8d775bad636c
note: It works well using the tar.gz npm i --save https://github.com/cloudinary-devs/gatsby-source-cloudinary/archive/19a2115fdf876c55ff74756e6dfd8d775bad636c.tar.gz
npm supports both, so it would be worth documenting this behavior in case this becomes a won't fix
@dacevedo12 As we recently migrated to node2nix, it would be nice to tests if this works now.
Seems node2nix is capable of it, but it doesn't find the git binary
error: builder for '...' failed with exit code 1;
last 10 log lines:
> code: 'ENOENT',
> syscall: 'spawn git',
> path: 'git',
> spawnargs: [
> 'clone',
> 'ssh://[email protected]/cloudinary-devs/gatsby-source-cloudinary.git'
> ]
> }
>
> Node.js v20.10.0
It only worked at makes level (make-node-js-modules/default.nix), by adding __nixpkgs__.git
git via ssh doesn't work but that's a limitation from node2nix https://github.com/svanderburg/node2nix/issues/309
git via https works fine with the aforementioned patch
@dacevedo12 A PR adding git to the builtin is welcome!
Addressed in https://github.com/fluidattacks/makes/pull/1286
Thanks @dsalaza4 node2nix sure was an improvement!