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

@@ -111,6 +111,25 @@ not part of a record or item, so it sits exactly where you put it.
older file in a newer build (see below) still works. **Cancel** and the
other editing rules work the same as for records.
## Version number
The top of the page shows the app's version after the "Last update" date,
for example **Ver 261109B**: `261109` is the date (YY MM DD) and the letter is
the iteration that day (A first, B second, up to Z). It is the version of the
*app code*, not of your data, so a file saved from a newer build shows the
newer number. After upgrading an old file (below), check that it changed.
For the developer: the bump is automatic. A git pre-commit hook
(`.githooks/pre-commit`) moves `src/version.js` to today's date with the next
letter (or A on a new day) in any commit that changes `src/` or `build.js`.
Docs-only and test-only commits don't bump, and a commit that already changes
the version by hand is left alone. Past Z (26 in a day) it warns and keeps Z.
- Once per clone, switch the hook on: `npm run hooks` (sets
`core.hooksPath` to `.githooks`). Until then commits are not bumped.
- `npm run bump` still bumps by hand if you need it.
- The hook adds `src/version.js` to the commit being made. It works with
`git add ... && git commit` and `git commit -a`; with `git commit <paths>`
the bump is left out of that commit, so use the first form.
## Upgrading the app (new version, same data)
Your data is stored encrypted inside each `final-wishes.html`; the app code
sits beside it in the same file. A file therefore keeps running the version it