Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
"\\.svg$": "<rootDir>/src/__mocks__/svg-mock.cjs",
"\\.svg": "<rootDir>/src/__mocks__/svg-mock.cjs",
"\\.(css|scss|png)$": "identity-obj-proxy"
},

Expand Down
23,057 changes: 12,941 additions & 10,116 deletions package-lock.json

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Storming BoardGame - An original board game in React",
"type": "module",
"engines": {
"node": ">=18.17"
"node": ">=20.19"
},
"engineStrict": true,
"private": false,
Expand All @@ -29,43 +29,44 @@
]
},
"scripts": {
"start": "vite",
"dev": "vite",
"build": "tsc && vite build",
"test": "jest",
"serve": "vite preview",
"release": "semantic-release",
"blue-ball": "npm run test && npm run build"
},
"dependencies": {
"classnames": "2.3.2",
"framer-motion": "^10.16.5",
"react": "18.2.0",
"react-dom": "18.2.0"
"classnames": "2.5.1",
"framer-motion": "12.23.5",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.47",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"eslint-plugin-html": "^7.1.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "13.0.1",
"@semantic-release/git": "10.0.1",
"@semantic-release/npm": "12.0.2",
"@semantic-release/release-notes-generator": "14.0.3",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.3.0",
"@testing-library/user-event": "14.6.1",
"@types/jest": "30.0.0",
"@types/node": "24.0.13",
"@types/react": "19.1.8",
"@types/react-dom": "19.1.6",
"@vitejs/plugin-react-swc": "3.10.2",
"eslint-plugin-html": "8.1.3",
"identity-obj-proxy": "3.0.0",
"jest": "30.0.4",
"jest-environment-jsdom": "30.0.4",
"sass": "^1.54.0",
"semantic-release": "^22.0.6",
"ts-jest": "^29.0.3",
"typescript": "^4.9.5",
"vite": "^3.1.3",
"vite-plugin-svgr": "^2.2.1",
"vite-tsconfig-paths": "^3.5.1"
"semantic-release": "24.2.7",
"ts-jest": "29.4.0",
"typescript": "5.8.3",
"vite": "7.0.4",
"vite-plugin-html": "3.2.2",
"vite-plugin-svgr": "4.3.0",
"vite-tsconfig-paths": "5.1.4"
}
}
19 changes: 10 additions & 9 deletions src/@types/storming.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type PlayerType =
| "enemy3" /* green */;

type PlayerHandCardStatus = "selected" | "available" | "played" | "active";
type CardStatus = "active"
type CardStatus = "active";

/**
* ```ts
Expand Down Expand Up @@ -43,22 +43,23 @@ type Piece = {
owner: PlayerType;
};

type TerrainType = "field" | "mountain" | "lake" | "forest";
type BuildingType = "village" | "town" | "city";
type TerrainType = "mountain" | "lake" | "forest";
type BuildingType = "tower" | "castle" | "citadel";
type PieceType = "soldier" | "knight";

interface Tile {
terrain: TerrainType;
type Tile = {
terrain?: TerrainType;
piece?: Piece;
building?: Building;
}
};

type VisualBoard = Record<TileID, TileWithStatus>;

type TileStatus = "idle" | "selected" | "available" | "forbidden";
interface TileWithStatus extends Tile {
type TileStatus = "selected" | "available" | "forbidden";

type TileWithStatus = Tile & {
status: TileStatus;
}
};

// --------------
// CARDS
Expand Down
8 changes: 7 additions & 1 deletion src/__mocks__/svg-mock.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @see https://github.com/gregberge/svgr/issues/83
// eslint-disable-next-line no-undef
module.exports = { ReactComponent: 'icon-mock' };

const React = require("react");

module.exports = {
__esModule: true,
default: (props) => React.createElement("svg", props, "svg-mock"),
};
25 changes: 25 additions & 0 deletions src/app.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.app {
display: grid;
grid-template-columns: 1fr 4fr 1fr;
grid-template-rows: 1fr 7fr 2fr; /** 10 rows */
gap: 0px 0px;

grid-template-areas:
"current-phase timeline timeline"
"current-phase board marketplace"
"round-summary player-hand player-hand";

height: 100vh;
}

/*
css fix: the first row (timeline) was collapsing to 0px height
when the content was not enough to fill the space.
This is a workaround to ensure that the first row has a minimum height.

default value:
min-height: auto
*/
.app > * {
min-height: 0;
}
66 changes: 0 additions & 66 deletions src/app.scss

This file was deleted.

6 changes: 4 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ import {
Marketplace,
Menu,
PlayerHand,
RoundSummary,
TimeLine,
} from "components";
import { GameContextProvider } from "game-context";
import { StrictMode } from "react";

import "./app.scss";
import styles from "./app.module.css";

export function App() {
return (
<StrictMode>
<main className="game">
<main className={styles.app}>
<GameContextProvider>
<CurrentPhase />
<TimeLine />
<Menu />
<Board />
<Marketplace />
<RoundSummary />
<PlayerHand />
</GameContextProvider>
</main>
Expand Down
Loading