Switch back to yarn, add in prettier linting
This commit is contained in:
parent
e263722dde
commit
d5ad770446
@ -1,2 +1,3 @@
|
|||||||
# collab-server
|
# collab-server
|
||||||
|
|
||||||
Excalidraw collaboration server
|
Excalidraw collaboration server
|
||||||
|
4337
package-lock.json
generated
4337
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||||
|
11
src/index.ts
11
src/index.ts
@ -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;
|
||||||
|
@ -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"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user