Driver decisions (cards BUILD-OUTPUT-IS-ONE-FOLDER, BUILD-PLUGIN-STUDIO-IS-THE-OUTPUT-FRONT-PAGE).
- public/ holds only <tree>/ and a generated README.md. The build no longer writes public/index.html,
public/assets/ or public/__gallery/; `rm -rf public && bun run build` recreates exactly these two.
- The Plugin Studio is <tree>/index.html (tree-base "."), replacing the staging-forge chooser; nothing
is written above the tree. check:staging-lang, which tested that chooser, is retired with it.
- Assets are gathered in a temp directory and the fetched allowlist staged into <tree>/assets/ as
before. fonts/, images/, brand/ and legacy/ existed ONLY in public/assets: they are sources and move
to data/ (git mv). Poster previews keep their tracked sources in plugin-designs/*/assets/previews
(all 378 verified present).
- __gallery/ is archived out of public/ (a copy kept in the umbrella's _qa-cycle/archive) and out of
the build; generate-gallery renders only on request, into a directory you name, never public/.
- Native shells load the output folder: capacitor webDir public/<tree> (cap copy needs an index.html
there), Tauri frontendDist + window url relative to it. internal/sync-app-shells.mjs keeps both in
step with the tree's name on every build, so the coming rename stays one config line; the Capacitor
start page resolves its leaf tree-relative.
- dropin.include now lists only extras (README.md): the tree is always shipped and never named twice;
excludes are tree-relative ({tree}/...). clean.mjs removes the old root entries from existing
checkouts; the build lock and public/.gitignore's rules move out of public/.
- check:wp-embed read the BUILT manifest from gates:pre, before the build, so a from-scratch build
could never pass; it runs in gates:post and reads the tree name from config.
- Stale bundles refreshed by the clean build (key-cities, template-bundle, wall-of-people-groups);
the CLI doc's quoted scripts re-synced; capability exemplars regenerated; the '#' note leaves
check:stale-sweep-claim's command (it was already in //scripts).
Proof: rm -rf public && bun run build -> public/ = README.md + doxa-maps/; check:sri, check:drop,
check:parse, check:public-hygiene, check:quoted-scripts, check:capability-exemplars PASS; all 57 pages
(the front page + 56 leaves) mount under /doxa-maps/ on this tree. check:facet-cascade is red as on main.
75 lines
3.8 KiB
HTML
75 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>legacy map host</title>
|
|
<style>html,body{margin:0;height:100%;background:#f3f3f1}.host{position:fixed;inset:0}</style>
|
|
</head>
|
|
<body>
|
|
<div class="host" id="host"></div>
|
|
<script>
|
|
// Sandboxed host for the LEGACY upg-neighbor IIFE (pre-bundler architecture). This page runs
|
|
// inside an IFRAME so the old engine and its dependencies cannot collide with the modern
|
|
// bundles -- the isolation pattern the roundup mandates ("add without breaking doxa-maps").
|
|
var q = new URLSearchParams(location.search);
|
|
var el = (q.get('el') || 'send-map').replace(/[^a-z0-9-]/g, '');
|
|
var tk = q.get('tk') || '';
|
|
// Token globals the legacy build may read.
|
|
window.MAPBOX_TOKEN = tk; window.MAP_TOKEN = tk; window.UPG_TOKEN = tk;
|
|
// The legacy code fetches relative "/api/people-groups/..." which only resolved on its old
|
|
// origin. Shim fetch so those calls reach the live API from ANY host (static tree, iframe).
|
|
var API = 'https://pray.doxa.life';
|
|
// The cockpit profile fails closed without a configured API base and names this global in
|
|
// its own error banner (measured: "No API base configured (apiBase / window.MAP_APP_API_URL
|
|
// / VITE_API_BASE_URL) -- failing closed").
|
|
window.MAP_APP_API_URL = API;
|
|
var origFetch = window.fetch.bind(window);
|
|
window.fetch = function (input, init) {
|
|
try {
|
|
var url = typeof input === 'string' ? input : (input && input.url) || '';
|
|
if (url.indexOf('/api/') === 0) return origFetch(API + url, init);
|
|
} catch (e) { /* fall through */ }
|
|
return origFetch(input, init);
|
|
};
|
|
// ── KEYLESS SHIM ──────────────────────────────────────────────────────────
|
|
// The legacy bundle expects a mapboxgl GLOBAL and requests mapbox://styles/mapbox/light-v11.
|
|
// MapLibre is API-compatible with the mapbox-gl v1 surface the bundle uses, and OpenFreeMap
|
|
// Positron is the keyless twin of light-v11 -- so the shim below makes every legacy map run
|
|
// WITHOUT a Mapbox token: load our self-hosted MapLibre, alias it as mapboxgl, and rewrite
|
|
// any mapbox:// style to the keyless URL inside a patched Map constructor.
|
|
var KEYLESS_STYLE = 'https://tiles.openfreemap.org/styles/positron';
|
|
var lib = document.createElement('link'); lib.rel='stylesheet'; lib.href='./maplibre-gl.css';
|
|
document.head.appendChild(lib);
|
|
var ml = document.createElement('script');
|
|
ml.src = './maplibre-gl.js';
|
|
ml.onload = function () {
|
|
var Real = window.maplibregl.Map;
|
|
function PatchedMap (opts) {
|
|
if (opts && typeof opts.style === 'string' && opts.style.indexOf('mapbox://') === 0) opts.style = KEYLESS_STYLE;
|
|
return new Real(opts);
|
|
}
|
|
PatchedMap.prototype = Real.prototype;
|
|
window.mapboxgl = Object.assign({}, window.maplibregl, { Map: PatchedMap, accessToken: '' });
|
|
loadLegacy();
|
|
};
|
|
ml.onerror = function () { loadLegacy(); };
|
|
document.head.appendChild(ml);
|
|
|
|
function loadLegacy () {
|
|
var s = document.createElement('script');
|
|
s.src = './upg-neighbor.iife.js';
|
|
s.onload = function () {
|
|
var node = document.createElement(el);
|
|
node.style.cssText = 'display:block;width:100%;height:100%';
|
|
// The legacy elements use the SAME profile-config attribute contract as the modern
|
|
// bundles (measured: without it the element renders its own usage banner).
|
|
node.setAttribute('profile-config', JSON.stringify({ profile: el, tk: tk }));
|
|
document.getElementById('host').appendChild(node);
|
|
};
|
|
s.onerror = function () { document.body.innerHTML = '<p style="font:14px system-ui;padding:20px">legacy bundle failed to load</p>'; };
|
|
document.head.appendChild(s);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|