move the versions manager to its own module

This commit is contained in:
Iuri Matias 2018-07-20 21:14:52 +03:00
parent 8a5ccac1ee
commit 2baaba07e6
4 changed files with 4 additions and 13 deletions

View File

@ -296,11 +296,7 @@ class Engine {
} }
libraryManagerService(_options) { libraryManagerService(_options) {
const LibraryManager = require('../versions/library_manager.js'); this.registerModule('library_manager');
this.libraryManager = new LibraryManager({
plugins: this.plugins,
config: this.config
});
} }
} }

View File

@ -2,14 +2,11 @@ var Npm = require('./npm.js');
class LibraryManager { class LibraryManager {
constructor(options) { constructor(embark) {
this.plugins = options.plugins; this.config = embark.config;
this.config = options.config;
this.contractsConfig = this.config.contractsConfig; this.contractsConfig = this.config.contractsConfig;
this.storageConfig = this.config.storageConfig; this.storageConfig = this.config.storageConfig;
this.embark = this.plugins.createPlugin('libraryManager', {});
this.determineVersions(); this.determineVersions();
this.registerCommands(); this.registerCommands();

View File

@ -1,11 +1,9 @@
const {PerformanceObserver, performance} = require('perf_hooks'); const {PerformanceObserver, performance} = require('perf_hooks');
require('colors'); require('colors');
const utils = require('../utils/utils.js'); 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'); i18n.setOrDetectLocale('en');
class NpmTimer{ class NpmTimer{
constructor(options){ constructor(options){
this._logger = (options.logger && typeof options.logger.info == 'function') ? options.logger : console; this._logger = (options.logger && typeof options.logger.info == 'function') ? options.logger : console;