From f76c3bf7eeff6a190af22cd46c41256e24e9ec84 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 26 Sep 2024 17:21:29 +0200 Subject: [PATCH] Add version to the menu --- package-lock.json | 4 ++-- package.json | 2 +- src/routes/dashboard.tsx | 9 ++++++++- src/vite-env.d.ts | 2 ++ vite.config.ts | 3 +++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67885dc..41ef59f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codex-storage/marketplace-ui", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codex-storage/marketplace-ui", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "dependencies": { "@codex-storage/marketplace-ui-components": "0.0.9", diff --git a/package.json b/package.json index 7322595..2b2573e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/codex-storage/codex-marketplace-ui" }, - "version": "0.0.1", + "version": "0.0.2", "type": "module", "scripts": { "dev": "vite", diff --git a/src/routes/dashboard.tsx b/src/routes/dashboard.tsx index 8e180e5..f16d2b6 100644 --- a/src/routes/dashboard.tsx +++ b/src/routes/dashboard.tsx @@ -82,7 +82,14 @@ const Layout = () => { }, ] satisfies MenuItem[]; - return } items={items} Right={Right} />; + return ( + } + items={items} + Right={Right} + version={__APP_VERSION__} + /> + ); }; export const Route = createFileRoute("/dashboard")({ diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index fd9deca..df826d2 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,5 +1,7 @@ /// +declare const __APP_VERSION__: string; + interface ImportMetaEnv { VITE_CODEX_API_URL: string; } diff --git a/vite.config.ts b/vite.config.ts index 395f15e..d4ce8b7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,9 @@ import { defineConfig } from "vite"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [TanStackRouterVite(), react()], + define: { + __APP_VERSION__: JSON.stringify(process.env.npm_package_version), + }, build: { sourcemap: true, rollupOptions: {