synp icon indicating copy to clipboard operation
synp copied to clipboard

Use npm-logical-tree to get a traversable dependency graph

Open imsnif opened this issue 7 years ago • 5 comments

Right now, we're doing a lot of this manually, and flattening the package-lock.json file. It'll save a lot (and likely protect against future breakage) to use this instead:

https://www.npmjs.com/package/npm-logical-tree

imsnif avatar Nov 20 '17 16:11 imsnif

Why cannot we just use JSON.parse(), to parse the strings?

redoz94 avatar Nov 06 '19 19:11 redoz94

How do you mean @redoz94 ?

imsnif avatar Nov 06 '19 21:11 imsnif

Ah, I think this is due to bad wording on my part in the issue name - sorry! npm-logical-tree is pretty neat in that it would allow us to get a traversable tree representation of a package.json + package-lock.json combination. We could use that to figure out all the dependencies and make a yarn.lock file (or do the reverse with some adjustments). It's far simpler than what this package does at the moment.

imsnif avatar Nov 06 '19 21:11 imsnif

As an alternative: https://github.com/npm/arborist

antongolub avatar Aug 31 '20 19:08 antongolub

For sure :) Though to note: if we use npm-logical-tree, we'll probably be able to forgo having a node_modules on disk. In that case, we might even be able to run in the browser (unless I'm missing something).

imsnif avatar Aug 31 '20 19:08 imsnif