Files
breeze/scripts/prepare-package-assets.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

47 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""Stage deterministic package resources, keeping large practice art in Practices."""
from pathlib import Path
import shutil
from animation_inventory import inventory
ROOT = Path(__file__).resolve().parent.parent
OUTPUT = ROOT / 'build/package-assets'
_, _, unique_animation = inventory()
unique_animation = set(unique_animation)
if OUTPUT.exists():
shutil.rmtree(OUTPUT)
for name in ('inbe', 'lists', 'habits', 'practices', 'diary', 'lumi', 'leaderboard'):
(OUTPUT / name / 'assets').mkdir(parents=True)
patterns = (
'assets/mcp/*.json', 'assets/app/icon.png', 'assets/app/icon-sky-cradle.png',
'assets/app/icon-ink-and-air.png', 'assets/easteregg/*.png', 'assets/pet/*.png',
'assets/social/*.png', 'assets/profile-pictures/*.png',
'assets/practices/whm/1.png', 'assets/practices/whm/2.png',
'assets/practices/meditation/1.png', 'assets/practices/*/banner-light.png',
'assets/practices/*/banner-dark.png',
'assets/practices/sunsalutation/characters/*/*.png', 'assets/sounds/*.ogg',
'assets/habits/**/*', 'assets/lists/**/*', 'assets/diary/**/*', 'assets/lumi/**/*',
'assets/fonts/subset/*-App-Regular.*', 'assets/styles/*.kss',
'locales/*.txt', 'themes/catalog_*.kss',
'build/packages/kss/styles/*.kss', 'build/packages/kryon/icons/ui.png',
'build/packages/kryon/icons/pfp.png',
)
for file in sorted({p for pattern in patterns for p in ROOT.glob(pattern) if p.is_file()}):
if '-prompt.' in file.name:
continue
if '/sunsalutation/characters/' in file.as_posix() and file not in unique_animation:
continue
path = file.relative_to(ROOT).as_posix()
owner = 'inbe'
if path.startswith(('assets/practices/', 'assets/sounds/')):
owner = 'practices'
for feature in ('habits', 'lists', 'diary', 'lumi'):
if path.startswith('assets/' + feature + '/'):
owner = feature
for prefix in ('build/packages/kss/', 'build/packages/kryon/'):
if path.startswith(prefix):
path = path.removeprefix(prefix)
target = OUTPUT / owner / path
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(file, target)