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:
parent
0b7a33f835
commit
9e469cc83e
15
lib/cmd.js
15
lib/cmd.js
|
@ -18,6 +18,7 @@ class Cmd {
|
|||
this.simulator();
|
||||
this.test();
|
||||
this.reset();
|
||||
this.graph();
|
||||
this.upload();
|
||||
this.versionCmd();
|
||||
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() {
|
||||
program
|
||||
.command('reset')
|
||||
|
@ -207,6 +221,7 @@ class Cmd {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = Cmd;
|
||||
|
|
|
@ -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;
|
|
@ -185,6 +185,13 @@ class Embark {
|
|||
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() {
|
||||
let resetCmd = require('./cmds/reset.js');
|
||||
resetCmd();
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
"globule": "^1.1.0",
|
||||
"http-shutdown": "^1.2.0",
|
||||
"ipfs-api": "17.2.4",
|
||||
"klaw": "^2.1.1",
|
||||
"merge": "^1.2.0",
|
||||
"mocha": "^2.2.5",
|
||||
"orbit-db": "^0.17.3",
|
||||
|
@ -51,12 +52,14 @@
|
|||
"serve-static": "^1.11.1",
|
||||
"shelljs": "^0.5.0",
|
||||
"solc": "0.4.17",
|
||||
"solidity-parser": "^0.4.0",
|
||||
"style-loader": "^0.19.0",
|
||||
"tar": "^3.1.5",
|
||||
"toposort": "^1.0.0",
|
||||
"underscore": "^1.8.3",
|
||||
"underscore.string": "^3.3.4",
|
||||
"url-loader": "^0.6.2",
|
||||
"viz.js": "^1.8.1",
|
||||
"web3": "1.0.0-beta.27",
|
||||
"webpack": "^3.10.0",
|
||||
"window-size": "^1.1.0"
|
||||
|
|
Loading…
Reference in New Issue