Reported from a laptop running `bun run dev`: under the Plugin Studio, maps drew with no boundary polygons and UPG-100 had no posters. The built tree was fine, and every gate measured the built tree. Cause: a dev leaf page is /__leaf/<bundle>/<profile>. A plugin that falls back to the page-relative './assets' asked for /__leaf/<bundle>/assets/…, and the leaf route answered with its own HTML at HTTP 200, so JSON.parse failed and the map drew without our data. /<tree>/assets/ was not served in dev at all. The built leaf never hits this because its page passes assetsBase "../../assets". - dev-plugin serves the pool at /__leaf/…/assets/ and /<tree>/assets/ too, and the dev leaf page passes assetsBase "/assets" in its profile-config, as the built leaf passes its own. - resolveAssetsBase's last rung is '/assets' under the dev server (import.meta.env.DEV, false in every build); the built tree keeps './assets'. - check:dev-assets (headless): starts a short-lived dev server for this checkout, requires boundaries/previews/fonts/images/tables to answer 200 and not HTML at every prefix a dev page can produce, and requires the dev leaf to carry the root-absolute assetsBase. It fails on the parent commit (4 prefixes and both leaves) and passes here. |
||
|---|---|---|
| .. | ||
| api | ||
| colors | ||
| components | ||
| composables | ||
| constants | ||
| data | ||
| i18n | ||
| layouts | ||
| maps | ||
| packet | ||
| scripts | ||
| stores | ||
| styles | ||
| utils | ||
| index.js | ||
| ProfileLoader.vue | ||
| README.md | ||
library/ (@map) — the shared map template
The other half of the architecture (see ../plugin-designs/README.md):
every map in plugin-designs/<your-map>/ composes the reusable, parameterized pieces that live here.
Fix something here and every map benefits on the next build; break something here and every map
breaks — read components/WARNING.md before touching shared pieces.
| Folder | What lives there |
|---|---|
ProfileLoader.vue |
The root of every bundle: parses profile-config, loads the profile, provides the stores + config |
components/ |
Shared UI — map, legends, controls, popup (PeopleGroupDetail), tables, charts, hints (README) |
composables/ |
Shared logic — map engine (useMapInstance), provider switch, shadow-DOM styles, theming |
stores/ |
Per-instance Pinia stores (ui / map / data) — provided by ProfileLoader, injected by children |
api/ |
Data-source registry (sources.json) + fetch layer — the JAMstack runtime wiring |
colors/ |
Color sets maps opt into via profile-config.colorSet |
i18n/ |
The shared string catalogs (all maps speak the same languages) |
data/ |
Small shared datasets baked at build time (big served data lives in ../data/) |
constants/ |
Shared constants |
scripts/ |
Maintainer pipelines (posters, research) — not part of any bundle |
The rule of thumb (same as WARNING.md): custom code in your app-profile, reusable code here — and things only move from the first to the second once they've earned it.