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
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wyrazy = void 0;
4
+ const constants_1 = require("@scrabble-solver/constants");
5
+ const types_1 = require("@scrabble-solver/types");
6
+ exports.wyrazy = {
7
+ bingo: { score: 25 },
8
+ blankScore: 0,
9
+ blanksCount: 2,
10
+ boardHeight: 15,
11
+ boardWidth: 15,
12
+ game: types_1.Game.Wyrazy,
13
+ name: 'Wyrazy',
14
+ rackSize: 7,
15
+ bonuses: [
16
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 2, y: 0 },
17
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 6, y: 0 },
18
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 8, y: 0 },
19
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 12, y: 0 },
20
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 1, y: 1 },
21
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 5, y: 1 },
22
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 9, y: 1 },
23
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 13, y: 1 },
24
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 0, y: 2 },
25
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 4, y: 2 },
26
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 10, y: 2 },
27
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 14, y: 2 },
28
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 3, y: 3 },
29
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 7, y: 3 },
30
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 11, y: 3 },
31
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 2, y: 4 },
32
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 6, y: 4 },
33
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 8, y: 4 },
34
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 12, y: 4 },
35
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 1, y: 5 },
36
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 5, y: 5 },
37
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 9, y: 5 },
38
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 13, y: 5 },
39
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 0, y: 6 },
40
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 4, y: 6 },
41
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 10, y: 6 },
42
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 14, y: 6 },
43
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 3, y: 7 },
44
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 11, y: 7 },
45
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 0, y: 8 },
46
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 4, y: 8 },
47
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 10, y: 8 },
48
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 14, y: 8 },
49
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 1, y: 9 },
50
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 5, y: 9 },
51
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 9, y: 9 },
52
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 13, y: 9 },
53
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 2, y: 10 },
54
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 6, y: 10 },
55
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 8, y: 10 },
56
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 12, y: 10 },
57
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 3, y: 11 },
58
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 7, y: 11 },
59
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 11, y: 11 },
60
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 0, y: 12 },
61
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 4, y: 12 },
62
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 10, y: 12 },
63
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 14, y: 12 },
64
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 1, y: 13 },
65
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 5, y: 13 },
66
+ { multiplier: 2, type: constants_1.BONUS_WORD, x: 9, y: 13 },
67
+ { multiplier: 3, type: constants_1.BONUS_CHARACTER, x: 13, y: 13 },
68
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 2, y: 14 },
69
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 6, y: 14 },
70
+ { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 8, y: 14 },
71
+ { multiplier: 3, type: constants_1.BONUS_WORD, x: 12, y: 14 },
72
+ ],
73
+ };
@@ -1,3 +1,4 @@
1
1
  import { Config } from '@scrabble-solver/types';
2
2
  export declare const polishScrabble: Config;
3
3
  export declare const polishLiteraki: Config;
4
+ export declare const polishWyrazy: Config;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.polishLiteraki = exports.polishScrabble = void 0;
3
+ exports.polishWyrazy = exports.polishLiteraki = exports.polishScrabble = void 0;
4
4
  const types_1 = require("@scrabble-solver/types");
5
5
  const games_1 = require("../games");
6
6
  exports.polishScrabble = new types_1.Config({
@@ -79,3 +79,41 @@ exports.polishLiteraki = new types_1.Config({
79
79
  { character: 'ż', count: 1, score: 5 },
80
80
  ],
81
81
  });
82
+ exports.polishWyrazy = new types_1.Config({
83
+ ...games_1.wyrazy,
84
+ locale: types_1.Locale.PL_PL,
85
+ tiles: [
86
+ { character: 'a', count: 9, score: 1 },
87
+ { character: 'ą', count: 1, score: 5 },
88
+ { character: 'b', count: 2, score: 3 },
89
+ { character: 'c', count: 3, score: 2 },
90
+ { character: 'ć', count: 1, score: 5 },
91
+ { character: 'd', count: 3, score: 2 },
92
+ { character: 'e', count: 7, score: 1 },
93
+ { character: 'ę', count: 1, score: 5 },
94
+ { character: 'f', count: 1, score: 5 },
95
+ { character: 'g', count: 2, score: 3 },
96
+ { character: 'h', count: 2, score: 3 },
97
+ { character: 'i', count: 8, score: 1 },
98
+ { character: 'j', count: 2, score: 3 },
99
+ { character: 'k', count: 3, score: 2 },
100
+ { character: 'l', count: 3, score: 2 },
101
+ { character: 'ł', count: 2, score: 3 },
102
+ { character: 'm', count: 3, score: 2 },
103
+ { character: 'n', count: 5, score: 1 },
104
+ { character: 'ń', count: 1, score: 5 },
105
+ { character: 'o', count: 6, score: 1 },
106
+ { character: 'ó', count: 1, score: 5 },
107
+ { character: 'p', count: 3, score: 2 },
108
+ { character: 'r', count: 4, score: 1 },
109
+ { character: 's', count: 4, score: 1 },
110
+ { character: 'ś', count: 1, score: 5 },
111
+ { character: 't', count: 3, score: 2 },
112
+ { character: 'u', count: 2, score: 3 },
113
+ { character: 'w', count: 4, score: 1 },
114
+ { character: 'y', count: 4, score: 2 },
115
+ { character: 'z', count: 5, score: 1 },
116
+ { character: 'ź', count: 1, score: 5 },
117
+ { character: 'ż', count: 1, score: 5 },
118
+ ],
119
+ });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scrabble-solver/configs",
3
- "version": "2.18.1",
4
- "description": "Game and language configs for Scrabble Solver: board layouts, bonus squares, tile distributions, and points for 7 games and 9 locales.",
3
+ "version": "2.18.3",
4
+ "description": "Game and language configs for Scrabble Solver: board layouts, bonus squares, tile distributions, and points for 8 games and 9 locales.",
5
5
  "keywords": [
6
6
  "scrabble",
7
7
  "board-game",
@@ -9,6 +9,7 @@
9
9
  "game-config",
10
10
  "literaki",
11
11
  "kelimelik",
12
+ "wyrazy",
12
13
  "super-scrabble"
13
14
  ],
14
15
  "main": "build/index.js",
@@ -32,8 +33,8 @@
32
33
  "clean": "rimraf build/"
33
34
  },
34
35
  "dependencies": {
35
- "@scrabble-solver/constants": "^2.18.1",
36
- "@scrabble-solver/types": "^2.18.1"
36
+ "@scrabble-solver/constants": "^2.18.3",
37
+ "@scrabble-solver/types": "^2.18.3"
37
38
  },
38
39
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
39
40
  }
@@ -5,3 +5,4 @@ export * from './literaki';
5
5
  export * from './scrabble';
6
6
  export * from './scrabbleDuel';
7
7
  export * from './superScrabble';
8
+ export * from './wyrazy';
@@ -0,0 +1,71 @@
1
+ import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
2
+ import { Game } from '@scrabble-solver/types';
3
+
4
+ export const wyrazy = {
5
+ bingo: { score: 25 },
6
+ blankScore: 0,
7
+ blanksCount: 2,
8
+ boardHeight: 15,
9
+ boardWidth: 15,
10
+ game: Game.Wyrazy,
11
+ name: 'Wyrazy',
12
+ rackSize: 7,
13
+ bonuses: [
14
+ { multiplier: 3, type: BONUS_WORD, x: 2, y: 0 },
15
+ { multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 0 },
16
+ { multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 0 },
17
+ { multiplier: 3, type: BONUS_WORD, x: 12, y: 0 },
18
+ { multiplier: 3, type: BONUS_CHARACTER, x: 1, y: 1 },
19
+ { multiplier: 2, type: BONUS_WORD, x: 5, y: 1 },
20
+ { multiplier: 2, type: BONUS_WORD, x: 9, y: 1 },
21
+ { multiplier: 3, type: BONUS_CHARACTER, x: 13, y: 1 },
22
+ { multiplier: 3, type: BONUS_WORD, x: 0, y: 2 },
23
+ { multiplier: 3, type: BONUS_CHARACTER, x: 4, y: 2 },
24
+ { multiplier: 3, type: BONUS_CHARACTER, x: 10, y: 2 },
25
+ { multiplier: 3, type: BONUS_WORD, x: 14, y: 2 },
26
+ { multiplier: 2, type: BONUS_CHARACTER, x: 3, y: 3 },
27
+ { multiplier: 2, type: BONUS_WORD, x: 7, y: 3 },
28
+ { multiplier: 2, type: BONUS_CHARACTER, x: 11, y: 3 },
29
+ { multiplier: 3, type: BONUS_CHARACTER, x: 2, y: 4 },
30
+ { multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 4 },
31
+ { multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 4 },
32
+ { multiplier: 3, type: BONUS_CHARACTER, x: 12, y: 4 },
33
+ { multiplier: 2, type: BONUS_WORD, x: 1, y: 5 },
34
+ { multiplier: 3, type: BONUS_CHARACTER, x: 5, y: 5 },
35
+ { multiplier: 3, type: BONUS_CHARACTER, x: 9, y: 5 },
36
+ { multiplier: 2, type: BONUS_WORD, x: 13, y: 5 },
37
+ { multiplier: 2, type: BONUS_CHARACTER, x: 0, y: 6 },
38
+ { multiplier: 2, type: BONUS_CHARACTER, x: 4, y: 6 },
39
+ { multiplier: 2, type: BONUS_CHARACTER, x: 10, y: 6 },
40
+ { multiplier: 2, type: BONUS_CHARACTER, x: 14, y: 6 },
41
+ { multiplier: 2, type: BONUS_WORD, x: 3, y: 7 },
42
+ { multiplier: 2, type: BONUS_WORD, x: 11, y: 7 },
43
+ { multiplier: 2, type: BONUS_CHARACTER, x: 0, y: 8 },
44
+ { multiplier: 2, type: BONUS_CHARACTER, x: 4, y: 8 },
45
+ { multiplier: 2, type: BONUS_CHARACTER, x: 10, y: 8 },
46
+ { multiplier: 2, type: BONUS_CHARACTER, x: 14, y: 8 },
47
+ { multiplier: 2, type: BONUS_WORD, x: 1, y: 9 },
48
+ { multiplier: 3, type: BONUS_CHARACTER, x: 5, y: 9 },
49
+ { multiplier: 3, type: BONUS_CHARACTER, x: 9, y: 9 },
50
+ { multiplier: 2, type: BONUS_WORD, x: 13, y: 9 },
51
+ { multiplier: 3, type: BONUS_CHARACTER, x: 2, y: 10 },
52
+ { multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 10 },
53
+ { multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 10 },
54
+ { multiplier: 3, type: BONUS_CHARACTER, x: 12, y: 10 },
55
+ { multiplier: 2, type: BONUS_CHARACTER, x: 3, y: 11 },
56
+ { multiplier: 2, type: BONUS_WORD, x: 7, y: 11 },
57
+ { multiplier: 2, type: BONUS_CHARACTER, x: 11, y: 11 },
58
+ { multiplier: 3, type: BONUS_WORD, x: 0, y: 12 },
59
+ { multiplier: 3, type: BONUS_CHARACTER, x: 4, y: 12 },
60
+ { multiplier: 3, type: BONUS_CHARACTER, x: 10, y: 12 },
61
+ { multiplier: 3, type: BONUS_WORD, x: 14, y: 12 },
62
+ { multiplier: 3, type: BONUS_CHARACTER, x: 1, y: 13 },
63
+ { multiplier: 2, type: BONUS_WORD, x: 5, y: 13 },
64
+ { multiplier: 2, type: BONUS_WORD, x: 9, y: 13 },
65
+ { multiplier: 3, type: BONUS_CHARACTER, x: 13, y: 13 },
66
+ { multiplier: 3, type: BONUS_WORD, x: 2, y: 14 },
67
+ { multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 14 },
68
+ { multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 14 },
69
+ { multiplier: 3, type: BONUS_WORD, x: 12, y: 14 },
70
+ ],
71
+ };
@@ -1,6 +1,6 @@
1
1
  import { Config, Locale } from '@scrabble-solver/types';
2
2
 
3
- import { literaki, scrabble } from '../games';
3
+ import { literaki, scrabble, wyrazy } from '../games';
4
4
 
5
5
  export const polishScrabble = new Config({
6
6
  ...scrabble,
@@ -79,3 +79,42 @@ export const polishLiteraki = new Config({
79
79
  { character: 'ż', count: 1, score: 5 },
80
80
  ],
81
81
  });
82
+
83
+ export const polishWyrazy = new Config({
84
+ ...wyrazy,
85
+ locale: Locale.PL_PL,
86
+ tiles: [
87
+ { character: 'a', count: 9, score: 1 },
88
+ { character: 'ą', count: 1, score: 5 },
89
+ { character: 'b', count: 2, score: 3 },
90
+ { character: 'c', count: 3, score: 2 },
91
+ { character: 'ć', count: 1, score: 5 },
92
+ { character: 'd', count: 3, score: 2 },
93
+ { character: 'e', count: 7, score: 1 },
94
+ { character: 'ę', count: 1, score: 5 },
95
+ { character: 'f', count: 1, score: 5 },
96
+ { character: 'g', count: 2, score: 3 },
97
+ { character: 'h', count: 2, score: 3 },
98
+ { character: 'i', count: 8, score: 1 },
99
+ { character: 'j', count: 2, score: 3 },
100
+ { character: 'k', count: 3, score: 2 },
101
+ { character: 'l', count: 3, score: 2 },
102
+ { character: 'ł', count: 2, score: 3 },
103
+ { character: 'm', count: 3, score: 2 },
104
+ { character: 'n', count: 5, score: 1 },
105
+ { character: 'ń', count: 1, score: 5 },
106
+ { character: 'o', count: 6, score: 1 },
107
+ { character: 'ó', count: 1, score: 5 },
108
+ { character: 'p', count: 3, score: 2 },
109
+ { character: 'r', count: 4, score: 1 },
110
+ { character: 's', count: 4, score: 1 },
111
+ { character: 'ś', count: 1, score: 5 },
112
+ { character: 't', count: 3, score: 2 },
113
+ { character: 'u', count: 2, score: 3 },
114
+ { character: 'w', count: 4, score: 1 },
115
+ { character: 'y', count: 4, score: 2 },
116
+ { character: 'z', count: 5, score: 1 },
117
+ { character: 'ź', count: 1, score: 5 },
118
+ { character: 'ż', count: 1, score: 5 },
119
+ ],
120
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/constants",
3
- "version": "2.18.1",
3
+ "version": "2.18.3",
4
4
  "description": "Shared constants for Scrabble Solver (blank tile, bonus markers).",
5
5
  "keywords": [
6
6
  "scrabble",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/dictionaries",
3
- "version": "2.18.1",
3
+ "version": "2.18.3",
4
4
  "description": "Dictionary manager for Scrabble Solver: downloads per-locale word lists and serves them as GADDAG automata with layered disk/memory caching.",
5
5
  "keywords": [
6
6
  "scrabble",
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@kamilmielnik/gaddag": "^2.0.0",
41
- "@scrabble-solver/logger": "^2.18.1",
42
- "@scrabble-solver/types": "^2.18.1",
43
- "@scrabble-solver/word-lists": "^2.18.1"
41
+ "@scrabble-solver/logger": "^2.18.3",
42
+ "@scrabble-solver/types": "^2.18.3",
43
+ "@scrabble-solver/word-lists": "^2.18.3"
44
44
  },
45
45
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/logger",
3
- "version": "2.18.1",
3
+ "version": "2.18.3",
4
4
  "description": "Winston-based JSON file logger for Scrabble Solver.",
5
5
  "keywords": [
6
6
  "logger",
@@ -4,49 +4,70 @@ const path = require('path');
4
4
  const { argv } = require('process');
5
5
 
6
6
  const DAY = 24 * 60 * 60 * 1000;
7
+ const EVENTS = [` message: 'visit - request',`, ` message: 'solve - request',`, ` message: 'dictionary - request',`];
8
+ const TIMESTAMP_PREFIX = ` timestamp: '`;
9
+ const DATE_LENGTH = 'YYYY-MM-DD'.length;
7
10
 
8
- const getStats = (event, lines, since) => {
9
- const daysCount = Math.ceil((Date.now() - Number(new Date(since))) / DAY);
10
- const days = {};
11
+ main();
12
+
13
+ async function main() {
14
+ const filepath = path.resolve(os.homedir(), 'desktop', 'all.log');
15
+ const since = argv[2] || '2021-06-01';
16
+ const countsPerDay = await countEventsPerDay(filepath, since);
17
+
18
+ for (const event of EVENTS) {
19
+ printStats(getStats(event, countsPerDay.get(event), since));
20
+ }
21
+ }
11
22
 
12
- let nextIndex = 0;
13
- while (nextIndex !== -1) {
14
- nextIndex = lines.indexOf(event, nextIndex + 1);
23
+ async function countEventsPerDay(filepath, since) {
24
+ const countsPerDay = new Map(EVENTS.map((event) => [event, {}]));
25
+ let pendingEvent;
15
26
 
16
- if (nextIndex) {
17
- const timestampLine = lines[nextIndex + 1];
18
- const day = timestampLine.substr(` timestamp: '`.length, 'YYYY-MM-DD'.length);
19
- days[day] = days[day] || 0;
20
- days[day]++;
27
+ for await (const line of readLines(filepath)) {
28
+ if (pendingEvent) {
29
+ const day = line.slice(TIMESTAMP_PREFIX.length, TIMESTAMP_PREFIX.length + DATE_LENGTH);
30
+
31
+ if (day >= since) {
32
+ const counts = countsPerDay.get(pendingEvent);
33
+ counts[day] = (counts[day] || 0) + 1;
34
+ }
35
+
36
+ pendingEvent = undefined;
37
+ } else if (countsPerDay.has(line)) {
38
+ pendingEvent = line;
21
39
  }
22
40
  }
23
41
 
24
- const filteredDays = Object.fromEntries(
25
- Object.entries(days).filter(([key]) => {
26
- return key.localeCompare(since) >= 0;
27
- }),
28
- );
42
+ return countsPerDay;
43
+ }
44
+
45
+ async function* readLines(filepath) {
46
+ let remainder = '';
47
+
48
+ for await (const chunk of fs.createReadStream(filepath, 'utf-8')) {
49
+ const lines = (remainder + chunk).split('\n');
50
+ remainder = lines.pop();
51
+ yield* lines;
52
+ }
53
+
54
+ if (remainder) {
55
+ yield remainder;
56
+ }
57
+ }
29
58
 
30
- const sum = Object.entries(filteredDays).reduce((result, [, value]) => result + value, 0);
59
+ function getStats(event, countsPerDay, since) {
60
+ const daysCount = Math.ceil((Date.now() - Number(new Date(since))) / DAY);
61
+ const sum = Object.values(countsPerDay).reduce((result, count) => result + count, 0);
31
62
 
32
- return { daysCount, event, filteredDays, sum };
33
- };
63
+ return { daysCount, event, countsPerDay, sum };
64
+ }
34
65
 
35
- const printStats = ({ daysCount, event, filteredDays, sum }) => {
66
+ function printStats({ daysCount, event, countsPerDay, sum }) {
36
67
  console.log('--------------------------------------');
37
68
  console.log(event);
38
69
  console.log('--------------------------------------');
39
70
  console.log(`Sum: ${sum}`);
40
71
  console.log(`Avg: ${sum / daysCount}`);
41
- console.table(filteredDays);
42
- };
43
-
44
- const filepath = path.resolve(os.homedir(), '.scrabble-solver', 'logs', 'all.log');
45
- const file = fs.readFileSync(filepath, 'utf-8');
46
- const lines = file.split('\n');
47
- const since = argv[2] || '2021-06-01';
48
- const events = [` message: 'visit - request',`, ` message: 'solve - request',`, ` message: 'dictionary - request',`];
49
-
50
- for (const event of events) {
51
- printStats(getStats(event, lines, since));
72
+ console.table(countsPerDay);
52
73
  }
@@ -1 +1 @@
1
- 5KOWzYqfY1Z2rjrzptr8D
1
+ 8WnIUTe-yJvPD6stltvYI
@@ -4,37 +4,37 @@
4
4
  ],
5
5
  "devFiles": [],
6
6
  "lowPriorityFiles": [
7
- "static/5KOWzYqfY1Z2rjrzptr8D/_buildManifest.js",
8
- "static/5KOWzYqfY1Z2rjrzptr8D/_ssgManifest.js"
7
+ "static/8WnIUTe-yJvPD6stltvYI/_buildManifest.js",
8
+ "static/8WnIUTe-yJvPD6stltvYI/_ssgManifest.js"
9
9
  ],
10
10
  "rootMainFiles": [],
11
11
  "rootMainFilesTree": {},
12
12
  "pages": {
13
13
  "/": [
14
- "static/chunks/webpack-cfb34d175e081981.js",
14
+ "static/chunks/webpack-d7138f1ef6b8c9d6.js",
15
15
  "static/chunks/framework-626cbd48ac5aca57.js",
16
- "static/chunks/main-b92e08f3fc96dd8d.js",
16
+ "static/chunks/main-7e52da35a4beea0b.js",
17
17
  "static/chunks/101-829ab8a8d310e7a0.js",
18
- "static/css/c403ce739a9c0d83.css",
19
- "static/chunks/pages/index-e0087247c995328d.js"
18
+ "static/css/a691348b788f8bc0.css",
19
+ "static/chunks/pages/index-b073a1686818dd26.js"
20
20
  ],
21
21
  "/_app": [
22
- "static/chunks/webpack-cfb34d175e081981.js",
22
+ "static/chunks/webpack-d7138f1ef6b8c9d6.js",
23
23
  "static/chunks/framework-626cbd48ac5aca57.js",
24
- "static/chunks/main-b92e08f3fc96dd8d.js",
25
- "static/css/4dbcacc1122ac6b9.css",
26
- "static/chunks/pages/_app-2e607dcd4135f340.js"
24
+ "static/chunks/main-7e52da35a4beea0b.js",
25
+ "static/css/92f85ce358a0a468.css",
26
+ "static/chunks/pages/_app-e3fe880e24c024ab.js"
27
27
  ],
28
28
  "/_error": [
29
- "static/chunks/webpack-cfb34d175e081981.js",
29
+ "static/chunks/webpack-d7138f1ef6b8c9d6.js",
30
30
  "static/chunks/framework-626cbd48ac5aca57.js",
31
- "static/chunks/main-b92e08f3fc96dd8d.js",
31
+ "static/chunks/main-7e52da35a4beea0b.js",
32
32
  "static/chunks/pages/_error-f0290a98eb3ed0ec.js"
33
33
  ],
34
34
  "/not-found": [
35
- "static/chunks/webpack-cfb34d175e081981.js",
35
+ "static/chunks/webpack-d7138f1ef6b8c9d6.js",
36
36
  "static/chunks/framework-626cbd48ac5aca57.js",
37
- "static/chunks/main-b92e08f3fc96dd8d.js",
37
+ "static/chunks/main-7e52da35a4beea0b.js",
38
38
  "static/css/dee878eb64099d92.css",
39
39
  "static/chunks/pages/not-found-a59f9deeeff63d17.js"
40
40
  ]
@@ -1 +1 @@
1
- {"previewModeId":"58ad9cc4e044ab96b5c9d69b422a5e5c","previewModeSigningKey":"262ade13c7e20ac94c1e56fa928443a2980d07917e3e59554548f77b44a06cb5","previewModeEncryptionKey":"05a6f3604ddd5cb0180564e180d09255222092e97e010947f1eafbd68a8188f6","expireAt":1788089376569}
1
+ {"previewModeId":"d56d08e80e1c264fb9d5bd2f046d21e9","previewModeSigningKey":"710dfc296ee593a012938c12ca917fa8a7e3ee8c4ee055414ad75479b6de3c74","previewModeEncryptionKey":"b8cd042dcfa5ffc82dead343e6d398a5c6e43f0914c1fcf246c66c0a019c64ed","expireAt":1788815296531}
@@ -1 +1 @@
1
- {"encryption.key":"abDcXlcjZFIEZYawTs1Em1o5xnk8kg21Bm4gJYe0xNw=","encryption.expire_at":1788089376567}
1
+ {"encryption.key":"YarGHnilucy7AOI9ayDZUAGfe4eQGgej5vNDdcCPS2k=","encryption.expire_at":1788815296528}