board-game-engine-react 0.0.16 → 0.0.17
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/.nycrc.json +8 -0
- package/babel.config.js +6 -1
- package/dist/board-game-engine-react.js +2 -1
- package/dist/board-game-engine-react.min.js +1 -1
- package/e2e/coverage.js +28 -0
- package/e2e/harness.spec.js +73 -0
- package/examples/checkers.json +793 -0
- package/examples/connect-four.json +126 -0
- package/examples/eights.json +653 -0
- package/examples/reversi.json +215 -0
- package/examples/tic-tac-toe.json +53 -0
- package/package.json +15 -3
- package/playwright.config.cjs +23 -0
- package/src/components/entity/entity.js +2 -1
- package/test-app/index.html +25 -0
- package/test-app/main.jsx +101 -0
- package/test-app/public/games/checkers.json +793 -0
- package/test-app/public/games/connect-four.json +126 -0
- package/test-app/public/games/eights.json +653 -0
- package/test-app/public/games/reversi.json +215 -0
- package/test-app/public/games/tic-tac-toe.json +53 -0
- package/vite.harness.config.js +16 -0
package/.nycrc.json
ADDED
package/babel.config.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
const coverage = process.env.COVERAGE === '1'
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
4
|
presets: [
|
|
3
5
|
'@babel/preset-react',
|
|
4
6
|
['@babel/preset-env', { targets: { node: 'current' } }]
|
|
5
7
|
],
|
|
6
8
|
plugins: [
|
|
7
|
-
'@babel/plugin-proposal-object-rest-spread'
|
|
9
|
+
'@babel/plugin-proposal-object-rest-spread',
|
|
10
|
+
...(coverage
|
|
11
|
+
? [['istanbul', { include: ['src/**/*.js'], exclude: ['**/*.spec.js', '**/node_modules/**', 'e2e/**'] }]]
|
|
12
|
+
: [])
|
|
8
13
|
]
|
|
9
14
|
}
|
|
@@ -5660,7 +5660,8 @@ function Entity({
|
|
|
5660
5660
|
} = useGame();
|
|
5661
5661
|
const isClickable = allClickable.has(entity);
|
|
5662
5662
|
const attributes = entity.attributes;
|
|
5663
|
-
|
|
5663
|
+
const entityType = attributes.entityType ?? attributes.type;
|
|
5664
|
+
switch (entityType) {
|
|
5664
5665
|
case 'Grid':
|
|
5665
5666
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
5666
5667
|
grid: entity,
|