Initial commit for graphviz functionality

- Added required packages
- Added command to cmd.js
- Created graph.js to contain graph logic
This commit is contained in:
Richard Ramos 2018-03-22 10:43:29 -04:00
parent 0b7a33f835
commit 9e469cc83e
4 changed files with 42 additions and 0 deletions

View File

@ -18,6 +18,7 @@ class Cmd {
this.simulator(); this.simulator();
this.test(); this.test();
this.reset(); this.reset();
this.graph();
this.upload(); this.upload();
this.versionCmd(); this.versionCmd();
this.otherCommands(); this.otherCommands();
@ -171,6 +172,19 @@ class Cmd {
}); });
} }
graph() {
program
.command('graph [environment]')
.description('generates documentation based on the smart contracts configured')
.action(function (env, options) {
embark.initConfig(env || 'development', {
embarkConfig: 'embark.json',
interceptLogs: false
});
embark.graph();
});
}
reset() { reset() {
program program
.command('reset') .command('reset')
@ -206,6 +220,7 @@ class Cmd {
process.exit(0); process.exit(0);
}); });
} }
} }

17
lib/cmds/graph.js Normal file
View File

@ -0,0 +1,17 @@
const fs = require("fs");
const klaw = require('klaw');
const path = require('path');
const SolidityParser = require("solidity-parser");
const Viz = require('viz.js');
class GraphGenerator {
constructor(config) {
this.config = config;
}
generate() {
console.log("TODO");
}
}
module.exports = GraphGenerator;

View File

@ -185,6 +185,13 @@ class Embark {
return new Test(options); return new Test(options);
} }
graph() {
const GraphGenerator = new require('./cmds/graph.js');
console.log(this.config);
let graphGen = new GraphGenerator(this.config);
graphGen.generate();
}
reset() { reset() {
let resetCmd = require('./cmds/reset.js'); let resetCmd = require('./cmds/reset.js');
resetCmd(); resetCmd();

View File

@ -42,6 +42,7 @@
"globule": "^1.1.0", "globule": "^1.1.0",
"http-shutdown": "^1.2.0", "http-shutdown": "^1.2.0",
"ipfs-api": "17.2.4", "ipfs-api": "17.2.4",
"klaw": "^2.1.1",
"merge": "^1.2.0", "merge": "^1.2.0",
"mocha": "^2.2.5", "mocha": "^2.2.5",
"orbit-db": "^0.17.3", "orbit-db": "^0.17.3",
@ -51,12 +52,14 @@
"serve-static": "^1.11.1", "serve-static": "^1.11.1",
"shelljs": "^0.5.0", "shelljs": "^0.5.0",
"solc": "0.4.17", "solc": "0.4.17",
"solidity-parser": "^0.4.0",
"style-loader": "^0.19.0", "style-loader": "^0.19.0",
"tar": "^3.1.5", "tar": "^3.1.5",
"toposort": "^1.0.0", "toposort": "^1.0.0",
"underscore": "^1.8.3", "underscore": "^1.8.3",
"underscore.string": "^3.3.4", "underscore.string": "^3.3.4",
"url-loader": "^0.6.2", "url-loader": "^0.6.2",
"viz.js": "^1.8.1",
"web3": "1.0.0-beta.27", "web3": "1.0.0-beta.27",
"webpack": "^3.10.0", "webpack": "^3.10.0",
"window-size": "^1.1.0" "window-size": "^1.1.0"