/** * Theme Inheritance Validator * * Guards the one rule that makes a *variant* theme a variant rather than a * fork: it carries colors and nothing else. * * A variant theme (declared in `THEME_PARENTS` in * `packages/eddie-design-tokens/themes.js`) compiles as * `core` → `` → ``. Style Dictionary deep-merges sources in * that order, so the variant's directory only needs the tokens it actually * changes — for a dark mode, that is the color files and a handful of tier-3 * component color overrides. Its type scale, shadow geometry, borders and * motion come from the parent, automatically, forever. * * The moment someone authors a `typography.*` or `shadow.*` token into the * variant's directory, that inheritance link is severed for that token and it * starts rotting. This is not hypothetical: `bfw-dark` began as a full copy of * `bfw` and was maintained by hand, so it silently kept whatever `bfw` looked * like the day it was forked. By the time anyone looked it was 25 typography * tokens behind — no lowercase display type, buttons at 16px Montserrat * instead of 24px League Gothic, no fluid body clamps — and had lost * `box-shadow-bold` entirely, which (an unresolved custom property invalidates * the *whole* declaration) meant every element using it rendered with no * shadow rather than a fallback one. Switching a site to dark mode showed the * design system as it had looked months earlier. * * Scope: Style Dictionary token JSON under a theme directory * (`/tier-1-definitions/*.json`, `tier-2-usage`, `tier-3-components`). * Files outside a variant theme's directory are ignored entirely, so this * costs nothing on the common path. * * The repo-level gate `npm run check:theme-inheritance` enforces the same rule * across the whole token source at once. This validator is the per-file half: * it fires while an agent is editing, before the commit that CI would reject. */ import type { HealthIssue } from '../types.js'; export declare class ThemeInheritanceValidator { /** * Validate a single token JSON file. Returns an empty array for anything * that is not token source inside a variant theme's directory. */ validateFile(filePath: string): Promise; } //# sourceMappingURL=theme-inheritance-validator.d.ts.map