소스 검색

Add excalidraw as submodule

patwie 2 년 전
부모
커밋
3893dfb13e
5개의 변경된 파일31개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 0
      .gitmodules
  2. 9 3
      README.md
  3. 1 0
      excalidraw
  4. 6 4
      main.go
  5. 12 0
      ui-build.Dockerfile

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "excalidraw"]
+	path = excalidraw
+	url = https://github.com/excalidraw/excalidraw.git

+ 9 - 3
README.md

@@ -41,11 +41,17 @@ Interested in contributing or customizing? Build Excalidraw Complete from source
 
 ```bash
 # Clone and prepare the Excalidraw frontend
-git clone https://github.com/excalidraw/excalidraw.git
+git clone https://github.com/PatWie/excalidraw-complete.git --recursive
 cd excalidraw
-git checkout tags/v0.17.3
+# git checkout tags/v0.17.3
+# Fix docker build
+git remote add jcobol https://github.com/jcobol/excalidraw
+git fetch jcobol
+git checkout 7582_fix_docker_build
 git apply ../frontend.patch
-# Follow build instructions to compile assets into the frontend directory
+cd ../
+docker build -t exalidraw-ui-build excalidraw -f ui-build.Dockerfile
+docker run -v ${PWD}/:/pwd/ -it exalidraw-ui-build cp -r /frontend /pwd
 ```
 
 Compile the Go application:

+ 1 - 0
excalidraw

@@ -0,0 +1 @@
+Subproject commit 37ad34c4c221e1da5202782ba65bbdffd2393d87

+ 6 - 4
main.go

@@ -22,12 +22,13 @@ import (
 
 type (
 	UserToFollow struct {
-		SocketId string
-		Username string
+		SocketId string `json:"socketId"`
+		Username string `json:"username"`
 	}
+
 	OnUserFollowedPayload struct {
-		UserToFollow UserToFollow
-		action       string
+		UserToFollow UserToFollow `json:"userToFollow"`
+		Action       string       `json:"action"` // "FOLLOW" | "UNFOLLOW"
 	}
 )
 
@@ -72,6 +73,7 @@ func setupSocketIO() *socketio.Server {
 		Credentials: true,
 	})
 	ioo := socketio.NewServer(nil, opts)
+
 	ioo.On("connection", func(clients ...any) {
 		socket := clients[0].(*socketio.Socket)
 		ioo.To(socketio.Room(socket.Id())).Emit("init-room")

+ 12 - 0
ui-build.Dockerfile

@@ -0,0 +1,12 @@
+FROM node:18 AS build
+
+WORKDIR /home/node/app
+
+COPY . .
+
+RUN npm install
+RUN cd excalidraw-app && npm run build:app:docker
+
+FROM ubuntu:20.04
+COPY --from=build /home/node/app/excalidraw-app/build /frontend
+