conflict in package lock

This commit is contained in:
Jonathan Rainville 2018-05-15 14:42:06 -04:00
parent 69e264e765
commit 8cee44cbd7
1 changed files with 19 additions and 14 deletions

View File

@ -146,16 +146,9 @@ class Engine {
plugins: this.plugins plugins: this.plugins
}); });
const queue = async.queue((task, callback) => {
pipeline.build(task.abi, task.contractsJSON, task.path, callback);
}, 1);
this.events.on('code-generator-ready', function () { this.events.on('code-generator-ready', function () {
self.events.request('code', function (abi, contractsJSON) { self.events.request('code', function (abi, contractsJSON) {
self.currentAbi = abi; pipeline.build(abi, contractsJSON, null, () => {
self.contractsJSON = contractsJSON;
queue.push({abi, contractsJSON, path: null}, () => {
if (self.watch) { if (self.watch) {
self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched
} }
@ -168,7 +161,7 @@ class Engine {
codeGeneratorService(_options) { codeGeneratorService(_options) {
let self = this; let self = this;
let generateCode = function (contractsManager) { const generateCode = function (contractsManager) {
let codeGenerator = new CodeGenerator({ let codeGenerator = new CodeGenerator({
blockchainConfig: self.config.blockchainConfig, blockchainConfig: self.config.blockchainConfig,
contractsConfig: self.config.contractsConfig, contractsConfig: self.config.contractsConfig,
@ -183,9 +176,17 @@ class Engine {
self.events.emit('code-generator-ready'); self.events.emit('code-generator-ready');
}); });
}; };
this.events.on('contractsDeployed', generateCode); const cargo = async.cargo((tasks, callback) => {
this.events.on('blockchainDisabled', generateCode); generateCode(tasks[tasks.length - 1].contractsManager);
this.events.on('asset-changed', generateCode); self.events.once('outputDone', callback);
});
const addToCargo = function (contractsManager) {
cargo.push({contractsManager});
};
this.events.on('contractsDeployed', addToCargo);
this.events.on('blockchainDisabled', addToCargo);
this.events.on('asset-changed', addToCargo);
} }
deploymentService(options) { deploymentService(options) {
@ -226,9 +227,13 @@ class Engine {
// TODO: still need to redeploy contracts because the original contracts // TODO: still need to redeploy contracts because the original contracts
// config is being corrupted // config is being corrupted
if (fileType === 'asset') { if (fileType === 'asset') {
self.events.emit('asset-changed', self.contractsManager); // Throttle file changes so we re-write only once for all files
clearTimeout(self.fileTimeout);
self.fileTimeout = setTimeout(() => {
self.events.emit('asset-changed', self.contractsManager);
}, 50);
} }
// TODO: for now need to deploy on asset chanes as well // TODO: for now need to deploy on asset changes as well
// because the contractsManager config is corrupted after a deploy // because the contractsManager config is corrupted after a deploy
if (fileType === 'contract' || fileType === 'config') { if (fileType === 'contract' || fileType === 'config') {
self.config.reloadConfig(); self.config.reloadConfig();