diff --git a/lib/core/engine.js b/lib/core/engine.js index 53dc4a3f..d480fc2c 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -296,11 +296,7 @@ class Engine { } libraryManagerService(_options) { - const LibraryManager = require('../versions/library_manager.js'); - this.libraryManager = new LibraryManager({ - plugins: this.plugins, - config: this.config - }); + this.registerModule('library_manager'); } } diff --git a/lib/versions/library_manager.js b/lib/modules/library_manager/index.js similarity index 93% rename from lib/versions/library_manager.js rename to lib/modules/library_manager/index.js index 52508c06..55305da6 100644 --- a/lib/versions/library_manager.js +++ b/lib/modules/library_manager/index.js @@ -2,14 +2,11 @@ var Npm = require('./npm.js'); class LibraryManager { - constructor(options) { - this.plugins = options.plugins; - this.config = options.config; + constructor(embark) { + this.config = embark.config; this.contractsConfig = this.config.contractsConfig; this.storageConfig = this.config.storageConfig; - this.embark = this.plugins.createPlugin('libraryManager', {}); - this.determineVersions(); this.registerCommands(); diff --git a/lib/versions/npm.js b/lib/modules/library_manager/npm.js similarity index 100% rename from lib/versions/npm.js rename to lib/modules/library_manager/npm.js diff --git a/lib/versions/npmTimer.js b/lib/modules/library_manager/npmTimer.js similarity index 98% rename from lib/versions/npmTimer.js rename to lib/modules/library_manager/npmTimer.js index 12a58ef9..c49c7500 100644 --- a/lib/versions/npmTimer.js +++ b/lib/modules/library_manager/npmTimer.js @@ -1,11 +1,9 @@ const {PerformanceObserver, performance} = require('perf_hooks'); require('colors'); const utils = require('../utils/utils.js'); -// TODO: remove this -const i18n = require('../core/i18n/i18n.js'); +const i18n = require('../../core/i18n/i18n.js'); i18n.setOrDetectLocale('en'); - class NpmTimer{ constructor(options){ this._logger = (options.logger && typeof options.logger.info == 'function') ? options.logger : console;