chess-tactics 0.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/LICENSE +674 -0
- package/README.md +145 -0
- package/dist/ChessTactics.d.ts +8 -0
- package/dist/ChessTactics.js +37 -0
- package/dist/TacticFactory.d.ts +4 -0
- package/dist/TacticFactory.js +25 -0
- package/dist/_types.d.ts +15 -0
- package/dist/_types.js +2 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +12 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +23 -0
- package/dist/tactics/BaseTactic.d.ts +13 -0
- package/dist/tactics/BaseTactic.js +68 -0
- package/dist/tactics/Fork.d.ts +9 -0
- package/dist/tactics/Fork.js +32 -0
- package/dist/tactics/HangingPiece.d.ts +7 -0
- package/dist/tactics/HangingPiece.js +34 -0
- package/dist/tactics/Pin.d.ts +10 -0
- package/dist/tactics/Pin.js +97 -0
- package/dist/tactics/Sacrifice.d.ts +9 -0
- package/dist/tactics/Sacrifice.js +41 -0
- package/dist/tactics/Skewer.d.ts +9 -0
- package/dist/tactics/Skewer.js +81 -0
- package/dist/tactics/Trap.d.ts +12 -0
- package/dist/tactics/Trap.js +100 -0
- package/dist/tactics/index.d.ts +7 -0
- package/dist/tactics/index.js +17 -0
- package/dist/types.d.ts +46 -0
- package/dist/types.js +2 -0
- package/dist/utils/SequenceInterpreter.d.ts +13 -0
- package/dist/utils/SequenceInterpreter.js +88 -0
- package/dist/utils/TacticContextParser.d.ts +9 -0
- package/dist/utils/TacticContextParser.js +109 -0
- package/dist/utils/TacticHeuristics.d.ts +9 -0
- package/dist/utils/TacticHeuristics.js +177 -0
- package/dist/utils/Utils.d.ts +18 -0
- package/dist/utils/Utils.js +106 -0
- package/dist/utils/constants.d.ts +5 -0
- package/dist/utils/constants.js +22 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +24 -0
- package/package.json +28 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attackingSquareIsGood = attackingSquareIsGood;
|
|
4
|
+
exports.attackingSquareIsBad = attackingSquareIsBad;
|
|
5
|
+
exports.materialAdvantageAfterTradesAtSquare = materialAdvantageAfterTradesAtSquare;
|
|
6
|
+
exports.getEscapeSquares = getEscapeSquares;
|
|
7
|
+
exports.getBlockingMoves = getBlockingMoves;
|
|
8
|
+
exports.getMovesToSquare = getMovesToSquare;
|
|
9
|
+
exports.getThreateningMoves = getThreateningMoves;
|
|
10
|
+
const chess_js_1 = require("chess.js");
|
|
11
|
+
const _utils_1 = require("./index");
|
|
12
|
+
function attackingSquareIsGood(fen, square, startingMove = null) {
|
|
13
|
+
const advantage = materialAdvantageAfterTradesAtSquare(fen, square, startingMove);
|
|
14
|
+
const color = (0, _utils_1.colorToPlay)(fen);
|
|
15
|
+
if (color === "w") {
|
|
16
|
+
return advantage > 0;
|
|
17
|
+
}
|
|
18
|
+
return advantage < 0;
|
|
19
|
+
}
|
|
20
|
+
function attackingSquareIsBad(fen, square, startingMove = null) {
|
|
21
|
+
const advantage = materialAdvantageAfterTradesAtSquare(fen, square, startingMove);
|
|
22
|
+
const color = (0, _utils_1.colorToPlay)(fen);
|
|
23
|
+
if (color === "w") {
|
|
24
|
+
return advantage < 0;
|
|
25
|
+
}
|
|
26
|
+
return advantage > 0;
|
|
27
|
+
}
|
|
28
|
+
function materialAdvantageAfterTradesAtSquare(position, square, startingMove = null) {
|
|
29
|
+
const chess = new chess_js_1.Chess(position);
|
|
30
|
+
let score = 0;
|
|
31
|
+
if (startingMove) {
|
|
32
|
+
chess.move(startingMove);
|
|
33
|
+
if (startingMove.captured) {
|
|
34
|
+
if (chess.turn() === "w") {
|
|
35
|
+
score -= _utils_1.PIECE_VALUES[startingMove.captured];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
score += _utils_1.PIECE_VALUES[startingMove.captured];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return helper(chess, square, score);
|
|
43
|
+
}
|
|
44
|
+
function helper(chess, square, score) {
|
|
45
|
+
if (chess.turn() === "w" && score > 0)
|
|
46
|
+
return score;
|
|
47
|
+
if (chess.turn() === "b" && score < 0)
|
|
48
|
+
return score;
|
|
49
|
+
const possibleMoves = chess.moves({ verbose: true }).filter((m) => m.to === square);
|
|
50
|
+
if (possibleMoves.length === 0)
|
|
51
|
+
return score;
|
|
52
|
+
const leastMaterialMove = possibleMoves.sort((a, b) => _utils_1.PIECE_VALUES[a.piece] - _utils_1.PIECE_VALUES[b.piece]);
|
|
53
|
+
const move = chess.move(leastMaterialMove[0]);
|
|
54
|
+
if (chess.turn() === "w") {
|
|
55
|
+
score -= _utils_1.PIECE_VALUES[move.captured];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
score += _utils_1.PIECE_VALUES[move.captured];
|
|
59
|
+
}
|
|
60
|
+
return helper(chess, square, score);
|
|
61
|
+
}
|
|
62
|
+
function getEscapeSquares(fen, square) {
|
|
63
|
+
const chess = new chess_js_1.Chess(fen);
|
|
64
|
+
const piece = chess.get(square);
|
|
65
|
+
if (!piece) {
|
|
66
|
+
throw new Error("function called on a square that is unoccupied!");
|
|
67
|
+
}
|
|
68
|
+
const moves = chess.moves({ square, verbose: true });
|
|
69
|
+
const escapeSquares = [];
|
|
70
|
+
for (let i = 0; i < moves.length; i++) {
|
|
71
|
+
if (!attackingSquareIsBad(fen, moves[i].to, moves[i])) {
|
|
72
|
+
escapeSquares.push(moves[i].to);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return escapeSquares;
|
|
76
|
+
}
|
|
77
|
+
function getBlockingMoves(fen, attackingSquare, threatenedSquare) {
|
|
78
|
+
if (squaresAreNeighbors(attackingSquare, threatenedSquare)) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
const chess = new chess_js_1.Chess(fen);
|
|
82
|
+
const attackingPiece = chess.get(attackingSquare);
|
|
83
|
+
const threatenedPiece = chess.get(threatenedSquare);
|
|
84
|
+
if (!attackingPiece || !threatenedPiece) {
|
|
85
|
+
throw new Error(`The squares ${attackingSquare} or ${threatenedSquare} do not have pieces on them`);
|
|
86
|
+
}
|
|
87
|
+
if (attackingPiece.color === chess.turn()) {
|
|
88
|
+
throw new Error("It should not be attacker's turn to move!");
|
|
89
|
+
}
|
|
90
|
+
if (threatenedPiece.color !== chess.turn()) {
|
|
91
|
+
throw new Error("It needs to be defender's turn to move!");
|
|
92
|
+
}
|
|
93
|
+
chess.load((0, _utils_1.setTurn)(chess.fen(), attackingPiece.color));
|
|
94
|
+
if (chess
|
|
95
|
+
.moves({ square: attackingSquare, verbose: true })
|
|
96
|
+
.filter((m) => m.to === threatenedSquare).length === 0) {
|
|
97
|
+
throw new Error("attackingSquare doesn't even threaten threatenedSquare");
|
|
98
|
+
}
|
|
99
|
+
chess.load((0, _utils_1.setTurn)(chess.fen(), threatenedPiece.color));
|
|
100
|
+
const candidateMoves = chess
|
|
101
|
+
.moves({ verbose: true })
|
|
102
|
+
.filter((m) => m.from !== threatenedSquare)
|
|
103
|
+
.filter((m) => {
|
|
104
|
+
const chessCopy = new chess_js_1.Chess(fen);
|
|
105
|
+
chessCopy.move(m);
|
|
106
|
+
return (chessCopy
|
|
107
|
+
.moves({ square: attackingSquare, verbose: true })
|
|
108
|
+
.filter((n) => n.to === threatenedSquare).length === 0);
|
|
109
|
+
});
|
|
110
|
+
const blockingMoves = [];
|
|
111
|
+
for (let i = 0; i < candidateMoves.length; i++) {
|
|
112
|
+
chess.load(fen);
|
|
113
|
+
chess.move(candidateMoves[i]);
|
|
114
|
+
let initialAdvantage = 0;
|
|
115
|
+
const captured = candidateMoves[i].captured;
|
|
116
|
+
if (captured) {
|
|
117
|
+
initialAdvantage = _utils_1.PIECE_VALUES[captured];
|
|
118
|
+
}
|
|
119
|
+
const opponentAdvantage = materialAdvantageAfterTradesAtSquare(chess.fen(), candidateMoves[i].to);
|
|
120
|
+
if (initialAdvantage - opponentAdvantage >= 0) {
|
|
121
|
+
blockingMoves.push({ from: candidateMoves[i].from, to: candidateMoves[i].to });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return blockingMoves;
|
|
125
|
+
}
|
|
126
|
+
function squaresAreNeighbors(sq1, sq2) {
|
|
127
|
+
if (sq1 === sq2)
|
|
128
|
+
return false;
|
|
129
|
+
const x1 = sq1.charCodeAt(0);
|
|
130
|
+
const y1 = parseInt(sq1[1], 10);
|
|
131
|
+
const x2 = sq2.charCodeAt(0);
|
|
132
|
+
const y2 = parseInt(sq2[1], 10);
|
|
133
|
+
const deltaX = Math.abs(x1 - x2);
|
|
134
|
+
const deltaY = Math.abs(y1 - y2);
|
|
135
|
+
return deltaX <= 1 && deltaY <= 1;
|
|
136
|
+
}
|
|
137
|
+
function getMovesToSquare(fen, square) {
|
|
138
|
+
const chess = new chess_js_1.Chess(fen, { skipValidation: true });
|
|
139
|
+
const piece = chess.get(square);
|
|
140
|
+
if (piece && piece.color === chess.turn()) {
|
|
141
|
+
throw new Error("Provided a square that is occupied by a piece of the player to play. This could cause unexpected behavior");
|
|
142
|
+
}
|
|
143
|
+
const pieceMoves = chess
|
|
144
|
+
.moves({ verbose: true })
|
|
145
|
+
.filter((m) => m.to === square && m.piece !== "p");
|
|
146
|
+
const pawnMoves = pawnsDefendingSquare(fen, square, chess.turn());
|
|
147
|
+
chess.load(fen, { skipValidation: true });
|
|
148
|
+
return pieceMoves.concat(pawnMoves);
|
|
149
|
+
}
|
|
150
|
+
function pawnsDefendingSquare(fen, square, color) {
|
|
151
|
+
const chess = new chess_js_1.Chess((0, _utils_1.setTurn)(fen, color), { skipValidation: true });
|
|
152
|
+
chess.put({ type: "q", color: color === "w" ? "b" : "w" }, square);
|
|
153
|
+
chess.setTurn(color);
|
|
154
|
+
const result = chess.moves({ verbose: true }).filter((m) => m.to === square && m.piece === "p");
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
function getThreateningMoves(position, currentMove) {
|
|
158
|
+
// game must be the initial position
|
|
159
|
+
const chess = new chess_js_1.Chess(position);
|
|
160
|
+
chess.move(currentMove);
|
|
161
|
+
(0, _utils_1.invertTurn)(chess);
|
|
162
|
+
const possibleMoves = chess.moves({ square: currentMove.to, verbose: true });
|
|
163
|
+
const threateningMoves = [];
|
|
164
|
+
for (const m of possibleMoves) {
|
|
165
|
+
for (const n of possibleMoves) {
|
|
166
|
+
if (n.captured !== "k" && n.to !== m.to)
|
|
167
|
+
chess.remove(n.to);
|
|
168
|
+
}
|
|
169
|
+
if (m.captured && attackingSquareIsGood(chess.fen(), m.to, m)) {
|
|
170
|
+
threateningMoves.push(m);
|
|
171
|
+
}
|
|
172
|
+
chess.load(position);
|
|
173
|
+
chess.move(currentMove);
|
|
174
|
+
(0, _utils_1.invertTurn)(chess);
|
|
175
|
+
}
|
|
176
|
+
return threateningMoves;
|
|
177
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PieceSymbol, Color, Chess, Move } from "chess.js";
|
|
2
|
+
import { Fen } from "../types";
|
|
3
|
+
export declare function isWhiteToPlay(x: number | string): boolean;
|
|
4
|
+
export declare function setTurn(position: Fen, color: Color): string;
|
|
5
|
+
export declare function invertTurn(chess: Chess): void;
|
|
6
|
+
export declare function colorToPlay(x: number | string): Color;
|
|
7
|
+
export declare function sanToUci(position: Fen, san: string): string;
|
|
8
|
+
export declare function uciToSan(position: Fen, uci: string): string;
|
|
9
|
+
export declare function uciToMove(position: Fen, uci: string): Move;
|
|
10
|
+
export declare function sanToMove(position: Fen, san: string): Move;
|
|
11
|
+
export declare function moveToUci(move: Move | {
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function materialValueInPosition(position: Fen): Record<Color, number>;
|
|
16
|
+
export declare function pieceCountsInPosition(position: Fen): Record<Color, Record<PieceSymbol, number>>;
|
|
17
|
+
export declare function getMaterialChange(startFen: Fen, endFen: Fen, pieceColor: Color | string): number;
|
|
18
|
+
export declare function getMoveDiff(originalMoves: Move[], newMoves: Move[]): Move[];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWhiteToPlay = isWhiteToPlay;
|
|
4
|
+
exports.setTurn = setTurn;
|
|
5
|
+
exports.invertTurn = invertTurn;
|
|
6
|
+
exports.colorToPlay = colorToPlay;
|
|
7
|
+
exports.sanToUci = sanToUci;
|
|
8
|
+
exports.uciToSan = uciToSan;
|
|
9
|
+
exports.uciToMove = uciToMove;
|
|
10
|
+
exports.sanToMove = sanToMove;
|
|
11
|
+
exports.moveToUci = moveToUci;
|
|
12
|
+
exports.materialValueInPosition = materialValueInPosition;
|
|
13
|
+
exports.pieceCountsInPosition = pieceCountsInPosition;
|
|
14
|
+
exports.getMaterialChange = getMaterialChange;
|
|
15
|
+
exports.getMoveDiff = getMoveDiff;
|
|
16
|
+
const chess_js_1 = require("chess.js");
|
|
17
|
+
const constants_1 = require("./constants");
|
|
18
|
+
function isWhiteToPlay(x) {
|
|
19
|
+
if (typeof x === "number") {
|
|
20
|
+
return x % 2 === 0;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return x.split(" ")[1] === "w";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Note: this is needed over chess.setTurn because it allows color change when in check
|
|
27
|
+
function setTurn(position, color) {
|
|
28
|
+
let fenSplit = position.split(" ");
|
|
29
|
+
fenSplit[1] = color;
|
|
30
|
+
fenSplit[3] = "-";
|
|
31
|
+
return fenSplit.join(" ");
|
|
32
|
+
}
|
|
33
|
+
function invertTurn(chess) {
|
|
34
|
+
let fenSplit = chess.fen().split(" ");
|
|
35
|
+
fenSplit[1] = fenSplit[1] === "w" ? "b" : "w";
|
|
36
|
+
fenSplit[3] = "-";
|
|
37
|
+
chess.load(fenSplit.join(" "));
|
|
38
|
+
}
|
|
39
|
+
function colorToPlay(x) {
|
|
40
|
+
const isWhite = isWhiteToPlay(x);
|
|
41
|
+
return isWhite ? "w" : "b";
|
|
42
|
+
}
|
|
43
|
+
function sanToUci(position, san) {
|
|
44
|
+
const m = sanToMove(position, san);
|
|
45
|
+
return `${m.from}${m.to}`;
|
|
46
|
+
}
|
|
47
|
+
function uciToSan(position, uci) {
|
|
48
|
+
const m = uciToMove(position, uci);
|
|
49
|
+
return m.san;
|
|
50
|
+
}
|
|
51
|
+
function uciToMove(position, uci) {
|
|
52
|
+
const chess = new chess_js_1.Chess(position);
|
|
53
|
+
return chess.move(uci);
|
|
54
|
+
}
|
|
55
|
+
function sanToMove(position, san) {
|
|
56
|
+
const chess = new chess_js_1.Chess(position);
|
|
57
|
+
return chess.move(san);
|
|
58
|
+
}
|
|
59
|
+
function moveToUci(move) {
|
|
60
|
+
return `${move.from}${move.to}`;
|
|
61
|
+
}
|
|
62
|
+
function materialValueInPosition(position) {
|
|
63
|
+
const pieceCounts = pieceCountsInPosition(position);
|
|
64
|
+
const values = { w: 0, b: 0 };
|
|
65
|
+
for (const [color, pieces] of Object.entries(pieceCounts)) {
|
|
66
|
+
for (const [piece, count] of Object.entries(pieces)) {
|
|
67
|
+
if (piece !== "k") {
|
|
68
|
+
values[color] += constants_1.PIECE_VALUES[piece] * count;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return values;
|
|
73
|
+
}
|
|
74
|
+
function pieceCountsInPosition(position) {
|
|
75
|
+
const counts = {
|
|
76
|
+
w: { p: 0, b: 0, n: 0, q: 0, r: 0, k: 0 },
|
|
77
|
+
b: { p: 0, b: 0, n: 0, q: 0, r: 0, k: 0 },
|
|
78
|
+
};
|
|
79
|
+
const pieces = position.split(" ")[0];
|
|
80
|
+
for (const p of pieces) {
|
|
81
|
+
if (!Object.keys(counts.w).includes(p.toLowerCase())) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const pieceKey = p.toLowerCase();
|
|
85
|
+
if (p === pieceKey) {
|
|
86
|
+
counts.b[pieceKey] += 1;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
counts.w[pieceKey] += 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return counts;
|
|
93
|
+
}
|
|
94
|
+
function getMaterialChange(startFen, endFen, pieceColor) {
|
|
95
|
+
const startMaterial = materialValueInPosition(startFen);
|
|
96
|
+
const endMaterial = materialValueInPosition(endFen);
|
|
97
|
+
const startAdvantageWhite = startMaterial.w - startMaterial.b;
|
|
98
|
+
const endAdvantageWhite = endMaterial.w - endMaterial.b;
|
|
99
|
+
if (pieceColor === "w") {
|
|
100
|
+
return endAdvantageWhite - startAdvantageWhite;
|
|
101
|
+
}
|
|
102
|
+
return startAdvantageWhite - endAdvantageWhite;
|
|
103
|
+
}
|
|
104
|
+
function getMoveDiff(originalMoves, newMoves) {
|
|
105
|
+
return newMoves.filter((m) => originalMoves.map((n) => n.to).includes(m.to) === false && m.captured);
|
|
106
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PieceSymbol } from "chess.js";
|
|
2
|
+
import { TacticKey, TacticOptions } from "../types";
|
|
3
|
+
export declare const PIECE_VALUES: Record<PieceSymbol, number>;
|
|
4
|
+
export declare const DEFAULT_TACTIC_OPTIONS: TacticOptions;
|
|
5
|
+
export declare const DEFAULT_TACTIC_CLASSIFIERS: TacticKey[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_TACTIC_CLASSIFIERS = exports.DEFAULT_TACTIC_OPTIONS = exports.PIECE_VALUES = void 0;
|
|
4
|
+
exports.PIECE_VALUES = {
|
|
5
|
+
p: 1,
|
|
6
|
+
n: 3,
|
|
7
|
+
b: 3,
|
|
8
|
+
r: 5,
|
|
9
|
+
q: 9,
|
|
10
|
+
k: Infinity,
|
|
11
|
+
};
|
|
12
|
+
exports.DEFAULT_TACTIC_OPTIONS = {
|
|
13
|
+
trimEndSequence: false,
|
|
14
|
+
};
|
|
15
|
+
exports.DEFAULT_TACTIC_CLASSIFIERS = [
|
|
16
|
+
"fork",
|
|
17
|
+
"pin",
|
|
18
|
+
"sacrifice",
|
|
19
|
+
"skewer",
|
|
20
|
+
"trap",
|
|
21
|
+
"hanging",
|
|
22
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TacticContextParser = exports.SequenceInterpreter = void 0;
|
|
18
|
+
var SequenceInterpreter_1 = require("./SequenceInterpreter");
|
|
19
|
+
Object.defineProperty(exports, "SequenceInterpreter", { enumerable: true, get: function () { return SequenceInterpreter_1.SequenceInterpreter; } });
|
|
20
|
+
__exportStar(require("./TacticHeuristics"), exports);
|
|
21
|
+
__exportStar(require("./Utils"), exports);
|
|
22
|
+
var TacticContextParser_1 = require("./TacticContextParser");
|
|
23
|
+
Object.defineProperty(exports, "TacticContextParser", { enumerable: true, get: function () { return TacticContextParser_1.TacticContextParser; } });
|
|
24
|
+
__exportStar(require("./constants"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chess-tactics",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"test:watch": "jest --watch",
|
|
12
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "GPL-3.0-or-later",
|
|
17
|
+
"description": "",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"chess.js": "^1.4.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/jest": "^30.0.0",
|
|
23
|
+
"jest": "^30.2.0",
|
|
24
|
+
"ts-jest": "^29.4.6",
|
|
25
|
+
"ts-node": "^10.9.2",
|
|
26
|
+
"tsc-alias": "^1.8.16"
|
|
27
|
+
}
|
|
28
|
+
}
|