From 5e81b05281f17d180e42020eb3eb8550ebdcc9dd Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Tue, 29 Sep 2026 08:58:30 +0000 Subject: [PATCH] check:no-free-identifiers reads internal/ and .mjs, which is where two gates had crashed on load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A commit on 09-25 gave some 30 browser gates `const ROOT = …(_fileURLToPath(…))`. Two never imported it, and crashed with a ReferenceError the moment they loaded: check-legend-info-localized (found by hand after four days, fixed this morning) and library/scripts/posters/verify-posters.mjs, found now by this change and fixed here. Both run only by hand, so nothing noticed. The gate read only .vue and .js under plugin-designs/ and library/. It now reads .mjs as well, and internal/. Scanning them surfaced standard globals the list lacked (eval, EvalError, Bun, and the window members that page.evaluate() callbacks use), which are added. A file tagged @one-shot is skipped: it is kept as a reproduction recipe, not run. --- library/scripts/posters/verify-posters.mjs | 2 +- .../scripts/check-no-free-identifiers.mjs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/library/scripts/posters/verify-posters.mjs b/library/scripts/posters/verify-posters.mjs index f0ade270b..b9e15eadc 100644 --- a/library/scripts/posters/verify-posters.mjs +++ b/library/scripts/posters/verify-posters.mjs @@ -32,7 +32,7 @@ import { resolve as _resolvePath, dirname as _dirnamePath } from 'node:path' const __dirname = dirname(fileURLToPath(import.meta.url)); const DIR = process.env.POSTER_DIR || join(__dirname, 'out', 'posters'); const PREFIX = process.argv[2] || ''; -const ROOT = _resolvePath(_dirnamePath(_fileURLToPath(import.meta.url)), '../../..') +const ROOT = _resolvePath(_dirnamePath(fileURLToPath(import.meta.url)), '../../..') // ★ MEASURE THIS BUILD, OR MEASURE NOTHING. Several worktrees run on one machine and a default port // belongs to whichever server started first — measured 2026-09-24 on :4173, where browser gates diff --git a/plugin-designs/research-map-plus-grid/scripts/check-no-free-identifiers.mjs b/plugin-designs/research-map-plus-grid/scripts/check-no-free-identifiers.mjs index f660282c2..6d95926e3 100644 --- a/plugin-designs/research-map-plus-grid/scripts/check-no-free-identifiers.mjs +++ b/plugin-designs/research-map-plus-grid/scripts/check-no-free-identifiers.mjs @@ -38,7 +38,10 @@ import * as acorn from 'acorn' const TAG = 'NO-FREE-IDENTIFIERS' const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..', '..') -const ROOTS = ['plugin-designs', 'library'] +// internal/ too, and .mjs files (below): 30 browser gates gained `const ROOT = …(_fileURLToPath(…))` in one +// commit, and the two that never imported it crashed on load for four days, because they run only by hand. +// A free identifier at module scope is the same defect in a Node script as in an SFC. +const ROOTS = ['plugin-designs', 'library', 'internal'] // Vue's