Merge main into bundler-2/work

This commit is contained in:
doxa-maps-88655c70 2026-09-25 21:47:37 +00:00
commit c14967e890
10 changed files with 18 additions and 15 deletions

View file

@ -31,7 +31,7 @@
* 4. zero failed requests to the TREE's own origin (a 404/CORS on our assets is our bug; third-
* party tile/glyph hiccups are reported, not failed — they are not this repo's to fix).
*
* PRECONDITION: a built tree in public/doxa-maps (this starts its own servers; no dev server).
* PRECONDITION: a built tree in public/<tree> (named in the build config; this starts its own servers; no dev server).
* Usage: node internal/check-research-gallery-embed.mjs [--mode js|iframe] [--only id,id] [--provider maplibre]
* Exit: 0 pass · 1 fail · 2 SKIP (no built tree / no browser) · 75 NOT MEASURED (server identity)
*/

View file

@ -1112,7 +1112,7 @@ export default defineComponent({
// TWO CANDIDATES, because the shell runs in two trees that put the manifest in different
// places. The built tree has it beside the bundle folders (resolve() → <base>/manifest.json).
// The dev tree serves SOURCE from /plugin-designs/, where no manifest exists — it is a BUILD
// ARTIFACT and lives under /public/doxa-maps/. Trying the built-tree path second means a dev
// ARTIFACT and lives under /public/<tree>/ (the build config names the tree). Trying the built-tree path second means a dev
// run finds the real manifest instead of going dark, and a production run is unchanged
// (candidate 1 answers, candidate 2 is never requested).
loadManifest() {
@ -1270,7 +1270,7 @@ export default defineComponent({
// Every scriptUrl comes out of manifest.json as a tree-relative path ("<bundle>/<bundle>.js"),
// so it is only meaningful against the root the MANIFEST was read from. Those two roots are
// the same in the built tree and DIFFERENT under the dev server, where the page is served
// from /plugin-designs/ while the manifest lives at /public/doxa-maps/. Resolving against the
// from /plugin-designs/ while the manifest lives at /public/<tree>/. Resolving against the
// document there produced 404 /plugin-designs/research-map-plus-grid/research-map-plus-grid.js
// — a path that exists nowhere. Anchoring on the manifest's own directory makes one rule
// correct for both trees (in the built tree manifestBase === base, so nothing changes).

View file

@ -22,7 +22,7 @@
* or profile-config.treeBase.
*
* Usage from a host page (direct-JS, deploy-method-3):
* <script src="/doxa-maps/doxa-maps-spa/doxa-maps-spa.js"></script>
* <script src="/dx-maps/doxa-maps-spa/doxa-maps-spa.js"></script>
* <doxa-maps-spa></doxa-maps-spa>
* <!-- or pin the tree explicitly: -->
* <doxa-maps-spa tree-base="https://your-host/doxa-maps"></doxa-maps-spa>

View file

@ -31,7 +31,10 @@ import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..', '..')
if (!existsSync(resolve(ROOT, 'public/doxa-maps/research-map-plus-grid/research-map-plus-grid.js'))) {
// The tree's name comes from the build config, never a literal: the doxa-maps -> dx-maps rename
// turned the literal into a silent SKIP (exit 2) that measured nothing.
const { TREE_NAME } = await import(resolve(ROOT, 'internal/_tree-name.mjs'))
if (!existsSync(resolve(ROOT, `public/${TREE_NAME}/research-map-plus-grid/research-map-plus-grid.js`))) {
console.log('SKIP check-export-one-click: no built research-map-plus-grid'); process.exit(2)
}
let chromium
@ -40,7 +43,7 @@ try { ({ chromium } = await import('playwright')) } catch { console.log('SKIP ch
const freePort = () => new Promise(ok => { const s = createServer().listen(0, '127.0.0.1', () => { const p = s.address().port; s.close(() => ok(p)) }) })
const PROVIDER = process.argv.includes('--provider') ? process.argv[process.argv.indexOf('--provider') + 1] : '' // maplibre = the keyless engine
const TP = await freePort(), HP = await freePort()
const TREE = `http://127.0.0.1:${TP}/doxa-maps`
const TREE = `http://127.0.0.1:${TP}/${TREE_NAME}`
let lang = 'en'
const srv = spawn(process.execPath, ['internal/serve-strict.mjs', '--port', String(TP)], { cwd: ROOT, stdio: 'ignore' })
const host = createServer((_, r) => { r.writeHead(200, { 'content-type': 'text/html' }); r.end(`<!doctype html><html lang="${lang}"><body style="margin:0"><script src="${TREE}/doxa-maps-spa/doxa-maps-spa.js"></script><doxa-maps-spa tab="research-map-plus-grid"${PROVIDER ? ` provider="${PROVIDER}"` : ''} style="height:900px"></doxa-maps-spa></body></html>`) }).listen(HP, 'localhost')
@ -49,7 +52,7 @@ await new Promise(r => setTimeout(r, 800))
// Server identity by CONTENT: the served manifest must be this checkout's.
{
const disk = readFileSync(resolve(ROOT, 'public/doxa-maps/manifest.json'), 'utf8')
const disk = readFileSync(resolve(ROOT, `public/${TREE_NAME}/manifest.json`), 'utf8')
let served = ''
for (let i = 0; i < 20 && !served; i++) {
try { const r = await fetch(`${TREE}/manifest.json`); if (r.ok) served = await r.text() } catch { /* not up yet */ }

View file

@ -24,7 +24,7 @@
<prayer-walk-planner instance-id="staging"></prayer-walk-planner>
<!-- Vite multi-page entry. In dev, served transformed; in build, Vite emits
../../../public/doxa-maps/prayer-walk-planner/prayer-walk-planner.js and rewrites this script tag. -->
../../../public/<tree>/prayer-walk-planner/prayer-walk-planner.js (the tree is named in the build config) and rewrites this script tag. -->
<script type="module" src="./index.js"></script>
</body>
</html>

View file

@ -4,7 +4,7 @@
* Bundle entry for PRAYER WALK PLANNER — an experimental capability-1 plugin.
*
* Usage from a host page:
* <script src="/doxa-maps/prayer-walk-planner/prayer-walk-planner.js"></script>
* <script src="/dx-maps/prayer-walk-planner/prayer-walk-planner.js"></script>
* <prayer-walk-planner></prayer-walk-planner>
*
* ★ MOUNTS THE ROOT SFC DIRECTLY — no ProfileLoader. Same choice golden-path-check and

View file

@ -863,7 +863,7 @@
"bundle": "prayer-walk-planner",
"scriptUrl": "./prayer-walk-planner/prayer-walk-planner.js",
"output": "dx-maps/prayer-walk-planner/prayer-walk-planner.js",
"integrity": "sha384-ouqzKWsU1HZgAWpi5z/RbyiVwAeaG6pXcYHia/Wo71KZDYgVgY1YwyRwvyC/Yg03",
"integrity": "sha384-R/ybjDe8VDmUbk7hl3Q6KApwLKwSs/8/zkzQVASWM9EpT5TwJpCxoLS33GSV9F8u",
"elements": [
"prayer-walk-planner"
],
@ -879,7 +879,7 @@
"scriptUrl": "./prayer-walk-planner/prayer-walk-planner.js",
"embed": {
"iframe": "<iframe src=\"./prayer-walk-planner/prayer-walk-planner/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
"script": "<!-- Mapbox engine, fetched early; remove this line if you set \"provider\":\"maplibre\" -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./prayer-walk-planner/prayer-walk-planner.js\" integrity=\"sha384-ouqzKWsU1HZgAWpi5z/RbyiVwAeaG6pXcYHia/Wo71KZDYgVgY1YwyRwvyC/Yg03\" crossorigin=\"anonymous\"></script>\n<prayer-walk-planner profile-config='{\"profile\":\"prayer-walk-planner\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></prayer-walk-planner>"
"script": "<!-- Mapbox engine, fetched early; remove this line if you set \"provider\":\"maplibre\" -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./prayer-walk-planner/prayer-walk-planner.js\" integrity=\"sha384-R/ybjDe8VDmUbk7hl3Q6KApwLKwSs/8/zkzQVASWM9EpT5TwJpCxoLS33GSV9F8u\" crossorigin=\"anonymous\"></script>\n<prayer-walk-planner profile-config='{\"profile\":\"prayer-walk-planner\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></prayer-walk-planner>"
}
}
]

View file

@ -863,7 +863,7 @@
"bundle": "prayer-walk-planner",
"scriptUrl": "./prayer-walk-planner/prayer-walk-planner.js",
"output": "dx-maps/prayer-walk-planner/prayer-walk-planner.js",
"integrity": "sha384-ouqzKWsU1HZgAWpi5z/RbyiVwAeaG6pXcYHia/Wo71KZDYgVgY1YwyRwvyC/Yg03",
"integrity": "sha384-R/ybjDe8VDmUbk7hl3Q6KApwLKwSs/8/zkzQVASWM9EpT5TwJpCxoLS33GSV9F8u",
"elements": [
"prayer-walk-planner"
],
@ -879,7 +879,7 @@
"scriptUrl": "./prayer-walk-planner/prayer-walk-planner.js",
"embed": {
"iframe": "<iframe src=\"./prayer-walk-planner/prayer-walk-planner/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
"script": "<!-- Mapbox engine, fetched early; remove this line if you set \"provider\":\"maplibre\" -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./prayer-walk-planner/prayer-walk-planner.js\" integrity=\"sha384-ouqzKWsU1HZgAWpi5z/RbyiVwAeaG6pXcYHia/Wo71KZDYgVgY1YwyRwvyC/Yg03\" crossorigin=\"anonymous\"></script>\n<prayer-walk-planner profile-config='{\"profile\":\"prayer-walk-planner\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></prayer-walk-planner>"
"script": "<!-- Mapbox engine, fetched early; remove this line if you set \"provider\":\"maplibre\" -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./prayer-walk-planner/prayer-walk-planner.js\" integrity=\"sha384-R/ybjDe8VDmUbk7hl3Q6KApwLKwSs/8/zkzQVASWM9EpT5TwJpCxoLS33GSV9F8u\" crossorigin=\"anonymous\"></script>\n<prayer-walk-planner profile-config='{\"profile\":\"prayer-walk-planner\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></prayer-walk-planner>"
}
}
]

File diff suppressed because one or more lines are too long

View file

@ -29,7 +29,7 @@
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
<!-- Bundle IIFE — registers the <prayer-walk-planner> custom element. -->
<script src="../prayer-walk-planner.js" integrity="sha384-ouqzKWsU1HZgAWpi5z/RbyiVwAeaG6pXcYHia/Wo71KZDYgVgY1YwyRwvyC/Yg03" crossorigin="anonymous"></script>
<script src="../prayer-walk-planner.js" integrity="sha384-R/ybjDe8VDmUbk7hl3Q6KApwLKwSs/8/zkzQVASWM9EpT5TwJpCxoLS33GSV9F8u" crossorigin="anonymous"></script>
<script>
// Mapbox token resolution — the A3 ladder, in precedence order: