GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Prometheus-AI-Agent/scripts/sync_design.py at main · Engine-User/Prometheus-AI-Agent Expand file tree/ Copy pathsync_design.pyMore file actions 84 lines (63 loc) · 2.93 KB / Copy pathsync_design.pyFile metadata and controls84 lines (63 loc) · 2.93 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 """Copy Prometheus Memory's design files into the dashboard, and record where they came from. Usage: python scripts/sync_design.py <path to waku-memory-frontend> tokens.css and controls.css are copied unchanged into waku/ops/static/design/. SOURCE.md is rewritten with the commit that last changed them and each file's sha256. evals/deterministic/test_design_system.py checks those hashes, so a hand edit to a copied file fails CI. To change a token, change it in Prometheus Memory, commit it there, then run this.""" from __future__ import annotations import hashlib import shutil import subprocess import sys from pathlib import Path DEST = Path(__file__).resolve().parents[1] / "waku" / "ops" / "static" / "design" FILES = ("tokens.css", "controls.css") SOURCE = """\ # Where the design files come from The dashboard uses the Prometheus Memory design system. Do not edit the copied files here. Change them in Prometheus Memory, then run `python scripts/sync_design.py <path to waku-memory-frontend>`. ## Copied unchanged From `ShenSeanChen/waku-memory-frontend`, `public/design/`, as of commit `{commit}` (the last commit that changed them). `evals/deterministic/test_design_system.py` checks these hashes. ``` {hashes} ``` ## Copied by hand `type.css` holds values Prometheus Memory keeps in `app/globals.css` rather than in `tokens.css`: the type scale (`--text-*`), the two weights (`--font-weight-*`), the line heights (`--leading-*`) and the field border (`--input`). They were copied from `app/globals.css` at `03ab1d7`. Check them against that file when you sync. ## Fonts `../fonts/` holds the Latin subsets Prometheus Memory loads through next/font, from Google Fonts. Each face is under the SIL Open Font License; its license is next to it as `OFL-<face>.txt`. | File | Face | |---|---| | `InstrumentSans-var.woff2` | Instrument Sans, variable, 400–700 | | `JetBrainsMono-var.woff2` | JetBrains Mono, variable, 100–800 | | `PlayfairDisplaySC-400.woff2` | Playfair Display SC, 400 | """ def _git(root: Path, *args: str) -> str: return subprocess.run(["git", "-C", str(root), *args], capture_output=True, text=True, check=True).stdout.strip() def main(argv: list[str]) -> int: if len(argv) != 2: print(__doc__) return 2 root = Path(argv[1]).expanduser().resolve() if _git(root, "status", "--porcelain", "--", "public/design"): print("refusing: public/design has uncommitted changes, so no commit describes them") return 1 commit = _git(root, "log", "-1", "--format=%h", "--", "public/design") hashes = [] for name in FILES: shutil.copyfile(root / "public" / "design" / name, DEST / name) hashes.append(f"{hashlib.sha256((DEST / name).read_bytes()).hexdigest()} {name}") (DEST / "SOURCE.md").write_text(SOURCE.format(commit=commit, hashes="\n".join(hashes))) print(f"copied {', '.join(FILES)} from {commit}") return 0 if __name__ == "__main__": sys.exit(main(sys.argv)) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |