With the following dependency in package.json:
"dependencies": {
"lean4-infoview": "https://gitpkg.now.sh/leanprover/vscode-lean4/lean4-infoview?de0062c"
}
running nix run nixpkgs#nodePackages.node2nix -- -18 -d generates the following source in node-packages.nix:
"lean4-infoview-https://gitpkg.now.sh/leanprover/vscode-lean4/lean4-infoview?de0062c" = {
name = "_at_leanprover_slash_infoview";
packageName = "@leanprover/infoview";
version = "0.4.2";
src = fetchurl {
name = "infoview-0.4.2.tar.gz";
url = "https://gitpkg.vercel.app/leanprover/vscode-lean4/lean4-infoview?de0062c";
sha256 = "73a23b9848095cc47cc01680466a81b4399a24ca8115fcd1000a47cdd826a3ea";
};
};
which has incorrect packageName (should be lean4-infoview). Using the package-lock.json, nix run nixpkgs#nodePackages.node2nix -- -18 -d -l generates the a Nix block with the correct packageName:
"lean4-infoview-https://gitpkg.now.sh/leanprover/vscode-lean4/lean4-infoview?de0062c" = {
name = "lean4-infoview";
packageName = "lean4-infoview";
version = 1;
src = fetchurl {
name = "lean4-infoview-1.tar.gz";
url = "https://gitpkg.now.sh/leanprover/vscode-lean4/lean4-infoview?de0062c";
sha512 = "0CJ5uSJInhWV6edhT39mqRhH7jbcBSdJiMoIa77cSuMheyRLik6Hpm1KW6bB9kR2/koeqP9AlTbp2yahhl+QNg==";
};
};
These two result in completely different node_modules, the first having the dependency bundled into node_modules/@leanprover/infoview whereas the second is bundled correctly to node_modules/lean4-infoview.
With the following dependency in
package.json:running
nix run nixpkgs#nodePackages.node2nix -- -18 -dgenerates the following source innode-packages.nix:which has incorrect
packageName(should belean4-infoview). Using thepackage-lock.json,nix run nixpkgs#nodePackages.node2nix -- -18 -d -lgenerates the a Nix block with the correct packageName:These two result in completely different node_modules, the first having the dependency bundled into
node_modules/@leanprover/infoviewwhereas the second is bundled correctly tonode_modules/lean4-infoview.