NGU-Web/src/lib/version.ts
Zaldimmar d890efca2b Version v1.14.1-schedule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:07:14 -06:00

28 lines
1.8 KiB
TypeScript

/* ═══════════════════════════════════════════════════════════════
SITE VERSION: src/lib/version.ts
One string, bumped by hand when the working directory name
changes. Read by the admin's footer and home, and the site's
footer.
Each version has a name, Minecraft style: the tag's words after
the number, "v1.13.2-region-cards" → "The Region Cards Update".
A version with no words after its number has no name.
═══════════════════════════════════════════════════════════════ */
export const SITE_VERSION = "NGU-Web.v1.14.1-schedule";
/** The number, eg. v1.13.2. */
export const VERSION_NUMBER: string = SITE_VERSION.match(/v\d+(?:\.\d+)*/)?.[0] ?? SITE_VERSION
/** The version's name from its tag, eg. The Region Cards Update, or null. */
export const VERSION_NAME: string | null = (() => {
const words = SITE_VERSION.match(/v\d+(?:\.\d+)*-(.+)$/)?.[1]
if (!words) return null
const title = words
.split('-')
.filter(Boolean)
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
return `The ${title} Update`
})()