Open vjpr opened 3 years ago
Thanks for the test repository. I'm working on the webpack5 upgrade and then with a bit of time will try and take a look here.
My strong intuition is that while the duplicates
sub-feature (Duplicates: Found 3 similar files across 4 code sources
) is working, the versions
sub-feature (Packages: Found 0 packages with 0 resolved, 0 installed, and 0 depended versions.
) of the duplicates plugin is unable to correctly infer node_modules
roots in the manner that pnpm places them.
I'll see if I can come with an appropriate test fixture that mirrors how pnpm does it and work from there when I get time. (The fixtures application in test land is a bit complicated, but they live here if you're curious: https://github.com/FormidableLabs/inspectpack/tree/master/test/fixtures )
Reproduction: https://github.com/vjpr/repro-inspectpack-pnpm-test
Possibly related: https://github.com/FormidableLabs/inspectpack/issues/131
Upon compiling I get the following error.
Notice how
Found map: {}
.I've tracked down what is causing the map to be empty to here:
https://github.com/FormidableLabs/inspectpack/blob/917c7c9ba5118ae19b5992ed0afd505dbf6ba460/src/lib/actions/versions.ts#L362-L368
Notice how
modsToFilePath
's keys are the "realpath" of the package, whereasfilePath
is the "logical path".filePath
seems to comes from here:https://github.com/FormidableLabs/inspectpack/blob/917c7c9ba5118ae19b5992ed0afd505dbf6ba460/src/lib/util/dependencies.ts#L145-L209
However I have reached the point where I don't understand what is going on and maybe a maintainer could quickly point to the right fix?