fix: CI — i18n importable en Node + mistune >=3.3.4 (BUG-128, BUG-129)
BUG-129 : les exports globaux de i18n.js sont protégés par typeof window pour que desktop-roots.test.mjs (Node sans JSDOM) ne casse plus. BUG-128 : mistune 3.3.3 -> >=3.3.4 (CVE-2026-97698/97699), plancher ajouté au garde-fou pip-audit.
This commit is contained in:
+10
-5
@@ -158,11 +158,16 @@ async function _loadLocaleStrings(locale) {
|
||||
}
|
||||
|
||||
// ── Global exports for non-module scripts (legacy app.js) ──────────────────
|
||||
window.t = t;
|
||||
window.tr = tr;
|
||||
window.getLocale = getLocale;
|
||||
window.setLocale = setLocale;
|
||||
window.initI18n = initI18n;
|
||||
// Guarded so the module can also be imported in Node (JSDOM-less unit tests)
|
||||
// without a browser global: desktop.js/auth.js import i18n.js and must stay
|
||||
// loadable in `node tests/frontend/desktop-roots.test.mjs`.
|
||||
if (typeof window !== "undefined") {
|
||||
window.t = t;
|
||||
window.tr = tr;
|
||||
window.getLocale = getLocale;
|
||||
window.setLocale = setLocale;
|
||||
window.initI18n = initI18n;
|
||||
}
|
||||
|
||||
/** Walk the DOM and update every element with a data-i18n* attribute. */
|
||||
function _applyDOM() {
|
||||
|
||||
Reference in New Issue
Block a user