- Rename player-asbuilt.html → stage.html (the pedalboard build). Update build.sh + deploy.sh (deploy now also removes the old player-asbuilt.html from the web root) and the cross-links in player.html / stage.html. - New /micro.html — a stripped-down home-practice metronome on the same RP2040 firmware. Hardware is just: ONE depressable scroll/rotary encoder, a red 7-segment LED display, a speaker, and USB-C for power. The encoder does everything: spin = tempo, press = start/stop, hold + spin = switch track (the LED shows the track number, with BPM / TRACK / ▶ indicators). Tracks = the editor's seed grooves flattened (23). Shares src/engine.js, setlists.js, base.css; synth-only; steady practice loop (ramps/bars ignored). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
1.8 KiB
Bash
Executable file
36 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Assemble the deployed single-file pages from source + shared partials + assets/.
|
|
#
|
|
# Both index.html and player.html are sources that share code via markers:
|
|
# /*@BUILD:include:src/<file>@*/ inlines a shared partial (engine, seed lists, base CSS)
|
|
# @BUILD:favicon@ / @BUILD:logo-*@ / /*@BUILD:samples@*/{} inline base64 assets
|
|
# This resolves them so each built page in dist/ is one self-contained file
|
|
# (zero deps, works fully offline). deploy.sh runs this first. dist/ is generated —
|
|
# don't edit or commit it.
|
|
set -euo pipefail
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
mkdir -p dist
|
|
python3 - <<'PY'
|
|
import json, os, pathlib, re
|
|
A = pathlib.Path("assets")
|
|
SAMPLES = json.dumps(json.load(open(A / "samples.json")))
|
|
|
|
def build(name):
|
|
src = pathlib.Path(name).read_text()
|
|
# 1) inline shared partials (function-replacement: no backslash/group interpretation)
|
|
src = re.sub(r"/\*@BUILD:include:([^@]+)@\*/",
|
|
lambda m: pathlib.Path(m.group(1)).read_text().rstrip("\n"), src)
|
|
# 2) inline base64 assets
|
|
src = src.replace("@BUILD:favicon@", (A / "favicon.b64").read_text().strip())
|
|
src = src.replace("@BUILD:logo-dark@", (A / "logo-dark.b64").read_text().strip())
|
|
src = src.replace("@BUILD:logo-light@", (A / "logo-light.b64").read_text().strip())
|
|
src = src.replace("/*@BUILD:samples@*/{}", SAMPLES)
|
|
assert "@BUILD:" not in src, f"unresolved build marker(s) remain in {name}"
|
|
out = pathlib.Path("dist") / name
|
|
out.write_text(src)
|
|
return out.stat().st_size
|
|
|
|
i = build("index.html"); p = build("player.html"); a = build("stage.html"); u = build("micro.html")
|
|
print("built index.html (%dKB) + player.html (%dKB) + stage.html (%dKB) + micro.html (%dKB)"
|
|
% (i // 1024, p // 1024, a // 1024, u // 1024))
|
|
PY
|