Switch back to yarn, add in prettier linting

This commit is contained in:
idlewinn 2020-03-12 14:31:22 -07:00
parent e263722dde
commit d5ad770446
6 changed files with 1580 additions and 4356 deletions

View File

@ -1,2 +1,3 @@
# collab-server # collab-server
Excalidraw collaboration server Excalidraw collaboration server

4337
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,12 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"fix": "yarn prettier --write",
"lint": "yarn prettier --list-different",
"postinstall": "npm run build", "postinstall": "npm run build",
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
"start": "node dist/index.js", "start": "node dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "yarn lint"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -40,10 +40,13 @@ io.on("connection", socket => {
); );
}); });
socket.on("server-broadcast", (roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => { socket.on(
"server-broadcast",
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
console.log(`${socket.id} sends update to ${roomID}`); console.log(`${socket.id} sends update to ${roomID}`);
socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv); socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
}); }
);
socket.on("disconnecting", () => { socket.on("disconnecting", () => {
const rooms = io.sockets.adapter.rooms; const rooms = io.sockets.adapter.rooms;

View File

@ -13,4 +13,4 @@
"isolatedModules": true, "isolatedModules": true,
"outDir": "dist" "outDir": "dist"
} }
} }

1554
yarn.lock Normal file

File diff suppressed because it is too large Load Diff