Files
TREK/server/src/app-config/running-version.ts
T
Maurice 0c2226c5f0 refactor(realtime): the websocket welcome frame reads the running version from app-config
The gateway imported hostVersion from the plugin install code to put the
version in its welcome frame, which made the realtime domain, imported by
nearly every other, depend on plugins. The running version (image VERSION
or APP_VERSION, else package.json) is app config; runningVersion() holds it
and the plugin host-compat checks call the same function.
2026-10-10 20:15:59 +02:00

12 lines
472 B
TypeScript

import { readEnv } from './env';
/**
* The running TREK version: the image's VERSION file or APP_VERSION (both behind
* `readEnv().app.appVersion`), else server/package.json. The websocket welcome
* frame and the plugin host-compatibility checks both announce it, so it lives
* here rather than inside either domain.
*/
export function runningVersion(): string {
return readEnv().app.appVersion || (require('../../package.json') as { version: string }).version;
}