cm-engine-runner 1.1.3 → 1.2.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.
- package/index.html +13 -3
- package/package.json +3 -5
- package/src/{cm-engine-runner/EngineRunner.js → EngineRunner.js} +4 -1
- package/src/{cm-engine-runner/PolyglotRunner.js → PolyglotRunner.js} +1 -1
- package/postinstall.cjs +0 -9
- /package/src/{cm-engine-runner/StockfishRunner.js → StockfishRunner.js} +0 -0
package/index.html
CHANGED
|
@@ -10,9 +10,19 @@
|
|
|
10
10
|
<body>
|
|
11
11
|
<h1>cm-engine-runner</h1>
|
|
12
12
|
<p>Logs are in the developer console</p>
|
|
13
|
+
<script src="https://cdn.jsdelivr.net/npm/es-module-shims@1.7.2/dist/es-module-shims.min.js"></script>
|
|
14
|
+
<!-- @formatter:off -->
|
|
15
|
+
<script type="importmap">
|
|
16
|
+
{
|
|
17
|
+
"imports": {
|
|
18
|
+
"cm-polyglot/": "./node_modules/cm-polyglot/"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
<!-- @formatter:on -->
|
|
13
23
|
<script type="module" crossorigin="anonymous">
|
|
14
|
-
import {PolyglotRunner} from "./src/
|
|
15
|
-
import {StockfishRunner} from "./src/
|
|
24
|
+
import {PolyglotRunner} from "./src/PolyglotRunner.js"
|
|
25
|
+
import {StockfishRunner} from "./src/StockfishRunner.js"
|
|
16
26
|
|
|
17
27
|
const polyglotRunner = new PolyglotRunner({bookUrl: "./assets/books/openings.bin", responseDelay: 0, debug: true})
|
|
18
28
|
const startingPosition = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
|
|
@@ -33,4 +43,4 @@
|
|
|
33
43
|
console.log("stockfish", await stockfishRunner.calculateMove(positionManyPawns, {level: 3}))
|
|
34
44
|
</script>
|
|
35
45
|
</body>
|
|
36
|
-
</html>
|
|
46
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cm-engine-runner",
|
|
3
3
|
"description": "Abstraction layer to run chess engines, supports opening books",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
-
"postinstall": "node postinstall.cjs"
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
9
|
},
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
@@ -28,7 +27,6 @@
|
|
|
28
27
|
"teevi": "^2.2.4"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"cm-polyglot": "^1.0
|
|
32
|
-
"modlib": "^1.2.12"
|
|
30
|
+
"cm-polyglot": "^1.1.0"
|
|
33
31
|
}
|
|
34
32
|
}
|
|
@@ -22,7 +22,10 @@ export class EngineRunner {
|
|
|
22
22
|
Object.assign(this.props, props)
|
|
23
23
|
this.engineState = ENGINE_STATE.LOADING
|
|
24
24
|
this.initialized = this.init()
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated 2023-04-11 use `this.initialized` instead
|
|
27
|
+
*/
|
|
28
|
+
this.initialization = this.initialized
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
init() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License: MIT, see file 'LICENSE'
|
|
5
5
|
*/
|
|
6
6
|
import {ENGINE_STATE, EngineRunner} from "./EngineRunner.js"
|
|
7
|
-
import {Polyglot} from "
|
|
7
|
+
import {Polyglot} from "cm-polyglot/src/Polyglot.js"
|
|
8
8
|
|
|
9
9
|
export class PolyglotRunner extends EngineRunner {
|
|
10
10
|
|
package/postinstall.cjs
DELETED
|
File without changes
|