Skip to content

Rewrite PNPM analyzer to use (generated) lockfiles #10129

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

Open
sschuberth opened this issue Apr 4, 2025 · 2 comments
Open

Rewrite PNPM analyzer to use (generated) lockfiles #10129

sschuberth opened this issue Apr 4, 2025 · 2 comments
Labels
analyzer About the analyzer tool

Comments

@sschuberth
Copy link
Member

sschuberth commented Apr 4, 2025

I'm writing this to document an idea I've already discussed with @fviernau.

I believe that a major bottleneck of (initial) analyzer runs on Node projects in general is the fact that we need to run (p)npm install which downloads all binary artifacts. However, recent (P)NPM versions learned the --lockfile-only option which at least safes the file I/O to write the node_modules directory, but ideally also avoids the download of binary artifacts.

While many lockfiles have the problem that they do not provide information about the hierarchy of dependencies, the PNPM lockfile format version 9 does provide that information.

So the idea is to rewrite the PNPM analyzer to parse the lockfile instead of running pnpm list, which has several problems. If no lockfile is already present, a temporary one would be created on-the-fly via pnpm install --lockfile-only, and then continuing with the usual processing. The latter needs to do the usual (p)npm info / view calls to enrich metadata of packages with information missing from the lockfile.

@sschuberth sschuberth added the analyzer About the analyzer tool label Apr 4, 2025
@sschuberth
Copy link
Member Author

I just discovered https://lfx.rushstack.io/, BTW, which looks like a useful tool to analyze / debug PNPM lockfile issues.

@MatthiasGrandl
Copy link

I think the pnpm info calls should also be parallelized akin to what was done with npm here #10059 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool
Projects
None yet
Development

No branches or pull requests

2 participants