Side-effect-only module that registers Chart.js, D3.js, and Papa Parse on globalThis at module evaluation time.
The CIA dashboard modules (src/browser/cia/visualizations.ts etc.) capture globalThis.Chart at module-init time via const Chart = (globalThis as ...).Chart. Because ECMAScript module imports are hoisted, importing this bootstrap module FIRST in cia-entry.ts guarantees the globals exist before downstream modules evaluate. Without this, Chart would be captured as undefined and every chart on dashboard/index*.html would silently fail.
The dedicated bootstrap module exists (rather than calling registerBrowserGlobals() from register-globals.ts itself or from the cia-entry.ts body) so that:
register-globals.ts remains a pure exports-only module โ the cia-dashboard-entry-contract.test.ts contract forbids top-level side effects there for tree-shaking integrity.
The static (non-dynamic) import graph is preserved so Vite emits the canonical styles-*.css asset chunk that the static-pages-emit plugin expects.
Security
No inline scripts โ programmatic global registration only.
Description
Side-effect-only module that registers Chart.js, D3.js, and Papa Parse on
globalThisat module evaluation time.The CIA dashboard modules (
src/browser/cia/visualizations.tsetc.) captureglobalThis.Chartat module-init time viaconst Chart = (globalThis as ...).Chart. Because ECMAScript module imports are hoisted, importing this bootstrap module FIRST incia-entry.tsguarantees the globals exist before downstream modules evaluate. Without this,Chartwould be captured asundefinedand every chart ondashboard/index*.htmlwould silently fail.The dedicated bootstrap module exists (rather than calling
registerBrowserGlobals()fromregister-globals.tsitself or from thecia-entry.tsbody) so that:register-globals.tsremains a pure exports-only module โ thecia-dashboard-entry-contract.test.tscontract forbids top-level side effects there for tree-shaking integrity.styles-*.cssasset chunk that thestatic-pages-emitplugin expects.Security
No inline scripts โ programmatic global registration only.