From b3fbc0972d9898041e759e8871ab092bc22a71dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A4=A7=E7=8C=AB?= <16399091+binaricat@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:42:49 +0800 Subject: [PATCH] feat: use dynamic package version in CloudSyncManager (#153) Replaced the hardcoded '1.0.0' version string in CloudSyncManager.ts with the version from package.json. Enabled resolveJsonModule in tsconfig.json to support JSON imports. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- infrastructure/services/CloudSyncManager.ts | 3 ++- tsconfig.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/infrastructure/services/CloudSyncManager.ts b/infrastructure/services/CloudSyncManager.ts index ee06983e..b8aeb4bf 100644 --- a/infrastructure/services/CloudSyncManager.ts +++ b/infrastructure/services/CloudSyncManager.ts @@ -31,6 +31,7 @@ import { generateDeviceId, getDefaultDeviceName, } from '../../domain/sync'; +import packageJson from '../../package.json'; import { EncryptionService } from './EncryptionService'; import { createAdapter, type CloudAdapter } from './adapters'; import type { GitHubAdapter } from './adapters/GitHubAdapter'; @@ -890,7 +891,7 @@ export class CloudSyncManager { this.masterPassword, this.state.deviceId, this.state.deviceName, - '1.0.0', // TODO: Get from package.json + packageJson.version, this.state.localVersion ); diff --git a/tsconfig.json b/tsconfig.json index 9e9a86c8..06fea84f 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "DOM.Iterable" ], "skipLibCheck": true, + "resolveJsonModule": true, "types": [ "node", "vite/client"