feat: show git tag version

This commit is contained in:
2026-03-10 10:06:55 +01:00
parent 0863dfad2e
commit 539cbdd2f1
2 changed files with 28 additions and 3 deletions

View File

@@ -50,7 +50,7 @@
<div class="sidebar-divider" />
<div class="footer-row">
<p class="font-mono text-[10px] tracking-widest uppercase text-white/40">
Supervisor v1.0
Supervisor {{ appVersion }}
</p>
</div>
</div>
@@ -123,7 +123,7 @@
</div>
<div class="footer-row">
<p class="font-mono text-[10px] tracking-widest uppercase text-white/40">
Supervisor v1.0
Supervisor {{ appVersion }}
</p>
<button class="close-button" type="button" @click="isMenuOpen = false">
<IconifyIcon icon="mdi:close" class="text-xl" />
@@ -143,6 +143,9 @@ import { ref } from "vue"
import { Icon as IconifyIcon } from "@iconify/vue"
import logoSrc from '~/assets/LOGO_CARRE_BLANC.png'
const {
public: { appVersion }
} = useRuntimeConfig()
const isMenuOpen = ref(false)
const navItems = [
{

View File

@@ -1,10 +1,32 @@
import { execSync } from "node:child_process"
import tailwindcss from "@tailwindcss/vite"
const getRepoVersion = () => {
try {
const tags = execSync(
"git for-each-ref --sort=-version:refname --format='%(refname:short)' refs/tags",
{ encoding: "utf8" }
)
.split("\n")
.map((tag) => tag.trim())
.filter(Boolean)
return tags[0] || "dev"
} catch {
return "dev"
}
}
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
compatibilityDate: "2025-07-15",
devtools: { enabled: true },
css: ["~/assets/css/main.css"],
runtimeConfig: {
public: {
appVersion: getRepoVersion()
}
},
vite: {
plugins: [tailwindcss()]
}