Export gate reads the tree name from the build config
After the dx-maps rename, its public/doxa-maps literal made it SKIP (exit 2) without measuring. Validated against its baseline on the renamed tree: 4/4 one-click exports, 1700x2200 PNGs, 0 errors, as before the rename. Also: usage examples and present-tense comments in the gallery and planner name /dx-maps/ or the configured tree; both bundles rebuild byte-identical.
This commit is contained in:
parent
9006a8eabd
commit
b862c7d61a
6 changed files with 12 additions and 9 deletions
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 */ }
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue