+
+ {t('settings.about.title')}
+
+
+
+ {t('settings.about.appVersion')}
+ {__APP_VERSION__}
+
+
+ {t('settings.about.protocolVersion')}
+ {PROTOCOL_VERSION}
+
+
diff --git a/web/src/test/setup.ts b/web/src/test/setup.ts
new file mode 100644
index 00000000..a9d0dd31
--- /dev/null
+++ b/web/src/test/setup.ts
@@ -0,0 +1 @@
+import '@testing-library/jest-dom/vitest'
diff --git a/web/src/types/global.d.ts b/web/src/types/global.d.ts
new file mode 100644
index 00000000..e042dcc5
--- /dev/null
+++ b/web/src/types/global.d.ts
@@ -0,0 +1 @@
+declare const __APP_VERSION__: string
diff --git a/web/vite.config.ts b/web/vite.config.ts
index 62a02b56..0e328a04 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -2,10 +2,15 @@ import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
import { resolve } from 'node:path'
+import { createRequire } from 'node:module'
+const require = createRequire(import.meta.url)
const base = process.env.VITE_BASE_URL || '/'
export default defineConfig({
+ define: {
+ __APP_VERSION__: JSON.stringify(require('../cli/package.json').version),
+ },
server: {
host: true,
allowedHosts: ['hapidev.weishu.me'],
diff --git a/web/vitest.config.ts b/web/vitest.config.ts
new file mode 100644
index 00000000..8c99dbd5
--- /dev/null
+++ b/web/vitest.config.ts
@@ -0,0 +1,14 @@
+import { defineConfig, mergeConfig } from 'vitest/config'
+import viteConfig from './vite.config'
+
+export default mergeConfig(
+ viteConfig,
+ defineConfig({
+ test: {
+ globals: false,
+ environment: 'jsdom',
+ include: ['src/**/*.test.{ts,tsx}'],
+ setupFiles: ['./src/test/setup.ts'],
+ },
+ })
+)