spago icon indicating copy to clipboard operation
spago copied to clipboard

New command: `spago graph`

Open f-f opened this issue 4 years ago • 3 comments

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.

f-f avatar Dec 29 '20 00:12 f-f

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!

colinwahl avatar Apr 03 '21 18:04 colinwahl

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

f-f avatar Apr 03 '21 18:04 f-f

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

colinwahl avatar Apr 07 '21 16:04 colinwahl