cm-chess 2.5.3 → 3.0.1

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/README.md CHANGED
@@ -17,7 +17,7 @@ PGN header values, Nags and Comments.
17
17
 
18
18
  ## API
19
19
 
20
- For documentation, see the jsdoc annotations in [Chess.js](https://github.com/shaack/cm-chess/blob/master/src/cm-chess/Chess.js).
20
+ For documentation, see the jsdoc annotations in [Chess.js](https://github.com/shaack/cm-chess/blob/master/src/Chess.js).
21
21
 
22
22
  cm-chess uses [cm-pgn](https://github.com/shaack/cm-pgn) for the
23
23
  header and history, therefore you have also the full API of **cm-pgn**.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "cm-chess",
3
- "version": "2.5.3",
3
+ "version": "3.0.1",
4
4
  "description": "It's like chess.js, but in ES6 and can handle variations (tree-structured move history)",
5
- "main": "./src/cm-chess/Chess.js",
5
+ "main": "./src/Chess.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "postinstall": "node postinstall.cjs"
8
+ "test": "echo request test/index.html in a browser for testing"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
@@ -24,9 +24,9 @@
24
24
  },
25
25
  "homepage": "https://github.com/shaack/cm-chess#readme",
26
26
  "dependencies": {
27
- "chess.mjs": "^1.3.1",
28
- "cm-pgn": "2.3.4",
29
- "modlib": "^1.2.12"
27
+ "chess.mjs": "^1.4.0",
28
+ "cm-pgn": "3.1.3",
29
+ "node-modules-url": "^1.0.3"
30
30
  },
31
31
  "devDependencies": {
32
32
  "teevi": "^2.2.4"
@@ -3,9 +3,9 @@
3
3
  * Repository: https://github.com/shaack/cm-chess
4
4
  * License: MIT, see file 'LICENSE'
5
5
  */
6
- import {Pgn} from "../../lib/cm-pgn/Pgn.js"
7
- import {TAGS} from "../../lib/cm-pgn/Header.js"
8
- import {Chess as ChessJs, SQUARES} from "../../lib/chess.mjs/Chess.js"
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")
9
9
 
10
10
  export const PIECES = {
11
11
  p: {name: "pawn", value: 1},
package/test/TestChess.js CHANGED
@@ -1,9 +1,10 @@
1
- import {Chess, COLOR, FEN} from "../src/cm-chess/Chess.js"
2
- import {TAGS} from "../lib/cm-pgn/Header.js"
1
+ /**
2
+ * @author Stefan Haack (https://shaack.com)
3
+ */
4
+ const {TAGS} = await import(nodeModulesUrl + "cm-pgn/src/Header.js")
5
+ import {Chess, COLOR, FEN} from "../src/Chess.js"
3
6
  import {describe, it, assert} from "../node_modules/teevi/src/teevi.js"
4
7
 
5
- // TODO create a test, which demonstrates all features, including variations
6
-
7
8
  describe("Chess", function () {
8
9
 
9
10
  it("should create empty Chess", () => {
package/test/TestFen.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {describe, it, assert} from "../node_modules/teevi/src/teevi.js"
2
- import {Fen} from "../src/cm-chess/Fen.js"
2
+ import {Fen} from "../src/Fen.js"
3
3
 
4
4
  describe("Fen", function () {
5
5
 
package/test/index.html CHANGED
@@ -4,6 +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
8
  <script type="module">
8
9
  import {teevi} from "../node_modules/teevi/src/teevi.js"
9
10
  import "./TestChess.js"
@@ -11,4 +12,4 @@
11
12
  teevi.run()
12
13
  </script>
13
14
  </body>
14
- </html>
15
+ </html>
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-pgn")
9
- modLib.add("chess.mjs")
File without changes