_Comment made by: deraen_
I would add the call to {{cljs.compiler.api}} and it could be called {{output-dependency-graph}}.
Creating the graph requires list of all the nodes and dependencies for each node. For Cljs namespaces
these are accessible through {{all-ns}} and ns analysis map {{:requires}}. Data about foreign-deps
and closure libs is available in the compiler state under {{:js-dependency-index}} key. To create the
graph we need to:
1. Get list of all nodes
2. Get dependencies for given node
3. Get output file for given node
Because steps 2 and 3 depend on the type of node, it would probably be easiest to collect those
values in step 1. So step 1 would do something like this:
{{(get-nodes ...) => [{:provides "goog.net" :file "out/goog/net.js" :dependencies #{"goog.foo"}} {:provides "frontend.core" :file "out/frontend/core.js" :dependencies #{"cljs.core"}}]}}
That could be implemented by concatenating data from cljs namespaces retrieved from {{all-ns}} etc. with
data from {{:js-dependency-index}}. The next and last step would be to construct the graph using reduce.
Using this implementation there would be just one new API call: {{output-dependency-graph}}.
I was thinking alternative approach with {{all-ns}}, {{find-ns}} etc. versions which would work also with foreign-deps and closure libs, but I don't think it's very easy (or efficient) e.g. to retrieve data for foreign-dep with just a name as they are indexed by file paths.