scrabble-solver 2.18.1 → 2.18.3

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.
Files changed (354) hide show
  1. package/.nx/workspace-data/d/server-process.json +2 -2
  2. package/.nx/workspace-data/file-map.json +1721 -1473
  3. package/.nx/workspace-data/lockfile-dependencies.hash +1 -1
  4. package/.nx/workspace-data/lockfile-nodes.hash +1 -1
  5. package/.nx/workspace-data/nx_files.nxt +0 -0
  6. package/.nx/workspace-data/parsed-lock-file.dependencies.json +184 -209
  7. package/.nx/workspace-data/parsed-lock-file.nodes.json +374 -419
  8. package/.nx/workspace-data/project-graph.json +610 -653
  9. package/.nx/workspace-data/source-maps.json +68 -0
  10. package/CLAUDE.md +13 -11
  11. package/README.md +3 -3
  12. package/bun.lock +115 -130
  13. package/e2e/bugs/398-digraphs-in-created-words.spec.ts +2 -2
  14. package/e2e/bugs/445-tile-text-selection.spec.ts +38 -0
  15. package/e2e/bugs/451-results-list-gap-hover.spec.ts +35 -0
  16. package/e2e/bugs/452-stale-translations-cache.spec.ts +32 -0
  17. package/e2e/features/427-highlight-created-words.spec.ts +86 -0
  18. package/e2e/features/430-highlight-unreachable-cells-results.spec.ts +75 -0
  19. package/e2e/features/91-hover-remaining-tile-highlights.spec.ts +22 -0
  20. package/e2e/features/result-candidate-picker.spec.ts +21 -0
  21. package/e2e/features/results-interactions.spec.ts +170 -0
  22. package/e2e/features/words-dictionary-search.spec.ts +36 -0
  23. package/e2e/features/words-empty-state.spec.ts +42 -0
  24. package/e2e/features/words-interactions.spec.ts +179 -0
  25. package/e2e/features/words-preview.spec.ts +140 -0
  26. package/e2e/features/words-table-filtering.spec.ts +22 -0
  27. package/e2e/features/words-table-sorting.spec.ts +33 -0
  28. package/e2e/lib/actions.ts +76 -6
  29. package/e2e/lib/selectors.ts +40 -3
  30. package/lerna.json +1 -1
  31. package/package.json +10 -10
  32. package/packages/configs/build/games/index.d.ts +1 -0
  33. package/packages/configs/build/games/index.js +1 -0
  34. package/packages/configs/build/games/wyrazy.d.ts +19 -0
  35. package/packages/configs/build/games/wyrazy.js +73 -0
  36. package/packages/configs/build/languages/polish.d.ts +1 -0
  37. package/packages/configs/build/languages/polish.js +39 -1
  38. package/packages/configs/package.json +5 -4
  39. package/packages/configs/src/games/index.ts +1 -0
  40. package/packages/configs/src/games/wyrazy.ts +71 -0
  41. package/packages/configs/src/languages/polish.ts +40 -1
  42. package/packages/constants/package.json +1 -1
  43. package/packages/dictionaries/package.json +4 -4
  44. package/packages/logger/package.json +1 -1
  45. package/packages/logger/scripts/stats.js +52 -31
  46. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  47. package/packages/scrabble-solver/.next/build-manifest.json +14 -14
  48. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -1
  49. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  50. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  51. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  52. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  53. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  54. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  55. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  56. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  57. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  58. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  59. package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
  60. package/packages/scrabble-solver/.next/dynamic-css-manifest.json +2 -2
  61. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  62. package/packages/scrabble-solver/.next/react-loadable-manifest.json +37 -37
  63. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  64. package/packages/scrabble-solver/.next/server/chunks/309.js +1 -1
  65. package/packages/scrabble-solver/.next/server/chunks/344.js +1 -1
  66. package/packages/scrabble-solver/.next/server/chunks/371.js +1 -1
  67. package/packages/scrabble-solver/.next/server/chunks/392.js +1 -1
  68. package/packages/scrabble-solver/.next/server/chunks/465.js +1 -1
  69. package/packages/scrabble-solver/.next/server/chunks/546.js +1 -1
  70. package/packages/scrabble-solver/.next/server/chunks/641.js +1 -1
  71. package/packages/scrabble-solver/.next/server/chunks/67.js +1 -0
  72. package/packages/scrabble-solver/.next/server/chunks/712.js +1 -1
  73. package/packages/scrabble-solver/.next/server/chunks/812.js +1 -1
  74. package/packages/scrabble-solver/.next/server/chunks/846.js +1 -1
  75. package/packages/scrabble-solver/.next/server/chunks/886.js +1 -1
  76. package/packages/scrabble-solver/.next/server/chunks/942.js +1 -0
  77. package/packages/scrabble-solver/.next/server/chunks/953.js +1 -1
  78. package/packages/scrabble-solver/.next/server/chunks/961.js +1 -1
  79. package/packages/scrabble-solver/.next/server/dynamic-css-manifest.js +1 -1
  80. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  81. package/packages/scrabble-solver/.next/server/middleware-react-loadable-manifest.js +1 -1
  82. package/packages/scrabble-solver/.next/server/pages/404.html +3 -3
  83. package/packages/scrabble-solver/.next/server/pages/500.html +3 -3
  84. package/packages/scrabble-solver/.next/server/pages/_app.js +1 -1
  85. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  86. package/packages/scrabble-solver/.next/server/pages/_document.js +2 -2
  87. package/packages/scrabble-solver/.next/server/pages/_document.js.nft.json +1 -1
  88. package/packages/scrabble-solver/.next/server/pages/_error.js +1 -1
  89. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  90. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +1 -1
  91. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  92. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
  93. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  94. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  95. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  96. package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
  97. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  98. package/packages/scrabble-solver/.next/server/pages/index.html +3 -3
  99. package/packages/scrabble-solver/.next/server/pages/index.js +4 -4
  100. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  101. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  102. package/packages/scrabble-solver/.next/server/pages/not-found.html +3 -3
  103. package/packages/scrabble-solver/.next/server/pages/not-found.js.nft.json +1 -1
  104. package/packages/scrabble-solver/.next/server/pages-manifest.json +1 -1
  105. package/packages/scrabble-solver/.next/static/{5KOWzYqfY1Z2rjrzptr8D → 8WnIUTe-yJvPD6stltvYI}/_buildManifest.js +1 -1
  106. package/packages/scrabble-solver/.next/static/chunks/100.305bdf9c75b1758f.js +1 -0
  107. package/packages/scrabble-solver/.next/static/chunks/256.6a20b23a766cfebd.js +1 -0
  108. package/packages/scrabble-solver/.next/static/chunks/{307.67f52f13e3d60d4e.js → 307.89e6100f58443679.js} +1 -1
  109. package/packages/scrabble-solver/.next/static/chunks/{363.01eed3233f92b6a4.js → 363.cec65b1f9668a75e.js} +1 -1
  110. package/packages/scrabble-solver/.next/static/chunks/{422.1559ae6756912ca5.js → 422.3e55b4c94e328701.js} +1 -1
  111. package/packages/scrabble-solver/.next/static/chunks/{663.d2c9ca36b26695b8.js → 663.bd2c45413fbca518.js} +1 -1
  112. package/packages/scrabble-solver/.next/static/chunks/693.677c88e0eb1340b5.js +1 -0
  113. package/packages/scrabble-solver/.next/static/chunks/{820.97b82f751ca49579.js → 820.823e9e885ebb66af.js} +1 -1
  114. package/packages/scrabble-solver/.next/static/chunks/827.c81b92b383a748c9.js +1 -0
  115. package/packages/scrabble-solver/.next/static/chunks/{865.a9b563a45848a83c.js → 865.59baba8296c9b116.js} +1 -1
  116. package/packages/scrabble-solver/.next/static/chunks/912.077603e4f0bc6cca.js +1 -0
  117. package/packages/scrabble-solver/.next/static/chunks/{939.19b33a3d3c351d73.js → 939.2ad86b50405c7897.js} +1 -1
  118. package/packages/scrabble-solver/.next/static/chunks/980.7ce17464fc56648a.js +1 -0
  119. package/packages/scrabble-solver/.next/static/chunks/{main-b92e08f3fc96dd8d.js → main-7e52da35a4beea0b.js} +1 -1
  120. package/packages/scrabble-solver/.next/static/chunks/pages/_app-e3fe880e24c024ab.js +1 -0
  121. package/packages/scrabble-solver/.next/static/chunks/pages/index-b073a1686818dd26.js +1 -0
  122. package/packages/scrabble-solver/.next/static/chunks/webpack-d7138f1ef6b8c9d6.js +1 -0
  123. package/packages/scrabble-solver/.next/static/css/65bcc9440e067113.css +1 -0
  124. package/packages/scrabble-solver/.next/static/css/{4dbcacc1122ac6b9.css → 92f85ce358a0a468.css} +1 -1
  125. package/packages/scrabble-solver/.next/static/css/a691348b788f8bc0.css +1 -0
  126. package/packages/scrabble-solver/.next/static/css/cd4d7f2458487399.css +1 -0
  127. package/packages/scrabble-solver/.next/trace +22 -21
  128. package/packages/scrabble-solver/.next/trace-build +1 -1
  129. package/packages/scrabble-solver/AGENTS.md +9 -0
  130. package/packages/scrabble-solver/CLAUDE.md +1 -0
  131. package/packages/scrabble-solver/package.json +13 -11
  132. package/packages/scrabble-solver/public/llms.txt +1 -1
  133. package/packages/scrabble-solver/public/service-worker.js +1 -1
  134. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -1
  135. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +26 -20
  136. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +4 -4
  137. package/packages/scrabble-solver/src/components/Board/lib.test.ts +106 -0
  138. package/packages/scrabble-solver/src/components/Board/lib.ts +34 -3
  139. package/packages/scrabble-solver/src/components/Board/selectors.ts +17 -5
  140. package/packages/scrabble-solver/src/components/Button/Button.module.scss +1 -1
  141. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +0 -4
  142. package/packages/scrabble-solver/src/components/Results/Header.tsx +30 -5
  143. package/packages/scrabble-solver/src/components/Results/Result.tsx +45 -55
  144. package/packages/scrabble-solver/src/components/Results/Results.module.scss +0 -126
  145. package/packages/scrabble-solver/src/components/Results/Results.module.scss.d.ts +0 -10
  146. package/packages/scrabble-solver/src/components/Results/Results.tsx +25 -5
  147. package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +4 -4
  148. package/packages/scrabble-solver/src/components/Solver/Solver.tsx +5 -3
  149. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +5 -1
  150. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss.d.ts +1 -0
  151. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -2
  152. package/packages/scrabble-solver/src/components/Table/Cell.tsx +42 -0
  153. package/packages/scrabble-solver/src/components/Table/Header.tsx +11 -0
  154. package/packages/scrabble-solver/src/components/{Results → Table}/HeaderButton.tsx +22 -14
  155. package/packages/scrabble-solver/src/components/Table/Row.tsx +59 -0
  156. package/packages/scrabble-solver/src/components/{ResultsInput/ResultsInput.tsx → Table/Search.tsx} +9 -11
  157. package/packages/scrabble-solver/src/components/Table/Table.module.scss +147 -0
  158. package/packages/scrabble-solver/src/components/Table/Table.module.scss.d.ts +19 -0
  159. package/packages/scrabble-solver/src/components/Table/index.ts +5 -0
  160. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +2 -1
  161. package/packages/scrabble-solver/src/hooks/useColumns.ts +7 -5
  162. package/packages/scrabble-solver/src/hooks/useIsCompactLayout.ts +14 -0
  163. package/packages/scrabble-solver/src/i18n/languages/english.json +6 -1
  164. package/packages/scrabble-solver/src/i18n/languages/french.json +6 -1
  165. package/packages/scrabble-solver/src/i18n/languages/german.json +6 -1
  166. package/packages/scrabble-solver/src/i18n/languages/persian.json +6 -1
  167. package/packages/scrabble-solver/src/i18n/languages/polish.json +6 -1
  168. package/packages/scrabble-solver/src/i18n/languages/romanian.json +6 -1
  169. package/packages/scrabble-solver/src/i18n/languages/spanish.json +6 -1
  170. package/packages/scrabble-solver/src/i18n/languages/turkish.json +6 -1
  171. package/packages/scrabble-solver/src/icons/QuestionSquare.svg +5 -0
  172. package/packages/scrabble-solver/src/lib/createCoordinatesComparator.ts +23 -0
  173. package/packages/scrabble-solver/src/lib/createKeyComparator.ts +1 -4
  174. package/packages/scrabble-solver/src/lib/createSortComparator.ts +22 -0
  175. package/packages/scrabble-solver/src/lib/getCoordinates.test.ts +21 -0
  176. package/packages/scrabble-solver/src/lib/getCoordinates.ts +16 -0
  177. package/packages/scrabble-solver/src/lib/getNextSort.ts +12 -0
  178. package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +3 -1
  179. package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +8 -9
  180. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +14 -10
  181. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss +16 -27
  182. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.module.scss.d.ts +3 -6
  183. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +56 -42
  184. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordRow.tsx +92 -0
  185. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss +69 -0
  186. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.module.scss.d.ts +16 -0
  187. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/WordsTable.tsx +137 -0
  188. package/packages/scrabble-solver/src/modals/WordsModal/components/WordsTable/index.ts +1 -0
  189. package/packages/scrabble-solver/src/modals/WordsModal/components/index.ts +1 -0
  190. package/packages/scrabble-solver/src/pages/api/verify.ts +7 -6
  191. package/packages/scrabble-solver/src/pages/index.tsx +29 -4
  192. package/packages/scrabble-solver/src/parameters/index.ts +2 -0
  193. package/packages/scrabble-solver/src/sdk/verify.ts +3 -2
  194. package/packages/scrabble-solver/src/solver-worker/client.test.ts +10 -3
  195. package/packages/scrabble-solver/src/solver-worker/index.worker.ts +7 -7
  196. package/packages/scrabble-solver/src/solver-worker/messages.ts +3 -3
  197. package/packages/scrabble-solver/src/state/hoveredWord/index.ts +4 -0
  198. package/packages/scrabble-solver/src/state/hoveredWord/initialState.ts +5 -0
  199. package/packages/scrabble-solver/src/state/hoveredWord/selectors.ts +5 -0
  200. package/packages/scrabble-solver/src/state/hoveredWord/slice.ts +18 -0
  201. package/packages/scrabble-solver/src/state/hoveredWord/types.ts +5 -0
  202. package/packages/scrabble-solver/src/state/index.ts +1 -0
  203. package/packages/scrabble-solver/src/state/localStorage.ts +13 -2
  204. package/packages/scrabble-solver/src/state/results/lib.ts +9 -26
  205. package/packages/scrabble-solver/src/state/results/selectors.ts +9 -1
  206. package/packages/scrabble-solver/src/state/results/slice.ts +4 -16
  207. package/packages/scrabble-solver/src/state/sagas.ts +26 -1
  208. package/packages/scrabble-solver/src/state/selectors.ts +18 -1
  209. package/packages/scrabble-solver/src/state/store.ts +2 -0
  210. package/packages/scrabble-solver/src/state/types.ts +2 -0
  211. package/packages/scrabble-solver/src/state/verify/initialState.ts +7 -0
  212. package/packages/scrabble-solver/src/state/verify/lib.test.ts +55 -0
  213. package/packages/scrabble-solver/src/state/verify/lib.ts +49 -0
  214. package/packages/scrabble-solver/src/state/verify/selectors.ts +37 -0
  215. package/packages/scrabble-solver/src/state/verify/slice.ts +13 -2
  216. package/packages/scrabble-solver/src/state/verify/types.ts +6 -2
  217. package/packages/scrabble-solver/src/styles/_tokens.scss +2 -0
  218. package/packages/scrabble-solver/src/styles/mixins.scss +5 -0
  219. package/packages/scrabble-solver/src/styles/variables.module.scss +1 -0
  220. package/packages/scrabble-solver/src/styles/variables.module.scss.d.ts +1 -0
  221. package/packages/scrabble-solver/src/styles/variables.scss +1 -1
  222. package/packages/scrabble-solver/src/types/index.ts +24 -11
  223. package/packages/scrabble-solver/tsconfig.tsbuildinfo +1 -1
  224. package/packages/solver/package.json +5 -5
  225. package/packages/types/build/Bingo.d.ts +0 -3
  226. package/packages/types/build/Bingo.js +0 -14
  227. package/packages/types/build/Board.d.ts +3 -1
  228. package/packages/types/build/Board.js +5 -40
  229. package/packages/types/build/BoardJson.d.ts +0 -1
  230. package/packages/types/build/BoardJson.js +0 -19
  231. package/packages/types/build/BoardWord.d.ts +7 -0
  232. package/packages/types/build/BoardWord.js +2 -0
  233. package/packages/types/build/CellJson.d.ts +0 -1
  234. package/packages/types/build/CellJson.js +0 -11
  235. package/packages/types/build/Game.d.ts +2 -2
  236. package/packages/types/build/Game.js +2 -4
  237. package/packages/types/build/Locale.d.ts +0 -1
  238. package/packages/types/build/Locale.js +1 -4
  239. package/packages/types/build/Result.js +3 -3
  240. package/packages/types/build/TileJson.d.ts +0 -1
  241. package/packages/types/build/TileJson.js +0 -6
  242. package/packages/types/build/index.d.ts +9 -8
  243. package/packages/types/build/index.js +14 -17
  244. package/packages/types/build/lib/getBoardWords.d.ts +3 -0
  245. package/packages/types/build/lib/getBoardWords.js +10 -0
  246. package/packages/types/build/lib/getCells.d.ts +4 -0
  247. package/packages/types/build/lib/getCells.js +27 -0
  248. package/packages/types/build/lib/getCollidingWords.d.ts +3 -0
  249. package/packages/types/build/lib/getCollidingWords.js +19 -0
  250. package/packages/types/build/lib/getCollision.d.ts +3 -0
  251. package/packages/types/build/lib/getCollision.js +31 -0
  252. package/packages/types/build/lib/getCollisions.d.ts +3 -0
  253. package/packages/types/build/lib/getCollisions.js +17 -0
  254. package/packages/types/build/lib/getPlacedCell.d.ts +3 -0
  255. package/packages/types/build/lib/getPlacedCell.js +10 -0
  256. package/packages/types/build/lib/getWordThrough.d.ts +4 -0
  257. package/packages/types/build/lib/getWordThrough.js +23 -0
  258. package/packages/types/build/lib/getWordsInRows.d.ts +8 -0
  259. package/packages/types/build/lib/getWordsInRows.js +29 -0
  260. package/packages/types/build/lib/index.d.ts +5 -0
  261. package/packages/types/build/lib/index.js +21 -0
  262. package/packages/types/build/lib/isSameBoardWord.d.ts +2 -0
  263. package/packages/types/build/lib/isSameBoardWord.js +6 -0
  264. package/packages/types/build/lib/toBoardWord.d.ts +4 -0
  265. package/packages/types/build/lib/toBoardWord.js +11 -0
  266. package/packages/types/build/lib/transpose.d.ts +1 -0
  267. package/packages/types/build/lib/transpose.js +16 -0
  268. package/packages/types/build/type-guards/index.d.ts +10 -0
  269. package/packages/types/build/type-guards/index.js +23 -0
  270. package/packages/types/build/type-guards/isBingo.d.ts +2 -0
  271. package/packages/types/build/type-guards/isBingo.js +9 -0
  272. package/packages/types/build/type-guards/isBoardJson.d.ts +2 -0
  273. package/packages/types/build/type-guards/isBoardJson.js +21 -0
  274. package/packages/types/build/type-guards/isCellJson.d.ts +2 -0
  275. package/packages/types/build/type-guards/isCellJson.js +13 -0
  276. package/packages/types/build/type-guards/isGame.d.ts +2 -0
  277. package/packages/types/build/type-guards/isGame.js +7 -0
  278. package/packages/types/build/type-guards/isLocale.d.ts +2 -0
  279. package/packages/types/build/type-guards/isLocale.js +7 -0
  280. package/packages/types/build/type-guards/isMultiplierBingo.d.ts +2 -0
  281. package/packages/types/build/type-guards/isMultiplierBingo.js +8 -0
  282. package/packages/types/build/type-guards/isScoreBingo.d.ts +2 -0
  283. package/packages/types/build/type-guards/isScoreBingo.js +8 -0
  284. package/packages/types/build/type-guards/isTileJson.d.ts +2 -0
  285. package/packages/types/build/type-guards/isTileJson.js +8 -0
  286. package/packages/types/package.json +2 -2
  287. package/packages/types/src/Bingo.ts +0 -14
  288. package/packages/types/src/Board.test.ts +85 -0
  289. package/packages/types/src/Board.ts +8 -49
  290. package/packages/types/src/BoardJson.ts +1 -21
  291. package/packages/types/src/BoardWord.ts +8 -0
  292. package/packages/types/src/CellJson.ts +1 -12
  293. package/packages/types/src/Game.ts +1 -4
  294. package/packages/types/src/Locale.ts +0 -4
  295. package/packages/types/src/Result.ts +3 -3
  296. package/packages/types/src/TileJson.ts +0 -6
  297. package/packages/types/src/index.ts +20 -8
  298. package/packages/types/src/lib/getBoardWords.ts +11 -0
  299. package/packages/types/src/lib/getCells.test.ts +127 -0
  300. package/packages/types/src/lib/getCells.ts +31 -0
  301. package/packages/types/src/lib/getCollidingWords.ts +25 -0
  302. package/packages/types/src/lib/getCollision.ts +38 -0
  303. package/packages/types/src/lib/getCollisions.test.ts +82 -0
  304. package/packages/types/src/lib/getCollisions.ts +22 -0
  305. package/packages/types/src/lib/getPlacedCell.ts +9 -0
  306. package/packages/types/src/lib/getWordThrough.ts +30 -0
  307. package/packages/types/src/lib/getWordsInRows.ts +34 -0
  308. package/packages/types/src/lib/index.ts +5 -0
  309. package/packages/types/src/lib/isSameBoardWord.ts +5 -0
  310. package/packages/types/src/lib/toBoardWord.ts +12 -0
  311. package/packages/types/src/lib/transpose.ts +15 -0
  312. package/packages/types/src/type-guards/index.ts +10 -0
  313. package/packages/types/src/type-guards/isBingo.ts +8 -0
  314. package/packages/types/src/type-guards/isBoardJson.test.ts +33 -0
  315. package/packages/types/src/type-guards/isBoardJson.ts +23 -0
  316. package/packages/types/src/type-guards/isCellJson.ts +14 -0
  317. package/packages/types/src/type-guards/isGame.ts +5 -0
  318. package/packages/types/src/type-guards/isLocale.ts +5 -0
  319. package/packages/types/src/type-guards/isMultiplierBingo.ts +7 -0
  320. package/packages/types/src/type-guards/isScoreBingo.ts +7 -0
  321. package/packages/types/src/type-guards/isTileJson.ts +7 -0
  322. package/packages/word-definitions/package.json +2 -2
  323. package/packages/word-lists/package.json +2 -2
  324. package/playwright-report/index.html +1 -1
  325. package/screencast.gif +0 -0
  326. package/packages/scrabble-solver/.next/server/chunks/316.js +0 -1
  327. package/packages/scrabble-solver/.next/server/chunks/916.js +0 -1
  328. package/packages/scrabble-solver/.next/static/chunks/106.e414e88694add27f.js +0 -1
  329. package/packages/scrabble-solver/.next/static/chunks/127.125d896a19061d71.js +0 -1
  330. package/packages/scrabble-solver/.next/static/chunks/18.8b91e137d239e15c.js +0 -1
  331. package/packages/scrabble-solver/.next/static/chunks/583.7a46807be14c377e.js +0 -1
  332. package/packages/scrabble-solver/.next/static/chunks/711.ba7b8f900dfd40d0.js +0 -1
  333. package/packages/scrabble-solver/.next/static/chunks/912.ff8037ba9d4db5c8.js +0 -1
  334. package/packages/scrabble-solver/.next/static/chunks/pages/_app-2e607dcd4135f340.js +0 -1
  335. package/packages/scrabble-solver/.next/static/chunks/pages/index-e0087247c995328d.js +0 -1
  336. package/packages/scrabble-solver/.next/static/chunks/webpack-cfb34d175e081981.js +0 -1
  337. package/packages/scrabble-solver/.next/static/css/b74cd7de82dabcdd.css +0 -1
  338. package/packages/scrabble-solver/.next/static/css/c403ce739a9c0d83.css +0 -1
  339. package/packages/scrabble-solver/.next/static/css/fbfdce70731d0d2b.css +0 -1
  340. package/packages/scrabble-solver/src/components/Results/Cell.tsx +0 -32
  341. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss +0 -12
  342. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss.d.ts +0 -7
  343. package/packages/scrabble-solver/src/components/ResultsInput/index.ts +0 -1
  344. package/packages/types/build/readResultCells.d.ts +0 -5
  345. package/packages/types/build/readResultCells.js +0 -75
  346. package/packages/types/src/readResultCells.test.ts +0 -140
  347. package/packages/types/src/readResultCells.ts +0 -90
  348. /package/packages/scrabble-solver/.next/static/{5KOWzYqfY1Z2rjrzptr8D → 8WnIUTe-yJvPD6stltvYI}/_ssgManifest.js +0 -0
  349. /package/packages/types/build/{isError.d.ts → type-guards/isError.d.ts} +0 -0
  350. /package/packages/types/build/{isError.js → type-guards/isError.js} +0 -0
  351. /package/packages/types/build/{isObject.d.ts → type-guards/isObject.d.ts} +0 -0
  352. /package/packages/types/build/{isObject.js → type-guards/isObject.js} +0 -0
  353. /package/packages/types/src/{isError.ts → type-guards/isError.ts} +0 -0
  354. /package/packages/types/src/{isObject.ts → type-guards/isObject.ts} +0 -0
@@ -64,6 +64,10 @@
64
64
  "packages/configs/package.json",
65
65
  "nx/core/package-json"
66
66
  ],
67
+ "tags.npm:wyrazy": [
68
+ "packages/configs/package.json",
69
+ "nx/core/package-json"
70
+ ],
67
71
  "tags.npm:super-scrabble": [
68
72
  "packages/configs/package.json",
69
73
  "nx/core/package-json"
@@ -832,6 +836,14 @@
832
836
  "packages/scrabble-solver/package.json",
833
837
  "nx/core/package-json"
834
838
  ],
839
+ "metadata.targetGroups.NPM Scripts.8": [
840
+ "packages/scrabble-solver/package.json",
841
+ "nx/core/package-json"
842
+ ],
843
+ "metadata.targetGroups.NPM Scripts.9": [
844
+ "packages/scrabble-solver/package.json",
845
+ "nx/core/package-json"
846
+ ],
835
847
  "metadata.description": [
836
848
  "packages/scrabble-solver/package.json",
837
849
  "nx/core/package-json"
@@ -964,6 +976,62 @@
964
976
  "packages/scrabble-solver/package.json",
965
977
  "nx/core/package-json"
966
978
  ],
979
+ "targets.dev:next": [
980
+ "packages/scrabble-solver/package.json",
981
+ "nx/core/package-json"
982
+ ],
983
+ "targets.dev:next.executor": [
984
+ "packages/scrabble-solver/package.json",
985
+ "nx/core/package-json"
986
+ ],
987
+ "targets.dev:next.metadata": [
988
+ "packages/scrabble-solver/package.json",
989
+ "nx/core/package-json"
990
+ ],
991
+ "targets.dev:next.options.script": [
992
+ "packages/scrabble-solver/package.json",
993
+ "nx/core/package-json"
994
+ ],
995
+ "targets.dev:next.options": [
996
+ "packages/scrabble-solver/package.json",
997
+ "nx/core/package-json"
998
+ ],
999
+ "targets.dev:next.metadata.scriptContent": [
1000
+ "packages/scrabble-solver/package.json",
1001
+ "nx/core/package-json"
1002
+ ],
1003
+ "targets.dev:next.metadata.runCommand": [
1004
+ "packages/scrabble-solver/package.json",
1005
+ "nx/core/package-json"
1006
+ ],
1007
+ "targets.dev:scss": [
1008
+ "packages/scrabble-solver/package.json",
1009
+ "nx/core/package-json"
1010
+ ],
1011
+ "targets.dev:scss.executor": [
1012
+ "packages/scrabble-solver/package.json",
1013
+ "nx/core/package-json"
1014
+ ],
1015
+ "targets.dev:scss.metadata": [
1016
+ "packages/scrabble-solver/package.json",
1017
+ "nx/core/package-json"
1018
+ ],
1019
+ "targets.dev:scss.options.script": [
1020
+ "packages/scrabble-solver/package.json",
1021
+ "nx/core/package-json"
1022
+ ],
1023
+ "targets.dev:scss.options": [
1024
+ "packages/scrabble-solver/package.json",
1025
+ "nx/core/package-json"
1026
+ ],
1027
+ "targets.dev:scss.metadata.scriptContent": [
1028
+ "packages/scrabble-solver/package.json",
1029
+ "nx/core/package-json"
1030
+ ],
1031
+ "targets.dev:scss.metadata.runCommand": [
1032
+ "packages/scrabble-solver/package.json",
1033
+ "nx/core/package-json"
1034
+ ],
967
1035
  "targets.generate-scss-types": [
968
1036
  "packages/scrabble-solver/package.json",
969
1037
  "nx/core/package-json"
package/CLAUDE.md CHANGED
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
 
5
5
  ## Repository layout
6
6
 
7
- This is a Bun-workspaces monorepo (managed with Lerna for versioning/publishing and Nx purely for build caching/ordering). `engines` requires **Bun >=1.3** and **Node.js >=24**. The lockfile is `bun.lock` (text JSON, lockfileVersion 1) — `package-lock.json` was removed when the project migrated off npm/Jest in `#421` (Apr 2026). Workspace scripts use `bun run --filter <pattern> <script>` — the `'./packages/*'` glob runs in dependency order (built-in Nx cache), and `'*'` skips workspaces without that script (relevant for `test`). The root `workspaces` field is an explicit nine-entry list in dependency order, not a glob.
7
+ This is a Bun-workspaces monorepo (managed with Lerna for versioning/publishing and Nx purely for build caching/ordering). `engines` requires **Bun >=1.4** and **Node.js >=24**. The lockfile is `bun.lock` (text JSON, lockfileVersion 1) — `package-lock.json` was removed when the project migrated off npm/Jest in `#421` (Apr 2026). Workspace scripts use `bun run --filter <pattern> <script>` — the `'./packages/*'` glob runs in dependency order (built-in Nx cache), and `'*'` skips workspaces without that script (relevant for `test`). The root `workspaces` field is an explicit nine-entry list in dependency order, not a glob.
8
8
 
9
9
  The nine packages live under `packages/` and have a strict dependency order. When something breaks "downstream" of where you edited, rebuild the upstream package first:
10
10
 
@@ -19,24 +19,25 @@ logger (independent, used by app + dictionaries)
19
19
  The GADDAG itself lives outside this repo, in [`@kamilmielnik/gaddag`](https://github.com/kamilmielnik/gaddag) — a flat typed-array automaton with `has`/`hasPrefix`/`getArc`, binary `serialize`/`deserialize`, and `Gaddag.fromArray(words)`. It replaced `@kamilmielnik/trie` (#164) and is consumed by `dictionaries`, `solver`, and the app as a regular npm dependency (`^2.0.0`). A local `packages/gaddag/` directory may exist — it holds git-ignored compiled output left over from before the package was extracted and is **not** a workspace.
20
20
 
21
21
  - `solver` — pure word-finding engine. Given a `Gaddag`, `Config`, `Board`, and `Tile[]`, returns scored `ResultJson`s. Has no I/O. `solve.ts` delegates to `MoveGenerator` (a single file holding all the logic) — anchor-based GADDAG move generation with per-cell cross-check masks, run once per direction; results are scored inline and sorted deterministically so UI ties resolve identically. `MoveGenerator` throws on alphabets over 64 tiles or boards over 32×32 because move sort keys pack direction/line/start/end into one integer. `benchmarks/` measures median `solve()` times on fixed mid-game boards (en-US, en-GB, pl-PL; 0–2 blanks): `bun run benchmark` from the root reruns them and rewrites the chart SVG + results table in the package `README.md`; it needs real (downloaded) dictionaries.
22
- - `dictionaries` — downloads/caches per-locale word lists to `$HOME/.scrabble-solver/dictionaries` and exposes them as `Gaddag`s (binary `<locale>.gaddag` files on disk; building the Polish GADDAG from its 3.2M-word list takes ~25 s, so it happens in `postbuild`/background updates, not per request; the `update-dictionaries` / `remove-dictionaries` bin scripts wrap this, and `update()` refreshes only stale locales unless forced). The `Dictionaries` class layers a `MemoryCache` over a `DiskCache` (`LayeredCache`) and uses a per-locale `createAsyncProxy` to coalesce concurrent downloads. Cache entries older than `CACHE_STALE_THRESHOLD` (1 day) are considered stale, but only `update()` (run from `postbuild` and the packaging workflows) refreshes them — `get()` serves stale entries as-is. `DiskCache.get` treats files it cannot deserialize (corrupted, or written by an app version with an incompatible format — the binary magic doubles as the format version) as cache misses: it deletes them and the dictionary is re-downloaded and re-serialized automatically; `set` also removes the pre-#164 `<locale>.txt` trie cache. The service worker does the same client-side: `getGaddag` returns undefined for undeserializable cached dictionaries, falling back to the server and revalidating. Only this package and `logger` perform filesystem I/O — keep other packages pure so they can run in Edge / browser contexts.
22
+ - `dictionaries` — downloads/caches per-locale word lists to `$HOME/.scrabble-solver/dictionaries` and exposes them as `Gaddag`s (binary `<locale>.gaddag` files on disk; building the Polish GADDAG from its 3.2M-word list takes ~25 s, so it happens in `postbuild`/background updates, not per request; the `update-dictionaries` / `remove-dictionaries` bin scripts wrap this, and `update()` refreshes only stale locales unless forced). The `Dictionaries` class layers a `MemoryCache` over a `DiskCache` (`LayeredCache`) and uses a per-locale `createAsyncProxy` to coalesce concurrent downloads. Cache entries older than `CACHE_STALE_THRESHOLD` (1 day) are considered stale, but only `update()` (run from `postbuild` and the packaging workflows) refreshes them — `get()` serves stale entries as-is. `DiskCache.get` treats files it cannot deserialize (corrupted, or written by an app version with an incompatible format — the binary magic doubles as the format version) as cache misses: it deletes them and the dictionary is re-downloaded and re-serialized automatically; `set` also removes the pre-#164 `<locale>.txt` trie cache. The solver worker does the same client-side (`src/solver-worker/getGaddag.ts`): it returns undefined for undeserializable cached dictionaries, falling back to the server and revalidating. Only this package and `logger` perform filesystem I/O — keep other packages pure so they can run in Edge / browser contexts.
23
23
  - `word-lists` — pulls raw word lists from upstream sources (one fetcher per locale in `src/languages/`). Used by `dictionaries` during downloads.
24
24
  - `word-definitions` — per-locale `crawl(word) → string` and a parser for each source (Wiktionary, CNRTL, DWDS, SJP, dexonline, vajehyab, etc.). English uses the Wiktionary REST API (#431): `parse` JSON-parses the payload and uses cheerio only to strip HTML from definition strings, so the English fixtures are `.json`. Add a new locale by adding a `crawl` and a `parse` function in `src/languages/` and wiring them into `crawl.ts` / `parse.ts`. `parse.test.ts` is where you add fixture-based parser tests.
25
- - `types` — domain model classes (`Board`, `Cell`, `Tile`, `Result`, `Config`, `Locale`, …) plus `*Json` shapes. Most of these have a `fromJson` / `toJson` round-trip — use them at the wire boundary instead of hand-rolled serialization.
26
- - `configs` — split into **games** (`scrabble`, `superScrabble`, `scrabbleDuel`, `letterLeague`, `crossplay`, `literaki`, `kelimelik` — each defines board size, bonuses, rack size, blanks count, bingo bonus) and **languages** (`english`, `french`, …, each spreads a base game config and overrides `locale` + `tiles`). A locale config is one game × one language; e.g. `polishScrabble` = `scrabble` ⊕ Polish tiles + digraphs. Adding a language means a new config here **and** the 15-step checklist under "Add a new language" in `README.md`.
25
+ - `types` — domain model classes (`Board`, `Cell`, `Tile`, `Result`, `Config`, `Locale`, …) plus `*Json` shapes. Most of these have a `fromJson` / `toJson` round-trip — use them at the wire boundary instead of hand-rolled serialization. Free functions live one-per-file under `src/lib/` (`getBoardWords`, `getCells`, `getCollidingWords`, `getCollisions`, `isSameBoardWord`, …) and type guards under `src/type-guards/` (`isBoardJson`, `isCellJson`, `isGame`, `isLocale`, …); the class methods are thin wrappers over them, so put new board/word logic in `lib/` and expose it as a method rather than growing `Board.ts`. `Board.getWords()` returns `BoardWord[]` (`{ direction, word, x, y }`), not strings — the same word can appear twice on a board, so a word's identity is its start cell plus direction (`isSameBoardWord`), and `Board.getCollidingWords(word)` returns the perpendicular words crossing it.
26
+ - `configs` — split into **games** (`scrabble`, `superScrabble`, `scrabbleDuel`, `letterLeague`, `crossplay`, `literaki`, `kelimelik`, `wyrazy` — each defines board size, bonuses, rack size, blanks count, bingo bonus) and **languages** (`english`, `french`, …, each spreads a base game config and overrides `locale` + `tiles`). A locale config is one game × one language; e.g. `polishScrabble` = `scrabble` ⊕ Polish tiles + digraphs. Adding a language means a new config here **and** the 15-step checklist under "Add a new language" in `README.md`.
27
27
  - `logger` — Winston logger writing JSON to `$HOME/.scrabble-solver/logs/{all,error}.log`. Only `error` goes to console. Used server-side by the app + dictionaries; do **not** import from browser code.
28
28
  - `constants` — shared primitives (`BLANK`, `BONUS_CHARACTER`, `BONUS_WORD`, …). No runtime dependencies.
29
29
 
30
30
  ### App package (`@scrabble-solver/scrabble-solver`)
31
31
 
32
32
  - **Routing**: Next.js Pages Router (`src/pages/`). API routes: `solve`, `verify`, `visit`, `dictionary/[locale]` (binary GADDAG download), and `dictionary/[locale]/[word]` (definitions). The path alias `@/*` resolves to `src/*` (set in `tsconfig.json`).
33
- - **State**: Redux Toolkit + Redux-Saga. Slices in `src/state/{app,board,cellFilters,dictionary,hoveredTile,i18n,rack,results,settings,solve,verify}`, each exporting `<name>Slice` (reducer + actions) and selectors. The root saga in `state/sagas.ts` reacts to slice actions: `submit` → call SDK → write results back. `solve`, `verify`, and `dictionary` use `takeLatest` (only the latest in-flight request resolves); cell/rack edits use `takeEvery`. State is intentionally **not** serializable-checked (`serializableCheck: false`) because slices hold class instances (`Board`, `Tile`). `initialize({ version })` carries the app version (from `getStaticProps`) into the `app` slice; the translations cache is keyed on it.
34
- - **Board render budget**: `Cell`/`Tile` render 225+ times at once and must not subscribe to the store — every value they need flows down from `BoardPure` as memo-friendly props, and event handlers read state at event time via `useTypedStore().getState()` (see `Cell.tsx`). Anything added to a cell that subscribes via `useSelector` multiplies by 225 and shows up directly in TBT.
35
- - **SDK layer (`src/sdk/`)**: thin browser/server clients for the four API routes. `findWordDefinitions` is memoized at the saga level via `lib/memoize`. Always go through SDK — never `fetch` directly from a saga or component.
36
- - **Persistence**: settings, board, and rack auto-persist to `localStorage` via `store2` under the `scrabble-solver` namespace. The `useLocalStorage` hook (mounted in `pages/index.tsx`) subscribes to the three slices and writes them out on every change (skipping each effect's first post-hydration run, which would only echo what was just read) — **adding a new field to `SettingsState` is enough; you don't need to touch any save code** (PR #321, Apr 2026). Boot state is deterministic (SSR/hydration must match — issue #412): persisted settings/board/rack are applied post-mount by `hydratePersistedState` in the `initialize()` saga, guarded so a throw leaves the deterministic defaults and `app.hydrated` still fires (`finally`) — otherwise persistence would silently die for the session. The `state/localStorage.ts` getters treat corrupt/mismatched entries as absent and remove them; the saga skips no-op `init` dispatches so an empty-storage boot changes no state identities and re-renders nothing. The active locale's translations are also cached (`translations` key, keyed by app version + locale) and hydrated synchronously so a returning user's first post-hydration paint is already translated. When changing settings shape, add a migration block (see `migrateLegacySettings` for the pattern — dated comment with introduction date and life expectancy).
37
- - **Service worker**: built by `WorkboxPlugin.InjectManifest` from `src/service-worker/index.ts` to `public/service-worker.js`. It precaches the app shell and intercepts `/api/solve` and `/api/verify` requests so the app can still solve offline once a dictionary is cached. Only generated in production builds (`!isServer && !dev`). The precache excludes `.css` — every page inlines its stylesheets (see `_document.tsx`), so the emitted CSS files are never requested.
33
+ - **State**: Redux Toolkit + Redux-Saga. Slices in `src/state/{app,board,cellFilters,dictionary,hoveredTile,hoveredWord,i18n,rack,results,settings,solve,verify}`, each exporting `<name>Slice` (reducer + actions) and selectors. The root saga in `state/sagas.ts` reacts to slice actions: `submit` → call SDK → write results back. `solve`, `verify`, and `dictionary` use `takeLatest` (only the latest in-flight request resolves); cell/rack edits use `takeEvery`. State is intentionally **not** serializable-checked (`serializableCheck: false`) because slices hold class instances (`Board`, `Tile`). `initialize({ version })` carries the app version (from `getStaticProps`) into the `app` slice; the translations cache is keyed on it. Two slices drive board highlighting and they are mutually exclusive: `results.candidate` (a solver result being previewed) and `hoveredWord` (a created word hovered or selected in the words table) — each one's saga clears the other, and both funnel into the same `searchDictionary` helper in `state/sagas.ts` that fills the dictionary panel. The `verify` slice mirrors `results`: alongside `validWords`/`invalidWords` (both `VerifiedWord[]`) it owns the words table's own `query` and `sort`, toggled through the shared `lib/getNextSort`.
34
+ - **Board render budget**: `Cell`/`Tile` render 225+ times at once and must not subscribe to the store — every value they need flows down from `BoardPure` as memo-friendly props, and event handlers read state at event time via `useTypedStore().getState()` (see `Cell.tsx`). Anything added to a cell that subscribes via `useSelector` multiplies by 225 and shows up directly in TBT. A cell's `highlighted` flag is the OR of every highlight source (result candidate, hovered rack/remaining tile character, hovered created word) and is computed in `BoardPure`, so a new highlight means a new `boolean[][]` prop selector — never a lookup inside `Cell`.
35
+ - **Tables**: `src/components/Table/` holds the shared table chrome — `Header`, `HeaderButton` (generic over the column-id enum; sort state and `onSort` arrive as props), `Row`, `Cell`, and `Search` (the controlled RegExp filter input, formerly `ResultsInput`). Two tables use it: `components/Results` (solver results) and `modals/WordsModal/components/WordsTable` (created words). The kit owns chrome only — column widths stay in each table's own `*.module.scss`, and the single column that absorbs the leftover width is marked with the `primary` prop rather than a class. `Row` derives `cursor: pointer` from whether it was given an `onClick`, so a row never advertises a click it will ignore; that is also why `Result` passes handlers through conditionally instead of defaulting them to `noop`. Both tables read as one behaviour matrix over layout × input, and the two axes mean different things: the **layout** decides where the footer buttons live (compact shows *Preview*, plus *Insert* for results; desktop shows neither), while **touch** decides what a repeated click on the already-picked row does (previews it, since a touch user has no other way to get back to the board). Between them sits the highlight's lifetime, and both tables answer it identically: only on desktop non-touch does the pointer own it (hover and focus pick, leaving the list clears, clicking adds nothing) — everywhere else it is sticky, so clicking a row picks it and hovering one does nothing at all. `Table`'s `.row` therefore highlights on `:focus-visible`, never `:focus`: a row left focused by a click must stop looking picked the moment another row takes over. That also means a row's picked state has to come from an explicit `highlighted` prop (`highlightedIndex`), never from focus — the results sidebar passes `selectResultCandidateIndex` for exactly that reason. Both tables virtualise with `react-window` and keep their sort/filter state in their own slice (`state/results/*`, `state/verify/*`); each slice's `lib.ts` owns a `Record<ColumnId, ComparatorFactory>` that the shared `lib/createSortComparator` collapses into one comparator (`lib/getNextSort` toggles the direction, `lib/createCoordinatesComparator` + `lib/getCoordinates` cover the coordinates column). Neither table filters rows out — `groupResults`/`groupWords` float the matches to the top and render the rest dimmed and `aria-hidden`, so the row count never depends on the query. Only the words table has an empty case: with no created words it swaps the list for an `EmptyState` and hides the `Search` input.
36
+ - **SDK layer (`src/sdk/`)**: thin browser/server clients for the four API routes. `findWordDefinitions` is memoized at the saga level via `lib/memoize`. Always go through SDK — never `fetch` directly from a saga or component. `solve` and `verify` first try the local `src/solver-worker/` web worker and fall back to the API route, so their payload shapes are implemented twice — change `pages/api/verify.ts` and `solver-worker/index.worker.ts` together (both answer with `VerifiedWord[]`, i.e. `BoardWord` plus `isValid`, not `string[]`).
37
+ - **Persistence**: settings, board, and rack auto-persist to `localStorage` via `store2` under the `scrabble-solver` namespace. The `useLocalStorage` hook (mounted in `pages/index.tsx`) subscribes to the three slices and writes them out on every change (skipping each effect's first post-hydration run, which would only echo what was just read) — **adding a new field to `SettingsState` is enough; you don't need to touch any save code** (PR #321, Apr 2026). Boot state is deterministic (SSR/hydration must match — issue #412): persisted settings/board/rack are applied post-mount by `hydratePersistedState` in the `initialize()` saga, guarded so a throw leaves the deterministic defaults and `app.hydrated` still fires (`finally`) — otherwise persistence would silently die for the session. The `state/localStorage.ts` getters treat corrupt/mismatched entries as absent and remove them; the saga skips no-op `init` dispatches so an empty-storage boot changes no state identities and re-renders nothing. The active locale's translations are also cached (`translations` key, keyed by app version + locale) and hydrated synchronously so a returning user's first post-hydration paint is already translated; the entry is also discarded when it is missing any key of the statically bundled English object (`hasEveryTranslation`), so a new `TranslationKey` shipped without a version bump can't strand a returning user on a stale cache (#452). When changing settings shape, add a migration block (see `migrateLegacySettings` for the pattern — dated comment with introduction date and life expectancy).
38
+ - **Service worker**: built by `WorkboxPlugin.InjectManifest` from `src/service-worker/index.ts` to `public/service-worker.js`. It precaches the app shell and routes navigations to it — solving and verifying offline is the `src/solver-worker/` web worker's job, not the service worker's. Only generated in production builds (`!isServer && !dev`). The precache excludes `.css` — every page inlines its stylesheets (see `_document.tsx`), so the emitted CSS files are never requested.
38
39
  - **i18n**: `src/i18n/languages/<lang>.json` (8 languages, mapped to `Locale` in `i18n.ts`). English is statically bundled; every other locale is a dynamic-import chunk (`loadTranslations`), loaded into the `i18n` slice — `selectTranslations` falls back to the complete English object, so missing keys are impossible mid-load. All locales preload on idle/first intent (`preloadTranslationsWhenIdle`), which is what makes switching languages apply instantly; the active locale is additionally cached in localStorage (see Persistence). The `LOCALE_FEATURES` registry in `src/i18n/constants.ts` carries per-locale UI metadata: `direction` ('ltr' | 'rtl'), `comma`/`separator` glyphs (Latin vs Arabic), language `label`/`name`, and `consonants`/`vowels` flags that drive the auto-group-tiles UI; flag icons live separately in `src/i18n/localeIcons.ts` (`LOCALE_ICONS`) so they stay out of the main bundle. The `useDirection` hook applies `direction` to `<html dir>`. Add a new locale by extending both maps plus the i18n JSON dictionary plus a `Flag<XX>.svg` icon. `useTranslate()` is the lookup hook.
39
- - **Layout**: all layout sizing lives in CSS custom properties (`src/styles/variables.scss`: `--cell-size`, `--rack-tile-size`, `--max-board-width`, …), with the config-dependent inputs (`--board-cols`, `--board-rows`, `--rack-size`) set on `:root` twice: before first paint by an inline script in `_document.tsx` (which reads persisted settings, also sets `dir`/`lang`, and adds the `config-pending` class that hides `main` until hydration applies a persisted non-default game — see `CONFIG_PENDING_CLASS`), and post-hydration by an effect in `pages/index.tsx`. There is no JS layout hook — components size themselves via these variables (the board grid templates use `repeat(var(--board-cols), …)` so the held board has its final geometry pre-hydration); JS reads viewport state only through `useMediaQuery`. **Boot-path DOM rules**: never read computed style in mount effects (forced reflow — compare against inline style or known defaults instead), and guard same-value writes to `<html>` attributes/variables (they invalidate style/paint document-wide and destabilize LCP). The active modal in `pages/index.tsx` is tracked as a `Record<Modal, boolean>` patched through a single `patchModals` callback; each modal mounts on first open and stays mounted (`mountedModals` latch), because a `next/dynamic({ssr: false})` component starts its chunk request during render.
40
+ - **Layout**: all layout sizing lives in CSS custom properties (`src/styles/variables.scss`: `--cell-size`, `--rack-tile-size`, `--max-board-width`, …), with the config-dependent inputs (`--board-cols`, `--board-rows`, `--rack-size`) set on `:root` twice: before first paint by an inline script in `_document.tsx` (which reads persisted settings, also sets `dir`/`lang`, and adds the `config-pending` class that hides `main` until hydration applies a persisted non-default game — see `CONFIG_PENDING_CLASS`), and post-hydration by an effect in `pages/index.tsx`. There is no JS layout hook — components size themselves via these variables (the board grid templates use `repeat(var(--board-cols), …)` so the held board has its final geometry pre-hydration); JS reads viewport state only through `useMediaQuery`. The compact/desktop split is `useIsCompactLayout()` — the desktop layout needs a viewport that is both `l` wide (1200px) and `$breakpoint-height-l` tall (800px), so a short desktop window gets the same layout as a tablet; `showResultsInModal`, `showCompactControls`, `isCompactLayout` and `selectsFirstWord` are all that same hook. SCSS says it with the `compact` / `desktop` media expressions from `styles/mixins.scss` (the split is spelled out twice — change both), never with `<l` / `>=l`. `Modal`'s footer is not size-gated at all — a modal shows one by passing `footer`, and it's up to that modal to decide when (`WordsModal` renders its *Preview* button only below the breakpoint, `ResultsModal` closes itself above it). **Boot-path DOM rules**: never read computed style in mount effects (forced reflow — compare against inline style or known defaults instead), and guard same-value writes to `<html>` attributes/variables (they invalidate style/paint document-wide and destabilize LCP). The active modal in `pages/index.tsx` is tracked as a `Record<Modal, boolean>` patched through a single `patchModals` callback; each modal mounts on first open and stays mounted (`mountedModals` latch), because a `next/dynamic({ssr: false})` component starts its chunk request during render.
40
41
  - **Styling**: SCSS modules with a shared design-token system. When one module's class overrides another component's styles (e.g. `Actions` restyling `Button`), it must win on **specificity**, not stylesheet order — webpack's CSS emission order shifts with the import graph (this flipped once and widened a square button). Class names are type-checked (#16): `scripts/generate-scss-types.ts` writes a git-ignored sibling `.d.ts` for every `*.module.scss` — the `build` and `type-check` scripts run it up front, `dev` runs it in watch mode, and its sass options mirror `sassOptions` in `next.config.js`. `src/@types/scss.d.ts` only covers side-effect imports of non-module stylesheets, deliberately exporting nothing so an import of an ungenerated module fails the type-check. SCSS tokens live in `src/styles/_tokens.scss`; the same values are re-exported to TS via `:export` in `variables.module.scss`. Concrete JS constants live in `src/parameters/index.ts` (e.g. `BREAKPOINTS`, `COLOR_BLUE`, `TRANSITION_DURATION`) — that file is the only place that should read from `variables.module.scss`. Update `_tokens.scss` first → expose via `variables.module.scss` `:export` block → consume via `parameters/`. This was added in PR #228 (Apr 2026); before it, JS-side colors and breakpoints were hard-coded duplicates. Responsive helpers come from `include-media`.
41
42
  - **SVGs**: imported as React components via `@svgr/webpack` (configured in `next.config.js`), typed by `src/@types/svg.d.ts`.
42
43
  - **Service worker registration**: production-only. Registered by `serviceWorkerManager.ts` from the index page, deferred until load + idle (`waitForIdle`) so the install's precache downloads never compete with page resources (an eager install once caused Lighthouse's robots.txt fetch to time out). Playwright blocks registration entirely via `serviceWorkers: 'block'` in `playwright.config.ts`, and each test gets a fresh browser context, so e2e tests need no service-worker or localStorage cleanup.
@@ -118,8 +119,9 @@ The `bunx scrabble-solver@latest` entry point (`bin/scrabble-solver.js`) just `c
118
119
 
119
120
  Look here when something seems set up oddly — the reason is usually one of these recent changes. Reference issue numbers, not dates, when grepping git log.
120
121
 
122
+ - **#450 — Created-words table** (Aug 2026, issues #179/#427/#452). The words modal became a virtualised, sortable, RegExp-filterable table that shares `src/components/Table/` with the results table (`ResultsInput` moved there as `Search`). Picking a row — by hover where the pointer owns the highlight, by click everywhere else — highlights that word on the board and looks it up in the dictionary together with the words it crosses. Below the `l` breakpoint the first word is selected automatically (the modal covers the board, so the in-modal dictionary is the payoff) and the footer offers *Preview*, the only exit from the modal that leaves the highlight standing — every other way out clears it. On touch, re-tapping the already-picked row previews it too. The compact-layout result-candidate picker stopped going dead while nothing is picked: it stays enabled whenever fresh results exist and shows a `results.select` placeholder, so *next* picks the first result. `Board.getWords()` returns `BoardWord[]` instead of `string[]`, `/api/verify` and the solver worker answer with `VerifiedWord[]`, and the `types` package's free functions and type guards moved into `src/lib/` and `src/type-guards/` (`readResultCells.ts` → `lib/getCells.ts` + `lib/getCollisions.ts`).
121
123
  - **#447 — Lighthouse 100** (Aug 2026, issue #412). The index page is fully server-rendered (the old `isClient` client-only gate is gone), so everything at boot must be SSR/hydration-safe and deterministic. The JS layout layer (`useAppLayoutValue`, `AppLayoutContext`) was deleted in favor of CSS variables; stylesheets are inlined into the HTML by `InlineCssHead` in `_document.tsx` (the emitted `.css` files exist but nothing requests them); a pre-paint inline script in `_document.tsx` applies persisted board dimensions/direction and holds `main` hidden until hydration when the persisted game differs from the default. Board cells are store-subscription-free (see "Board render budget"), modals mount on first open, tooltips/service-worker/dictionary/translations work is deferred past load or idle, and per-locale i18n chunks replaced the bundled all-locales map (with an idle preload and a version-keyed localStorage cache for instant/flash-free language behavior). `transliteration` was replaced with Unicode normalization, all barrel files were removed for tree-shaking, and Next's bundled polyfills are stubbed out. Perf invariants to preserve: no store subscriptions in `Cell`/`Tile`, no computed-style reads or same-value `<html>` writes in boot effects, nothing heavy before load+idle, and hydration must not change state identities on an empty-storage boot.
122
- - **#164 — GADDAG solver** (Aug 2026). `@kamilmielnik/trie` was dropped everywhere in favor of the external `@kamilmielnik/gaddag` package; `solve()` was rewritten as anchor-based GADDAG move generation (~40-60× faster). Disk-cached dictionaries changed from serialized-trie `.txt` to binary `.gaddag` files, and `/api/dictionary/[locale]` now serves `application/octet-stream`, gzipped when the client accepts it (compressed once per in-memory dictionary via a `WeakMap` cache — the route parses `Accept-Encoding` q-values so `gzip;q=0` gets identity and `*` counts as accepting, evicts failed compression promises from the cache, and sets `Vary: Accept-Encoding`). Responses are `Cache-Control: no-cache`, so clients revalidate with `If-None-Match` and unchanged re-downloads become 304s — the `ETag` comes from Next's built-in per-payload generation (it overrides any hand-set `ETag` on `send()`, so don't set one). The service worker deserializes with `Gaddag.deserialize` (the browser undoes `Content-Encoding` before the Cache API stores the body) and memoizes the deserialized `Gaddag` per locale, keyed on the cached response's `ETag`/`Date`/`Content-Length`, until `revalidateDictionary` replaces the entry.
124
+ - **#164 — GADDAG solver** (Aug 2026). `@kamilmielnik/trie` was dropped everywhere in favor of the external `@kamilmielnik/gaddag` package; `solve()` was rewritten as anchor-based GADDAG move generation (~40-60× faster). Disk-cached dictionaries changed from serialized-trie `.txt` to binary `.gaddag` files, and `/api/dictionary/[locale]` now serves `application/octet-stream`, gzipped when the client accepts it (compressed once per in-memory dictionary via a `WeakMap` cache — the route parses `Accept-Encoding` q-values so `gzip;q=0` gets identity and `*` counts as accepting, evicts failed compression promises from the cache, and sets `Vary: Accept-Encoding`). Responses are `Cache-Control: no-cache`, so clients revalidate with `If-None-Match` and unchanged re-downloads become 304s — the `ETag` comes from Next's built-in per-payload generation (it overrides any hand-set `ETag` on `send()`, so don't set one). The solver worker deserializes with `Gaddag.deserialize` (the browser undoes `Content-Encoding` before the Cache API stores the body) and memoizes the deserialized `Gaddag` per locale, keyed on the cached response's `ETag`/`Date`/`Content-Length`, until `revalidateDictionary` replaces the entry.
123
125
  - **#421 — Bun migration** (Apr 2026). npm/Jest → Bun. Top-level scripts now use `bun run --filter`, lockfile is `bun.lock`, unit tests run on `bun test`, the published binary's launcher (`bin/scrabble-solver.js`) shells out to `bun start`, and the packaging workflow now runs in two variants (`bunx.yml` installs via `bun add --global`, `npx.yml` via `npm install --global`). All workflows use `oven-sh/setup-bun@v2`; `npx.yml` is the only one that also uses `setup-node`.
124
126
  - **#422 — TypeScript 7** (Apr 2026). Moved build/type-check to `tsgo` (native preview). Superseded in Aug 2026 by stable `typescript@7`, where the native compiler ships as plain `tsc` — scripts call `tsc` again and `@typescript/native-preview` is gone.
125
127
  - **#420 — ESLint → Oxlint**. The `eslint-plugin-*` packages still appear in devDeps because oxlint loads them as JS plugins (`jsPlugins` in `.oxlintrc.json`). Don't strip them.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  </p>
7
7
 
8
8
  <p>
9
- Free, open-source, cross-platform, multi-language analysis tool for <a href="https://en.wikipedia.org/wiki/Scrabble">Scrabble</a>, <a href="https://www.scopely.com/en/games/scrabble-go">Scrabble Duel</a>, <a href="https://en.wikipedia.org/wiki/Super_Scrabble">Super Scrabble</a>, <a href="https://support-apps.discord.com/hc/en-us/articles/26502196674583-Letter-League-FAQ">Letter League</a>, <a href="https://www.nytimes.com/games/crossplay">Crossplay</a>, <a href="https://pl.wikipedia.org/wiki/Literaki">Literaki</a> &amp; <a href="https://play.google.com/store/apps/details?id=com.he2apps.kelimelik">Kelimelik</a>
9
+ Free, open-source, cross-platform, multi-language analysis tool for <a href="https://en.wikipedia.org/wiki/Scrabble">Scrabble</a>, <a href="https://www.scopely.com/en/games/scrabble-go">Scrabble Duel</a>, <a href="https://en.wikipedia.org/wiki/Super_Scrabble">Super Scrabble</a>, <a href="https://support-apps.discord.com/hc/en-us/articles/26502196674583-Letter-League-FAQ">Letter League</a>, <a href="https://www.nytimes.com/games/crossplay">Crossplay</a>, <a href="https://pl.wikipedia.org/wiki/Literaki">Literaki</a>, <a href="https://play.google.com/store/apps/details?id=com.he2apps.kelimelik">Kelimelik</a> &amp; <a href="https://play.google.com/store/apps/details?id=com.foltyn.Wyrazy">Wyrazy</a>
10
10
  </p>
11
11
 
12
12
  <p>
@@ -36,7 +36,7 @@
36
36
  <p>
37
37
  <img src="https://img.shields.io/github/package-json/v/kamilmielnik/scrabble-solver" alt="Version" />
38
38
  <img src="https://img.shields.io/npm/l/scrabble-solver" alt="License" />
39
- <img src="https://img.shields.io/badge/bun-%3E=1.3-brightgreen.svg" />
39
+ <img src="https://img.shields.io/badge/bun-%3E=1.4-brightgreen.svg" />
40
40
  <img src="https://img.shields.io/node/v/scrabble-solver" alt="Node version" />
41
41
  </p>
42
42
 
@@ -88,7 +88,7 @@ Some of the word lists below are sourced from the companion repository [kamilmie
88
88
 
89
89
  ## Run
90
90
 
91
- You can run Scrabble Solver on your machine - all you need is [Bun](https://bun.sh/) 1.3 or later.
91
+ You can run Scrabble Solver on your machine - all you need is [Bun](https://bun.sh/) 1.4 or later.
92
92
 
93
93
  ```Shell
94
94
  bunx scrabble-solver@latest