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
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",
"scripts": {
"build": "tsc",
"fix": "yarn prettier --write",
"lint": "yarn prettier --list-different",
"postinstall": "npm run build",
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
"start": "node dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "yarn lint"
},
"repository": {
"type": "git",

View File

@ -40,10 +40,13 @@ io.on("connection", socket => {
);
});
socket.on("server-broadcast", (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(
"server-broadcast",
(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", () => {
const rooms = io.sockets.adapter.rooms;

View File

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

1554
yarn.lock Normal file

File diff suppressed because it is too large Load Diff