37 lines
853 B
JavaScript
37 lines
853 B
JavaScript
import { readFileSync } from "node:fs";
|
|
|
|
const main = readFileSync("src/styles/main.css", "utf8");
|
|
const unified = readFileSync("src/styles/unified-page.css", "utf8");
|
|
|
|
const requiredMainTokens = [
|
|
"--ctms-primary",
|
|
"--ctms-text-main",
|
|
"--ctms-bg-base",
|
|
"--ctms-radius",
|
|
"--ctms-shadow",
|
|
"--ctms-brand-900",
|
|
"--ctms-brand-700",
|
|
"--ctms-neutral-100",
|
|
"--ctms-neutral-300",
|
|
"--ctms-focus-ring"
|
|
];
|
|
|
|
const requiredUnifiedTokens = [
|
|
"--unified-shell-bg",
|
|
"--unified-shell-radius",
|
|
".unified-action-bar",
|
|
".unified-section"
|
|
];
|
|
|
|
const missing = [
|
|
...requiredMainTokens.filter((t) => !main.includes(t)),
|
|
...requiredUnifiedTokens.filter((t) => !unified.includes(t))
|
|
];
|
|
|
|
if (missing.length) {
|
|
console.error("UI contract check failed. Missing:", missing.join(", "));
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log("UI contract check passed");
|