scrabble-solver 2.9.0 → 2.9.1

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 (69) hide show
  1. package/.eslintignore +4 -2
  2. package/lerna.json +1 -1
  3. package/package.json +1 -1
  4. package/packages/configs/package.json +3 -3
  5. package/packages/constants/package.json +1 -1
  6. package/packages/dictionaries/build/constants/index.js +1 -1
  7. package/packages/dictionaries/package-lock.json +2 -2
  8. package/packages/dictionaries/package.json +4 -4
  9. package/packages/dictionaries/src/constants/index.ts +1 -1
  10. package/packages/logger/package-lock.json +2 -2
  11. package/packages/logger/package.json +3 -2
  12. package/packages/logger/scripts/stats.js +52 -0
  13. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  14. package/packages/scrabble-solver/.next/build-manifest.json +8 -8
  15. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  16. package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
  17. package/packages/scrabble-solver/.next/cache/next-server.js.nft.json +1 -1
  18. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  19. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  20. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
  21. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  22. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  23. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  24. package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
  25. package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
  26. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  27. package/packages/scrabble-solver/.next/server/chunks/413.js +1 -1
  28. package/packages/scrabble-solver/.next/server/chunks/44.js +1 -1
  29. package/packages/scrabble-solver/.next/server/chunks/452.js +1 -1
  30. package/packages/scrabble-solver/.next/server/chunks/515.js +5 -3
  31. package/packages/scrabble-solver/.next/server/chunks/865.js +230 -116
  32. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  33. package/packages/scrabble-solver/.next/server/pages/404.html +2 -2
  34. package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
  35. package/packages/scrabble-solver/.next/server/pages/500.html +2 -2
  36. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  37. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  38. package/packages/scrabble-solver/.next/server/pages/index.html +2 -2
  39. package/packages/scrabble-solver/.next/server/pages/index.js +5 -1
  40. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  41. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  42. package/packages/scrabble-solver/.next/static/{BiJ0RS1mh1CdONVQg_p20 → Oki2Ia4sgLw021iM7byAe}/_buildManifest.js +1 -1
  43. package/packages/scrabble-solver/.next/static/{BiJ0RS1mh1CdONVQg_p20 → Oki2Ia4sgLw021iM7byAe}/_ssgManifest.js +0 -0
  44. package/packages/scrabble-solver/.next/static/chunks/317-e7d5d859f1f95938.js +1 -0
  45. package/packages/scrabble-solver/.next/static/chunks/pages/{_app-1878e12521f2d115.js → _app-10893b318367f97c.js} +1 -1
  46. package/packages/scrabble-solver/.next/static/chunks/pages/{index-14d33636a0746c22.js → index-b1ffeaddd9fb64b5.js} +1 -1
  47. package/packages/scrabble-solver/.next/static/css/e3d218f4ea72c5fb.css +1 -0
  48. package/packages/scrabble-solver/.next/trace +52 -52
  49. package/packages/scrabble-solver/package-lock.json +2 -2
  50. package/packages/scrabble-solver/package.json +8 -8
  51. package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +2 -7
  52. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +1 -1
  53. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +4 -1
  54. package/packages/scrabble-solver/src/components/Board/components/Cell/CellPure.tsx +12 -1
  55. package/packages/scrabble-solver/src/components/Splash/Splash.module.scss +1 -1
  56. package/packages/scrabble-solver/src/pages/index.tsx +6 -1
  57. package/packages/scrabble-solver/src/service-worker/dictionaries/constants.ts +3 -1
  58. package/packages/solver/package-lock.json +2 -2
  59. package/packages/solver/package.json +5 -5
  60. package/packages/types/build/Locale.d.ts +2 -2
  61. package/packages/types/build/Locale.js +1 -1
  62. package/packages/types/package.json +2 -2
  63. package/packages/types/src/Locale.ts +1 -1
  64. package/packages/word-definitions/package-lock.json +14 -14
  65. package/packages/word-definitions/package.json +2 -2
  66. package/packages/word-lists/package-lock.json +2 -2
  67. package/packages/word-lists/package.json +2 -2
  68. package/packages/scrabble-solver/.next/static/chunks/317-c5d262202c17d519.js +0 -1
  69. package/packages/scrabble-solver/.next/static/css/9ac903004135f4b1.css +0 -1
package/.eslintignore CHANGED
@@ -1,8 +1,10 @@
1
+ **/bin/*.js
1
2
  **/build/**/*
2
3
  **/coverage/**/*
3
4
  **/dist/**/*
4
5
  **/node_modules/**/*
6
+ *.d.ts
5
7
  .eslintrc.js
6
8
  next.config.js
7
- *.d.ts
8
- **/bin/*.js
9
+ packages/logger/scripts/stats.js
10
+ packages/scrabble-solver/public/service-worker.js
package/lerna.json CHANGED
@@ -6,5 +6,5 @@
6
6
  "access": "public"
7
7
  },
8
8
  "tagVersionPrefix": "",
9
- "version": "2.9.0"
9
+ "version": "2.9.1"
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scrabble-solver",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Scrabble Solver 2 - Free and open-source analysis tool for Scrabble and Literaki. Quickly find top scoring words using given letters and board state. Available in English, French, German, Polish & Spanish.",
5
5
  "keywords": [
6
6
  "Scrabble",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/configs",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Scrabble Solver 2 - Configs",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/constants": "^2.9.0",
28
- "@scrabble-solver/types": "^2.9.0"
27
+ "@scrabble-solver/constants": "^2.9.1",
28
+ "@scrabble-solver/types": "^2.9.1"
29
29
  },
30
30
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
31
31
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/constants",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Scrabble Solver 2 - Constants",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -7,5 +7,5 @@ exports.OUTPUT_DIRECTORY = exports.CACHE_STALE_THRESHOLD = exports.DAY = void 0;
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  exports.DAY = 24 * 60 * 60 * 1000;
10
- exports.CACHE_STALE_THRESHOLD = 30 * exports.DAY;
10
+ exports.CACHE_STALE_THRESHOLD = 1 * exports.DAY; // eslint-disable-line no-implicit-coercion
11
11
  exports.OUTPUT_DIRECTORY = path_1.default.resolve(os_1.default.homedir(), '.scrabble-solver', 'dictionaries');
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/dictionaries",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/dictionaries",
9
- "version": "2.9.0",
9
+ "version": "2.9.1",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "@kamilmielnik/trie": "^2.0.1"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/dictionaries",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Scrabble Solver 2 - Dictionaries",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@kamilmielnik/trie": "^2.0.1",
34
- "@scrabble-solver/logger": "^2.9.0",
35
- "@scrabble-solver/types": "^2.9.0",
36
- "@scrabble-solver/word-lists": "^2.9.0"
34
+ "@scrabble-solver/logger": "^2.9.1",
35
+ "@scrabble-solver/types": "^2.9.1",
36
+ "@scrabble-solver/word-lists": "^2.9.1"
37
37
  },
38
38
  "gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
39
39
  }
@@ -3,6 +3,6 @@ import path from 'path';
3
3
 
4
4
  export const DAY = 24 * 60 * 60 * 1000;
5
5
 
6
- export const CACHE_STALE_THRESHOLD = 30 * DAY;
6
+ export const CACHE_STALE_THRESHOLD = 1 * DAY; // eslint-disable-line no-implicit-coercion
7
7
 
8
8
  export const OUTPUT_DIRECTORY = path.resolve(os.homedir(), '.scrabble-solver', 'dictionaries');
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scrabble-solver/logger",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@scrabble-solver/logger",
9
- "version": "2.9.0",
9
+ "version": "2.9.1",
10
10
  "license": "CC-BY-NC-ND-4.0",
11
11
  "dependencies": {
12
12
  "winston": "^3.8.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/logger",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Scrabble Solver 2 - Logger",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -21,7 +21,8 @@
21
21
  "scripts": {
22
22
  "build": "tsc --project .",
23
23
  "clean": "rimraf build/ node_modules/",
24
- "clean:force": "npm run clean && rimraf package-lock.json"
24
+ "clean:force": "npm run clean && rimraf package-lock.json",
25
+ "stats": "node scripts/stats.js"
25
26
  },
26
27
  "dependencies": {
27
28
  "winston": "^3.8.2"
@@ -0,0 +1,52 @@
1
+ const fs = require('fs');
2
+ const os = require('os');
3
+ const path = require('path');
4
+ const { argv } = require('process');
5
+
6
+ const DAY = 24 * 60 * 60 * 1000;
7
+
8
+ const getStats = (event, lines, since) => {
9
+ const daysCount = Math.ceil((Date.now() - Number(new Date(since))) / DAY);
10
+ const days = {};
11
+
12
+ let nextIndex = 0;
13
+ while (nextIndex !== -1) {
14
+ nextIndex = lines.indexOf(event, nextIndex + 1);
15
+
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]++;
21
+ }
22
+ }
23
+
24
+ const filteredDays = Object.fromEntries(
25
+ Object.entries(days).filter(([key]) => {
26
+ return key.localeCompare(since) !== -1;
27
+ }),
28
+ );
29
+
30
+ const sum = Object.entries(filteredDays).reduce((result, [, value]) => result + value, 0);
31
+
32
+ return { daysCount, event, filteredDays, sum };
33
+ };
34
+
35
+ const printStats = ({ daysCount, event, filteredDays, sum }) => {
36
+ console.log('--------------------------------------');
37
+ console.log(event);
38
+ console.log('--------------------------------------');
39
+ console.log(`Sum: ${sum}`);
40
+ 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));
52
+ }
@@ -1 +1 @@
1
- BiJ0RS1mh1CdONVQg_p20
1
+ Oki2Ia4sgLw021iM7byAe
@@ -5,8 +5,8 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/BiJ0RS1mh1CdONVQg_p20/_buildManifest.js",
9
- "static/BiJ0RS1mh1CdONVQg_p20/_ssgManifest.js"
8
+ "static/Oki2Ia4sgLw021iM7byAe/_buildManifest.js",
9
+ "static/Oki2Ia4sgLw021iM7byAe/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [],
12
12
  "pages": {
@@ -15,18 +15,18 @@
15
15
  "static/chunks/framework-4556c45dd113b893.js",
16
16
  "static/chunks/main-a75cf611e061d8f8.js",
17
17
  "static/chunks/546-447e243fc9de2c59.js",
18
- "static/css/9ac903004135f4b1.css",
19
- "static/chunks/317-c5d262202c17d519.js",
18
+ "static/css/e3d218f4ea72c5fb.css",
19
+ "static/chunks/317-e7d5d859f1f95938.js",
20
20
  "static/css/751e8a14776d05d8.css",
21
- "static/chunks/pages/index-14d33636a0746c22.js"
21
+ "static/chunks/pages/index-b1ffeaddd9fb64b5.js"
22
22
  ],
23
23
  "/404": [
24
24
  "static/chunks/webpack-5752944655d749a0.js",
25
25
  "static/chunks/framework-4556c45dd113b893.js",
26
26
  "static/chunks/main-a75cf611e061d8f8.js",
27
27
  "static/chunks/546-447e243fc9de2c59.js",
28
- "static/css/9ac903004135f4b1.css",
29
- "static/chunks/317-c5d262202c17d519.js",
28
+ "static/css/e3d218f4ea72c5fb.css",
29
+ "static/chunks/317-e7d5d859f1f95938.js",
30
30
  "static/chunks/pages/404-7082923654d5996f.js"
31
31
  ],
32
32
  "/_app": [
@@ -34,7 +34,7 @@
34
34
  "static/chunks/framework-4556c45dd113b893.js",
35
35
  "static/chunks/main-a75cf611e061d8f8.js",
36
36
  "static/css/ad2a08918868cad8.css",
37
- "static/chunks/pages/_app-1878e12521f2d115.js"
37
+ "static/chunks/pages/_app-10893b318367f97c.js"
38
38
  ],
39
39
  "/_error": [
40
40
  "static/chunks/webpack-5752944655d749a0.js",