Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated source has incorrect packageName for URL dependency #333

Open
xhalo32 opened this issue Jul 7, 2024 · 0 comments
Open

Generated source has incorrect packageName for URL dependency #333

xhalo32 opened this issue Jul 7, 2024 · 0 comments

Comments

@xhalo32
Copy link

xhalo32 commented Jul 7, 2024

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.

@xhalo32 xhalo32 changed the title Generated source has incorrect name for URL dependency Generated source has incorrect packageName for URL dependency Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant