chore: add app version display (semver via Vite inject), set 0.5.0

Shows the running build next to the title. Versioning scheme: patch=fix/tweak,
minor=new backward-compatible feature, major=breaking (e.g. MQTT contract) or
first stable release.
This commit is contained in:
efiten committed 2026-06-10 11:53:44 +02:00
1 parent 050652b49a
commit baeed272fc
4 files changed
+16 -2

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@
</style>
</head>
<body>
<h1>📡 CoreScope RX</h1>
<h1>📡 CoreScope RX <span id="appver" style="font-size:11px;font-weight:400;color:#9aa4b2"></span></h1>
<div id="view-home">
<div class="card">
<div class="stats">
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "corescope-rx",
"version": "0.1.0",
"version": "0.5.0",
"private": true,
"type": "module",
"description": "Mobile RX coverage capture for CoreScope: BLE companion → MQTT (GPS + SNR/RSSI + multibyte)",
+3
View File
@@ -17,6 +17,8 @@ const els = (id) => document.getElementById(id);
const state = { transport: null, gps: new Gps(), queue: new Queue(), publisher: null, heard: 0, companionPubkey: '', companionName: '', connected: false, recent: [], localMap: null };
const RECENT_MAX = 20;
// Build version, injected from package.json by Vite (see vite.config.js).
const VERSION = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev';
// SNR → colour bucket (LoRa-ish). Returns a CSS colour.
function snrColor(snr) {
@@ -210,6 +212,7 @@ async function disconnectAll(keepProgress) {
}
window.addEventListener('DOMContentLoaded', () => {
els('appver').textContent = 'v' + VERSION;
setButton();
els('btnConnect').addEventListener('click', () => (state.connected ? disconnectAll() : connectAll()));
els('btnClear').addEventListener('click', () => { els('log').textContent = ''; });
+11
View File
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import { readFileSync } from 'fs';
// Inject the package.json version so the app can display which build is running.
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
export default defineConfig({
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
});