scrabble-solver 2.8.3 → 2.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +2 -0
- package/HISTORY.md +17 -0
- package/README.md +8 -26
- package/lerna.json +1 -1
- package/package.json +13 -13
- package/packages/configs/package.json +3 -3
- package/packages/constants/package.json +1 -1
- package/packages/dictionaries/build/lib/DiskCache.js +2 -4
- package/packages/dictionaries/build/lib/index.d.ts +0 -2
- package/packages/dictionaries/build/lib/index.js +1 -5
- package/packages/dictionaries/package-lock.json +10 -10
- package/packages/dictionaries/package.json +5 -5
- package/packages/dictionaries/src/lib/DiskCache.ts +2 -4
- package/packages/dictionaries/src/lib/index.ts +0 -2
- package/packages/logger/package-lock.json +2 -2
- package/packages/logger/package.json +1 -1
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +10 -10
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/packages/scrabble-solver/.next/cache/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
- package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
- package/packages/scrabble-solver/.next/server/chunks/206.js +98 -97
- package/packages/scrabble-solver/.next/server/chunks/413.js +5 -4
- package/packages/scrabble-solver/.next/server/chunks/515.js +135 -53
- package/packages/scrabble-solver/.next/server/chunks/907.js +2 -2
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +5 -1
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +2 -2
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +50 -94
- package/packages/scrabble-solver/.next/server/pages/index.html +17 -1
- package/packages/scrabble-solver/.next/server/pages/index.js +5 -12
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/static/TzKQ3IntkvaYmHBkWpfoi/_buildManifest.js +1 -0
- package/packages/scrabble-solver/.next/static/{OhUvTNKwyrrzmNwKBnpUU → TzKQ3IntkvaYmHBkWpfoi}/_ssgManifest.js +0 -0
- package/packages/scrabble-solver/.next/static/chunks/56-2d34867599a0ac66.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/{404-02d949d2fe59e960.js → 404-30c06e61d256c5b2.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-6ffa2ab900772b67.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/{index-75517525489ab316.js → index-13ea7770a65c69ee.js} +1 -1
- package/packages/scrabble-solver/.next/static/css/{d676d43c6b9c9a57.css → 551d09cac435debb.css} +1 -1
- package/packages/scrabble-solver/.next/static/css/{6a9e5ba3f77c27f2.css → cdbc9e0afcff5473.css} +1 -1
- package/packages/scrabble-solver/.next/trace +42 -42
- package/packages/scrabble-solver/package-lock.json +85 -85
- package/packages/scrabble-solver/package.json +13 -13
- package/packages/scrabble-solver/src/components/Board/hooks/useGrid.ts +9 -0
- package/packages/scrabble-solver/src/components/KeyMap/KeyMap.tsx +1 -1
- package/packages/scrabble-solver/src/components/KeyMap/components/Mapping/Mapping.module.scss +4 -0
- package/packages/scrabble-solver/src/components/KeyMap/components/Mapping/Mapping.tsx +16 -12
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.tsx +4 -0
- package/packages/scrabble-solver/src/components/SvgFontCss/SvgFontCss.tsx +12 -0
- package/packages/scrabble-solver/src/components/SvgFontCss/index.ts +1 -0
- package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +1 -1
- package/packages/scrabble-solver/src/components/index.ts +1 -0
- package/packages/scrabble-solver/src/lib/createKeyboardNavigation.ts +3 -0
- package/packages/scrabble-solver/src/pages/index.tsx +5 -14
- package/packages/scrabble-solver/src/styles/global.scss +3 -0
- package/packages/solver/build/PatternsFiller.js +2 -6
- package/packages/solver/build/PatternsGenerator.js +13 -9
- package/packages/solver/build/Solver.js +3 -4
- package/packages/solver/package-lock.json +17 -17
- package/packages/solver/package.json +7 -7
- package/packages/solver/src/PatternsFiller.ts +2 -8
- package/packages/solver/src/PatternsGenerator.ts +17 -16
- package/packages/solver/src/Solver.ts +4 -8
- package/packages/types/build/Cell.js +1 -1
- package/packages/types/build/Pattern.js +1 -1
- package/packages/types/package.json +2 -2
- package/packages/types/src/Cell.ts +1 -1
- package/packages/types/src/Pattern.ts +1 -1
- package/packages/word-definitions/build/crawl/crawlGerman.js +1 -1
- package/packages/word-definitions/package-lock.json +8 -8
- package/packages/word-definitions/package.json +2 -2
- package/packages/word-definitions/src/crawl/crawlGerman.ts +1 -1
- package/packages/word-lists/build/getPlPlWordList.js +2 -3
- package/packages/word-lists/build/lib/downloadFile.d.ts +1 -2
- package/packages/word-lists/build/lib/downloadFile.js +24 -6
- package/packages/word-lists/build/lib/getTxtWordList.js +2 -4
- package/packages/word-lists/package-lock.json +2 -2
- package/packages/word-lists/package.json +2 -2
- package/packages/word-lists/src/getPlPlWordList.ts +2 -3
- package/packages/word-lists/src/lib/downloadFile.ts +25 -7
- package/packages/word-lists/src/lib/getTxtWordList.ts +2 -4
- package/packages/dictionaries/build/lib/readFile.d.ts +0 -2
- package/packages/dictionaries/build/lib/readFile.js +0 -19
- package/packages/dictionaries/build/lib/writeFile.d.ts +0 -2
- package/packages/dictionaries/build/lib/writeFile.js +0 -19
- package/packages/dictionaries/src/lib/readFile.ts +0 -15
- package/packages/dictionaries/src/lib/writeFile.ts +0 -15
- package/packages/scrabble-solver/.next/static/OhUvTNKwyrrzmNwKBnpUU/_buildManifest.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/195-4b75c9c697b7b455.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-72522bfb306a8aef.js +0 -1
package/.gitattributes
ADDED
package/HISTORY.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# History
|
|
2
|
+
|
|
3
|
+
Back in January 2012 I wrote 200 lines of C++ code to load up a dictionary, store it in a Trie structure, read up to 7 letters from console input and traverse the Trie structure to find all the words that could be created from provided letters. I did it for 200 PLN (about 60 USD back then) and it was my first money earned by programming (assuming that beer is not a currency).
|
|
4
|
+
|
|
5
|
+
I enjoyed working on it and wanted to enhance that with some visuals to take it to the next level. So I created a simple Windows Forms project in C#, added support for "blank" characters & displayed the results grouped by word length. And I left it like that.
|
|
6
|
+
|
|
7
|
+
Some time later I got familiar with WPF and somehow I got the idea it would be fun to enhance the C# solver with a visual board input. This would provide solver with information which would allow to find a move that will give you the most points. So in September 2014 I started working on a new C# WPF project, but I haven't got far with it.
|
|
8
|
+
|
|
9
|
+
After getting experienced with JavaScript, I decided to tackle the challenge once again. I started a new project in February 2017. React on the front, node.js in the back. On September 13th 2017, five and a half years since the beginning, `scrabble-solver@1.0.0` was released. And I saw it was good.
|
|
10
|
+
|
|
11
|
+
It got to `1.4.0` - I have added en-US & en-GB locales support, a mini tutorial and kept the dependencies up to date (e.g. upgraded React from 15 to 16).
|
|
12
|
+
|
|
13
|
+
Frontend development has changed, I've learned a few things - it was time for `scrabble-solver@2.0.0`. In 2019 I started to work on a new version. But due to many distractions the work took around 2 years to complete. Nevertheless, here it is, a shiny, state-of-the-art frontend app, January 2021 - 9 years after the first project.
|
|
14
|
+
|
|
15
|
+
## Scrabble Solver 1
|
|
16
|
+
|
|
17
|
+
A piece of history, available at http://scrabble-solver-v1.kamilmielnik.com/.
|
package/README.md
CHANGED
|
@@ -56,14 +56,14 @@ rm -rf $HOME/.scrabble-solver
|
|
|
56
56
|
|
|
57
57
|
## Dictionaries
|
|
58
58
|
|
|
59
|
-
| Language
|
|
60
|
-
|
|
61
|
-
| 🇬🇧 English |
|
|
62
|
-
| 🇺🇸 English |
|
|
63
|
-
| 🇫🇷 French |
|
|
64
|
-
| 🇩🇪 German |
|
|
65
|
-
| 🇵🇱 Polish |
|
|
66
|
-
| 🇪🇸 Spanish |
|
|
59
|
+
| Language | Word list | Word list | Word definitions |
|
|
60
|
+
|------------|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
|
|
61
|
+
| 🇬🇧 English | [SOWPODS](https://en.wikipedia.org/wiki/Collins_Scrabble_Words) | [Source](https://www.wordgamedictionary.com/sowpods/download/sowpods.txt) | [Merriam-Webster](https://www.merriam-webster.com/) |
|
|
62
|
+
| 🇺🇸 English | [TWL06](https://en.wikipedia.org/wiki/NASPA_Word_List) | [Source](https://www.wordgamedictionary.com/twl06/download/twl06.txt) | [Merriam-Webster](https://www.merriam-webster.com/) |
|
|
63
|
+
| 🇫🇷 French | [hbenbel/French-Dictionary](https://github.com/hbenbel/French-Dictionary/) | [Source](https://raw.githubusercontent.com/hbenbel/French-Dictionary/a573eab10cc798d7d5da7daab4d2ac0259bb46a3/dictionary/dictionary.txt) | [CNRTL](https://www.cnrtl.fr/) |
|
|
64
|
+
| 🇩🇪 German | [HanSolo80/German-Dictionary](https://github.com/HanSolo80/German-Dictionary) | [Source](https://raw.githubusercontent.com/HanSolo80/German-Dictionary/master/dictionary.txt) | [DWDS](https://www.dwds.de) |
|
|
65
|
+
| 🇵🇱 Polish | [SJP.PL](https://sjp.pl/slownik/dp.phtml) | [Source](https://sjp.pl/slownik/growy/) | [SJP.PL](https://sjp.pl) |
|
|
66
|
+
| 🇪🇸 Spanish | [FISE-2](https://fisescrabble.org/) | [Source](https://github.com/kamilmielnik/fise-2/blob/master/fise-2.txt) | [Diccionarios.com](https://www.diccionarios.com/) |
|
|
67
67
|
|
|
68
68
|
## Tech stack
|
|
69
69
|
|
|
@@ -77,21 +77,3 @@ rm -rf $HOME/.scrabble-solver
|
|
|
77
77
|
- [Jest](https://jestjs.io/)
|
|
78
78
|
- [ESLint](https://eslint.org/)
|
|
79
79
|
- [Prettier](https://prettier.io/)
|
|
80
|
-
|
|
81
|
-
## History
|
|
82
|
-
|
|
83
|
-
Back in January 2012 I wrote 200 lines of C++ code to load up a dictionary, store it in a Trie structure, read up to 7 letters from console input and traverse the Trie structure to find all the words that could be created from provided letters. I did it for 200 PLN (about 60 USD back then) and it was my first money earned by programming (assuming that beer is not a currency).
|
|
84
|
-
|
|
85
|
-
I enjoyed working on it and wanted to enhance that with some visuals to take it to the next level. So I created a simple Windows Forms project in C#, added support for "blank" characters & displayed the results grouped by word length. And I left it like that.
|
|
86
|
-
|
|
87
|
-
Some time later I got familiar with WPF and somehow I got the idea it would be fun to enhance the C# solver with a visual board input. This would provide solver with information which would allow to find a move that will give you the most points. So in September 2014 I started working on a new C# WPF project, but I haven't got far with it.
|
|
88
|
-
|
|
89
|
-
After getting experienced with JavaScript, I decided to tackle the challenge once again. I started a new project in February 2017. React on the front, node.js in the back. On September 13th 2017, five and a half years since the beginning, `scrabble-solver@1.0.0` was released. And I saw it was good.
|
|
90
|
-
|
|
91
|
-
It got to `1.4.0` - I have added en-US & en-GB locales support, a mini tutorial and kept the dependencies up to date (e.g. upgraded React from 15 to 16).
|
|
92
|
-
|
|
93
|
-
Frontend development has changed, I've learned a few things - it was time for `scrabble-solver@2.0.0`. In 2019 I started to work on a new version. But due to many distractions the work took around 2 years to complete. Nevertheless, here it is, a shiny, state-of-the-art frontend app, January 2021 - 9 years after the first project.
|
|
94
|
-
|
|
95
|
-
### Scrabble Solver 1
|
|
96
|
-
|
|
97
|
-
A piece of history, available at http://scrabble-solver-v1.kamilmielnik.com/.
|
package/lerna.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scrabble-solver",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"description": "Scrabble Solver 2 - The ultimate, open-source cheating app for Scrabble and Literaki",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Scrabble",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"App"
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=16
|
|
28
|
+
"node": ">=16"
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
31
|
"scrabble-solver": "./bin/scrabble-solver.js"
|
|
@@ -74,31 +74,31 @@
|
|
|
74
74
|
},
|
|
75
75
|
"homepage": "https://github.com/kamilmielnik/scrabble-solver#readme",
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"lerna": "^5.5.
|
|
77
|
+
"lerna": "^5.5.4",
|
|
78
78
|
"npm-run-all": "^4.1.5",
|
|
79
79
|
"open-cli": "^7.0.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@babel/core": "^7.19.
|
|
82
|
+
"@babel/core": "^7.19.3",
|
|
83
83
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
84
|
-
"@babel/preset-env": "^7.19.
|
|
85
|
-
"@types/jest": "^29.
|
|
86
|
-
"@types/node": "^18.7.
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "^5.38.
|
|
88
|
-
"@typescript-eslint/parser": "^5.38.
|
|
84
|
+
"@babel/preset-env": "^7.19.3",
|
|
85
|
+
"@types/jest": "^29.1.1",
|
|
86
|
+
"@types/node": "^18.7.23",
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
|
88
|
+
"@typescript-eslint/parser": "^5.38.1",
|
|
89
89
|
"babel-eslint": "10.1.0",
|
|
90
|
-
"eslint": "^8.
|
|
90
|
+
"eslint": "^8.24.0",
|
|
91
91
|
"eslint-config-prettier": "^8.5.0",
|
|
92
92
|
"eslint-import-resolver-node": "^0.3.6",
|
|
93
93
|
"eslint-plugin-import": "^2.26.0",
|
|
94
94
|
"eslint-plugin-prettier": "^4.2.1",
|
|
95
95
|
"eslint-plugin-react": "^7.31.8",
|
|
96
96
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
97
|
-
"jest": "29.
|
|
97
|
+
"jest": "29.1.2",
|
|
98
98
|
"np": "^7.6.2",
|
|
99
99
|
"prettier": "^2.7.1",
|
|
100
100
|
"rimraf": "^3.0.2",
|
|
101
|
-
"ts-jest": "^29.0.
|
|
102
|
-
"typescript": "^4.8.
|
|
101
|
+
"ts-jest": "^29.0.3",
|
|
102
|
+
"typescript": "^4.8.4"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/configs",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
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.8.
|
|
28
|
-
"@scrabble-solver/types": "^2.8.
|
|
27
|
+
"@scrabble-solver/constants": "^2.8.5",
|
|
28
|
+
"@scrabble-solver/types": "^2.8.5"
|
|
29
29
|
},
|
|
30
30
|
"gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
|
|
31
31
|
}
|
|
@@ -7,15 +7,13 @@ const trie_1 = require("@kamilmielnik/trie");
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
9
|
const getDictionaryFilepath_1 = __importDefault(require("./getDictionaryFilepath"));
|
|
10
|
-
const readFile_1 = __importDefault(require("./readFile"));
|
|
11
|
-
const writeFile_1 = __importDefault(require("./writeFile"));
|
|
12
10
|
class DiskCache {
|
|
13
11
|
async get(locale) {
|
|
14
12
|
if (!this.has(locale)) {
|
|
15
13
|
return undefined;
|
|
16
14
|
}
|
|
17
15
|
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
18
|
-
const serialized = await
|
|
16
|
+
const serialized = await fs_1.default.promises.readFile(filepath, 'utf-8');
|
|
19
17
|
const trie = trie_1.Trie.deserialize(serialized);
|
|
20
18
|
return trie;
|
|
21
19
|
}
|
|
@@ -44,7 +42,7 @@ class DiskCache {
|
|
|
44
42
|
}
|
|
45
43
|
async set(locale, trie) {
|
|
46
44
|
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
47
|
-
await
|
|
45
|
+
await fs_1.default.promises.writeFile(filepath, trie.serialize());
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
exports.default = DiskCache;
|
|
@@ -5,5 +5,3 @@ export { default as downloadDictionary } from './downloadDictionary';
|
|
|
5
5
|
export { default as getDictionaryFilepath } from './getDictionaryFilepath';
|
|
6
6
|
export { default as LayeredCache } from './LayeredCache';
|
|
7
7
|
export { default as MemoryCache } from './MemoryCache';
|
|
8
|
-
export { default as readFile } from './readFile';
|
|
9
|
-
export { default as writeFile } from './writeFile';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.MemoryCache = exports.LayeredCache = exports.getDictionaryFilepath = exports.downloadDictionary = exports.DiskCache = exports.createCacheTimestampComparator = exports.createAsyncProxy = void 0;
|
|
7
7
|
var createAsyncProxy_1 = require("./createAsyncProxy");
|
|
8
8
|
Object.defineProperty(exports, "createAsyncProxy", { enumerable: true, get: function () { return __importDefault(createAsyncProxy_1).default; } });
|
|
9
9
|
var createCacheTimestampComparator_1 = require("./createCacheTimestampComparator");
|
|
@@ -18,7 +18,3 @@ var LayeredCache_1 = require("./LayeredCache");
|
|
|
18
18
|
Object.defineProperty(exports, "LayeredCache", { enumerable: true, get: function () { return __importDefault(LayeredCache_1).default; } });
|
|
19
19
|
var MemoryCache_1 = require("./MemoryCache");
|
|
20
20
|
Object.defineProperty(exports, "MemoryCache", { enumerable: true, get: function () { return __importDefault(MemoryCache_1).default; } });
|
|
21
|
-
var readFile_1 = require("./readFile");
|
|
22
|
-
Object.defineProperty(exports, "readFile", { enumerable: true, get: function () { return __importDefault(readFile_1).default; } });
|
|
23
|
-
var writeFile_1 = require("./writeFile");
|
|
24
|
-
Object.defineProperty(exports, "writeFile", { enumerable: true, get: function () { return __importDefault(writeFile_1).default; } });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/dictionaries",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@scrabble-solver/dictionaries",
|
|
9
|
-
"version": "2.8.
|
|
9
|
+
"version": "2.8.5",
|
|
10
10
|
"license": "CC-BY-NC-ND-4.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@kamilmielnik/trie": "^
|
|
12
|
+
"@kamilmielnik/trie": "^2.0.0"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
15
|
"remove-dictionaries": "bin/remove-dictionaries.js",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"node_modules/@kamilmielnik/trie": {
|
|
20
|
-
"version": "
|
|
21
|
-
"resolved": "https://registry.npmjs.org/@kamilmielnik/trie/-/trie-
|
|
22
|
-
"integrity": "sha512-
|
|
20
|
+
"version": "2.0.0",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/@kamilmielnik/trie/-/trie-2.0.0.tgz",
|
|
22
|
+
"integrity": "sha512-YWTYtrV97bQ5hRifG1FImP47PI400a56O8+oQClQOtDjY3tioxab4sOgFHckiDdswciN1RwngCZ9Kv3phJfSuA==",
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=16"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@kamilmielnik/trie": {
|
|
30
|
-
"version": "
|
|
31
|
-
"resolved": "https://registry.npmjs.org/@kamilmielnik/trie/-/trie-
|
|
32
|
-
"integrity": "sha512-
|
|
30
|
+
"version": "2.0.0",
|
|
31
|
+
"resolved": "https://registry.npmjs.org/@kamilmielnik/trie/-/trie-2.0.0.tgz",
|
|
32
|
+
"integrity": "sha512-YWTYtrV97bQ5hRifG1FImP47PI400a56O8+oQClQOtDjY3tioxab4sOgFHckiDdswciN1RwngCZ9Kv3phJfSuA=="
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/dictionaries",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"description": "Scrabble Solver 2 - Dictionaries",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"postbuild": "node ./bin/update-dictionaries.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@kamilmielnik/trie": "^
|
|
34
|
-
"@scrabble-solver/logger": "^2.8.
|
|
35
|
-
"@scrabble-solver/types": "^2.8.
|
|
36
|
-
"@scrabble-solver/word-lists": "^2.8.
|
|
33
|
+
"@kamilmielnik/trie": "^2.0.0",
|
|
34
|
+
"@scrabble-solver/logger": "^2.8.5",
|
|
35
|
+
"@scrabble-solver/types": "^2.8.5",
|
|
36
|
+
"@scrabble-solver/word-lists": "^2.8.5"
|
|
37
37
|
},
|
|
38
38
|
"gitHead": "1e2d1ad49a288d4a44196d8e3336740da132c637"
|
|
39
39
|
}
|
|
@@ -6,8 +6,6 @@ import { CACHE_STALE_THRESHOLD } from '../constants';
|
|
|
6
6
|
import { Cache } from '../types';
|
|
7
7
|
|
|
8
8
|
import getDictionaryFilepath from './getDictionaryFilepath';
|
|
9
|
-
import readFile from './readFile';
|
|
10
|
-
import writeFile from './writeFile';
|
|
11
9
|
|
|
12
10
|
class DiskCache implements Cache<Locale, Trie> {
|
|
13
11
|
public async get(locale: Locale): Promise<Trie | undefined> {
|
|
@@ -16,7 +14,7 @@ class DiskCache implements Cache<Locale, Trie> {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
const filepath = getDictionaryFilepath(locale);
|
|
19
|
-
const serialized = await readFile(filepath);
|
|
17
|
+
const serialized = await fs.promises.readFile(filepath, 'utf-8');
|
|
20
18
|
const trie = Trie.deserialize(serialized);
|
|
21
19
|
return trie;
|
|
22
20
|
}
|
|
@@ -54,7 +52,7 @@ class DiskCache implements Cache<Locale, Trie> {
|
|
|
54
52
|
|
|
55
53
|
public async set(locale: Locale, trie: Trie): Promise<void> {
|
|
56
54
|
const filepath = getDictionaryFilepath(locale);
|
|
57
|
-
await writeFile(filepath, trie.serialize());
|
|
55
|
+
await fs.promises.writeFile(filepath, trie.serialize());
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
|
|
@@ -5,5 +5,3 @@ export { default as downloadDictionary } from './downloadDictionary';
|
|
|
5
5
|
export { default as getDictionaryFilepath } from './getDictionaryFilepath';
|
|
6
6
|
export { default as LayeredCache } from './LayeredCache';
|
|
7
7
|
export { default as MemoryCache } from './MemoryCache';
|
|
8
|
-
export { default as readFile } from './readFile';
|
|
9
|
-
export { default as writeFile } from './writeFile';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/logger",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@scrabble-solver/logger",
|
|
9
|
-
"version": "2.8.
|
|
9
|
+
"version": "2.8.5",
|
|
10
10
|
"license": "CC-BY-NC-ND-4.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"winston": "^3.8.2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
TzKQ3IntkvaYmHBkWpfoi
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"ampDevFiles": [],
|
|
7
7
|
"lowPriorityFiles": [
|
|
8
|
-
"static/
|
|
9
|
-
"static/
|
|
8
|
+
"static/TzKQ3IntkvaYmHBkWpfoi/_buildManifest.js",
|
|
9
|
+
"static/TzKQ3IntkvaYmHBkWpfoi/_ssgManifest.js"
|
|
10
10
|
],
|
|
11
11
|
"rootMainFiles": [],
|
|
12
12
|
"pages": {
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
"static/chunks/framework-4556c45dd113b893.js",
|
|
16
16
|
"static/chunks/main-a75cf611e061d8f8.js",
|
|
17
17
|
"static/chunks/758-f333b1dcdb941547.js",
|
|
18
|
-
"static/css/
|
|
19
|
-
"static/chunks/
|
|
18
|
+
"static/css/551d09cac435debb.css",
|
|
19
|
+
"static/chunks/56-2d34867599a0ac66.js",
|
|
20
20
|
"static/css/3159cfe62ff742a3.css",
|
|
21
|
-
"static/chunks/pages/index-
|
|
21
|
+
"static/chunks/pages/index-13ea7770a65c69ee.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/758-f333b1dcdb941547.js",
|
|
28
|
-
"static/css/
|
|
29
|
-
"static/chunks/
|
|
30
|
-
"static/chunks/pages/404-
|
|
28
|
+
"static/css/551d09cac435debb.css",
|
|
29
|
+
"static/chunks/56-2d34867599a0ac66.js",
|
|
30
|
+
"static/chunks/pages/404-30c06e61d256c5b2.js"
|
|
31
31
|
],
|
|
32
32
|
"/_app": [
|
|
33
33
|
"static/chunks/webpack-5752944655d749a0.js",
|
|
34
34
|
"static/chunks/framework-4556c45dd113b893.js",
|
|
35
35
|
"static/chunks/main-a75cf611e061d8f8.js",
|
|
36
|
-
"static/css/
|
|
37
|
-
"static/chunks/pages/_app-
|
|
36
|
+
"static/css/cdbc9e0afcff5473.css",
|
|
37
|
+
"static/chunks/pages/_app-6ffa2ab900772b67.js"
|
|
38
38
|
],
|
|
39
39
|
"/_error": [
|
|
40
40
|
"static/chunks/webpack-5752944655d749a0.js",
|