1.0.4 • Published 7 years ago
dd-angular-graph v1.0.4
dd-angular-graph
Very simple angular project file crawler.
Execute
- install
npm i --save-dev dd-angular-graph
- add script to
package.jsone.g.:"show_graph": "dd-angular-graph --open-svg"
- execute in terminal
npm run show_graph
Debugging
Clone repository and in VsCode open the launch.json and add the --sourcedir <DIR> argument for your Angular project /src folder then hit F5 in index.js. The file output.plantuml can then be used to generate a diagram e.g. at plantuml.com (keep in mind that the resulting diagram could be too big for PNG so try generating SVG instead).
Arguments
--sourcedir <DIR>optional ifangular.jsonis in working dir else mandatory path to/srcdir--output <FILENAME>standard 'output', used for generating files i.e.output.plantuml--downloadwill try to download SVG diagram--open-svgwill try to open SVG diagram in Chrome without downloading
Issues & TODOs
The parsing code is very simple and doesn't account for:
- modules importing other modules
- different objects with same name
- class inheritance
- interfaces (will occur as external/unknown dependencies when encountered)
What For
Creates a plantuml code representation of the Angular project's source files by:
- searching for all
.tsfiles - extracting
@Injectable, @Directive, @Component, @NgModuleclasses- extracting class constructor parameters as dependencies
- generating
plantumlby flagging dependencies as composition targets