Release 0.2.0: changelog, version reporting, push-to-deploy

- CHANGELOG.md following Keep a Changelog, covering 0.1.0 and 0.2.0
- server/version.js reads the version from package.json; /healthz returns it
  and the footer renders it, so a deployment always states what it is serving
- bump package.json 0.1.0 -> 0.2.0
This commit is contained in:
2026-09-03 17:31:21 -04:00
parent 074c7ae5d4
commit 6a3f966758
6 changed files with 67 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import QRCode from 'qrcode';
import { Router, HttpError, readBody, send, esc } from './http.js';
import { publicState } from './public-state.js';
import { VERSION } from './version.js';
import * as pub from './views/public.js';
import * as adm from './views/admin.js';
@@ -12,7 +13,7 @@ export function buildRouter({ registry, auth, store }) {
// ---------- public ----------
r.get('/', (req, res) => send.html(res, pub.homePage(registry.list())));
r.get('/healthz', (req, res) => send.json(res, { ok: true, tournaments: registry.items.size, uptime: process.uptime() }));
r.get('/healthz', (req, res) => send.json(res, { ok: true, version: VERSION, tournaments: registry.items.size, uptime: process.uptime() }));
r.get('/t/:slug', (req, res, { slug }) => {
const it = item(slug);
+7
View File
@@ -0,0 +1,7 @@
// Single source of truth for the running version: package.json, read once at start.
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
const here = dirname(fileURLToPath(import.meta.url));
export const VERSION = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')).version;
+2 -1
View File
@@ -1,3 +1,4 @@
import { VERSION } from '../version.js';
import { esc } from '../http.js';
export function layout({ title, body, state = null, script = null, bodyClass = '', admin = null, nav = '' }) {
@@ -22,7 +23,7 @@ export function layout({ title, body, state = null, script = null, bodyClass = '
<main>
${body}
</main>
<footer class="foot">Courtside · self-hosted tournament desk · <a href="https://gitea.cloudfreeiot.com/bkvargyas/courtside">source</a></footer>
<footer class="foot">Courtside v${VERSION} · self-hosted tournament desk · <a href="https://gitea.cloudfreeiot.com/bkvargyas/courtside">source</a></footer>
${state ? `<script id="state" type="application/json">${JSON.stringify(state).replace(/</g, '\\u003c')}</script>` : ''}
${script ? `<script src="${esc(script)}" defer></script>` : ''}
</body>