scrabble-solver 2.13.13 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/.github/workflows/build.yml +6 -14
  2. package/.github/workflows/cypress.yml +12 -8
  3. package/.github/workflows/eslint.yml +4 -10
  4. package/.github/workflows/jest.yml +4 -10
  5. package/.nx/cache/nx_files.nxt +0 -0
  6. package/.nx/workspace-data/file-map.json +319 -275
  7. package/.nx/workspace-data/lockfile.hash +1 -1
  8. package/.nx/workspace-data/parsed-lock-file.json +352 -277
  9. package/.nx/workspace-data/project-graph.json +583 -463
  10. package/README.md +12 -10
  11. package/bin/scrabble-solver.js +0 -0
  12. package/cypress/e2e/app.spec.cy.ts +87 -76
  13. package/cypress/e2e/bugs/112-character-bonus.ts +40 -0
  14. package/cypress/e2e/bugs/129-esc-sidebar.ts +23 -0
  15. package/cypress/e2e/bugs/2-q-tile-in-english.ts +33 -0
  16. package/cypress/e2e/bugs/3-x-tile-in-polish.ts +33 -0
  17. package/cypress/e2e/bugs/30-click-inside-radio-icon.ts +26 -0
  18. package/cypress/e2e/bugs/333-disabled-radio-cursor.ts +24 -0
  19. package/cypress/e2e/bugs/342-results-sorting.ts +48 -0
  20. package/cypress/e2e/bugs/348-results-word-padding.ts +74 -0
  21. package/cypress/e2e/bugs.spec.cy.ts +8 -0
  22. package/lerna.json +1 -1
  23. package/package.json +24 -15
  24. package/packages/configs/build/games/index.d.ts +4 -3
  25. package/packages/configs/build/games/index.js +17 -9
  26. package/packages/configs/build/games/kelimelik.d.ts +16 -0
  27. package/packages/configs/build/games/kelimelik.js +64 -0
  28. package/packages/configs/build/games/literaki.d.ts +1 -2
  29. package/packages/configs/build/games/literaki.js +2 -2
  30. package/packages/configs/build/games/scrabble.d.ts +1 -2
  31. package/packages/configs/build/games/scrabble.js +2 -2
  32. package/packages/configs/build/games/superScrabble.d.ts +1 -2
  33. package/packages/configs/build/games/superScrabble.js +2 -2
  34. package/packages/configs/build/languages/index.d.ts +1 -0
  35. package/packages/configs/build/languages/index.js +1 -0
  36. package/packages/configs/build/languages/turkish.d.ts +3 -0
  37. package/packages/configs/build/languages/turkish.js +75 -0
  38. package/packages/configs/package.json +3 -3
  39. package/packages/configs/src/games/index.ts +4 -3
  40. package/packages/configs/src/games/kelimelik.ts +62 -0
  41. package/packages/configs/src/games/literaki.ts +1 -3
  42. package/packages/configs/src/games/scrabble.ts +1 -3
  43. package/packages/configs/src/games/superScrabble.ts +1 -3
  44. package/packages/configs/src/languages/index.ts +1 -0
  45. package/packages/configs/src/languages/turkish.ts +75 -0
  46. package/packages/constants/build/index.js +2 -2
  47. package/packages/constants/package.json +1 -1
  48. package/packages/constants/src/index.ts +2 -2
  49. package/packages/dictionaries/package-lock.json +2 -2
  50. package/packages/dictionaries/package.json +4 -4
  51. package/packages/logger/package-lock.json +2 -2
  52. package/packages/logger/package.json +1 -1
  53. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  54. package/packages/scrabble-solver/.next/build-manifest.json +5 -5
  55. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  56. package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
  57. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  58. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  59. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  60. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  61. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  62. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  63. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  64. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  65. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  66. package/packages/scrabble-solver/.next/prerender-manifest.js +1 -1
  67. package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
  68. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  69. package/packages/scrabble-solver/.next/server/chunks/807.js +1 -1
  70. package/packages/scrabble-solver/.next/server/chunks/911.js +1 -1
  71. package/packages/scrabble-solver/.next/server/chunks/977.js +1 -1
  72. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  73. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  74. package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
  75. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  76. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  77. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
  78. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  79. package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
  80. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  81. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  82. package/packages/scrabble-solver/.next/server/pages-manifest.json +1 -1
  83. package/packages/scrabble-solver/.next/static/{qwJjm2FeDHHGY92CY5oQQ → C0yfLTukP3L3iDqdXbbBv}/_buildManifest.js +1 -1
  84. package/packages/scrabble-solver/.next/static/chunks/pages/_app-e73bbdbc75537614.js +17 -0
  85. package/packages/scrabble-solver/.next/static/chunks/pages/index-4143525ec0fa83bb.js +1 -0
  86. package/packages/scrabble-solver/.next/static/css/{2adc9736d823979b.css → ac3349339fcf58f2.css} +1 -1
  87. package/packages/scrabble-solver/.next/trace +45 -45
  88. package/packages/scrabble-solver/package-lock.json +4 -4
  89. package/packages/scrabble-solver/package.json +11 -11
  90. package/packages/scrabble-solver/public/service-worker.js +2 -2
  91. package/packages/scrabble-solver/public/service-worker.js.map +1 -1
  92. package/packages/scrabble-solver/src/components/Alert/Alert.tsx +1 -1
  93. package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -3
  94. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +1 -1
  95. package/packages/scrabble-solver/src/components/Button/Button.tsx +1 -1
  96. package/packages/scrabble-solver/src/components/IconButton/IconButton.tsx +1 -1
  97. package/packages/scrabble-solver/src/components/IconButton/Link.tsx +1 -1
  98. package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.tsx +4 -4
  99. package/packages/scrabble-solver/src/components/NotFound/NotFound.tsx +1 -1
  100. package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +3 -2
  101. package/packages/scrabble-solver/src/components/Radio/Radio.tsx +1 -1
  102. package/packages/scrabble-solver/src/components/Results/HeaderButton.tsx +1 -1
  103. package/packages/scrabble-solver/src/components/Results/Results.module.scss +5 -8
  104. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +1 -1
  105. package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +1 -1
  106. package/packages/scrabble-solver/src/i18n/constants.ts +12 -1
  107. package/packages/scrabble-solver/src/i18n/i18n.ts +2 -0
  108. package/packages/scrabble-solver/src/i18n/languages/turkish.json +78 -0
  109. package/packages/scrabble-solver/src/icons/FlagTr.svg +4 -0
  110. package/packages/scrabble-solver/src/icons/index.ts +1 -0
  111. package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +1 -1
  112. package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +1 -1
  113. package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +2 -2
  114. package/packages/scrabble-solver/src/pages/_app.tsx +11 -2
  115. package/packages/solver/package-lock.json +2 -2
  116. package/packages/solver/package.json +5 -5
  117. package/packages/types/build/Game.d.ts +1 -0
  118. package/packages/types/build/Game.js +1 -0
  119. package/packages/types/build/Locale.d.ts +2 -1
  120. package/packages/types/build/Locale.js +1 -0
  121. package/packages/types/package.json +2 -2
  122. package/packages/types/src/Game.ts +1 -0
  123. package/packages/types/src/Locale.ts +1 -0
  124. package/packages/word-definitions/build/crawl.js +1 -0
  125. package/packages/word-definitions/build/index.d.ts +1 -1
  126. package/packages/word-definitions/build/index.js +1 -3
  127. package/packages/word-definitions/build/languages/index.d.ts +1 -0
  128. package/packages/word-definitions/build/languages/index.js +2 -1
  129. package/packages/word-definitions/build/languages/turkish.d.ts +3 -0
  130. package/packages/word-definitions/build/languages/turkish.js +31 -0
  131. package/packages/word-definitions/build/lib/index.d.ts +3 -3
  132. package/packages/word-definitions/build/lib/index.js +17 -7
  133. package/packages/word-definitions/build/parse.js +1 -0
  134. package/packages/word-definitions/package-lock.json +2 -2
  135. package/packages/word-definitions/package.json +2 -2
  136. package/packages/word-definitions/src/__tests__/expected/tr-TR.lojik.json +4 -0
  137. package/packages/word-definitions/src/__tests__/input/tr-TR.lojik.html +1 -0
  138. package/packages/word-definitions/src/crawl.ts +2 -1
  139. package/packages/word-definitions/src/index.ts +1 -2
  140. package/packages/word-definitions/src/languages/index.ts +1 -0
  141. package/packages/word-definitions/src/languages/turkish.ts +32 -0
  142. package/packages/word-definitions/src/lib/index.ts +3 -3
  143. package/packages/word-definitions/src/parse.test.ts +1 -0
  144. package/packages/word-definitions/src/parse.ts +2 -1
  145. package/packages/word-lists/build/getWordList.js +1 -0
  146. package/packages/word-lists/build/languages/index.d.ts +1 -0
  147. package/packages/word-lists/build/languages/index.js +2 -1
  148. package/packages/word-lists/build/languages/turkish.d.ts +1 -0
  149. package/packages/word-lists/build/languages/turkish.js +10 -0
  150. package/packages/word-lists/package-lock.json +3 -3
  151. package/packages/word-lists/package.json +3 -3
  152. package/packages/word-lists/src/getWordList.ts +2 -1
  153. package/packages/word-lists/src/languages/index.ts +1 -0
  154. package/packages/word-lists/src/languages/turkish.ts +9 -0
  155. package/cypress/e2e/bugs/112.spec.cy.ts +0 -29
  156. package/cypress/e2e/bugs/129.spec.cy.ts +0 -13
  157. package/cypress/e2e/bugs/2.spec.cy.ts +0 -15
  158. package/cypress/e2e/bugs/3.spec.cy.ts +0 -15
  159. package/cypress/e2e/bugs/342.spec.cy.ts +0 -37
  160. package/cypress/e2e/bugs/348.spec.cy.ts +0 -73
  161. package/packages/scrabble-solver/.next/static/chunks/pages/_app-42ce6b4032e931ff.js +0 -17
  162. package/packages/scrabble-solver/.next/static/chunks/pages/index-3718075f2ba2220c.js +0 -1
  163. /package/packages/scrabble-solver/.next/static/{qwJjm2FeDHHGY92CY5oQQ → C0yfLTukP3L3iDqdXbbBv}/_ssgManifest.js +0 -0
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unique = exports.request = exports.normalizeDefinition = void 0;
4
- var normalizeDefinition_1 = require("./normalizeDefinition");
5
- Object.defineProperty(exports, "normalizeDefinition", { enumerable: true, get: function () { return normalizeDefinition_1.normalizeDefinition; } });
6
- var request_1 = require("./request");
7
- Object.defineProperty(exports, "request", { enumerable: true, get: function () { return request_1.request; } });
8
- var unique_1 = require("./unique");
9
- Object.defineProperty(exports, "unique", { enumerable: true, get: function () { return unique_1.unique; } });
17
+ __exportStar(require("./normalizeDefinition"), exports);
18
+ __exportStar(require("./request"), exports);
19
+ __exportStar(require("./unique"), exports);
@@ -13,6 +13,7 @@ const parsePerLocale = {
13
13
  [types_1.Locale.FR_FR]: languages_1.french.parse,
14
14
  [types_1.Locale.PL_PL]: languages_1.polish.parse,
15
15
  [types_1.Locale.RO_RO]: languages_1.romanian.parse,
16
+ [types_1.Locale.TR_TR]: languages_1.turkish.parse,
16
17
  };
17
18
  const parse = (locale, html) => {
18
19
  const { definitions, exists } = parsePerLocale[locale](html);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.13.13",
3
+ "version": "2.15.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/word-definitions",
9
- "version": "2.13.13",
9
+ "version": "2.15.0",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "cheerio": "^1.0.0-rc.12",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.13.13",
3
+ "version": "2.15.0",
4
4
  "description": "Scrabble Solver 2 - Word definitions",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.13.13",
26
+ "@scrabble-solver/types": "^2.15.0",
27
27
  "cheerio": "^1.0.0-rc.12",
28
28
  "follow-redirects": "^1.15.6",
29
29
  "striptags": "^3.2.0"
@@ -0,0 +1,4 @@
1
+ {
2
+ "definitions": ["Mantıkla ilgili", "mantıklı", "mantık"],
3
+ "exists": true
4
+ }
@@ -0,0 +1 @@
1
+ [{"madde_id":"44658","kac":"0","kelime_no":"33889","cesit":"0","anlam_gor":"0","on_taki":null,"on_taki_html":null,"madde":"lojik","madde_html":"<strong>lojik<\/strong>","cesit_say":"0","anlam_say":"3","taki":"ği","cogul_mu":"0","ozel_mi":"0","egik_mi":"0","lisan_kodu":"13","lisan":"Fransızca logique","telaffuz_html":null,"lisan_html":null,"telaffuz":"l ince okunur","birlesikler":null,"font":null,"madde_duz":"lojik","gosterim_tarihi":null,"anlamlarListe":[{"anlam_id":"58622","madde_id":"44658","anlam_sira":"1","fiil":"0","tipkes":"0","anlam":"Mantıkla ilgili","anlam_html":null,"gos":"0","gos_kelime":"0","gos_kultur":"0","ozelliklerListe":[{"ozellik_id":"20","tur":"3","tam_adi":"sıfat","kisa_adi":"sf.","ekno":"31"}]},{"anlam_id":"58623","madde_id":"44658","anlam_sira":"2","fiil":"0","tipkes":"0","anlam":"► mantıklı","anlam_html":"<p>► mantıklı<\/p>\n","gos":"0","gos_kelime":"0","gos_kultur":"0","orneklerListe":[{"ornek_id":"54500","anlam_id":"58623","ornek_sira":"1","ornek":"Osman mekanik araçları, bu araçların işleyişini göz önüne alarak aslına uymayı gözden kaçırmayan lojik bir sorumlulukla tasvir etmiştir.","kac":"1","yazar_id":"2221","yazar_vd":"","yazar":[{"yazar_id":"2221","tam_adi":"Sezer Tansuğ","kisa_adi":"S. Tansuğ","ekno":"2454"}]}]},{"anlam_id":"58624","madde_id":"44658","anlam_sira":"3","fiil":"0","tipkes":"0","anlam":"► mantık","anlam_html":"<p>► mantık<\/p>\n","gos":"1","gos_kelime":"0","gos_kultur":"0","ozelliklerListe":[{"ozellik_id":"19","tur":"3","tam_adi":"isim","kisa_adi":"a.","ekno":"30"},{"ozellik_id":"57","tur":"1","tam_adi":"felsefe","kisa_adi":"fel.","ekno":"106"}]}]}]
@@ -1,6 +1,6 @@
1
1
  import { Locale } from '@scrabble-solver/types';
2
2
 
3
- import { english, french, german, persian, polish, romanian, spanish } from './languages';
3
+ import { english, french, german, persian, polish, romanian, spanish, turkish } from './languages';
4
4
 
5
5
  const crawlPerLocale: Record<Locale, (word: string) => Promise<string>> = {
6
6
  [Locale.DE_DE]: german.crawl,
@@ -11,6 +11,7 @@ const crawlPerLocale: Record<Locale, (word: string) => Promise<string>> = {
11
11
  [Locale.FR_FR]: french.crawl,
12
12
  [Locale.PL_PL]: polish.crawl,
13
13
  [Locale.RO_RO]: romanian.crawl,
14
+ [Locale.TR_TR]: turkish.crawl,
14
15
  };
15
16
 
16
17
  export const crawl = (locale: Locale, word: string): Promise<string> => {
@@ -1,6 +1,5 @@
1
- export { getWordDefinition } from './getWordDefinition';
2
-
3
1
  export * from './crawl';
2
+ export * from './getWordDefinition';
4
3
  export * from './languages';
5
4
  export * from './lib';
6
5
  export * from './parse';
@@ -5,3 +5,4 @@ export * as persian from './persian';
5
5
  export * as polish from './polish';
6
6
  export * as romanian from './romanian';
7
7
  export * as spanish from './spanish';
8
+ export * as turkish from './turkish';
@@ -0,0 +1,32 @@
1
+ import { request } from '../lib';
2
+ import { ParsingResult } from '../types';
3
+
4
+ export const crawl = (word: string): Promise<string> => {
5
+ return request({
6
+ protocol: 'https',
7
+ hostname: 'sozluk.gov.tr',
8
+ path: `/gts?ara=${encodeURIComponent(word)}`,
9
+ headers: {
10
+ 'content-type': 'text/json',
11
+ },
12
+ });
13
+ };
14
+
15
+ export const parse = (json: string): ParsingResult => {
16
+ const response = JSON.parse(json);
17
+
18
+ if (response.error) {
19
+ return {
20
+ definitions: [],
21
+ exists: false,
22
+ };
23
+ }
24
+
25
+ const [wordInfo] = response;
26
+ const definitions = wordInfo.anlamlarListe.map((entry: { anlam: string }) => entry.anlam.replace('►', '').trim());
27
+
28
+ return {
29
+ definitions,
30
+ exists: definitions.length > 0,
31
+ };
32
+ };
@@ -1,3 +1,3 @@
1
- export { normalizeDefinition } from './normalizeDefinition';
2
- export { request } from './request';
3
- export { unique } from './unique';
1
+ export * from './normalizeDefinition';
2
+ export * from './request';
3
+ export * from './unique';
@@ -23,6 +23,7 @@ const tests = [
23
23
  { locale: Locale.ES_ES, word: 'corma' },
24
24
  { locale: Locale.ES_ES, word: 'portero' },
25
25
  { locale: Locale.RO_RO, word: 'aciua' },
26
+ { locale: Locale.TR_TR, word: 'lojik' },
26
27
  ];
27
28
 
28
29
  describe('parse', () => {
@@ -1,6 +1,6 @@
1
1
  import { Locale } from '@scrabble-solver/types';
2
2
 
3
- import { english, french, german, persian, polish, romanian, spanish } from './languages';
3
+ import { english, french, german, persian, polish, romanian, spanish, turkish } from './languages';
4
4
  import { normalizeDefinition, unique } from './lib';
5
5
  import { ParsingResult } from './types';
6
6
 
@@ -13,6 +13,7 @@ const parsePerLocale: Record<Locale, (html: string) => ParsingResult> = {
13
13
  [Locale.FR_FR]: french.parse,
14
14
  [Locale.PL_PL]: polish.parse,
15
15
  [Locale.RO_RO]: romanian.parse,
16
+ [Locale.TR_TR]: turkish.parse,
16
17
  };
17
18
 
18
19
  export const parse = (locale: Locale, html: string): ParsingResult => {
@@ -12,6 +12,7 @@ const localeMap = {
12
12
  [types_1.Locale.FR_FR]: languages_1.french.getWordList,
13
13
  [types_1.Locale.PL_PL]: languages_1.polish.getWordList,
14
14
  [types_1.Locale.RO_RO]: languages_1.romanian.getWordList,
15
+ [types_1.Locale.TR_TR]: languages_1.turkish.getWordList,
15
16
  };
16
17
  const getWordList = (locale) => localeMap[locale]();
17
18
  exports.getWordList = getWordList;
@@ -5,3 +5,4 @@ export * as persian from './persian';
5
5
  export * as polish from './polish';
6
6
  export * as romanian from './romanian';
7
7
  export * as spanish from './spanish';
8
+ export * as turkish from './turkish';
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.spanish = exports.romanian = exports.polish = exports.persian = exports.french = exports.german = exports.english = void 0;
26
+ exports.turkish = exports.spanish = exports.romanian = exports.polish = exports.persian = exports.french = exports.german = exports.english = void 0;
27
27
  exports.english = __importStar(require("./english"));
28
28
  exports.german = __importStar(require("./german"));
29
29
  exports.french = __importStar(require("./french"));
@@ -31,3 +31,4 @@ exports.persian = __importStar(require("./persian"));
31
31
  exports.polish = __importStar(require("./polish"));
32
32
  exports.romanian = __importStar(require("./romanian"));
33
33
  exports.spanish = __importStar(require("./spanish"));
34
+ exports.turkish = __importStar(require("./turkish"));
@@ -0,0 +1 @@
1
+ export declare const getWordList: () => Promise<string[]>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWordList = void 0;
4
+ const types_1 = require("@scrabble-solver/types");
5
+ const lib_1 = require("../lib");
6
+ const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/turkish/turkish.txt';
7
+ const getWordList = async () => {
8
+ return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.TR_TR);
9
+ };
10
+ exports.getWordList = getWordList;
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.13",
3
+ "version": "2.15.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/word-lists",
9
- "version": "2.13.13",
9
+ "version": "2.15.0",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "cheerio": "^1.0.0-rc.12",
13
13
  "follow-redirects": "^1.15.6",
14
14
  "latinize": "^1.0.0",
15
- "unzipper": "^0.12.1"
15
+ "unzipper": "^0.12.3"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/follow-redirects": "^1.14.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.13",
3
+ "version": "2.15.0",
4
4
  "description": "Scrabble Solver 2 - Word lists",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,11 +23,11 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.13.13",
26
+ "@scrabble-solver/types": "^2.15.0",
27
27
  "cheerio": "^1.0.0-rc.12",
28
28
  "follow-redirects": "^1.15.6",
29
29
  "latinize": "^1.0.0",
30
- "unzipper": "^0.12.1"
30
+ "unzipper": "^0.12.3"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/follow-redirects": "^1.14.4",
@@ -1,6 +1,6 @@
1
1
  import { Locale } from '@scrabble-solver/types';
2
2
 
3
- import { english, french, german, persian, polish, romanian, spanish } from './languages';
3
+ import { english, french, german, persian, polish, romanian, spanish, turkish } from './languages';
4
4
 
5
5
  const localeMap: Record<Locale, () => Promise<string[]>> = {
6
6
  [Locale.DE_DE]: german.getWordList,
@@ -11,6 +11,7 @@ const localeMap: Record<Locale, () => Promise<string[]>> = {
11
11
  [Locale.FR_FR]: french.getWordList,
12
12
  [Locale.PL_PL]: polish.getWordList,
13
13
  [Locale.RO_RO]: romanian.getWordList,
14
+ [Locale.TR_TR]: turkish.getWordList,
14
15
  };
15
16
 
16
17
  export const getWordList = (locale: Locale): Promise<string[]> => localeMap[locale]();
@@ -5,3 +5,4 @@ export * as persian from './persian';
5
5
  export * as polish from './polish';
6
6
  export * as romanian from './romanian';
7
7
  export * as spanish from './spanish';
8
+ export * as turkish from './turkish';
@@ -0,0 +1,9 @@
1
+ import { Locale } from '@scrabble-solver/types';
2
+
3
+ import { getTxtWordList } from '../lib';
4
+
5
+ const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/turkish/turkish.txt';
6
+
7
+ export const getWordList = async (): Promise<string[]> => {
8
+ return getTxtWordList(FILE_URL, Locale.TR_TR);
9
+ };
@@ -1,29 +0,0 @@
1
- import {
2
- assertResult,
3
- closeModal,
4
- getSettingOption,
5
- getSettingsButton,
6
- solve,
7
- typeRack,
8
- visitIndex,
9
- } from '../../support';
10
-
11
- /*
12
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/112
13
- */
14
- it('Scrabble - Character bonus not applied (#112)', () => {
15
- visitIndex();
16
-
17
- getSettingsButton().realClick();
18
- getSettingOption('Language', 'Français').check();
19
- closeModal();
20
- typeRack('jours');
21
- solve();
22
-
23
- assertResult(0, 'jours', 40);
24
- assertResult(1, 'jours', 40);
25
- assertResult(2, 'jours', 26);
26
- assertResult(3, 'jours', 26);
27
- assertResult(4, 'jours', 24);
28
- assertResult(5, 'jours', 24);
29
- });
@@ -1,13 +0,0 @@
1
- import { getModal, getSettingsButton, typeRack, visitIndex } from '../../support';
2
-
3
- /*
4
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/129
5
- */
6
- it('Esc does not close the sidebar when letters input is focused (#129)', () => {
7
- visitIndex();
8
- getSettingsButton().realClick();
9
- typeRack('a');
10
- cy.realPress('Escape');
11
-
12
- getModal().should('not.exist');
13
- });
@@ -1,15 +0,0 @@
1
- import { assertResult, getResults, solve, typeBoard, typeRack, visitIndex } from '../../support';
2
-
3
- /*
4
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/2
5
- */
6
- it('"Q" tile does not work (#2)', () => {
7
- visitIndex();
8
- typeBoard('i', 'horizontal', 7, 7);
9
- typeRack('q');
10
- solve();
11
-
12
- getResults().should('have.length', 2);
13
- assertResult(0, 'qi', 11);
14
- assertResult(1, 'qi', 11);
15
- });
@@ -1,15 +0,0 @@
1
- import { closeModal, getSettingOption, getSettingsButton, typeBoard, typeRack, visitIndex } from '../../support';
2
-
3
- /*
4
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/3
5
- */
6
- it('X tile is allowed in Polish language (#3)', () => {
7
- visitIndex();
8
- getSettingsButton().realClick();
9
- getSettingOption('Language', 'Polski').check();
10
- closeModal();
11
- typeBoard('x', 'horizontal', 7, 7);
12
- typeRack('x');
13
-
14
- cy.findByText('x').should('not.exist');
15
- });
@@ -1,37 +0,0 @@
1
- import {
2
- assertResult,
3
- closeModal,
4
- getResult,
5
- getResultsFilterInput,
6
- getSettingOption,
7
- getSettingsButton,
8
- solve,
9
- typeBoard,
10
- typeRack,
11
- visitIndex,
12
- } from '../../support';
13
-
14
- /*
15
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/342
16
- */
17
- it('Incorrect sorting when filtering (#342)', () => {
18
- visitIndex();
19
- getSettingsButton().realClick();
20
- getSettingOption('Language', 'Polski').check();
21
- closeModal();
22
- typeBoard('bopie', 'horizontal', 6, 3);
23
- typeBoard('apu', 'vertical', 8, 4);
24
- typeBoard('o', 'vertical', 10, 4);
25
- typeRack('oe');
26
- solve();
27
- getResultsFilterInput().type('p');
28
-
29
- assertResult(0, 'po', 5);
30
- assertResult(1, 'pe', 5);
31
- assertResult(2, 'op', 3);
32
- assertResult(3, 'eo', 6);
33
- getResult(0).should('not.have.attr', 'aria-hidden');
34
- getResult(1).should('not.have.attr', 'aria-hidden');
35
- getResult(2).should('not.have.attr', 'aria-hidden');
36
- getResult(3).should('have.attr', 'aria-hidden', 'true');
37
- });
@@ -1,73 +0,0 @@
1
- import {
2
- getResult,
3
- getSettingOption,
4
- getSettingsButton,
5
- solve,
6
- typeRack,
7
- unregisterServiceWorkers,
8
- visitIndex,
9
- } from '../../support';
10
-
11
- /*
12
- * @see https://github.com/kamilmielnik/scrabble-solver/issues/348
13
- */
14
- describe('#348', () => {
15
- beforeEach(async () => {
16
- await unregisterServiceWorkers();
17
- });
18
-
19
- it('Missing result word padding when coordinates are not shown (LTR) (#348)', () => {
20
- visitIndex();
21
- typeRack('ab');
22
- solve();
23
-
24
- getResult(0).then(([$result]) => {
25
- const $span = $result.children[0];
26
- const firstCell = $span.children[0];
27
- const lastCell = $span.children[$span.children.length - 1];
28
-
29
- expect(window.getComputedStyle(firstCell).paddingLeft).to.equal('15px');
30
- expect(window.getComputedStyle(lastCell).paddingRight).to.equal('5px');
31
- });
32
-
33
- getSettingsButton().realClick();
34
- getSettingOption('Coordinates', 'Original').check();
35
-
36
- getResult(0).then(([$result]) => {
37
- const $span = $result.children[0];
38
- const firstCell = $span.children[0];
39
- const lastCell = $span.children[$span.children.length - 1];
40
-
41
- expect(window.getComputedStyle(firstCell).paddingLeft).to.equal('5px');
42
- expect(window.getComputedStyle(lastCell).paddingRight).to.equal('5px');
43
- });
44
- });
45
-
46
- it('Missing result word padding when coordinates are not shown (RTL) (#348)', () => {
47
- visitIndex();
48
- getSettingsButton().realClick();
49
- getSettingOption('Language', 'فارسی').check();
50
- typeRack('فا');
51
- solve();
52
-
53
- getResult(0).then(([$result]) => {
54
- const $span = $result.children[0];
55
- const firstCell = $span.children[0];
56
- const lastCell = $span.children[$span.children.length - 1];
57
-
58
- expect(window.getComputedStyle(firstCell).paddingRight).to.equal('15px');
59
- expect(window.getComputedStyle(lastCell).paddingLeft).to.equal('5px');
60
- });
61
-
62
- getSettingOption('مختصات', 'إبداعي').check();
63
-
64
- getResult(0).then(([$result]) => {
65
- const $span = $result.children[0];
66
- const firstCell = $span.children[0];
67
- const lastCell = $span.children[$span.children.length - 1];
68
-
69
- expect(window.getComputedStyle(firstCell).paddingRight).to.equal('5px');
70
- expect(window.getComputedStyle(lastCell).paddingLeft).to.equal('5px');
71
- });
72
- });
73
- });