Skip to content

Commit db10064

Browse files
committed
feat: remove optional plugins from coming as default
feat(@embark/utils): add method to verify if a plugin is installed & configured feature(@embark/utils): add method to verify if a plugin is installed & configured feature: warn about packages that will be independent plugins and are not configured chore: update templates to specify plugins refactor: add to plugin api params so that blockchain plugins no longer need to be passed options address changes in code review remove unneded space Update packages/core/utils/src/index.ts Co-Authored-By: Jonathan Rainville <[email protected]> Update packages/core/utils/src/index.ts Co-Authored-By: Michael Bradley <[email protected]> fix linting issue add missing import remove optional plugins from coming as default Revert "chore: update hooks examples to destructure dependencies object" This reverts commit 448eab7. remove trailing comma fix linting issue include tsconfig
1 parent 1675019 commit db10064

File tree

12 files changed

+29
-93
lines changed

12 files changed

+29
-93
lines changed

dapps/templates/simple/embark.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
"solc": "0.6.1"
1414
},
1515
"plugins": {
16-
"embark-geth": {},
17-
"embark-parity": {},
18-
"embark-profiler": {},
19-
"embark-graph": {}
16+
"embark-geth": {}
2017
},
2118
"options": {
2219
"solc": {

dapps/templates/simple/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@
2929
},
3030
"devDependencies": {
3131
"embark": "^5.3.0-nightly.0",
32-
"embark-geth": "^5.3.0-nightly.0",
33-
"embark-graph": "^5.3.0-nightly.0",
34-
"embark-parity": "^5.3.0-nightly.0",
35-
"embark-profiler": "^5.3.0-nightly.0",
3632
"embark-reset": "^5.2.3",
3733
"embarkjs": "^5.2.3",
3834
"embarkjs-ens": "^5.2.3",
3935
"embarkjs-web3": "^5.2.3",
36+
"embark-geth": "^5.3.0-nightly.0",
4037
"rimraf": "3.0.0"
4138
}
4239
}

packages/core/console/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import chalk from "chalk";
22
import { Embark, EmbarkEvents } from "embark-core";
33
import constants from "embark-core/constants.json";
44
import { __ } from "embark-i18n";
5-
import { dappPath, escapeHtml, exit, jsonFunctionReplacer } from "embark-utils";
5+
import { dappPath, escapeHtml, exit, jsonFunctionReplacer, warnIfPackageNotDefinedLocally } from "embark-utils";
66
import stringify from "json-stringify-safe";
77
import { dirname } from "path";
88
import util from "util";
@@ -169,6 +169,9 @@ export default class Console {
169169
return this.ipc.request("console:executeCmd", cmd, callback);
170170
}
171171

172+
if (cmd.indexOf("profile") === 0 && warnIfPackageNotDefinedLocally("embark-profiler", this.embark.logger.warn) !== true) {
173+
return callback(null, "please install embark-profiler plugin");
174+
}
172175
if (!(cmd.split(" ")[0] === "history" || cmd === __("history"))) {
173176
this.saveHistory(cmd);
174177
}

packages/core/engine/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,28 @@
6666
"embark-ethereum-blockchain-client": "^5.3.0-nightly.0",
6767
"embark-ganache": "^5.3.0-nightly.0",
6868
"embark-geth": "^5.3.0-nightly.0",
69-
"embark-ipfs": "^5.3.0-nightly.0",
7069
"embark-library-manager": "^5.3.0-nightly.0",
7170
"embark-logger": "^5.3.0-nightly.0",
7271
"embark-mocha-tests": "^5.3.0-nightly.0",
7372
"embark-namesystem": "^5.3.0-nightly.0",
74-
"embark-parity": "^5.3.0-nightly.0",
7573
"embark-pipeline": "^5.3.0-nightly.0",
7674
"embark-plugin-cmd": "^5.3.0-nightly.0",
7775
"embark-process-logs-api-manager": "^5.3.0-nightly.0",
78-
"embark-profiler": "^5.3.0-nightly.0",
7976
"embark-proxy": "^5.3.0-nightly.0",
8077
"embark-rpc-manager": "^5.3.0-nightly.0",
8178
"embark-scaffolding": "^5.3.0-nightly.0",
8279
"embark-solidity": "^5.3.0-nightly.0",
8380
"embark-solidity-tests": "^5.3.0-nightly.0",
8481
"embark-specialconfigs": "^5.3.0-nightly.0",
8582
"embark-storage": "^5.3.0-nightly.0",
86-
"embark-swarm": "^5.3.0-nightly.0",
8783
"embark-test-runner": "^5.3.0-nightly.0",
8884
"embark-transaction-logger": "^5.3.0-nightly.0",
8985
"embark-transaction-tracker": "^5.2.3",
9086
"embark-utils": "^5.3.0-nightly.0",
9187
"embark-vyper": "^5.2.3",
9288
"embark-watcher": "^5.3.0-nightly.0",
9389
"embark-web3": "^5.3.0-nightly.0",
94-
"embark-webserver": "^5.3.0-nightly.0",
95-
"embark-whisper-geth": "^5.3.0-nightly.0",
96-
"embark-whisper-parity": "^5.3.0-nightly.0"
90+
"embark-webserver": "^5.3.0-nightly.0"
9791
},
9892
"devDependencies": {
9993
"embark-solo": "^5.2.3",

packages/core/engine/src/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ export class Engine {
152152
const options = _options || {};
153153

154154
const groups = {
155-
blockchain: this.blockchainComponents,
156155
coreComponents: this.coreComponents,
157156
stackComponents: this.stackComponents,
158157
serviceMonitor: this.serviceMonitor,
@@ -162,8 +161,6 @@ export class Engine {
162161
contracts: this.contractsComponents,
163162
pipeline: this.pipelineService,
164163
webserver: this.webserverService,
165-
storage: this.storageComponent,
166-
communication: this.communicationComponents,
167164
namesystem: this.namesystemComponents,
168165
filewatcher: this.filewatcherService,
169166
tests: this.testComponents,
@@ -263,13 +260,6 @@ export class Engine {
263260
this.registerModulePackage('embark-embarkjs', { plugins: this.plugins });
264261
}
265262

266-
blockchainComponents() {
267-
// plugins
268-
this.registerModulePackage('embark-ganache');
269-
this.registerModulePackage('embark-geth');
270-
this.registerModulePackage('embark-parity');
271-
}
272-
273263
testComponents(options) {
274264
this.registerModulePackage('embark-test-runner', { plugins: this.plugins, ipc: this.ipc });
275265
this.registerModulePackage('embark-coverage', { plugins: this.plugins, coverage: options.coverage });
@@ -291,17 +281,6 @@ export class Engine {
291281
this.registerModulePackage('embark-specialconfigs', { plugins: this.plugins });
292282
this.registerModulePackage('embark-transaction-logger');
293283
this.registerModulePackage('embark-transaction-tracker');
294-
this.registerModulePackage('embark-profiler');
295-
}
296-
297-
storageComponent() {
298-
this.registerModulePackage('embark-ipfs');
299-
this.registerModulePackage('embark-swarm');
300-
}
301-
302-
communicationComponents() {
303-
this.registerModulePackage('embark-whisper-geth');
304-
this.registerModulePackage('embark-whisper-parity');
305284
}
306285

307286
namesystemComponents() {

packages/core/engine/tsconfig.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,12 @@
3434
{
3535
"path": "../../plugins/geth"
3636
},
37-
{
38-
"path": "../../plugins/ipfs"
39-
},
4037
{
4138
"path": "../../plugins/mocha-tests"
4239
},
43-
{
44-
"path": "../../plugins/parity"
45-
},
4640
{
4741
"path": "../../plugins/plugin-cmd"
4842
},
49-
{
50-
"path": "../../plugins/profiler"
51-
},
5243
{
5344
"path": "../../plugins/rpc-manager"
5445
},
@@ -64,9 +55,6 @@
6455
{
6556
"path": "../../plugins/specialconfigs"
6657
},
67-
{
68-
"path": "../../plugins/swarm"
69-
},
7058
{
7159
"path": "../../plugins/transaction-logger"
7260
},
@@ -79,12 +67,6 @@
7967
{
8068
"path": "../../plugins/web3"
8169
},
82-
{
83-
"path": "../../plugins/whisper-geth"
84-
},
85-
{
86-
"path": "../../plugins/whisper-parity"
87-
},
8870
{
8971
"path": "../../stack/api"
9072
},

packages/embark/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"embark-core": "^5.3.0-nightly.0",
7979
"embark-deploy-tracker": "^5.3.0-nightly.0",
8080
"embark-engine": "^5.3.0-nightly.0",
81-
"embark-graph": "^5.3.0-nightly.0",
8281
"embark-i18n": "^5.2.3",
8382
"embark-logger": "^5.3.0-nightly.0",
8483
"embark-reset": "^5.2.3",

packages/embark/src/cmd/cmd_controller.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Config, Events, fs, TemplateGenerator } from 'embark-core';
22
import { Engine } from 'embark-engine';
33
import { __ } from 'embark-i18n';
4-
import { dappPath, joinPath, setUpEnv } from 'embark-utils';
4+
import { dappPath, joinPath, setUpEnv, warnIfPackageNotDefinedLocally } from 'embark-utils';
55
import { Logger, LogLevels } from 'embark-logger';
66
let async = require('async');
77
const constants = require('embark-core/constants');
@@ -63,7 +63,6 @@ class EmbarkController {
6363
engine.registerModuleGroup("coreComponents");
6464
engine.registerModuleGroup("serviceMonitor");
6565
engine.registerModuleGroup("blockchainStackComponents");
66-
engine.registerModuleGroup("blockchain");
6766

6867
// load custom plugins
6968
engine.loadDappPlugins();
@@ -167,14 +166,11 @@ class EmbarkController {
167166

168167
// TODO: replace with individual plugins
169168
engine.registerModuleGroup("namesystem");
170-
engine.registerModuleGroup("communication");
171-
engine.registerModuleGroup("blockchain");
172169
engine.registerModuleGroup("compiler");
173170
engine.registerModuleGroup("contracts");
174171
engine.registerModuleGroup("pipeline");
175172
engine.registerModuleGroup("webserver");
176173
engine.registerModuleGroup("filewatcher");
177-
engine.registerModuleGroup("storage");
178174
engine.registerModuleGroup("cockpit");
179175
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
180176
engine.registerModulePackage("embark-debugger");
@@ -293,11 +289,11 @@ class EmbarkController {
293289
engine.registerModuleGroup("contracts");
294290

295291
if (!options.onlyCompile) {
296-
engine.registerModuleGroup("blockchain");
297-
engine.registerModuleGroup("namesystem");
298-
engine.registerModuleGroup("storage");
299-
engine.registerModuleGroup("communication");
292+
// engine.registerModuleGroup("blockchain");
293+
// engine.registerModuleGroup("storage");
294+
// engine.registerModuleGroup("communication");
300295
engine.registerModuleGroup("pipeline");
296+
engine.registerModuleGroup("namesystem");
301297
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
302298
}
303299

@@ -423,14 +419,11 @@ class EmbarkController {
423419

424420
// TODO: replace with individual plugins
425421
engine.registerModuleGroup("namesystem");
426-
engine.registerModuleGroup("communication");
427-
engine.registerModuleGroup("blockchain");
428422
engine.registerModuleGroup("compiler");
429423
engine.registerModuleGroup("contracts");
430424
engine.registerModuleGroup("pipeline");
431425
engine.registerModuleGroup("webserver");
432426
engine.registerModuleGroup("filewatcher");
433-
engine.registerModuleGroup("storage");
434427
if (!isSecondaryProcess(engine)) {
435428
engine.registerModuleGroup("cockpit");
436429
}
@@ -528,7 +521,6 @@ class EmbarkController {
528521

529522
engine.registerModuleGroup("compiler");
530523
engine.registerModuleGroup("contracts");
531-
engine.registerModulePackage("embark-graph");
532524

533525
// load custom plugins
534526
engine.loadDappPlugins();
@@ -537,6 +529,10 @@ class EmbarkController {
537529
engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", "));
538530
}
539531

532+
if (warnIfPackageNotDefinedLocally("embark-graph", engine.logger.error) !== true) {
533+
process.exit(1);
534+
}
535+
540536
engine.startEngine(async () => {
541537
let contractsFiles = await engine.events.request2("config:contractsFiles");
542538
let compiledContracts = await engine.events.request2("compiler:contracts:compile", contractsFiles);
@@ -744,14 +740,11 @@ class EmbarkController {
744740
engine.registerModuleGroup("stackComponents");
745741

746742
engine.registerModuleGroup("namesystem");
747-
engine.registerModuleGroup("communication");
748-
engine.registerModuleGroup("blockchain");
749743
engine.registerModuleGroup("compiler");
750744
engine.registerModuleGroup("contracts");
751745
engine.registerModuleGroup("pipeline");
752746
engine.registerModuleGroup("webserver");
753747
engine.registerModuleGroup("filewatcher");
754-
engine.registerModuleGroup("storage");
755748
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
756749

757750
// load custom plugins
@@ -828,7 +821,6 @@ class EmbarkController {
828821
engine.registerModuleGroup("coreComponents");
829822
engine.registerModuleGroup("stackComponents");
830823

831-
engine.registerModuleGroup("blockchain");
832824
engine.registerModuleGroup("compiler");
833825
engine.registerModulePackage('embark-ganache');
834826
engine.registerModulePackage('embark-ethereum-blockchain-client');
@@ -840,8 +832,6 @@ class EmbarkController {
840832
engine.registerModuleGroup("tests", options);
841833
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins, trackContracts: false });
842834
engine.registerModuleGroup("namesystem");
843-
engine.registerModuleGroup("storage");
844-
engine.registerModuleGroup("communication");
845835
next();
846836
},
847837
function loadDappPlugins(next) {

packages/embark/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
{
3737
"path": "../plugins/deploy-tracker"
3838
},
39-
{
40-
"path": "../plugins/graph"
41-
},
4239
{
4340
"path": "../plugins/solidity"
4441
},

packages/plugins/graph/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"dependencies": {
4848
"@babel/runtime-corejs3": "7.7.4",
4949
"async": "2.6.1",
50+
"embark-utils": "^5.1.0-nightly.1",
5051
"core-js": "3.4.3",
5152
"embark-utils": "^5.3.0-nightly.0",
5253
"viz.js": "1.8.2"

0 commit comments

Comments
 (0)