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 ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "temp-dir": ".nyc_output",
3
+ "report-dir": "coverage",
4
+ "include": ["src/**/*.js"],
5
+ "exclude": ["**/*.spec.js", "**/node_modules/**", "e2e/**", "test-app/**"],
6
+ "instrument": false,
7
+ "sourceMap": false
8
+ }
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
- switch (attributes.type) {
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,