chore: bump version to 1.113.3 and update versioning process

This commit is contained in:
Azgaar 2026-03-07 16:37:31 +01:00
parent bbd3a907c2
commit 274e992799
7 changed files with 96 additions and 83 deletions

View file

@ -12,8 +12,8 @@
* Usage:
* node scripts/bump-version.js # interactive prompt
* node scripts/bump-version.js patch # non-interactive
* node scripts/bump-version.js minor
* node scripts/bump-version.js major
* node scripts/bump-version.js minor # non-interactive
* node scripts/bump-version.js major # non-interactive
* node scripts/bump-version.js --dry-run # preview only, no writes
*/

View file

@ -1,33 +0,0 @@
#!/usr/bin/env node
// Installs scripts/pre-push as .git/hooks/pre-push.
// Runs automatically via the `prepare` npm lifecycle hook (npm install).
const fs = require("fs");
const path = require("path");
const repoRoot = path.resolve(__dirname, "..");
const hooksDir = path.join(repoRoot, ".git", "hooks");
const source = path.join(repoRoot, "scripts", "pre-push");
const target = path.join(hooksDir, "pre-push");
if (!fs.existsSync(path.join(repoRoot, ".git"))) {
// Not a git repo (e.g. Docker / CI build from tarball) — skip silently.
process.exit(0);
}
if (!fs.existsSync(hooksDir)) {
fs.mkdirSync(hooksDir, {recursive: true});
}
try {
// Symlink so changes to scripts/pre-push are reflected immediately.
if (fs.existsSync(target) || fs.lstatSync(target).isSymbolicLink()) {
fs.unlinkSync(target);
}
} catch {
// Target doesn't exist yet — that's fine.
}
fs.symlinkSync(source, target);
fs.chmodSync(source, 0o755);
console.log("[prepare] Installed git pre-push hook → .git/hooks/pre-push");

View file

@ -1,29 +0,0 @@
#!/usr/bin/env sh
# Git pre-push hook — automatically bumps the version before pushing.
# Installed by: npm run prepare (scripts/install-hooks.js)
#
# Prompts for patch / minor / major (default: patch), updates:
# - public/versioning.js
# - package.json
# - src/index.html (cache-busting ?v= hashes for changed modules)
# then commits those changes so they are included in the push.
set -e
REPO_ROOT="$(git rev-parse --show-toplevel)"
echo ""
node "$REPO_ROOT/scripts/bump-version.js"
# Stage files that may have been modified by the bump
git add \
"$REPO_ROOT/public/versioning.js" \
"$REPO_ROOT/package.json" \
"$REPO_ROOT/src/index.html" 2>/dev/null || true
# Only commit if there are staged changes from the bump
if ! git diff --cached --quiet; then
NEW_VERSION=$(node -e "const f=require('fs');const m=f.readFileSync('$REPO_ROOT/public/versioning.js','utf8').match(/const VERSION = \"([\d.]+)\"/);console.log(m[1])")
git commit -m "chore: bump version to $NEW_VERSION"
echo "[pre-push] Committed version bump → $NEW_VERSION"
fi