From ecb8384c22c1979173660f7d5891dff560df1df8 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Wed, 23 Jul 2025 04:49:08 +0800 Subject: [PATCH] BLOG-58 feat: add app versioning support and update layout to include version meta tag --- frontend-v2/src/app.d.ts | 2 ++ frontend-v2/src/routes/+layout.svelte | 3 +++ frontend-v2/vite.config.ts | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend-v2/src/app.d.ts b/frontend-v2/src/app.d.ts index da08e6d..1af894e 100644 --- a/frontend-v2/src/app.d.ts +++ b/frontend-v2/src/app.d.ts @@ -7,6 +7,8 @@ declare global { // interface PageData {} // interface PageState {} // interface Platform {} + + declare const __VERSION__: string; } } diff --git a/frontend-v2/src/routes/+layout.svelte b/frontend-v2/src/routes/+layout.svelte index 0fece7c..5d87c98 100644 --- a/frontend-v2/src/routes/+layout.svelte +++ b/frontend-v2/src/routes/+layout.svelte @@ -5,6 +5,9 @@ import '@fortawesome/fontawesome-free/css/all.min.css'; + + +
diff --git a/frontend-v2/vite.config.ts b/frontend-v2/vite.config.ts index 2d35c4f..1333a23 100644 --- a/frontend-v2/vite.config.ts +++ b/frontend-v2/vite.config.ts @@ -2,6 +2,11 @@ import tailwindcss from '@tailwindcss/vite'; import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; +import { version } from './package.json'; + export default defineConfig({ - plugins: [tailwindcss(), sveltekit()] + plugins: [tailwindcss(), sveltekit()], + define: { + 'App.__VERSION__': JSON.stringify(version) + } });