| 1 | import { readFileSync } from "node:fs"; |
| 2 | |
| 3 | const styles = readFileSync(new URL("../styles.css", import.meta.url), "utf8"); |
| 4 | const packageJSON = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")); |
| 5 | |
| 6 | const boxedRule = styles.match(/\.md\s+\.katex\s+\.fbox\s*\{([^}]*)\}/s)?.[1] ?? ""; |
| 7 | if (!/width:\s*100%\s*;/.test(boxedRule)) { |
| 8 | throw new Error("KaTeX boxed frame must keep a standards-compatible width fallback"); |
| 9 | } |
| 10 | if (!/width:\s*-webkit-fill-available\s*;/.test(boxedRule)) { |
| 11 | throw new Error("KaTeX boxed frame must fill the containing row in WebKit"); |
| 12 | } |
| 13 | if (packageJSON.packageManager !== "pnpm@10.34.5") { |
| 14 | throw new Error(`frontend package manager pin drifted: ${packageJSON.packageManager ?? "missing"}`); |
| 15 | } |
| 16 | |
| 17 | console.log("katex boxed CSS/package contract: PASS"); |
| 18 |