auchenberg / dependo

Visualize your CommonJS or AMD module dependencies in a force directed graph report.
MIT License
484 stars 50 forks source link

Add ability to specify a requireJS-style 'config' file, or explain how to specify it #3

Closed isochronous closed 9 years ago

isochronous commented 11 years ago

I apologize if this is something you've already added and I just haven't figured out yet, but the reason I never used any of the graphviz-based tools was that our project is heavily dependent on custom paths mapped inside a require.config call. Can dependo use such a file to resolve file mappings, or does it do it automatically assuming you've got the correct "entry point" script? Or is this too specific to requireJS AMD implementations?

auchenberg commented 11 years ago

I definitely see the use-case for adding some sort of path-mapping support. I wonder what would be the best way to do so? Ideally dependo should be able to read the RequireJS path-mapping, so you don't need to keep those mappings in sync?

What do you think?

isochronous commented 11 years ago

Personally, I think the path-mapping provided by requireJS is a great model for implementation. It's clear, the parsing logic has already been written for you (in requireJS itself), and if you use said logic, you'd also be providing support for per-module mappings (via the map config) and non-AMD files as well (via the shim config). I bet James Burke would be willing to provide feedback on any effort you make towards this issue.

auchenberg commented 11 years ago

Agreed. This seems the way to go.

Kenneth Auchenberg +45 53 22 22 33

On Sat, Apr 13, 2013 at 9:09 PM, Jeremy McLeod notifications@github.comwrote:

Personally, I think the path-mapping provided by requireJS is a great model for implementation. It's clear, the parsing logic has already been written for you (in requireJS itself), and if you use said logic, you'd also be providing support for per-module mappings (via the map config) and non-AMD files as well (via the shim config). I bet James Burke would be willing to provide feedback on any effort you make towards this issue.

— Reply to this email directly or view it on GitHubhttps://github.com/auchenberg/dependo/issues/3#issuecomment-16338877 .

benkeen commented 10 years ago

Agreed, this would be a very nice feature. As is, the generated visualization contains duplicate entries for each module (module identifier + file path). Great script, though!

givankin commented 9 years ago

+1 for this issue. BTW, the node-madge lib (https://github.com/pahen/madge) you mention in description do support requirejs config files, so maybe you just have to expose this bit of underlying API?

auchenberg commented 9 years ago

Dependo simply forwards the config to madge, so you should be able to pass requireConfig as part of the options, to get things working as expected.

I updated the read-me.

isochronous commented 9 years ago

Awesome, thanks man.