mirror of
https://github.com/meshtastic/web.git
synced 2026-04-19 05:17:08 -04:00
add tag version to footer (#725)
This commit is contained in:
8
bun.lock
8
bun.lock
@@ -5,6 +5,7 @@
|
||||
"name": "meshtastic-web",
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^2.6.1",
|
||||
"@meshtastic/protobufs": "npm:@jsr/meshtastic__protobufs",
|
||||
"ste-simple-events": "^3.0.11",
|
||||
"tslog": "^4.9.3",
|
||||
},
|
||||
@@ -18,7 +19,6 @@
|
||||
"name": "@meshtastic/core",
|
||||
"version": "2.6.5",
|
||||
"dependencies": {
|
||||
"@meshtastic/protobufs": "npm:@jsr/meshtastic__protobufs",
|
||||
"crc": "npm:crc@^4.3.2",
|
||||
},
|
||||
},
|
||||
@@ -28,7 +28,7 @@
|
||||
},
|
||||
"packages/transport-http": {
|
||||
"name": "@meshtastic/transport-http",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
},
|
||||
"packages/transport-node": {
|
||||
"name": "@meshtastic/transport-node",
|
||||
@@ -36,14 +36,14 @@
|
||||
},
|
||||
"packages/transport-web-bluetooth": {
|
||||
"name": "@meshtastic/transport-web-bluetooth",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"devDependencies": {
|
||||
"@types/web-bluetooth": "npm:@types/web-bluetooth@^0.0.20",
|
||||
},
|
||||
},
|
||||
"packages/transport-web-serial": {
|
||||
"name": "@meshtastic/transport-web-serial",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"dependencies": {
|
||||
"@types/w3c-web-serial": "npm:@types/w3c-web-serial@^1.0.7",
|
||||
},
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { cn } from "@core/utils/cn.ts";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
type FooterProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Footer = ({ className, ...props }: FooterProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<footer
|
||||
className={cn(
|
||||
@@ -16,11 +14,15 @@ const Footer = ({ className, ...props }: FooterProps) => {
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<div className="justify-start px-2">
|
||||
<div className="px-2">
|
||||
<span className="font-semibold text-gray-500/40 dark:text-gray-400/40">
|
||||
{t("footer.commitSha", {
|
||||
sha: String(import.meta.env.VITE_COMMIT_HASH)?.toUpperCase(),
|
||||
})}
|
||||
{String(import.meta.env.VITE_VERSION)?.toUpperCase()}
|
||||
</span>
|
||||
<span className="font-semibold text-gray-500/40 dark:text-gray-400/40 mx-2">
|
||||
-
|
||||
</span>
|
||||
<span className="font-semibold text-gray-500/40 dark:text-gray-400/40">
|
||||
{`#${String(import.meta.env.VITE_COMMIT_HASH)?.toUpperCase()}`}
|
||||
</span>
|
||||
</div>
|
||||
<p className="ml-auto mr-auto text-gray-500 dark:text-gray-400">
|
||||
|
||||
1
packages/web/vite-env.d.ts
vendored
1
packages/web/vite-env.d.ts
vendored
@@ -3,6 +3,7 @@
|
||||
interface ImportMetaEnv {
|
||||
readonly env: {
|
||||
readonly VITE_COMMIT_HASH: string;
|
||||
readonly VITE_VERSION: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
let hash = "";
|
||||
let version = "v0.0.0";
|
||||
try {
|
||||
hash = execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
|
||||
} catch (error) {
|
||||
@@ -13,6 +14,14 @@ try {
|
||||
hash = "DEV";
|
||||
}
|
||||
|
||||
try {
|
||||
version = execSync("git describe --tags --abbrev=0", {
|
||||
encoding: "utf8",
|
||||
}).trim();
|
||||
} catch (error) {
|
||||
console.error("Error getting git version:", error);
|
||||
}
|
||||
|
||||
const CONTENT_SECURITY_POLICY =
|
||||
"script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' data: https://rsms.me https://cdn.jsdelivr.net; img-src 'self' data:; font-src 'self' data: https://rsms.me https://cdn.jsdelivr.net; worker-src 'self' blob:; object-src 'none'; base-uri 'self';";
|
||||
|
||||
@@ -37,6 +46,7 @@ export default defineConfig({
|
||||
},
|
||||
define: {
|
||||
"import.meta.env.VITE_COMMIT_HASH": JSON.stringify(hash),
|
||||
"import.meta.env.VITE_VERSION": JSON.stringify(version),
|
||||
},
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
|
||||
Reference in New Issue
Block a user