Open milahu opened 3 years ago
pname and version should be inherited from build
npmlock2nix.build rec {
src = "...";
pname = "some-package";
version = "1.2.3";
node_modules_attrs = {
inherit pname version; # avoid this
};
}
maybe the node_modules derivation name should be some-package-1.2.3-node_modules
pname and version should be inherited from build
npmlock2nix.build rec { src = "..."; pname = "some-package"; version = "1.2.3"; node_modules_attrs = { inherit pname version; # avoid this }; }
maybe the node_modules derivation name should be
some-package-1.2.3-node_modules
I agree on the node_modules
derivations name. Feel free to add a commit to this PR that adjusts that.
I also agree on the inheriting part. I think we already do that with a couple of attributes and it would make sense here. If we do that we also have to add a test case that ensures that it works as expected. Even if it is correct now I'd like to make it as risk-free as possible to refactor the implementation while keeping the external interface.
Perhaps this could be a starting point?
thanks. i just started test.sh
and it takes foreeeeeeeeever
seems to download a million packages ...
edit: just 742 paths
these paths will be fetched (989.65 MiB download, 4236.21 MiB unpacked):
crazy!
i hope there is a lighter test method, like snapshot testing
continue #102
name and version can be missing in package-lock.json, but are required for stdenv.mkDerivation
if version is missing, use the unknown version 0.0.0
sample use: