From 29b0d01f22b56f915a8664eae5681dd68387df0f Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 27 Jul 2018 17:33:50 -0400 Subject: [PATCH] move processes into core --- lib/core/engine.js | 2 +- lib/{ => core}/processes/eventsWrapper.js | 2 +- lib/{ => core}/processes/processLauncher.js | 4 ++-- lib/{ => core}/processes/processManager.js | 1 - lib/{ => core}/processes/processWrapper.js | 2 +- lib/modules/blockchain_process/blockchainProcess.js | 2 +- lib/modules/blockchain_process/blockchainProcessLauncher.js | 2 +- lib/modules/ipfs/process.js | 2 +- lib/modules/solidity/solcP.js | 2 +- lib/modules/solidity/solcW.js | 2 +- lib/modules/storage/storageProcessesLauncher.js | 2 +- lib/modules/swarm/process.js | 2 +- lib/pipeline/pipeline.js | 2 +- lib/pipeline/webpackProcess.js | 2 +- test/processLauncher.js | 2 +- 15 files changed, 15 insertions(+), 16 deletions(-) rename lib/{ => core}/processes/eventsWrapper.js (96%) rename lib/{ => core}/processes/processLauncher.js (98%) rename lib/{ => core}/processes/processManager.js (93%) rename lib/{ => core}/processes/processWrapper.js (97%) diff --git a/lib/core/engine.js b/lib/core/engine.js index 09148cf4e..ffa805833 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -72,7 +72,7 @@ class Engine { } processManagerService(_options) { - const ProcessManager = require('../processes/processManager.js'); + const ProcessManager = require('./processes/processManager.js'); this.processManager = new ProcessManager({ events: this.events, logger: this.logger, diff --git a/lib/processes/eventsWrapper.js b/lib/core/processes/eventsWrapper.js similarity index 96% rename from lib/processes/eventsWrapper.js rename to lib/core/processes/eventsWrapper.js index de1021585..0eee1901d 100644 --- a/lib/processes/eventsWrapper.js +++ b/lib/core/processes/eventsWrapper.js @@ -1,5 +1,5 @@ const uuid = require('uuid/v1'); -const constants = require('../constants'); +const constants = require('../../constants'); class Events { diff --git a/lib/processes/processLauncher.js b/lib/core/processes/processLauncher.js similarity index 98% rename from lib/processes/processLauncher.js rename to lib/core/processes/processLauncher.js index 9c2c1b1d1..418cb1dbd 100644 --- a/lib/processes/processLauncher.js +++ b/lib/core/processes/processLauncher.js @@ -1,7 +1,7 @@ const child_process = require('child_process'); -const constants = require('../constants'); +const constants = require('../../constants'); const path = require('path'); -const utils = require('../utils/utils'); +const utils = require('../../utils/utils'); class ProcessLauncher { diff --git a/lib/processes/processManager.js b/lib/core/processes/processManager.js similarity index 93% rename from lib/processes/processManager.js rename to lib/core/processes/processManager.js index 32a083ca0..2556acb5a 100644 --- a/lib/processes/processManager.js +++ b/lib/core/processes/processManager.js @@ -17,7 +17,6 @@ class ProcessManager { self.events.setCommandHandler('processes:launch', (name, cb) => { let process = self.processes[name]; if (process.state != 'unstarted') { - console.dir("=====> already started " + name); return cb(); } process.state = 'starting'; diff --git a/lib/processes/processWrapper.js b/lib/core/processes/processWrapper.js similarity index 97% rename from lib/processes/processWrapper.js rename to lib/core/processes/processWrapper.js index 84b808c16..d65350422 100644 --- a/lib/processes/processWrapper.js +++ b/lib/core/processes/processWrapper.js @@ -1,4 +1,4 @@ -const constants = require('../constants'); +const constants = require('../../constants'); const Events = require('./eventsWrapper'); // Set PWD to CWD since Windows doesn't have a value for PWD diff --git a/lib/modules/blockchain_process/blockchainProcess.js b/lib/modules/blockchain_process/blockchainProcess.js index 2d43b8c86..9ed6b4891 100644 --- a/lib/modules/blockchain_process/blockchainProcess.js +++ b/lib/modules/blockchain_process/blockchainProcess.js @@ -1,4 +1,4 @@ -const ProcessWrapper = require('../../processes/processWrapper'); +const ProcessWrapper = require('../../core/processes/processWrapper'); const BlockchainClient = require('./blockchain'); const i18n = require('../../core/i18n/i18n.js'); const constants = require('../../constants'); diff --git a/lib/modules/blockchain_process/blockchainProcessLauncher.js b/lib/modules/blockchain_process/blockchainProcessLauncher.js index 97167e707..2fc7be35c 100644 --- a/lib/modules/blockchain_process/blockchainProcessLauncher.js +++ b/lib/modules/blockchain_process/blockchainProcessLauncher.js @@ -1,4 +1,4 @@ -const ProcessLauncher = require('../../processes/processLauncher'); +const ProcessLauncher = require('../../core/processes/processLauncher'); const utils = require('../../utils/utils.js'); const constants = require('../../constants'); diff --git a/lib/modules/ipfs/process.js b/lib/modules/ipfs/process.js index b64f9fa95..b5aa6b99d 100644 --- a/lib/modules/ipfs/process.js +++ b/lib/modules/ipfs/process.js @@ -1,5 +1,5 @@ const child_process = require('child_process'); -const ProcessWrapper = require('../../processes/processWrapper'); +const ProcessWrapper = require('../../core/processes/processWrapper'); const constants = require('../../constants'); let ipfsProcess; // eslint-disable-line no-unused-vars diff --git a/lib/modules/solidity/solcP.js b/lib/modules/solidity/solcP.js index e33aa4a67..6fd58a1df 100644 --- a/lib/modules/solidity/solcP.js +++ b/lib/modules/solidity/solcP.js @@ -2,7 +2,7 @@ const fs = require('fs-extra'); const path = require('path'); const constants = require('../../constants'); const Utils = require('../../utils/utils'); -const ProcessWrapper = require('../../processes/processWrapper'); +const ProcessWrapper = require('../../core/processes/processWrapper'); const PluginManager = require('live-plugin-manager-git-fix').PluginManager; const NpmTimer = require('../library_manager/npmTimer'); diff --git a/lib/modules/solidity/solcW.js b/lib/modules/solidity/solcW.js index a82b390b1..8c3260ca2 100644 --- a/lib/modules/solidity/solcW.js +++ b/lib/modules/solidity/solcW.js @@ -1,7 +1,7 @@ let utils = require('../../utils/utils.js'); let fs = require('../../core/fs.js'); let currentSolcVersion = require('../../../package.json').dependencies.solc; -const ProcessLauncher = require('../../processes/processLauncher.js'); +const ProcessLauncher = require('../../core/processes/processLauncher.js'); const uuid = require('uuid/v1'); class SolcW { diff --git a/lib/modules/storage/storageProcessesLauncher.js b/lib/modules/storage/storageProcessesLauncher.js index eb7c07dad..5f7a0156c 100644 --- a/lib/modules/storage/storageProcessesLauncher.js +++ b/lib/modules/storage/storageProcessesLauncher.js @@ -1,7 +1,7 @@ const fs = require('../../core/fs'); const shellJs = require('shelljs'); const utils = require('../../utils/utils'); -const ProcessLauncher = require('../../processes/processLauncher'); +const ProcessLauncher = require('../../core/processes/processLauncher'); const constants = require('../../constants'); const {canonicalHost} = require('../../utils/host'); diff --git a/lib/modules/swarm/process.js b/lib/modules/swarm/process.js index 5278fa196..2ecf29d9c 100644 --- a/lib/modules/swarm/process.js +++ b/lib/modules/swarm/process.js @@ -1,5 +1,5 @@ const child_process = require('child_process'); -const ProcessWrapper = require('../../processes/processWrapper'); +const ProcessWrapper = require('../../core/processes/processWrapper'); const constants = require('../../constants'); const fs = require('../../core/fs'); diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index 5ca21f466..b1b818cce 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -1,6 +1,6 @@ const fs = require('../core/fs.js'); const async = require('async'); -const ProcessLauncher = require('../processes/processLauncher'); +const ProcessLauncher = require('../core/processes/processLauncher'); const utils = require('../utils/utils.js'); const constants = require('../constants'); diff --git a/lib/pipeline/webpackProcess.js b/lib/pipeline/webpackProcess.js index a7af3ace4..c9f4b2f55 100644 --- a/lib/pipeline/webpackProcess.js +++ b/lib/pipeline/webpackProcess.js @@ -4,7 +4,7 @@ const utils = require('../utils/utils'); const fs = require('../core/fs'); const constants = require('../constants'); const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); -const ProcessWrapper = require('../processes/processWrapper'); +const ProcessWrapper = require('../core/processes/processWrapper'); const path = require('path'); let webpackProcess; diff --git a/test/processLauncher.js b/test/processLauncher.js index 56d5c58ed..f09a762c8 100644 --- a/test/processLauncher.js +++ b/test/processLauncher.js @@ -3,7 +3,7 @@ const assert = require('assert'); const sinon = require('sinon'); const TestLogger = require('../lib/tests/test_logger'); const path = require('path'); -const ProcessLauncher = require('../lib/processes/processLauncher'); +const ProcessLauncher = require('../lib/core/processes/processLauncher'); describe('ProcessWrapper', () => { let processLauncher;