Skip to content

Commit ba1af3d

Browse files
committed
feat: scaffold modular React and Phaser workspace
1 parent 7adb636 commit ba1af3d

21 files changed

Lines changed: 2902 additions & 0 deletions

‎.dependency-cruiser.cjs‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
forbidden: [
3+
{
4+
name: "site-does-not-import-game-scenes",
5+
from: { path: "^web/apps/" },
6+
to: { path: "^web/packages/game-(?!kit/)" },
7+
},
8+
{
9+
name: "game-scenes-only-depend-on-game-kit",
10+
from: { path: "^web/packages/game-(?!kit/)" },
11+
to: {
12+
path: "^web/(apps/|packages/(?!game-kit/|game-[^/]+/))",
13+
},
14+
},
15+
{
16+
name: "shared-packages-do-not-import-apps",
17+
from: { path: "^web/packages/" },
18+
to: { path: "^web/apps/" },
19+
},
20+
{
21+
name: "no-circular-dependencies",
22+
severity: "error",
23+
from: {},
24+
to: { circular: true },
25+
},
26+
],
27+
options: {
28+
doNotFollow: { path: "node_modules" },
29+
tsConfig: { fileName: "tsconfig.json" },
30+
tsPreCompilationDeps: true,
31+
},
32+
};

‎.github/workflows/web.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Web CI
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
permissions:
7+
contents: read
8+
concurrency:
9+
group: web-ci-${{ github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
web:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm typecheck
22+
- run: pnpm lint
23+
- run: pnpm format:check
24+
- run: pnpm build

‎eslint.config.mjs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import globals from "globals";
4+
5+
export default tseslint.config(
6+
{ ignores: ["**/dist/**", "**/node_modules/**"] },
7+
js.configs.recommended,
8+
...tseslint.configs.recommended,
9+
{
10+
files: ["web/**/*.{ts,tsx}"],
11+
languageOptions: { globals: globals.browser },
12+
rules: { "@typescript-eslint/no-explicit-any": "error" },
13+
},
14+
{
15+
files: ["web/**/*.{ts,tsx}"],
16+
ignores: ["web/packages/api-client/**"],
17+
rules: {
18+
"no-restricted-globals": [
19+
"error",
20+
{ name: "fetch", message: "Use @gfa/api-client." },
21+
{ name: "WebSocket", message: "Use @gfa/api-client." },
22+
{ name: "XMLHttpRequest", message: "Use @gfa/api-client." },
23+
],
24+
},
25+
},
26+
);

‎package.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "gamesforai",
3+
"private": true,
4+
"packageManager": "pnpm@10.6.5",
5+
"scripts": {
6+
"build": "pnpm --filter @gfa/site build",
7+
"dev": "pnpm --filter @gfa/site dev",
8+
"typecheck": "tsc --noEmit -p web/tsconfig.json",
9+
"lint": "eslint web && depcruise web --config .dependency-cruiser.cjs",
10+
"format:check": "prettier --check 'web/**/*.{ts,tsx,css,html,json}'",
11+
"format": "prettier --write 'web/**/*.{ts,tsx,css,html,json}'"
12+
},
13+
"devDependencies": {
14+
"@eslint/js": "^9.22.0",
15+
"dependency-cruiser": "^16.10.2",
16+
"eslint": "^9.22.0",
17+
"globals": "^16.0.0",
18+
"prettier": "^3.5.3",
19+
"typescript": "^5.8.2",
20+
"typescript-eslint": "^8.26.0"
21+
}
22+
}

0 commit comments

Comments
 (0)