vizdeps icon indicating copy to clipboard operation
vizdeps copied to clipboard

Refactor code to make it possible to use with Boot

Open nha opened this issue 7 years ago • 4 comments

I get this is a leiningen task.

I am sure there are people using boot that would be interested (I am one).

This project could either provide a boot task, or expose functions that a boot task could use to render the graph, prune dependencies etc.

nha avatar Mar 09 '17 11:03 nha

It's possible a bit of it could be rewritten to use pomengranate (the underlying wrapper around the Aether/Maven code) more directly; that would make it more reasonable to have Boot make use of the code. To be honest, it's a bit of a hack getting the dependencies, especially the full dependency tree.

hlship avatar Mar 09 '17 17:03 hlship

There's also a few other things related to logging that are a bit Leiningen specific but that could be refactored (we pass around an options map everywhere, logging could be abstracted to functions added to the options map).

hlship avatar Mar 09 '17 17:03 hlship

So maybe steps towards boot compatibility would be:

  • exposing a function that takes dependencies in a format vizdeps likes and returns an image file (or takes a path/file as parameter). This would make it usable from clojure code as a library, and therefore by boot down the road.

  • providing a helper function that would go from (:dependencies pod/env) to the format you want, and maybe even a boot task using it. This would make it "batteries incuded" for boot users.

For context, I know boot has some facilities around dependencies like

  • (:dependencies pod/env) to get the dependencies
  • a pedantic namespace https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/pedantic.clj that could be interesting
  • boot.util/dep-as-map
  • probably some more, not sure about the full dependency tree yet.

Note: I did not dig into the vizdep code yet so it may not all make sense - or make sense at all. In any case 👍 for doing it - I was wishing for something like that.

nha avatar Mar 09 '17 17:03 nha

I don't use Boot any more (I tend to use Joker where in the past I used Boot). I'm open to a reasonable PR to break the code up to be more easily leveraged by Boot, but don't have the bandwidth to do the work itself.

hlship avatar Feb 08 '20 01:02 hlship