release: WRNexusJS 0.5.14

This commit is contained in:
2026-07-30 21:29:25 +05:30
parent 9dffe83f32
commit 358a520bc5
123 changed files with 11646 additions and 461 deletions
@@ -1,5 +1,5 @@
import { expect, test } from "bun:test";
import { collectScripts } from "../src/runtime.ts";
import { HMR_CLIENT_JS, collectScripts } from "../src/runtime.ts";
test("accent controls load the shared theme runtime", () => {
expect(collectScripts('<button data-wire-accent-set="rose">Rose</button>')).toContain(
@@ -12,3 +12,17 @@ test("accent clear controls load the shared theme runtime", () => {
"/__wrnexus/theme.js",
);
});
test("HMR preserves the active browser theme and accent", () => {
expect(HMR_CLIENT_JS).not.toContain('["data-theme", "data-accent", "lang"]');
expect(HMR_CLIENT_JS).not.toContain("document.documentElement.setAttribute(name, value)");
expect(HMR_CLIENT_JS).toMatch(/var nextLang\s*=\s*doc\.documentElement\.getAttribute\("lang"\)/);
expect(HMR_CLIENT_JS).toMatch(/typeof\s+window\.wireTheme\.bind\s*===\s*"function"/);
expect(HMR_CLIENT_JS).toMatch(/window\.wireTheme\.bind\(document\)/);
expect(HMR_CLIENT_JS).toContain('new CustomEvent("wrnexus:hmr-updated"');
});