From 46386a13b3ffac26ec408bd8d13ffaa4c8a95442 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Mon, 28 Mar 2022 07:40:25 +0000 Subject: [PATCH] application: Add more event emits on specific events --- core/application.mjs | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/application.mjs b/core/application.mjs index 0dd797c..4a45789 100644 --- a/core/application.mjs +++ b/core/application.mjs @@ -98,6 +98,7 @@ export default class Application extends EventEmitter { updateLog(message, level = 'info') { this.ctx.db.data.core[this.name].updater += message this.ctx.log[level](message) + this.emit('updatelog') return message } @@ -213,6 +214,8 @@ export default class Application extends EventEmitter { this.ctx.db.upsertFirst(this.ctx.db.data.core[this.name].versions, latest) } + this.emit('update', latest) + // The target file for the archive and the target folder for new our version let target = this.ctx.util.getPathFromRoot(`./${this.name}/${latest.version}/file${this.ctx.util.getExtension(latest.filename)}`) folder = this.ctx.util.getPathFromRoot(`./${this.name}/${latest.version}`) diff --git a/package.json b/package.json index dd208fa..7c08f23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "service-core", - "version": "3.0.0-beta.11", + "version": "3.0.0-beta.12", "description": "Core boiler plate code to install node server as windows service", "main": "index.mjs", "scripts": {