cm-engine-runner 1.1.4 → 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 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/cm-engine-runner/PolyglotRunner.js"
15
- import {StockfishRunner} from "./src/cm-engine-runner/StockfishRunner.js"
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.1.4",
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.7",
32
- "modlib": "^1.2.12"
30
+ "cm-polyglot": "^1.1.0"
33
31
  }
34
32
  }
@@ -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 "../../lib/cm-polyglot/Polyglot.js"
7
+ import {Polyglot} from "cm-polyglot/src/Polyglot.js"
8
8
 
9
9
  export class PolyglotRunner extends EngineRunner {
10
10
 
package/postinstall.cjs DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Author and copyright: Stefan Haack (https://shaack.com)
3
- * License: MIT, see file 'LICENSE'
4
- */
5
-
6
- const modLib = new (require("modlib"))
7
-
8
- modLib.add("cm-polyglot")
9
- modLib.add("cm-polyglot", "src", "stakelbase")