add tag version to footer (#725)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"name": "meshtastic-web",
|
"name": "meshtastic-web",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@bufbuild/protobuf": "^2.6.1",
|
"@bufbuild/protobuf": "^2.6.1",
|
||||||
|
"@meshtastic/protobufs": "npm:@jsr/meshtastic__protobufs",
|
||||||
"ste-simple-events": "^3.0.11",
|
"ste-simple-events": "^3.0.11",
|
||||||
"tslog": "^4.9.3",
|
"tslog": "^4.9.3",
|
||||||
},
|
},
|
||||||
@@ -18,7 +19,6 @@
|
|||||||
"name": "@meshtastic/core",
|
"name": "@meshtastic/core",
|
||||||
"version": "2.6.5",
|
"version": "2.6.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@meshtastic/protobufs": "npm:@jsr/meshtastic__protobufs",
|
|
||||||
"crc": "npm:crc@^4.3.2",
|
"crc": "npm:crc@^4.3.2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"packages/transport-http": {
|
"packages/transport-http": {
|
||||||
"name": "@meshtastic/transport-http",
|
"name": "@meshtastic/transport-http",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
},
|
},
|
||||||
"packages/transport-node": {
|
"packages/transport-node": {
|
||||||
"name": "@meshtastic/transport-node",
|
"name": "@meshtastic/transport-node",
|
||||||
@@ -36,14 +36,14 @@
|
|||||||
},
|
},
|
||||||
"packages/transport-web-bluetooth": {
|
"packages/transport-web-bluetooth": {
|
||||||
"name": "@meshtastic/transport-web-bluetooth",
|
"name": "@meshtastic/transport-web-bluetooth",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/web-bluetooth": "npm:@types/web-bluetooth@^0.0.20",
|
"@types/web-bluetooth": "npm:@types/web-bluetooth@^0.0.20",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"packages/transport-web-serial": {
|
"packages/transport-web-serial": {
|
||||||
"name": "@meshtastic/transport-web-serial",
|
"name": "@meshtastic/transport-web-serial",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/w3c-web-serial": "npm:@types/w3c-web-serial@^1.0.7",
|
"@types/w3c-web-serial": "npm:@types/w3c-web-serial@^1.0.7",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans } from "react-i18next";
|
||||||
|
|
||||||
type FooterProps = {
|
type FooterProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Footer = ({ className, ...props }: FooterProps) => {
|
const Footer = ({ className, ...props }: FooterProps) => {
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer
|
<footer
|
||||||
className={cn(
|
className={cn(
|
||||||
@@ -16,11 +14,15 @@ const Footer = ({ className, ...props }: FooterProps) => {
|
|||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<div className="justify-start px-2">
|
<div className="px-2">
|
||||||
<span className="font-semibold text-gray-500/40 dark:text-gray-400/40">
|
<span className="font-semibold text-gray-500/40 dark:text-gray-400/40">
|
||||||
{t("footer.commitSha", {
|
{String(import.meta.env.VITE_VERSION)?.toUpperCase()}
|
||||||
sha: String(import.meta.env.VITE_COMMIT_HASH)?.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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="ml-auto mr-auto text-gray-500 dark:text-gray-400">
|
<p className="ml-auto mr-auto text-gray-500 dark:text-gray-400">
|
||||||
|
|||||||
Vendored
+1
@@ -3,6 +3,7 @@
|
|||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly env: {
|
readonly env: {
|
||||||
readonly VITE_COMMIT_HASH: string;
|
readonly VITE_COMMIT_HASH: string;
|
||||||
|
readonly VITE_VERSION: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import react from "@vitejs/plugin-react";
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
let hash = "";
|
let hash = "";
|
||||||
|
let version = "v0.0.0";
|
||||||
try {
|
try {
|
||||||
hash = execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
|
hash = execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -13,6 +14,14 @@ try {
|
|||||||
hash = "DEV";
|
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 =
|
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';";
|
"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: {
|
define: {
|
||||||
"import.meta.env.VITE_COMMIT_HASH": JSON.stringify(hash),
|
"import.meta.env.VITE_COMMIT_HASH": JSON.stringify(hash),
|
||||||
|
"import.meta.env.VITE_VERSION": JSON.stringify(version),
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user