Add hybrid versioning scripts, version shown in app footer

This commit is contained in:
2026-01-16 16:55:13 +00:00
parent 966006db6a
commit 5bd9780ac0
8 changed files with 214 additions and 11 deletions

View File

@@ -8,8 +8,28 @@
* @license MIT
*/
import packageJson from '../../package.json';
// Direct import of version.json - Vite handles this natively with import assertions
// This file is generated by prebuild script with git info
// @ts-ignore
import versionJsonDefault from '../version.json' assert { type: 'json' };
// Use the imported version.json, or fall back to -dev version
const versionInfo = versionJsonDefault && Object.keys(versionJsonDefault).length > 0 && versionJsonDefault.version && !versionJsonDefault.version.includes('unknown')
? versionJsonDefault
: {
version: `${packageJson.version}-dev`,
semver: packageJson.version,
commit: 'unknown',
branch: 'unknown',
buildDate: new Date().toISOString(),
gitDate: 'unknown',
};
export const LOCAL_STORAGE_KEY = 'medPlanAssistantState_v7';
export const PROJECT_REPOSITORY_URL = 'https://git.11001001.org/cbaoth/med-plan-assistant';
export const APP_VERSION = versionInfo.version;
export const BUILD_INFO = versionInfo;
// Pharmacokinetic Constants (from research literature)
// MW ratio: 135.21 (d-amphetamine) / 455.60 (LDX dimesylate) = 0.29677