version display added

This commit is contained in:
Yared Yemane 2026-02-27 01:04:05 -08:00
parent a030b925d3
commit 6f9323de27
4 changed files with 23 additions and 3 deletions

1
.env
View File

@ -1,2 +1,3 @@
VITE_API_BASE_URL=http://localhost:8080/api/v1 VITE_API_BASE_URL=http://localhost:8080/api/v1
VITE_GOOGLE_CLIENT_ID=google_client_id VITE_GOOGLE_CLIENT_ID=google_client_id
VERSION=1.0.0

2
src/globals.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
declare const __BUILD_HASH__: string
declare const __BUILD_TIME__: string

View File

@ -401,11 +401,15 @@ export function LoginPage() {
</form> </form>
{/* Footer */} {/* Footer */}
<p className="mt-10 text-center text-xs text-grayScale-400"> <div className="mt-10 text-center text-xs text-grayScale-400">
© {new Date().getFullYear()} Yimaru Academy · All rights reserved <p>© {new Date().getFullYear()} Yimaru Academy · All rights reserved</p>
<p className="mt-1 font-mono text-[10px] text-grayScale-300">
v{__BUILD_HASH__} · {new Date(__BUILD_TIME__).toLocaleDateString()}
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div>
); );
} }

View File

@ -1,8 +1,21 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import { execSync } from 'child_process'
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
define: {
__BUILD_HASH__: JSON.stringify(
(() => {
try {
return execSync('git rev-parse --short HEAD').toString().trim()
} catch {
return 'unknown'
}
})()
),
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
},
}) })