From e4ef93595bf30efa528b6f68a58cc8dde6cfdfd9 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Thu, 10 Apr 2025 12:25:16 +0800 Subject: [PATCH] feat: enhance Pushy logging with version info and update EventData interface --- src/client.ts | 3 +++ src/type.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/client.ts b/src/client.ts index 4770196..d3e91ec 100644 --- a/src/client.ts +++ b/src/client.ts @@ -26,6 +26,7 @@ import { setLocalHashInfo, isFirstTime, isRolledBack, + getCurrentVersionInfo, } from './core'; const SERVER_PRESETS = { @@ -128,6 +129,7 @@ export class Pushy { log(type + ' ' + message); await this.loggerPromise.promise; const { logger = noop, appKey } = this.options; + const info = await getCurrentVersionInfo(); logger({ type, data: { @@ -137,6 +139,7 @@ export class Pushy { packageVersion, buildTime, message, + ...info, ...data, }, }); diff --git a/src/type.ts b/src/type.ts index f3c11d7..bf6c787 100644 --- a/src/type.ts +++ b/src/type.ts @@ -54,6 +54,9 @@ export interface EventData { message?: string; rolledBackVersion?: string; newVersion?: string; + name?: string; + description?: string; + metaInfo?: string; [key: string]: any; }