-
-
Notifications
You must be signed in to change notification settings - Fork 166
feat: add monorepo dev workflow with concurrently and fix TypeScript #51 #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ const Game: React.FC = () => { | |
| gameResult: { | ||
| isReady: false, | ||
| isWinner: false, | ||
| points: false, | ||
| points: 0, | ||
| totalPoints: 0, | ||
| evaluationMessage: "no data", | ||
| }, | ||
|
|
@@ -32,17 +32,20 @@ const Game: React.FC = () => { | |
| }); | ||
|
|
||
| const websocketRef = useRef<WebSocket | null>(null); | ||
| const lastTypingStateRef = useRef<boolean>(false); | ||
| const lastSpeakingStateRef = useRef<boolean>(false); | ||
| const _lastTypingStateRef = useRef<boolean>(false); | ||
| const _lastSpeakingStateRef = useRef<boolean>(false); | ||
| void _lastTypingStateRef; // Reserved for typing indicator feature | ||
| void _lastSpeakingStateRef; // Reserved for speaking indicator feature | ||
|
|
||
| const sendWebSocketMessage = useCallback((payload: Record<string, unknown>) => { | ||
| const _sendWebSocketMessage = useCallback((payload: Record<string, unknown>) => { | ||
| const ws = websocketRef.current; | ||
| if (ws?.readyState === WebSocket.OPEN) { | ||
| ws.send(JSON.stringify(payload)); | ||
| } else { | ||
| console.warn("Attempted to send message while WebSocket was not open.", payload); | ||
| } | ||
| }, []); | ||
| void _sendWebSocketMessage; // Reserved for future WebSocket messaging | ||
|
Comment on lines
+40
to
+48
|
||
|
|
||
| type GameWebSocketMessage = { | ||
| type: string; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -653,7 +653,7 @@ const TeamDebateRoom: React.FC = () => { | |||||
| }, [timer, debatePhase, isMyTurn, speechTranscripts, localRole, debateId]); | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| currentUserIdRef.current = currentUser?.id; | ||||||
| currentUserIdRef.current = currentUser?.id ?? null; | ||||||
| myTeamIdRef.current = myTeamId; | ||||||
| isTeam1Ref.current = isTeam1; | ||||||
| debatePhaseRef.current = debatePhase; | ||||||
|
|
@@ -738,7 +738,8 @@ const TeamDebateRoom: React.FC = () => { | |||||
| const amTeam1 = isTeam1Ref.current; | ||||||
| const currentMyTeamId = myTeamIdRef.current; | ||||||
| const currentUserId = currentUserIdRef.current; | ||||||
| const currentPhase = debatePhaseRef.current; | ||||||
| const _currentPhase = debatePhaseRef.current; | ||||||
| void _currentPhase; // Available for phase-aware message handling | ||||||
|
Comment on lines
+741
to
+742
|
||||||
| const _currentPhase = debatePhaseRef.current; | |
| void _currentPhase; // Available for phase-aware message handling |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import { useUser } from '../hooks/useUser'; | |
| import ProfileHover from './ProfileHover'; | ||
| import UserProfileModal from './UserProfileModal'; | ||
| import { | ||
| commentsByTranscriptAtom, | ||
| getCommentsForTranscriptAtom, | ||
| setCommentsForTranscriptAtom, | ||
| addCommentToTranscriptAtom, | ||
|
|
@@ -229,8 +228,9 @@ const CommentTree: React.FC<CommentTreeProps> = ({ | |
| const { user } = useUser(); | ||
| const [commentsAtom] = useAtom(getCommentsForTranscriptAtom(transcriptId)); | ||
| const [, setCommentsAtom] = useAtom(setCommentsForTranscriptAtom(transcriptId)); | ||
| const [, addCommentAtom] = useAtom(addCommentToTranscriptAtom(transcriptId)); | ||
| const [, _addCommentAtom] = useAtom(addCommentToTranscriptAtom(transcriptId)); | ||
| const [, removeCommentAtom] = useAtom(removeCommentFromTranscriptAtom(transcriptId)); | ||
| void _addCommentAtom; // Reserved for future use | ||
|
Comment on lines
229
to
+233
|
||
|
|
||
| const [comments, setComments] = useState<Comment[]>([]); | ||
| const [loading, setLoading] = useState(true); | ||
|
|
@@ -392,7 +392,8 @@ const CommentTree: React.FC<CommentTreeProps> = ({ | |
| } | ||
|
|
||
| const result = await response.json(); | ||
| const newComment: Comment = result.comment; | ||
| const _newComment: Comment = result.comment; | ||
| void _newComment; // Result used via fetchComments refresh | ||
|
Comment on lines
394
to
+396
|
||
|
|
||
| // Fetch updated comments (including the new one) and update atom | ||
| await fetchComments(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| "name": "debateai-monorepo", | ||||||||||||||||||||||||||||||||||||||||||||
| "version": "1.0.0", | ||||||||||||||||||||||||||||||||||||||||||||
| "private": true, | ||||||||||||||||||||||||||||||||||||||||||||
| "description": "DebateAI Monorepo - Run frontend and backend together", | ||||||||||||||||||||||||||||||||||||||||||||
| "scripts": { | ||||||||||||||||||||||||||||||||||||||||||||
| "dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| "dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", | |
| "dev": "concurrently --kill-others-on-fail -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", |
Copilot
AI
Feb 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm install at the repo root will only install root devDependencies (e.g., concurrently) and will not install frontend/ dependencies. As written, the PR description’s “npm install && npm run dev” flow will fail unless users manually run npm install in frontend/ first. Consider adding a root postinstall (or using npm workspaces / npm --prefix frontend install) so a single root install is sufficient, or adjust scripts so dev ensures frontend deps are installed.
| "install:all": "npm install && npm run install:frontend" | |
| "install:all": "npm install && npm run install:frontend", | |
| "postinstall": "npm --prefix frontend install" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm install alone won't bootstrap frontend — contributors hitting a broken npm run dev on fresh clone.
The PR states the usage is npm install; npm run dev, but npm install only installs root devDependencies (concurrently). Frontend dependencies in frontend/package.json are never installed, so dev:frontend will fail on a fresh clone.
Consider adding a postinstall hook to automate this, or at minimum update the documented workflow to use install:all:
Proposed fix
"scripts": {
"dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"",
"dev:frontend": "cd frontend && npm run dev",
"dev:backend": "cd backend && go run ./cmd/server/",
"build": "concurrently \"npm run build:frontend\" \"npm run build:backend\"",
"build:frontend": "cd frontend && npm run build",
"build:backend": "cd backend && go build ./cmd/server/",
"install:frontend": "cd frontend && npm install",
- "install:all": "npm install && npm run install:frontend"
+ "install:all": "npm install && npm run install:frontend",
+ "postinstall": "npm run install:frontend"
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "scripts": { | |
| "dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", | |
| "dev:frontend": "cd frontend && npm run dev", | |
| "dev:backend": "cd backend && go run ./cmd/server/", | |
| "build": "concurrently \"npm run build:frontend\" \"npm run build:backend\"", | |
| "build:frontend": "cd frontend && npm run build", | |
| "build:backend": "cd backend && go build ./cmd/server/", | |
| "install:frontend": "cd frontend && npm install", | |
| "install:all": "npm install && npm run install:frontend" | |
| }, | |
| "scripts": { | |
| "dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", | |
| "dev:frontend": "cd frontend && npm run dev", | |
| "dev:backend": "cd backend && go run ./cmd/server/", | |
| "build": "concurrently \"npm run build:frontend\" \"npm run build:backend\"", | |
| "build:frontend": "cd frontend && npm run build", | |
| "build:backend": "cd backend && go build ./cmd/server/", | |
| "install:frontend": "cd frontend && npm install", | |
| "install:all": "npm install && npm run install:frontend", | |
| "postinstall": "npm run install:frontend" | |
| }, |
🤖 Prompt for AI Agents
In `@package.json` around lines 6 - 15, The root package.json’s current scripts
leave frontend deps uninstalled causing npm run dev (which invokes dev:frontend)
to fail on a fresh clone; update package.json to automatically install frontend
deps after root install by adding a postinstall script that runs the existing
"install:all" (or directly "npm run install:frontend"), so that "npm install"
will bootstrap both root and frontend, and ensure the change references the
existing script names "install:all", "install:frontend", "dev", and
"dev:frontend".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These refs are renamed and then intentionally unused (only referenced via
void). This leaves dead code paths in a core page and makes it harder to understand what is actually used. Prefer removing them until the typing/speaking indicator feature is implemented, or wire them into the existingTYPING_*/SPEAKING_*handlers if that feature already exists in this component.