Something went wrong. Try again.
Cooperative email for PDS operators
Something went wrong. Try again.
729 B · 23 lines
TypeScript
at main
123456789101112131415161718192021222324// Build-time version string.//// Resolution order:// 1. PUBLIC_COMAIL_VERSION env var — set by Nix / CI builds from// the repo-root VERSION file.// 2. ../../VERSION via fs (local dev outside Nix; repo root is two// levels up from web-frontend/src/lib).// 3. "0.0.0-dev" fallback.import { readFileSync } from "node:fs";import { resolve } from "node:path";
function loadVersion(): string { const envVersion = process.env.PUBLIC_COMAIL_VERSION?.trim(); if (envVersion) return envVersion; try { const path = resolve(import.meta.dirname, "..", "..", "..", "VERSION"); return readFileSync(path, "utf8").trim(); } catch { return "0.0.0-dev"; }}
export const VERSION = loadVersion();