Skip to content

Generated source has incorrect packageName for URL dependency #333

@xhalo32

Description

@xhalo32

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions