From 948956ab1f7fde154e4a4a36c58cfa677ecff9c6 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 29 Jan 2020 14:11:50 -0500 Subject: [PATCH] chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin chore: make basic-pipeline an optional plugin fixes address code review fix linter issue fix missing param fix binding remove pipeline warning remove unused var --- dapps/templates/boilerplate/embark.json | 3 ++- dapps/templates/boilerplate/package.json | 1 + dapps/templates/demo/embark.json | 3 ++- dapps/templates/demo/package.json | 1 + dapps/tests/app/embark.json | 3 ++- dapps/tests/app/package.json | 1 + dapps/tests/contracts/embark.json | 3 ++- dapps/tests/contracts/package.json | 1 + packages/core/core/src/plugin.ts | 3 +++ packages/core/core/src/plugins.ts | 3 +++ packages/core/engine/package.json | 1 - packages/core/engine/src/index.ts | 12 ------------ packages/core/engine/tsconfig.json | 3 --- packages/embark/src/cmd/cmd_controller.js | 6 ++---- packages/plugins/basic-pipeline/src/index.js | 9 +++++---- 15 files changed, 25 insertions(+), 28 deletions(-) diff --git a/dapps/templates/boilerplate/embark.json b/dapps/templates/boilerplate/embark.json index ec7345cfc..01738c222 100644 --- a/dapps/templates/boilerplate/embark.json +++ b/dapps/templates/boilerplate/embark.json @@ -18,7 +18,8 @@ "embark-geth": {}, "embark-parity": {}, "embark-profiler": {}, - "embark-graph": {} + "embark-graph": {}, + "embark-basic-pipeline": {} }, "options": { "solc": { diff --git a/dapps/templates/boilerplate/package.json b/dapps/templates/boilerplate/package.json index 21873fb9d..3d902d38b 100644 --- a/dapps/templates/boilerplate/package.json +++ b/dapps/templates/boilerplate/package.json @@ -33,6 +33,7 @@ }, "devDependencies": { "embark": "^5.3.0-nightly.9", + "embark-basic-pipeline": "^5.3.0-nightly.7", "embark-geth": "^5.3.0-nightly.9", "embark-graph": "^5.3.0-nightly.7", "embark-ipfs": "^5.3.0-nightly.9", diff --git a/dapps/templates/demo/embark.json b/dapps/templates/demo/embark.json index 09d8a1307..f1d637421 100644 --- a/dapps/templates/demo/embark.json +++ b/dapps/templates/demo/embark.json @@ -18,7 +18,8 @@ "embark-geth": {}, "embark-parity": {}, "embark-profiler": {}, - "embark-graph": {} + "embark-graph": {}, + "embark-basic-pipeline": {} }, "options": { "solc": { diff --git a/dapps/templates/demo/package.json b/dapps/templates/demo/package.json index 4411ff49c..b9025a975 100644 --- a/dapps/templates/demo/package.json +++ b/dapps/templates/demo/package.json @@ -35,6 +35,7 @@ "bootstrap": "4.3.1", "classnames": "2.2.6", "embark": "^5.3.0-nightly.9", + "embark-basic-pipeline": "^5.3.0-nightly.7", "embark-geth": "^5.3.0-nightly.9", "embark-graph": "^5.3.0-nightly.7", "embark-ipfs": "^5.3.0-nightly.9", diff --git a/dapps/tests/app/embark.json b/dapps/tests/app/embark.json index 976da4024..777a9f127 100644 --- a/dapps/tests/app/embark.json +++ b/dapps/tests/app/embark.json @@ -25,7 +25,8 @@ "embark-parity": {}, "embark-profiler": {}, "embark-graph": {}, - "embark-dapp-test-service": {} + "embark-dapp-test-service": {}, + "embark-basic-pipeline": {} }, "options": { "solc": { diff --git a/dapps/tests/app/package.json b/dapps/tests/app/package.json index bd9817f2a..8889c1e59 100644 --- a/dapps/tests/app/package.json +++ b/dapps/tests/app/package.json @@ -3,6 +3,7 @@ "devDependencies": { "bootstrap": "3.4.1", "embark": "^5.3.0-nightly.9", + "embark-basic-pipeline": "^5.3.0-nightly.7", "embark-dapp-test-service": "^5.2.3", "embark-geth": "^5.3.0-nightly.9", "embark-graph": "^5.3.0-nightly.7", diff --git a/dapps/tests/contracts/embark.json b/dapps/tests/contracts/embark.json index 89dc71622..a28470775 100644 --- a/dapps/tests/contracts/embark.json +++ b/dapps/tests/contracts/embark.json @@ -18,6 +18,7 @@ "embark-geth": {}, "embark-parity": {}, "embark-profiler": {}, - "embark-graph": {} + "embark-graph": {}, + "embark-basic-pipeline": {} } } diff --git a/dapps/tests/contracts/package.json b/dapps/tests/contracts/package.json index d4dfb9c3d..d71726ba4 100644 --- a/dapps/tests/contracts/package.json +++ b/dapps/tests/contracts/package.json @@ -2,6 +2,7 @@ "description": "Test DApp for integration testing purposes", "devDependencies": { "embark": "^5.3.0-nightly.9", + "embark-basic-pipeline": "^5.3.0-nightly.7", "embark-geth": "^5.3.0-nightly.9", "embark-graph": "^5.3.0-nightly.7", "embark-ipfs": "^5.3.0-nightly.9", diff --git a/packages/core/core/src/plugin.ts b/packages/core/core/src/plugin.ts index 8027abda0..e0cb8379c 100644 --- a/packages/core/core/src/plugin.ts +++ b/packages/core/core/src/plugin.ts @@ -89,6 +89,8 @@ export class Plugin { plugins: any; + pluginsAPI: any; + env: any; loaded = false; @@ -121,6 +123,7 @@ export class Plugin { this.acceptedContext = options.pluginConfig.context || [constants.contexts.any]; this.version = options.version; this.constants = constants; + this.pluginsAPI = options.pluginsAPI; if (!Array.isArray(this.currentContext)) { this.currentContext = [this.currentContext]; diff --git a/packages/core/core/src/plugins.ts b/packages/core/core/src/plugins.ts index a6fb6c156..cf2658780 100644 --- a/packages/core/core/src/plugins.ts +++ b/packages/core/core/src/plugins.ts @@ -87,6 +87,7 @@ export class Plugins { events: this.events, config: this.config, plugins: this.plugins, + pluginsAPI: this, fs: this.fs, isInternal: true, context: this.context, @@ -121,6 +122,7 @@ export class Plugins { events: this.events, config: this.config, plugins: this.plugins, + pluginsAPI: this, fs: this.fs, isInternal: true, context: this.context, @@ -152,6 +154,7 @@ export class Plugins { events: this.events, config: this.config, plugins: this.plugins, + pluginsAPI: this, fs: this.fs, isInternal: false, context: this.context, diff --git a/packages/core/engine/package.json b/packages/core/engine/package.json index 33e3dfce7..0d4f813e1 100644 --- a/packages/core/engine/package.json +++ b/packages/core/engine/package.json @@ -50,7 +50,6 @@ "embark-accounts-manager": "^5.3.0-nightly.9", "embark-api": "^5.3.0-nightly.9", "embark-authenticator": "^5.3.0-nightly.7", - "embark-basic-pipeline": "^5.3.0-nightly.9", "embark-blockchain": "^5.3.0-nightly.9", "embark-code-runner": "^5.3.0-nightly.9", "embark-communication": "^5.3.0-nightly.7", diff --git a/packages/core/engine/src/index.ts b/packages/core/engine/src/index.ts index 0f3484e05..dea393055 100644 --- a/packages/core/engine/src/index.ts +++ b/packages/core/engine/src/index.ts @@ -39,8 +39,6 @@ export class Engine { webServerConfig: any; - webpackConfigName: string; - singleUseAuthToken: boolean; ipcRole = 'client'; @@ -73,7 +71,6 @@ export class Engine { this.context = options.context; this.useDashboard = options.useDashboard; this.webServerConfig = options.webServerConfig; - this.webpackConfigName = options.webpackConfigName; this.singleUseAuthToken = options.singleUseAuthToken; this.package = options.package; this.ipcRole = options.ipcRole || 'client'; @@ -170,7 +167,6 @@ export class Engine { blockchainStackComponents: this.blockchainStackComponents, compiler: this.compilerComponents, contracts: this.contractsComponents, - pipeline: this.pipelineService, webserver: this.webserverService, namesystem: this.namesystemComponents, filewatcher: this.filewatcherService, @@ -197,14 +193,6 @@ export class Engine { this.registerModulePackage('embark-watcher'); } - pipelineService(_options) { - this.registerModulePackage('embark-basic-pipeline', { - plugins: this.plugins, - webpackConfigName: this.webpackConfigName, - useDashboard: this.useDashboard - }); - } - serviceMonitor() { this.servicesMonitor = new ServicesMonitor({ events: this.events, logger: this.logger, plugins: this.plugins }); diff --git a/packages/core/engine/tsconfig.json b/packages/core/engine/tsconfig.json index 21885e9d0..bdabd6af4 100644 --- a/packages/core/engine/tsconfig.json +++ b/packages/core/engine/tsconfig.json @@ -13,9 +13,6 @@ { "path": "../../plugins/accounts-manager" }, - { - "path": "../../plugins/basic-pipeline" - }, { "path": "../../plugins/coverage" }, diff --git a/packages/embark/src/cmd/cmd_controller.js b/packages/embark/src/cmd/cmd_controller.js index 425dea7ea..f92e6f560 100644 --- a/packages/embark/src/cmd/cmd_controller.js +++ b/packages/embark/src/cmd/cmd_controller.js @@ -183,7 +183,6 @@ class EmbarkController { engine.registerModuleGroup("namesystem"); engine.registerModuleGroup("compiler"); engine.registerModuleGroup("contracts"); - engine.registerModuleGroup("pipeline"); engine.registerModuleGroup("webserver"); engine.registerModuleGroup("filewatcher"); engine.registerModuleGroup("cockpit"); @@ -435,7 +434,6 @@ class EmbarkController { engine.registerModuleGroup("namesystem"); engine.registerModuleGroup("compiler"); engine.registerModuleGroup("contracts"); - engine.registerModuleGroup("pipeline"); engine.registerModuleGroup("webserver"); engine.registerModuleGroup("filewatcher"); if (!isSecondaryProcess(engine)) { @@ -756,10 +754,10 @@ class EmbarkController { engine.registerModuleGroup("stackComponents"); engine.registerModulePackage('embark-ganache'); + engine.registerModuleGroup("namesystem"); engine.registerModuleGroup("compiler"); engine.registerModuleGroup("contracts"); - engine.registerModuleGroup("pipeline"); engine.registerModuleGroup("webserver"); engine.registerModuleGroup("filewatcher"); engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins }); @@ -838,6 +836,7 @@ class EmbarkController { engine.registerModuleGroup("coreComponents"); engine.registerModuleGroup("stackComponents"); + engine.registerModuleGroup("compiler"); engine.registerModulePackage('embark-ganache'); engine.registerModuleGroup("compiler"); engine.registerModulePackage('embark-ethereum-blockchain-client'); @@ -845,7 +844,6 @@ class EmbarkController { engine.registerModulePackage('embark-accounts-manager'); engine.registerModulePackage('embark-rpc-manager'); engine.registerModulePackage('embark-specialconfigs', { plugins: engine.plugins }); - engine.registerModuleGroup("pipeline"); engine.registerModuleGroup("tests", options); engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins, trackContracts: false }); engine.registerModuleGroup("namesystem"); diff --git a/packages/plugins/basic-pipeline/src/index.js b/packages/plugins/basic-pipeline/src/index.js index 3fdb20f80..0a8839b6d 100644 --- a/packages/plugins/basic-pipeline/src/index.js +++ b/packages/plugins/basic-pipeline/src/index.js @@ -8,15 +8,16 @@ require('./env'); class BasicPipeline { - constructor(embark, options) { + constructor(embark) { this.embark = embark; this.assetFiles = embark.config.assetFiles; this.isFirstBuild = true; this.embarkConfig = embark.config.embarkConfig; // TODO: why god why - this.useDashboard = options.useDashboard; + // this.useDashboard = options.useDashboard; + this.useDashboard = true; this.fs = embark.fs; - this.webpackConfigName = options.webpackConfigName; + this.webpackConfigName = embark.config.webpackConfigName; this.env = embark.config.env; this.buildDir = embark.config.buildDir; this.contractsFiles = embark.config.contractsFiles; @@ -24,7 +25,7 @@ class BasicPipeline { this.logger = embark.logger; this.events = embark.events; - this.plugins = options.plugins; + this.plugins = embark.pluginsAPI; this.pipelinePlugins = this.plugins.getPluginsFor('pipeline'); this.pipelineConfig = embark.config.pipelineConfig; let plugin = this.plugins.createPlugin('basic-pipeline', {});