All checks were successful
check / check (push) Successful in 26s
Add a new well at the bottom of the settings view that displays: - License (GPL-3.0) - Author (sneak) - Version (from package.json) - Build date (injected at build time) - Git commit short hash (linked to Gitea commit URL) Build-time injection: build.js now reads the git commit hash and version from package.json, injecting them via esbuild define constants. The Dockerfile and Makefile pass commit hashes as build args so the info is available even when .git is excluded from the Docker context. Easter egg: clicking the version number 10 times reveals a hidden debug well below the About well, containing a toggle for debug mode. The debug mode flag is persisted in state and enables verbose console logging via the runtime debug flag in the logger. closes #144
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
// Build-time constants injected by esbuild define in build.js.
|
|
// These globals are replaced at bundle time with string literals.
|
|
|
|
/* global __BUILD_VERSION__, __BUILD_LICENSE__, __BUILD_AUTHOR__,
|
|
__BUILD_COMMIT__, __BUILD_COMMIT_FULL__, __BUILD_DATE__ */
|
|
|
|
const BUILD_VERSION =
|
|
typeof __BUILD_VERSION__ !== "undefined" ? __BUILD_VERSION__ : "dev";
|
|
const BUILD_LICENSE =
|
|
typeof __BUILD_LICENSE__ !== "undefined" ? __BUILD_LICENSE__ : "GPL-3.0";
|
|
const BUILD_AUTHOR =
|
|
typeof __BUILD_AUTHOR__ !== "undefined"
|
|
? __BUILD_AUTHOR__
|
|
: "sneak <sneak@sneak.berlin>";
|
|
const BUILD_COMMIT =
|
|
typeof __BUILD_COMMIT__ !== "undefined" ? __BUILD_COMMIT__ : "unknown";
|
|
const BUILD_COMMIT_FULL =
|
|
typeof __BUILD_COMMIT_FULL__ !== "undefined"
|
|
? __BUILD_COMMIT_FULL__
|
|
: "unknown";
|
|
const BUILD_DATE =
|
|
typeof __BUILD_DATE__ !== "undefined" ? __BUILD_DATE__ : "unknown";
|
|
|
|
const GITEA_COMMIT_URL =
|
|
"https://git.eeqj.de/sneak/AutistMask/commit/" + BUILD_COMMIT_FULL;
|
|
|
|
module.exports = {
|
|
BUILD_VERSION,
|
|
BUILD_LICENSE,
|
|
BUILD_AUTHOR,
|
|
BUILD_COMMIT,
|
|
BUILD_COMMIT_FULL,
|
|
BUILD_DATE,
|
|
GITEA_COMMIT_URL,
|
|
};
|