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>
This commit is contained in:
陈大猫
2026-02-01 13:42:49 +08:00
committed by GitHub
parent 6edc4213f4
commit b3fbc0972d
2 changed files with 3 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ import {
generateDeviceId, generateDeviceId,
getDefaultDeviceName, getDefaultDeviceName,
} from '../../domain/sync'; } from '../../domain/sync';
import packageJson from '../../package.json';
import { EncryptionService } from './EncryptionService'; import { EncryptionService } from './EncryptionService';
import { createAdapter, type CloudAdapter } from './adapters'; import { createAdapter, type CloudAdapter } from './adapters';
import type { GitHubAdapter } from './adapters/GitHubAdapter'; import type { GitHubAdapter } from './adapters/GitHubAdapter';
@@ -890,7 +891,7 @@ export class CloudSyncManager {
this.masterPassword, this.masterPassword,
this.state.deviceId, this.state.deviceId,
this.state.deviceName, this.state.deviceName,
'1.0.0', // TODO: Get from package.json packageJson.version,
this.state.localVersion this.state.localVersion
); );

View File

@@ -10,6 +10,7 @@
"DOM.Iterable" "DOM.Iterable"
], ],
"skipLibCheck": true, "skipLibCheck": true,
"resolveJsonModule": true,
"types": [ "types": [
"node", "node",
"vite/client" "vite/client"