diff --git a/lib/cmd.js b/lib/cmd.js index ab76482a3..2977d69e8 100644 --- a/lib/cmd.js +++ b/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') @@ -206,6 +220,7 @@ class Cmd { process.exit(0); }); } + } diff --git a/lib/cmds/graph.js b/lib/cmds/graph.js new file mode 100644 index 000000000..dba9c2aad --- /dev/null +++ b/lib/cmds/graph.js @@ -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; diff --git a/lib/index.js b/lib/index.js index e08870ae0..14a789112 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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(); diff --git a/package.json b/package.json index 9de8bab93..7807007df 100644 --- a/package.json +++ b/package.json @@ -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"