From d98edd54091ff9f74e468c2a45904623bfcd5803 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 18:55:55 +0000 Subject: [PATCH] build(deps): bump viz.js from 1.8.2 to 2.1.2 Bumps [viz.js](https://github.com/mdaines/viz.js) from 1.8.2 to 2.1.2. - [Release notes](https://github.com/mdaines/viz.js/releases) - [Commits](https://github.com/mdaines/viz.js/compare/v1.8.2...v2.1.2) Signed-off-by: dependabot-preview[bot] --- packages/embark/package.json | 1 - packages/embark/src/cmd/cmd_controller.js | 17 +++++++++-------- packages/plugins/graph/package.json | 2 +- packages/plugins/graph/src/index.js | 16 ++++++++-------- packages/plugins/specialconfigs/package.json | 3 +-- .../plugins/transaction-tracker/package.json | 1 - yarn.lock | 8 ++++---- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/packages/embark/package.json b/packages/embark/package.json index 3d33dc6b6..ec7e667c4 100644 --- a/packages/embark/package.json +++ b/packages/embark/package.json @@ -108,7 +108,6 @@ "simples": "0.8.8", "source-map-support": "0.5.16", "term.js": "0.0.7", - "viz.js": "1.8.2", "vm2": "3.6.4", "web3": "1.2.6", "web3-bzz": "1.2.6", diff --git a/packages/embark/src/cmd/cmd_controller.js b/packages/embark/src/cmd/cmd_controller.js index 7a3421a02..425dea7ea 100644 --- a/packages/embark/src/cmd/cmd_controller.js +++ b/packages/embark/src/cmd/cmd_controller.js @@ -1,7 +1,7 @@ import { Config, Events, fs, TemplateGenerator } from 'embark-core'; import { Engine } from 'embark-engine'; import { __ } from 'embark-i18n'; -import { dappPath, joinPath, setUpEnv, warnIfPackageNotDefinedLocally } from 'embark-utils'; +import { dappPath, joinPath, setUpEnv } from 'embark-utils'; import { Logger, LogLevels } from 'embark-logger'; let async = require('async'); const constants = require('embark-core/constants'); @@ -544,10 +544,6 @@ class EmbarkController { engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); } - if (warnIfPackageNotDefinedLocally("embark-graph", engine.logger.error) !== true) { - process.exit(1); - } - engine.startEngine(async () => { let contractsFiles = await engine.events.request2("config:contractsFiles"); let compiledContracts = await engine.events.request2("compiler:contracts:compile", contractsFiles); @@ -562,13 +558,18 @@ class EmbarkController { if (err) { engine.logger.error(err.message); engine.logger.info(err.stack); + process.exit(1); } else { - engine.events.request("graph:create", options, () => { + engine.events.request("graph:create", options, (err) => { + if (err) { + engine.logger.error(err.message); + engine.logger.info(err.stack); + process.exit(1); + } engine.logger.info(__("Done. %s generated", options.output).underline); + process.exit(0); }); } - - process.exit(err ? 1 : 0); }); } diff --git a/packages/plugins/graph/package.json b/packages/plugins/graph/package.json index 0261badf7..c17187a17 100644 --- a/packages/plugins/graph/package.json +++ b/packages/plugins/graph/package.json @@ -49,7 +49,7 @@ "async": "3.2.0", "core-js": "3.4.3", "embark-utils": "^5.3.0-nightly.5", - "viz.js": "1.8.2" + "viz.js": "2.1.2" }, "devDependencies": { "embark-solo": "^5.2.3", diff --git a/packages/plugins/graph/src/index.js b/packages/plugins/graph/src/index.js index e6a148e1c..0e2b5c22e 100644 --- a/packages/plugins/graph/src/index.js +++ b/packages/plugins/graph/src/index.js @@ -2,6 +2,7 @@ import { warnIfPackageNotDefinedLocally } from 'embark-utils'; const async = require('async'); const Viz = require('viz.js'); +const { Module, render } = require('viz.js/full.render.js'); class GraphGenerator { constructor(embark, _options) { @@ -123,7 +124,7 @@ class GraphGenerator { next(); }, function (next) { - let dot = ` + const dot = ` digraph Contracts { node[shape=record,style=filled] edge[dir=back, arrowtail=empty] @@ -131,14 +132,13 @@ class GraphGenerator { ${relationshipString} }`; - let svg = Viz(dot); - - self.embark.fs.writeFileSync(options.output, svg, (err) => { - if (err) throw err; - next(); - }); + const viz = new Viz({ Module, render }); + viz.renderString(dot) + .then(svg => self.embark.fs.writeFile(options.output, svg, next)) + .catch(next); } - ], function(_err, _result) { + ], function(err) { + if (err) return cb(err); cb(); }); } diff --git a/packages/plugins/specialconfigs/package.json b/packages/plugins/specialconfigs/package.json index ac6cdba69..b82b8879f 100644 --- a/packages/plugins/specialconfigs/package.json +++ b/packages/plugins/specialconfigs/package.json @@ -50,8 +50,7 @@ "async": "3.2.0", "core-js": "3.4.3", "embark-i18n": "^5.3.0-nightly.5", - "string-replace-async": "1.2.1", - "viz.js": "1.8.2" + "string-replace-async": "1.2.1" }, "devDependencies": { "@babel/core": "7.8.6", diff --git a/packages/plugins/transaction-tracker/package.json b/packages/plugins/transaction-tracker/package.json index e10bab7eb..6f334d2e6 100644 --- a/packages/plugins/transaction-tracker/package.json +++ b/packages/plugins/transaction-tracker/package.json @@ -48,7 +48,6 @@ "@babel/runtime-corejs3": "7.8.4", "async": "3.2.0", "core-js": "3.4.3", - "viz.js": "1.8.2", "web3": "1.2.6" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index d909fd59c..b88cec7b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23466,10 +23466,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -viz.js@1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/viz.js/-/viz.js-1.8.2.tgz#d9cc04cd99f98ec986bf9054db76a6cbcdc5d97a" - integrity sha512-W+1+N/hdzLpQZEcvz79n2IgUE9pfx6JLdHh3Kh8RGvLL8P1LdJVQmi2OsDcLdY4QVID4OUy+FPelyerX0nJxIQ== +viz.js@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/viz.js/-/viz.js-2.1.2.tgz#6f09cd4e10af28754a6d50b055bd2e4a7693983a" + integrity sha512-UO6CPAuEMJ8oNR0gLLNl+wUiIzQUsyUOp8SyyDKTqVRBtq7kk1VnFmIZW8QufjxGrGEuI+LVR7p/C7uEKy0LQw== vm-browserify@^1.0.1: version "1.1.0"