feat: add app version in footer

This commit is contained in:
Lucien Cartier-Tilet 2024-02-10 18:30:09 +01:00
parent d73da8c1bd
commit 0dccf7e86e
4 changed files with 25 additions and 15 deletions

1
env.d.ts vendored
View File

@ -1 +1,2 @@
/// <reference types="vite/client" />
declare const __APP_VERSION__: string;

View File

@ -1,6 +1,6 @@
{
"name": "gege-jdr",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {

View File

@ -1,14 +1,22 @@
<template>
<footer class="flex-row flex-spread card">
<div id="copyright" class="small">Copyright &copy; {{ currentYear }} Lucien Cartier-Tilet</div>
<div id="source">
<a class="highlight small" href="https://labs.phundrak.com/phundrak/gege-jdr">Source code</a>
<footer class="flex-col flex-spread card gap-1rem">
<div class="flex-row flex-spread">
<div id="version" class="small">version {{ version }}</div>
<div id="copyright" class="small">
Copyright &copy; {{ currentYear }} Lucien Cartier-Tilet
</div>
<div id="source">
<a class="highlight small" href="https://labs.phundrak.com/phundrak/gege-jdr"
>Source code</a
>
</div>
</div>
</footer>
</template>
<script setup lang="ts">
const currentYear = new Date().getFullYear();
const version = __APP_VERSION__;
</script>
<style scoped="" lang="less">

View File

@ -1,16 +1,17 @@
import { fileURLToPath, URL } from 'node:url'
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
},
});