scrabble-solver 2.15.24 → 2.16.0-alpha.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 (143) hide show
  1. package/.claude/settings.local.json +12 -1
  2. package/.github/workflows/build.yml +3 -5
  3. package/.github/workflows/{npx.yml → bunx.yml} +7 -11
  4. package/.github/workflows/deploy.yml +2 -2
  5. package/.github/workflows/{cypress.yml → e2e-tests.yml} +7 -7
  6. package/.github/workflows/oxfmt.yml +4 -6
  7. package/.github/workflows/{eslint.yml → oxlint.yml} +6 -8
  8. package/.github/workflows/{jest.yml → unit-tests.yml} +6 -8
  9. package/.nx/workspace-data/d/server-process.json +5 -0
  10. package/.nx/workspace-data/file-map.json +614 -602
  11. package/.nx/workspace-data/lockfile-dependencies.hash +1 -1
  12. package/.nx/workspace-data/lockfile-nodes.hash +1 -1
  13. package/.nx/workspace-data/nx_files.nxt +0 -0
  14. package/.nx/workspace-data/parsed-lock-file.dependencies.json +5297 -11117
  15. package/.nx/workspace-data/parsed-lock-file.nodes.json +16371 -7676
  16. package/.nx/workspace-data/project-graph.json +25734 -20117
  17. package/.nx/workspace-data/source-maps.json +96 -0
  18. package/.oxlintrc.json +314 -0
  19. package/CLAUDE.md +120 -0
  20. package/README.md +27 -25
  21. package/bin/scrabble-solver.js +1 -1
  22. package/bump-version.js +3 -4
  23. package/bun-test-globals.d.ts +1 -0
  24. package/bun.lock +3984 -0
  25. package/bun.test.preload.ts +21 -0
  26. package/bunfig.toml +2 -0
  27. package/lerna.json +1 -1
  28. package/package.json +28 -38
  29. package/packages/configs/build/games/literaki.d.ts +1 -1
  30. package/packages/configs/package.json +4 -4
  31. package/packages/constants/package.json +2 -2
  32. package/packages/dictionaries/package.json +5 -5
  33. package/packages/logger/package.json +2 -2
  34. package/packages/scrabble-solver/.next/BUILD_ID +1 -1
  35. package/packages/scrabble-solver/.next/build-manifest.json +9 -9
  36. package/packages/scrabble-solver/.next/cache/.previewinfo +1 -1
  37. package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
  38. package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
  39. package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
  40. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
  41. package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
  42. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
  43. package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  44. package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
  45. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
  46. package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
  47. package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
  48. package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
  49. package/packages/scrabble-solver/.next/required-server-files.js +2 -1
  50. package/packages/scrabble-solver/.next/required-server-files.json +2 -1
  51. package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
  52. package/packages/scrabble-solver/.next/server/chunks/30.js +1 -1
  53. package/packages/scrabble-solver/.next/server/chunks/712.js +1 -1
  54. package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
  55. package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
  56. package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
  57. package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
  58. package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
  59. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  60. package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  61. package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
  62. package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
  63. package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
  64. package/packages/scrabble-solver/.next/server/pages/api/visit.js.nft.json +1 -1
  65. package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
  66. package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
  67. package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
  68. package/packages/scrabble-solver/.next/server/pages/not-found.html +1 -1
  69. package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +1 -1
  70. package/packages/scrabble-solver/.next/static/{f_g0t0jBAscXxDrNYOuV0 → HFiEUpdZIGYd_XKb5mCLZ}/_buildManifest.js +1 -1
  71. package/packages/scrabble-solver/.next/static/chunks/{main-ca07941c8a544c9a.js → main-65a5015b46ca9827.js} +1 -1
  72. package/packages/scrabble-solver/.next/static/chunks/pages/{_app-369e5cb907606ad4.js → _app-9c9aaea7b6881765.js} +4 -4
  73. package/packages/scrabble-solver/.next/static/chunks/pages/{index-08b3b0a754095919.js → index-e9ea63e97865edcf.js} +1 -1
  74. package/packages/scrabble-solver/.next/static/css/{500cdc9a24075d91.css → 78726ae7cf7a5497.css} +1 -1
  75. package/packages/scrabble-solver/.next/trace +21 -21
  76. package/packages/scrabble-solver/.next/trace-build +1 -1
  77. package/packages/scrabble-solver/README.md +3 -3
  78. package/packages/scrabble-solver/next.config.js +1 -0
  79. package/packages/scrabble-solver/package.json +11 -10
  80. package/packages/scrabble-solver/public/service-worker.js +1 -1
  81. package/packages/scrabble-solver/src/@types/scss.d.ts +5 -0
  82. package/packages/scrabble-solver/src/components/Board/Board.module.scss +2 -2
  83. package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.module.scss +1 -1
  84. package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +26 -6
  85. package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.module.scss +1 -1
  86. package/packages/scrabble-solver/src/components/Button/Button.module.scss +1 -1
  87. package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss +1 -1
  88. package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.module.scss +1 -1
  89. package/packages/scrabble-solver/src/components/IconButton/IconButton.module.scss +1 -1
  90. package/packages/scrabble-solver/src/components/Loading/Loading.module.scss +1 -1
  91. package/packages/scrabble-solver/src/components/Modal/Modal.module.scss +1 -1
  92. package/packages/scrabble-solver/src/components/Modal/Modal.tsx +0 -1
  93. package/packages/scrabble-solver/src/components/NotFound/NotFound.module.scss +1 -1
  94. package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.module.scss +1 -1
  95. package/packages/scrabble-solver/src/components/Rack/Rack.module.scss +11 -6
  96. package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +1 -1
  97. package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.module.scss +1 -1
  98. package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +1 -1
  99. package/packages/scrabble-solver/src/components/Results/Results.module.scss +1 -1
  100. package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.module.scss +1 -1
  101. package/packages/scrabble-solver/src/components/Solver/Solver.module.scss +1 -1
  102. package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.module.scss +1 -1
  103. package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.module.scss +1 -1
  104. package/packages/scrabble-solver/src/components/Spinner/Spinner.module.scss +1 -1
  105. package/packages/scrabble-solver/src/components/Tile/Tile.module.scss +1 -1
  106. package/packages/scrabble-solver/src/hooks/useLocalStorage.ts +4 -52
  107. package/packages/scrabble-solver/src/hooks/useMedia.ts +0 -1
  108. package/packages/scrabble-solver/src/lib/isMac.ts +1 -1
  109. package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.module.scss +1 -1
  110. package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.module.scss +1 -1
  111. package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.module.scss +1 -1
  112. package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +1 -1
  113. package/packages/scrabble-solver/src/pages/_app.tsx +0 -1
  114. package/packages/scrabble-solver/src/parameters/index.ts +48 -47
  115. package/packages/scrabble-solver/src/sdk/fetchJson.ts +3 -7
  116. package/packages/scrabble-solver/src/service-worker/index.ts +0 -1
  117. package/packages/scrabble-solver/src/service-worker/routeSolveRequests.ts +18 -12
  118. package/packages/scrabble-solver/src/state/board/slice.ts +6 -4
  119. package/packages/scrabble-solver/src/state/localStorage.ts +42 -52
  120. package/packages/scrabble-solver/src/state/sagas.ts +1 -2
  121. package/packages/scrabble-solver/src/state/settings/initialState.ts +7 -7
  122. package/packages/scrabble-solver/src/styles/_tokens.scss +59 -0
  123. package/packages/scrabble-solver/src/styles/global.scss +3 -3
  124. package/packages/scrabble-solver/src/styles/mixins.scss +13 -12
  125. package/packages/scrabble-solver/src/styles/variables.module.scss +53 -0
  126. package/packages/scrabble-solver/src/styles/variables.scss +44 -41
  127. package/packages/scrabble-solver/tsconfig.json +0 -1
  128. package/packages/scrabble-solver/tsconfig.tsbuildinfo +1 -1
  129. package/packages/solver/build/fillPattern.d.ts +1 -3
  130. package/packages/solver/package.json +8 -7
  131. package/packages/types/build/Result.d.ts +1 -1
  132. package/packages/types/package.json +3 -3
  133. package/packages/word-definitions/build/languages/english.js +1 -3
  134. package/packages/word-definitions/package.json +5 -4
  135. package/packages/word-definitions/src/languages/english.ts +0 -1
  136. package/packages/word-definitions/src/parse.test.ts +7 -2
  137. package/packages/word-lists/package.json +3 -3
  138. package/tsconfig.json +2 -1
  139. package/eslint.config.mjs +0 -722
  140. package/jest.config.js +0 -15
  141. package/jest.setup.js +0 -6
  142. package/tsconfig.jest.json +0 -11
  143. /package/packages/scrabble-solver/.next/static/{f_g0t0jBAscXxDrNYOuV0 → HFiEUpdZIGYd_XKb5mCLZ}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  </p>
19
19
 
20
20
  <p>
21
- You can <a href="#run">run</a> it on your machine: <code>npx scrabble-solver@latest</code>
21
+ You can <a href="#run">run</a> it on your machine: <code>bunx scrabble-solver@latest</code>
22
22
  </p>
23
23
 
24
24
  <p>
@@ -41,11 +41,11 @@
41
41
 
42
42
  <p>
43
43
  <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/build.yml/badge.svg" alt="Build" />
44
- <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/jest.yml/badge.svg" alt="Jest Tests" />
45
- <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/cypress.yml/badge.svg" alt="Cypress Tests" />
46
- <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/eslint.yml/badge.svg" alt="ESLint" />
47
- <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/oxfmt.yml/badge.svg" alt="oxfmt" />
48
- <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/npx.yml/badge.svg" alt="npx" />
44
+ <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/oxlint.yml/badge.svg" alt="Oxlint" />
45
+ <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/oxfmt.yml/badge.svg" alt="Oxfmt" />
46
+ <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/e2e-tests.yml/badge.svg" alt="E2E tests" />
47
+ <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/unit-tests.yml/badge.svg" alt="Unit tests" />
48
+ <img src="https://github.com/kamilmielnik/scrabble-solver/actions/workflows/bunx.yml/badge.svg" alt="bunx" />
49
49
  </p>
50
50
 
51
51
  <img alt="Screencast GIF showing user interface when solving for oxyphenbutazone, which is a top-scoring word in English version of Scrabble" src="https://raw.githubusercontent.com/kamilmielnik/scrabble-solver/master/screencast.gif" />
@@ -70,6 +70,8 @@
70
70
 
71
71
  ## Dictionaries
72
72
 
73
+ Some of the word lists below are sourced from the companion repository [kamilmielnik/scrabble-dictionaries](https://github.com/kamilmielnik/scrabble-dictionaries).
74
+
73
75
  | Language | Word list | Word definitions | [Highest-scoring word](https://codesandbox.io/s/highest-scoring-words-in-scrabble-vbj1ns?file=/src/index.js) |
74
76
  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
75
77
  | 🇬🇧 English | [💾](https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/refs/heads/master/english/sowpods.txt) [SOWPODS](https://en.wikipedia.org/wiki/Collins_Scrabble_Words) | [Merriam-Webster](https://www.merriam-webster.com/) | oxyphenbutazone (1458) |
@@ -84,10 +86,10 @@
84
86
 
85
87
  ## Run
86
88
 
87
- You can run Scrabble Solver on your machine - all you need is [Node.js](https://nodejs.org/) 24 or later.
89
+ You can run Scrabble Solver on your machine - all you need is [Bun](https://bun.sh/) 1.3 or later.
88
90
 
89
91
  ```Shell
90
- npx scrabble-solver@latest
92
+ bunx scrabble-solver@latest
91
93
  ```
92
94
 
93
95
  Give it a while to install and download dictionaries. When it's done it will automatically open http://localhost:3333/ in your browser.
@@ -114,8 +116,8 @@ One-time project setup.
114
116
  ```Shell
115
117
  git clone https://github.com/kamilmielnik/scrabble-solver.git
116
118
  cd scrabble-solver
117
- npm install
118
- npm run build
119
+ bun install
120
+ bun run build
119
121
  ```
120
122
 
121
123
  ### Run app dev server
@@ -123,7 +125,7 @@ npm run build
123
125
  The following command will serve the app at http://localhost:3000/.
124
126
 
125
127
  ```Shell
126
- npm run dev
128
+ bun run dev
127
129
  ```
128
130
 
129
131
  Note: hot code reload works only for the [`scrabble-solver`](https://github.com/kamilmielnik/scrabble-solver/tree/master/packages/scrabble-solver) package. If you make changes to any other package, you will need to rebuild it ([see below](#rebuild-a-single-package)).
@@ -131,7 +133,7 @@ Note: hot code reload works only for the [`scrabble-solver`](https://github.com/
131
133
  ### Rebuild the entire project
132
134
 
133
135
  ```Shell
134
- npm run build
136
+ bun run build
135
137
  ```
136
138
 
137
139
  ### Rebuild a single package
@@ -139,15 +141,15 @@ npm run build
139
141
  For convenience, here's a list of commands to rebuild every package individually.
140
142
 
141
143
  ```Shell
142
- npm run build -w @scrabble-solver/configs
143
- npm run build -w @scrabble-solver/constants
144
- npm run build -w @scrabble-solver/dictionaries
145
- npm run build -w @scrabble-solver/logger
146
- npm run build -w @scrabble-solver/scrabble-solver
147
- npm run build -w @scrabble-solver/solver
148
- npm run build -w @scrabble-solver/types
149
- npm run build -w @scrabble-solver/word-definitions
150
- npm run build -w @scrabble-solver/word-lists
144
+ bun run --filter @scrabble-solver/configs build
145
+ bun run --filter @scrabble-solver/constants build
146
+ bun run --filter @scrabble-solver/dictionaries build
147
+ bun run --filter @scrabble-solver/logger build
148
+ bun run --filter @scrabble-solver/scrabble-solver build
149
+ bun run --filter @scrabble-solver/solver build
150
+ bun run --filter @scrabble-solver/types build
151
+ bun run --filter @scrabble-solver/word-definitions build
152
+ bun run --filter @scrabble-solver/word-lists build
151
153
  ```
152
154
 
153
155
  ### Add a new language
@@ -159,7 +161,7 @@ npm run build -w @scrabble-solver/word-lists
159
161
  4. Add IETF language tag for the new locale in [packages/types/src/Locale.ts](https://github.com/kamilmielnik/scrabble-solver/blob/master/packages/types/src/Locale.ts)
160
162
  5. Rebuild the types package
161
163
  ```Shell
162
- npm run build -w @scrabble-solver/types
164
+ bun run --filter @scrabble-solver/types build
163
165
  ```
164
166
  6. Add locale configuration in [packages/scrabble-solver/src/i18n/constants.ts](https://github.com/kamilmielnik/scrabble-solver/blob/master/packages/scrabble-solver/src/i18n/constants.ts)
165
167
  7. Update locale-detecting code in [packages/scrabble-solver/src/state/settings/lib.ts](https://github.com/kamilmielnik/scrabble-solver/blob/master/packages/scrabble-solver/src/state/settings/lib.ts)
@@ -177,6 +179,7 @@ npm run build -w @scrabble-solver/word-lists
177
179
  ## Tech stack
178
180
 
179
181
  - [TypeScript](https://www.typescriptlang.org/)
182
+ - [Bun](https://bun.sh/docs)
180
183
  - [Node.js](https://nodejs.org/)
181
184
  - [Next.js](https://nextjs.org/)
182
185
  - [Express](https://expressjs.com/)
@@ -190,9 +193,8 @@ npm run build -w @scrabble-solver/word-lists
190
193
  - [include-media](https://eduardoboucas.github.io/include-media/)
191
194
  - [Lerna](https://lerna.js.org/)
192
195
  - [Cypress](https://www.cypress.io/)
193
- - [Jest](https://jestjs.io/)
194
- - [ESLint](https://eslint.org/)
195
- - [oxfmt](https://oxc.rs/docs/guide/usage/formatter)
196
+ - [Oxlint](https://oxc.rs/docs/guide/usage/linter)
197
+ - [Oxfmt](https://oxc.rs/docs/guide/usage/formatter)
196
198
 
197
199
  ## Related projects
198
200
 
@@ -5,4 +5,4 @@ const path = require('path');
5
5
 
6
6
  const rootDirectory = path.join(__dirname, '..');
7
7
  process.chdir(rootDirectory);
8
- execSync('npm start');
8
+ execSync('bun start');
package/bump-version.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Due to the use of npm workspaces we need to explicitly specify "@scrabble-solver/scrabble-solver"
2
+ * Due to the use of Bun workspaces we need to explicitly specify "@scrabble-solver/scrabble-solver"
3
3
  * package in the dependencies of this very "scrabble-solver" package. Otherwise none of
4
- * the "dependencies" from underlying packages/ would have been installed and any npm scripts
5
- * that work on subpackages would not work - specifically: npm start.
4
+ * the "dependencies" from underlying packages/ would have been installed and any package scripts
5
+ * that work on subpackages would not work - specifically: bun start.
6
6
  *
7
7
  * This script exists to ensure that the dependency version is bumped during the release.
8
8
  */
@@ -24,4 +24,3 @@ const updateDependencyVersion = (filename, dependency, version) => {
24
24
 
25
25
  const currentAppVersion = getCurrentAppVersion();
26
26
  updateDependencyVersion('package.json', '@scrabble-solver/scrabble-solver', currentAppVersion);
27
- updateDependencyVersion('package-lock.json', '@scrabble-solver/scrabble-solver', currentAppVersion);
@@ -0,0 +1 @@
1
+ /// <reference types="bun-types/test-globals" />