refactor: move app packages under apps

This commit is contained in:
2026-07-25 22:15:28 -04:00
parent 4326878282
commit 3dcadd7702
9 changed files with 12 additions and 10 deletions
+7 -6
View File
@@ -12,10 +12,11 @@ https://gitea.va.reichard.io/evan/xteink-apps/raw/branch/main/catalog.txt
```text
catalog.txt
<AppId>/
manifest.txt
main.lua
...
apps/
<AppId>/
manifest.txt
main.lua
...
scripts/update-manifests.py
```
@@ -26,7 +27,7 @@ XTEINK-CATALOG|1
<AppId>|<description>|<manifest path>|<manifest bytes>|<manifest SHA-256>
```
Each generated `manifest.txt` contains every installable file in that app:
Each generated `apps/<AppId>/manifest.txt` contains every installable file in that app:
```text
XTEINK-MANIFEST|1
@@ -37,7 +38,7 @@ App IDs and file paths cannot contain `|`. App IDs use only letters, numbers, `_
## Adding or changing an app
1. Add or edit an app directory containing `main.lua`.
1. Add or edit an `apps/<AppId>` directory containing `main.lua`.
2. Regenerate metadata:
```bash
+2 -2
View File
@@ -1,3 +1,3 @@
XTEINK-CATALOG|1
HomeAssistant|Home Assistant status cards|HomeAssistant/manifest.txt|177|27aa1f0edc78a5aeded413caf0508788fa597ee8f76a5b8515ec0c40c955d5be
Wordle|Guess the five-letter word in six tries|Wordle/manifest.txt|177|9977b49ffdbd67a254701b4fa38407fc9128a017673e3ce73560dea08a6a125e
HomeAssistant|Home Assistant status cards|apps/HomeAssistant/manifest.txt|177|27aa1f0edc78a5aeded413caf0508788fa597ee8f76a5b8515ec0c40c955d5be
Wordle|Guess the five-letter word in six tries|apps/Wordle/manifest.txt|177|9977b49ffdbd67a254701b4fa38407fc9128a017673e3ce73560dea08a6a125e
+3 -2
View File
@@ -11,6 +11,7 @@ import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
APPS_DIR = ROOT / "apps"
ID_PATTERN = re.compile(r"^[A-Za-z0-9_-]+$")
DESCRIPTION_PATTERN = re.compile(r"^--\s*DESCRIPTION:\s*(.+?)\s*$")
@@ -51,7 +52,7 @@ def build_manifest(app_dir: Path) -> bytes:
def generated_files():
apps = [path for path in ROOT.iterdir() if path.is_dir() and (path / "main.lua").is_file()]
apps = [path for path in APPS_DIR.iterdir() if path.is_dir() and (path / "main.lua").is_file()]
apps.sort(key=lambda path: path.name.casefold())
manifests = {}
@@ -61,7 +62,7 @@ def generated_files():
if not ID_PATTERN.fullmatch(app_id):
raise ValueError(f"invalid app id: {app_id}")
manifest = build_manifest(app_dir)
manifest_path = f"{app_id}/manifest.txt"
manifest_path = f"apps/{app_id}/manifest.txt"
manifests[ROOT / manifest_path] = manifest
catalog.append(
f"{app_id}|{description(app_dir)}|{manifest_path}|{len(manifest)}|{sha256(manifest)}"