spago
spago copied to clipboard
New command: `spago graph`
It should be basically an alias for purs graph $(spago sources)
The only caveat here is that we should probably check that the version of purs is at least 0.13.8, since graph shipped with that version.
I had to use purs graph internally to implement #730 - there is now a function Spago.Purs.graph which handles calling out to purs graph and decoding the console output.
If anyone is interested in working on this, I would be happy to help, just let me know!
I was thinking it would be cool to have both spago graph modules and spago graph packages - we should already have all the functionality for this
Yeah, spago graph modules is pretty much what's implemented by purs graph, so it shouldn't be bad.
spago graph packages would involve resolving files to package names, and then rebuilding a graph structure using package names as the nodes. This would be a little more involved. There is code to resolve a filename to a package name here: https://github.com/purescript/spago/blob/5042ae2c2ffa49cbe8ee686adac129743e3cd450/src/Spago/Build.hs#L80-L108