Files
breeze/scripts/update-package-version.py
T
waoziandClaude Opus 5.5 31456658f2 Move Leaderboard out of Profile into its own app
Leaderboard is now a seventh app with its own package, so it can update
without a new Inner Breeze release. It is installed for new and existing
profiles, listed in Apps and left out of the dock; removing it is kept.
Profile keeps Friends and loses its Leaderboard tab.

The board ranks you with your friends for Wim Hof, breathing patterns,
meditation and Sun Salutation, by current streak or by average hold or
average time. Meditation averages were sent by the server but never
fetched; they are now. Saved and fetched results are parsed and ranked once
when they change instead of with SQLite queries on every frame, and up to
64 rows are shown in a scrolling list.

The package importer on the node accepts archives with and without the new
app, so the node and the app can be updated in either order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 19:05:27 -03:00

40 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""Synchronize one module's ledger from its numeric changelog entry."""
import json
from pathlib import Path
import re
import sys
root = Path(__file__).resolve().parent.parent
names = {"inbe": "inbe", "lists": "lists", "habits": "habits",
"practices": "practice", "diary": "diary", "lumi": "lumi",
"leaderboard": "leaderboard"}
if len(sys.argv) != 2 or sys.argv[1] not in names:
raise SystemExit("usage: ./update_version.sh --cell inbe|lists|habits|practices|diary|lumi|leaderboard")
name = sys.argv[1]
changelog = (root / "apps" / names[name] / "CHANGELOG.md").read_text()
version = re.search(r"^## \[((?:0|[1-9][0-9]{0,8})\.(?:0|[1-9][0-9]{0,8})\.(?:0|[1-9][0-9]{0,8}))\]", changelog, re.M)
if not version:
raise SystemExit("module changelog needs a numeric release entry")
path = root / "apps/versions.json"
ledger = json.loads(path.read_text())
latest = version[1]
component = ledger["apps"].get(name)
if component is None:
component = {"id": "inbe." + name, "version": latest, "sequence": 1,
"bundled": True}
ledger["apps"][name] = component
path.write_text(json.dumps(ledger, indent=2) + "\n")
if tuple(map(int, latest.split("."))) < tuple(map(int, component["version"].split("."))):
raise SystemExit("module version cannot decrease")
if latest != component["version"]:
component["version"] = latest
component["sequence"] += 1
if component["sequence"] > 2**31 - 1:
raise SystemExit("module sequence limit reached")
path.write_text(json.dumps(ledger, indent=2) + "\n")
for cell in ledger["apps"].values():
cell["bundled"] = True
path.write_text(json.dumps(ledger, indent=2) + "\n")
print(f"{name} {latest}, sequence {component['sequence']}; native wrapper version retained")