Skip to content

Commit

Permalink
chore: read version from tauri.conf.json instead of hardcoding (#395)
Browse files Browse the repository at this point in the history
* chore: read version from tauri.conf.json instead of hardcoding

* remove unrelevant
  • Loading branch information
Charlie-XIAO authored Feb 2, 2025
1 parent 373a714 commit 5713891
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/manager/tabs/AboutTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const AboutTab = () => {
<DataList.Root size="2" css={{ gap: "var(--space-1)" }}>
<DataList.Item>
<DataList.Label>Version</DataList.Label>
<DataList.Value>0.0.1</DataList.Value>
<DataList.Value>{__VERSION__}</DataList.Value>
</DataList.Item>
<DataList.Item>
<DataList.Label>Authors</DataList.Label>
Expand Down
2 changes: 2 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/// <reference types="vite/client" />

declare const __VERSION__: string;
4 changes: 4 additions & 0 deletions src/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import tauriConf from "../crates/deskulpt/tauri.conf.json";

export default defineConfig({
define: {
__VERSION__: JSON.stringify(tauriConf.version),
},
plugins: [
react({
jsxImportSource: "@emotion/react",
Expand Down

0 comments on commit 5713891

Please sign in to comment.