@scriptonita/chess-football-ui 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,6 +35,27 @@ npm install @scriptonita/chess-football-ui
35
35
  (`bg-bg-surface`, `text-accent-green`, …). Each app must define those tokens and include this
36
36
  package's files in its Tailwind `content`/`@source` scan so the classes are generated.
37
37
 
38
+ ## Host app contract
39
+
40
+ Two things the package cannot enforce at build time and every consumer must check:
41
+
42
+ **1. Translation coverage.** `GAME_I18N_KEYS` is the manifest of every `game`-namespace key
43
+ the components read. Assert it in each app's test suite — without this, a key added here
44
+ surfaces as raw text on the pitch (`⚠ game.offsideWarning`) instead of failing CI:
45
+
46
+ ```ts
47
+ import { GAME_I18N_KEYS } from '@scriptonita/chess-football-ui'
48
+ import es from './messages/es.json'
49
+
50
+ const missing = GAME_I18N_KEYS.filter(k => !k.split('.').reduce<any>((o, p) => o?.[p], es.game))
51
+ expect(missing).toEqual([])
52
+ ```
53
+
54
+ **2. Design tokens.** Components emit Tailwind classes bound to tokens the app defines. A
55
+ token that is missing fails silently — the rule simply does not apply. The board's
56
+ `--last-move-highlight`, `--move-highlight`, `--pass-highlight`, `--accent-green`,
57
+ `--accent-green-light` and `--accent-green-dark` are all required.
58
+
38
59
  ## Peer dependencies
39
60
 
40
61
  `react`, `react-dom`, `framer-motion`, `lucide-react`.