Show the app version at the top of the page (Ver YYMMDDX)

Adds src/version.js, bump-version.js and a pre-commit hook that bumps the
version in commits that change the app.

Closes #15

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 19:01:33 -05:00
parent 1736548ef9
commit a2fcc65759
10 changed files with 193 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ const root = dirname(fileURLToPath(import.meta.url));
const read = (p) => readFileSync(join(root, 'src', p), 'utf8');
// Modules are concatenated (ES `import` lines and `export` keywords dropped) ahead of app.js into one scope.
const MODULES = ['crypto.js', 'images.js', 'model.js', 'ops.js', 'print.js', 'template.js'];
const MODULES = ['crypto.js', 'images.js', 'model.js', 'ops.js', 'print.js', 'template.js', 'version.js'];
export function bundleJs() {
return MODULES.map((f) => read(f).replace(/^import .*$/gm, '').replace(/^export /gm, '')).concat(read('app.js')).join('\n');
}
@@ -79,4 +79,4 @@ async function main() {
if (args.data) console.log(`Note: ${args.data} is still plaintext. Keep it out of git and delete it when done.`);
}
main().catch((e) => { console.error(e.message); process.exit(1); });
if (process.argv[1] === fileURLToPath(import.meta.url)) main().catch((e) => { console.error(e.message); process.exit(1); });