cm-chess 3.1.0 → 3.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chess",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "It's like chess.js, but in ES6 and can handle variations (tree-structured move history)",
5
5
  "main": "./src/Chess.js",
6
6
  "type": "module",
@@ -25,8 +25,8 @@
25
25
  "homepage": "https://github.com/shaack/cm-chess#readme",
26
26
  "dependencies": {
27
27
  "chess.mjs": "^1.4.0",
28
- "cm-pgn": "3.1.3",
29
- "node-modules-url": "^1.0.3"
28
+ "cm-pgn": "3.2.0",
29
+ "import-node-modules": "^1.0.6"
30
30
  },
31
31
  "devDependencies": {
32
32
  "teevi": "^2.2.4"
package/src/Chess.js CHANGED
@@ -3,9 +3,9 @@
3
3
  * Repository: https://github.com/shaack/cm-chess
4
4
  * License: MIT, see file 'LICENSE'
5
5
  */
6
- const {Pgn} = await import(nodeModulesUrl + "cm-pgn/src/Pgn.js")
7
- const {TAGS} = await import(nodeModulesUrl + "cm-pgn/src/Header.js")
8
- const {Chess: ChessJs, SQUARES} = await import(nodeModulesUrl + "chess.mjs/src/Chess.js")
6
+ const {Pgn} = await import(`${node_modules}/cm-pgn/src/Pgn.js`)
7
+ const {TAGS} = await import(`${node_modules}/cm-pgn/src/Header.js`)
8
+ const {Chess: ChessJs, SQUARES} = await import(`${node_modules}/chess.mjs/src/Chess.js`)
9
9
 
10
10
  export const PIECES = {
11
11
  p: {name: "pawn", value: 1},
package/test/TestChess.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @author Stefan Haack (https://shaack.com)
3
3
  */
4
- const {TAGS} = await import(nodeModulesUrl + "cm-pgn/src/Header.js")
5
- import {Chess, COLOR, FEN} from "../src/Chess.js"
4
+ const {TAGS} = await import(`${node_modules}/cm-pgn/src/Header.js`)
6
5
  import {describe, it, assert} from "../node_modules/teevi/src/teevi.js"
6
+ import {Chess, COLOR, FEN} from "../src/Chess.js"
7
7
 
8
8
  describe("Chess", function () {
9
9
 
@@ -225,8 +225,8 @@ Kc4 7. Qb4+ Kd5 8. Qc5#) 5. Bc5# 1-0`)
225
225
  it("should publish events", function() {
226
226
  return new Promise((resolve, reject) => {
227
227
  const chess = new Chess()
228
- chess.addObserver((event, data) => {
229
- if(event === "legalMove" && data.move === "e4") {
228
+ chess.addObserver((event) => {
229
+ if(event.type === "legalMove" && event.move === "e4") {
230
230
  resolve()
231
231
  } else {
232
232
  reject("error event")
package/test/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <title>cm-chess tests</title>
5
5
  </head>
6
6
  <body>
7
- <script type="module" src="../node_modules/node-modules-url/node-modules-url.js"></script>
7
+ <script type="module" src="../node_modules/import-node-modules/index.js"></script>
8
8
  <script type="module">
9
9
  import {teevi} from "../node_modules/teevi/src/teevi.js"
10
10
  import "./TestChess.js"