From fba2aa9746ddde7b25a951b7633dd514503531b9 Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Fri, 20 Mar 2026 05:03:04 +0800 Subject: [PATCH] feat: update version to 1.4.0 and integrate APP_VERSION in components --- package-lock.json | 4 ++-- package.json | 2 +- shared/app-version.ts | 1 + src/services/backup-archive.ts | 4 ++-- webapp/src/components/StandalonePageFrame.tsx | 3 +++ webapp/src/styles.css | 5 +++++ 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 shared/app-version.ts diff --git a/package-lock.json b/package-lock.json index 6ad70c2..689fac9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nodewarden", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nodewarden", - "version": "1.3.0", + "version": "1.4.0", "license": "LGPL-3.0", "dependencies": { "@noble/hashes": "^2.0.1", diff --git a/package.json b/package.json index 8335e59..0438619 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodewarden", - "version": "1.3.0", + "version": "1.4.0", "description": "Minimal Bitwarden-compatible server running on Cloudflare Workers", "author": "shuaiplus", "license": "LGPL-3.0", diff --git a/shared/app-version.ts b/shared/app-version.ts new file mode 100644 index 0000000..0526839 --- /dev/null +++ b/shared/app-version.ts @@ -0,0 +1 @@ +export const APP_VERSION = '1.4.0'; diff --git a/src/services/backup-archive.ts b/src/services/backup-archive.ts index 596e0ea..39ed209 100644 --- a/src/services/backup-archive.ts +++ b/src/services/backup-archive.ts @@ -1,5 +1,6 @@ import { zipSync, unzipSync } from 'fflate'; import type { Env } from '../types'; +import { APP_VERSION } from '../../shared/app-version'; import { getAttachmentObjectKey, getBlobStorageKind, @@ -8,7 +9,6 @@ import { type SqlRow = Record; const BACKUP_FORMAT_VERSION = 1; -const BACKUP_APP_VERSION = '1.3.0'; // Worker-side backup export must stay well below Cloudflare CPU limits. // Prefer store-only ZIP entries over heavier compression to keep exports reliable. const BACKUP_TEXT_COMPRESSION_LEVEL = 0; @@ -294,7 +294,7 @@ export async function buildBackupArchive( const manifestBase = { formatVersion: BACKUP_FORMAT_VERSION, exportedAt: date.toISOString(), - appVersion: BACKUP_APP_VERSION, + appVersion: APP_VERSION, storageKind: getBlobStorageKind(env), tableCounts: { config: configRows.length, diff --git a/webapp/src/components/StandalonePageFrame.tsx b/webapp/src/components/StandalonePageFrame.tsx index c912d7d..7d10dad 100644 --- a/webapp/src/components/StandalonePageFrame.tsx +++ b/webapp/src/components/StandalonePageFrame.tsx @@ -1,4 +1,5 @@ import type { ComponentChildren } from 'preact'; +import { APP_VERSION } from '@shared/app-version'; interface StandalonePageFrameProps { title: string; @@ -24,6 +25,8 @@ export default function StandalonePageFrame(props: StandalonePageFrameProps) { NodeWarden Repository | Author: @shuaiplus + | + v{APP_VERSION} ); diff --git a/webapp/src/styles.css b/webapp/src/styles.css index 34a6239..2dd4702 100644 --- a/webapp/src/styles.css +++ b/webapp/src/styles.css @@ -206,6 +206,11 @@ body, text-decoration: underline; } +.standalone-version { + font-weight: 700; + color: #1d4ed8; +} + .muted { margin: 0 0 16px 0; text-align: center;