Skip to content

Commit

Permalink
Added depthLimit option to restrict recursive searching of sub folder
Browse files Browse the repository at this point in the history
Fixed output files when no outputFileName is used
Made writing the svg file async
Catch all errors thrown and output to console
Bumped version
  • Loading branch information
Nicholas Addison committed Aug 16, 2019
1 parent d1c206d commit 5586bad
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 198 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $ sol2uml -h
-v, --verbose run with debugging statements
-f, --outputFormat <value> output file format: svg, png, dot or all (default: "svg")
-o, --outputFileName <value> output file name
-d, --depthLimit <depth> number of sub folders that will be recursively searched for Solidity files. Default -1 is unlimited (default: -1)
-n, --network <network> mainnet, ropsten, kovan, rinkeby or goerli (default: "mainnet")
-k, --etherscanApiKey <key> Etherscan API Key
-c, --clusterFolders Cluster contracts into source folders
Expand Down Expand Up @@ -122,4 +123,4 @@ This is a rewrite of the Richard Ramos's [solidity-diagram-gen](https://github.c

This version uses the [solidity-parser-antlr](https://github.com/federicobond/solidity-parser-antlr) Solidity parser which is built on top of [ANTLR4 grammar](https://github.com/solidityj/solidity-antlr4). The logic to generate the dot syntax has been rewritten and different UML syntax is now used.

The diagrams are generated using [viz.js](https://github.com/mdaines/viz.js/) which uses [Graphviz](http://www.graphviz.org/) to render a [Scalable Vector Graphics (SVG)](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics) file. [Graphviz Online](https://dreampuf.github.io/GraphvizOnline/) allows dot files to be edited and rendered into a SVN dynamically.
The diagrams are generated using [viz.js](https://github.com/mdaines/viz.js/) which uses [Graphviz](http://www.graphviz.org/) to render a [Scalable Vector Graphics (SVG)](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics) file. [Graphviz Online](https://dreampuf.github.io/GraphvizOnline/) allows dot files to be edited and rendered into a SVG dynamically.
4 changes: 2 additions & 2 deletions lib/converter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export declare function convertUmlClasses2Dot(umlClasses: UmlClass[], clusterFol
export declare function addAssociationsToDot(umlClasses: UmlClass[]): string;
export declare function convertDot2Svg(dot: string): any;
export declare function writeDot(dot: string, dotFilename?: string): void;
export declare function writeSVG(svg: any, svgFilename?: string, outputFormats?: OutputFormats): void;
export declare function writePng(svg: any, pngFilename?: string): Promise<void>;
export declare function writeSVG(svg: any, svgFilename?: string, outputFormats?: OutputFormats): Promise<void>;
export declare function writePng(svg: any, filename: string): Promise<void>;
48 changes: 28 additions & 20 deletions lib/converter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions lib/etherscan.d.ts

This file was deleted.

48 changes: 0 additions & 48 deletions lib/etherscan.js

This file was deleted.

6 changes: 3 additions & 3 deletions lib/fileParser.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTNode } from 'solidity-parser-antlr';
import { UmlClass } from './umlClass';
export declare const parseUmlClassesFromFiles: (fileOrFolders: string[]) => Promise<UmlClass[]>;
export declare function getSolidityFilesFromFolderOrFiles(folderOrFilePaths: string[]): Promise<string[]>;
export declare function getSolidityFilesFromFolderOrFile(folderOrFilePath: string): Promise<string[]>;
export declare const parseUmlClassesFromFiles: (fileOrFolders: string[], depthLimit?: number) => Promise<UmlClass[]>;
export declare function getSolidityFilesFromFolderOrFiles(folderOrFilePaths: string[], depthLimit?: number): Promise<string[]>;
export declare function getSolidityFilesFromFolderOrFile(folderOrFilePath: string, depthLimit?: number): Promise<string[]>;
export declare function parseSolidityFile(fileName: string): ASTNode;
14 changes: 8 additions & 6 deletions lib/fileParser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions lib/sol2uml.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions lib/solidityFileParser.d.ts

This file was deleted.

75 changes: 0 additions & 75 deletions lib/solidityFileParser.js

This file was deleted.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sol2uml",
"version": "1.1.1",
"version": "1.1.2",
"description": "Unified Modeling Language (UML) class diagram generator for Solidity contracts",
"main": "./lib/sol2uml.js",
"types": "./lib/sol2uml.d.ts",
Expand Down
Loading

0 comments on commit 5586bad

Please sign in to comment.