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(
console.log(`${socket.id} sends update to ${roomID}`); "server-broadcast",
socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv); (roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
}); console.log(`${socket.id} sends update to ${roomID}`);
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

@ -1,16 +1,16 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"strict": true, "strict": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"outDir": "dist" "outDir": "dist"
}
} }
}

1554
yarn.lock Normal file

File diff suppressed because it is too large Load Diff