The served generator was run by importing its VERIFIED text from a blob: URL, which fails closed on a partner page whose Content-Security-Policy forbids blob: scripts: safe, but no generated sheet there (dx-shepherd's FIX-POSTER-RENDER-LOAD-WITHOUT-BLOB-FOR-STRICT-CSP). The tree now also serves a CLASSIC-SCRIPT copy, lib/poster-render.global.js: the same file under a mechanical transform (strict mode kept; the one export becomes window.DoxaPosterRender), written by generate-tree with the function the pin is computed from (globalVariant, pin-poster-render.mjs) and on its served allowlist — produced by regenerating the tree, not copied in by hand. posterSheets keeps the proven path first; only when the blob import itself is refused does it load the classic copy with <script integrity=sha384-…>, so the browser verifies it natively. An integrity FAILURE never falls back: it throws before any import is tried. check:poster-render-pinned adds: the classic copy matches its pin and the served copy, and — run as a real classic script — draws the module's sheet byte for byte. The <script> path under a strict policy needs a browser (rega). country-posters 1,473,964 bytes (ceiling 1,500,000); verify-bundles-shipped PASS; gates:pre 74/74. |
||
|---|---|---|
| .. | ||
| data | ||
| fixtures | ||
| snapshots | ||
| build-gallery.mjs | ||
| build-hd-gallery.mjs | ||
| emit-countries.mjs | ||
| export-public.mjs | ||
| generate.mjs | ||
| make-previews.py | ||
| osm-basemap.mjs | ||
| packet-strings.json | ||
| packet.mjs | ||
| pin-poster-render.mjs | ||
| poster-regions.mjs | ||
| publish-html.mjs | ||
| README.md | ||
| series.json | ||
| serve-persist.sh | ||
| serve.sh | ||
| shoot.mjs | ||
| verify-posters.mjs | ||
library/scripts/posters/ — UPG-100 poster generator
Renders one 3ft × 3ft print poster per zone (28 today) for the my-upg-100-list profile, from the profile's own data. It ships inside the repo alongside that data on purpose — reaching for the data via an env var once silently rendered stale posters (Nepal, Bangladesh, Bhutan vanished).
bun run posters -> posters:shoot -> (WebP previews) -> bun run build
HTML per zone PNG @3000² assets/previews/ app shows them
generate.mjsis the template;shoot.mjsscreenshots to PNG (Firefox only — privacy-first policy).- A template change is not visible in the app until previews are regenerated and the app rebuilt.
- Exported PNGs go to a sibling folder (
../../../upg-100-posters/), neverpublic/— Capacitor packagespublic/wholesale. snapshots/holds frozen template versions (v5 is the approved current); each has its own README.
Full reference — files, env vars, gotchas, measurement discipline: ../../../documentation/architecture/poster-generation.md.