Show a version number at the top of the page (Ver YYMMDDX) #15
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Show the app's version in the top bar, to the right of the Last update date, e.g. Ver 261109B.
Format
Ver YYMMDDX: YYMMDD is the date of the version, X is the iteration on that date: A = first, B = second, and so on. 26 per day at most (A-Z).Behavior
Last update: YYYY-MM-DD, in the same muted style.Implementation
src/version.js:APP_VERSION = '261109A'plus pure helpersisVersion(v)andnextVersion(current, date)(same date -> next letter; new date -> A; error past Z). Added to the bundle inbuild.js.bump-version.js+npm run bump: rewritessrc/version.jsusing today's local date andnextVersion. Also the engine of the pre-commit hook.src/app.js: renderVer <APP_VERSION>in the top bar after the Last update span.Tests
nextVersion(same day, new day, Z overflow, bad input), the committedAPP_VERSIONis valid, and the built HTML contains it.Last update: ... Ver 261109Awith the version after the date.Notes
.githooks/pre-commit, enabled per clone withnpm run hooks) runsbump-version.js --staged. Any commit that changessrc/orbuild.jsgets the next version automatically, inside that same commit. Docs-only/test-only commits don't bump; a commit that already changes the version by hand is left alone; past Z it warns and keeps Z.npm run bumpstill works by hand.Implemented in
a2fcc65.Added
Ver YYMMDDX(currentlyVer 261109A) right after the Last update date, in the same muted style. Confirmed in a real browser: same row, version to the right of the date.src/version.js(APP_VERSION), not part of the document or encrypted payload. A file saved from a newer build shows the newer version, so after upgrading an old file you can check it took effect..githooks/pre-commitrunningbump-version.js --staged) moves the version to today's date with the next letter inside any commit that changessrc/orbuild.js. Docs-only and test-only commits don't bump; a hand-bumped version is left alone; past Z it warns and keeps Z.npm run bumpstill bumps by hand. The letter counts commits that change the app that day, not edits.npm run hooks(sets core.hooksPath). It is on in the owner's clone.build.jsno longer runs a build when imported (needed so tests can import it).3c347c4).Verified
Ver 261109A.Notes / not done
261109Aas is (the version file was new); the next app-changing commit becomes261109B.git commit <paths>leaves the bump out of that commit; usegit add … && git commitorgit commit -a.npm run hooksbefore commits are bumped there.