2017-03-30 13:16:46 +00:00
|
|
|
let version = require('../package.json').version;
|
|
|
|
|
2017-03-31 11:34:43 +00:00
|
|
|
class Embark {
|
2017-03-30 13:16:46 +00:00
|
|
|
|
2018-06-19 14:03:46 +00:00
|
|
|
constructor(options) {
|
2017-03-30 13:16:46 +00:00
|
|
|
this.version = version;
|
|
|
|
this.options = options || {};
|
|
|
|
}
|
2017-03-30 11:12:39 +00:00
|
|
|
|
2017-03-30 13:16:46 +00:00
|
|
|
initConfig(env, options) {
|
|
|
|
let Events = require('./core/events.js');
|
|
|
|
let Logger = require('./core/logger.js');
|
|
|
|
let Config = require('./core/config.js');
|
2017-03-30 11:12:39 +00:00
|
|
|
|
2017-03-30 13:16:46 +00:00
|
|
|
this.events = new Events();
|
2018-03-15 21:18:20 +00:00
|
|
|
this.logger = new Logger({logLevel: 'debug', events: this.events});
|
2017-03-30 13:16:46 +00:00
|
|
|
|
2018-04-25 14:34:17 +00:00
|
|
|
this.config = new Config({env: env, logger: this.logger, events: this.events, context: this.context});
|
2017-03-30 11:12:39 +00:00
|
|
|
this.config.loadConfigFiles(options);
|
|
|
|
this.plugins = this.config.plugins;
|
2017-03-30 13:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
2017-03-12 02:49:12 +00:00
|
|
|
|
2016-08-18 00:29:41 +00:00
|
|
|
module.exports = Embark;
|