From 48a14353192b67ec141bdc253ee67890f91dfee9 Mon Sep 17 00:00:00 2001 From: clemos Date: Fri, 23 Jun 2023 09:44:02 +0200 Subject: [PATCH 1/2] bump ws to 8.13.0 --- bin/server.js | 7 +++---- package-lock.json | 21 ++++++++++++--------- package.json | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/bin/server.js b/bin/server.js index 485f2ca..7d9c585 100755 --- a/bin/server.js +++ b/bin/server.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -import ws from 'ws' +import { WebSocketServer } from 'ws' import http from 'http' import * as map from 'lib0/map' @@ -12,8 +12,7 @@ const wsReadyStateClosed = 3 // eslint-disable-line const pingTimeout = 30000 const port = process.env.PORT || 4444 -// @ts-ignore -const wss = new ws.Server({ noServer: true }) +const wss = new WebSocketServer({ noServer: true }) const server = http.createServer((request, response) => { response.writeHead(200, { 'Content-Type': 'text/plain' }) @@ -81,7 +80,7 @@ const onconnection = conn => { closed = true }) conn.on('message', /** @param {object} message */ message => { - if (typeof message === 'string') { + if (typeof message === 'string' || message instanceof Buffer) { message = JSON.parse(message) } if (message && message.type && !closed) { diff --git a/package-lock.json b/package-lock.json index 637f18a..64d0252 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,10 @@ "url": "https://github.com/sponsors/dmonad" }, "optionalDependencies": { - "ws": "^7.2.0" + "ws": "^8.13.0" + }, + "peerDependencies": { + "yjs": "^13.5.6" } }, "node_modules/@babel/code-frame": { @@ -3991,16 +3994,16 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "optional": true, "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -7113,9 +7116,9 @@ } }, "ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "optional": true, "requires": {} }, diff --git a/package.json b/package.json index 2ec16dd..16141a5 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "yjs": "^13.5.6" }, "optionalDependencies": { - "ws": "^7.2.0" + "ws": "^8.13.0" }, "engines": { "node": ">=12" From 00113230ea68471216dc253f052a9d9f69b24e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Klein?= Date: Tue, 14 Nov 2023 11:34:40 +0100 Subject: [PATCH 2/2] Upgrade yjs, ws and y-protocols packages --- package-lock.json | 83 +++++++++++++++++++++++++++-------------------- package.json | 8 ++--- 2 files changed, 52 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 64d0252..508ebf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "lib0": "^0.2.42", "simple-peer": "^9.11.0", - "y-protocols": "^1.0.5" + "y-protocols": "^1.0.6" }, "bin": { "y-webrtc-signaling": "bin/server.js" @@ -27,7 +27,7 @@ "rollup-plugin-terser": "^5.3.1", "standard": "^14.3.4", "typescript": "^4.4.4", - "yjs": "^13.5.20" + "yjs": "^13.6.8" }, "engines": { "node": ">=12" @@ -37,10 +37,10 @@ "url": "https://github.com/sponsors/dmonad" }, "optionalDependencies": { - "ws": "^8.13.0" + "ws": "^8.14.2" }, "peerDependencies": { - "yjs": "^13.5.6" + "yjs": "^13.6.8" } }, "node_modules/@babel/code-frame": { @@ -2286,14 +2286,18 @@ } }, "node_modules/lib0": { - "version": "0.2.59", - "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.59.tgz", - "integrity": "sha512-aZdxUFjS0rKb0a18B3JC/MatCOrahCrAhKZT7bxjXnzRpIhMx/MiXN2ItN2CVhFxzTrL8U3URcVMxKD6PtRErw==", + "version": "0.2.87", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.87.tgz", + "integrity": "sha512-TbB63XJixvNToW2IHWAFsCJj9tVnajmwjE14p69i51Rx8byOQd2IP4ourE8v4d7vhyO++nVm1sQk3ePslfbucg==", "dependencies": { "isomorphic.js": "^0.2.4" }, + "bin": { + "0gentesthtml": "bin/gentesthtml.js", + "0serve": "bin/0serve.js" + }, "engines": { - "node": ">=14" + "node": ">=16" }, "funding": { "type": "GitHub Sponsors ❤", @@ -3994,9 +3998,9 @@ } }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "optional": true, "engines": { "node": ">=10.0.0" @@ -4024,15 +4028,22 @@ } }, "node_modules/y-protocols": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz", - "integrity": "sha512-Wil92b7cGk712lRHDqS4T90IczF6RkcvCwAD0A2OPg+adKmOe+nOiT/N2hvpQIWS3zfjmtL4CPaH5sIW1Hkm/A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.6.tgz", + "integrity": "sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==", "dependencies": { - "lib0": "^0.2.42" + "lib0": "^0.2.85" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" }, "funding": { "type": "GitHub Sponsors ❤", "url": "https://github.com/sponsors/dmonad" + }, + "peerDependencies": { + "yjs": "^13.0.0" } }, "node_modules/y18n": { @@ -4160,12 +4171,15 @@ } }, "node_modules/yjs": { - "version": "13.5.44", - "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.5.44.tgz", - "integrity": "sha512-UL+abIh2lQonqXfaJ+en7z9eGshpY11j1zNLc2kDYs0vrTjee4gZJUXC3ZsuhP6geQt0IRU04epCGRaVPQAVCA==", - "dev": true, + "version": "13.6.8", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.8.tgz", + "integrity": "sha512-ZPq0hpJQb6f59B++Ngg4cKexDJTvfOgeiv0sBc4sUm8CaBWH7OQC4kcCgrqbjJ/B2+6vO49exvTmYfdlPtcjbg==", "dependencies": { - "lib0": "^0.2.49" + "lib0": "^0.2.74" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" }, "funding": { "type": "GitHub Sponsors ❤", @@ -5826,9 +5840,9 @@ } }, "lib0": { - "version": "0.2.59", - "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.59.tgz", - "integrity": "sha512-aZdxUFjS0rKb0a18B3JC/MatCOrahCrAhKZT7bxjXnzRpIhMx/MiXN2ItN2CVhFxzTrL8U3URcVMxKD6PtRErw==", + "version": "0.2.87", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.87.tgz", + "integrity": "sha512-TbB63XJixvNToW2IHWAFsCJj9tVnajmwjE14p69i51Rx8byOQd2IP4ourE8v4d7vhyO++nVm1sQk3ePslfbucg==", "requires": { "isomorphic.js": "^0.2.4" } @@ -7116,9 +7130,9 @@ } }, "ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "optional": true, "requires": {} }, @@ -7129,11 +7143,11 @@ "dev": true }, "y-protocols": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz", - "integrity": "sha512-Wil92b7cGk712lRHDqS4T90IczF6RkcvCwAD0A2OPg+adKmOe+nOiT/N2hvpQIWS3zfjmtL4CPaH5sIW1Hkm/A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.6.tgz", + "integrity": "sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==", "requires": { - "lib0": "^0.2.42" + "lib0": "^0.2.85" } }, "y18n": { @@ -7239,12 +7253,11 @@ } }, "yjs": { - "version": "13.5.44", - "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.5.44.tgz", - "integrity": "sha512-UL+abIh2lQonqXfaJ+en7z9eGshpY11j1zNLc2kDYs0vrTjee4gZJUXC3ZsuhP6geQt0IRU04epCGRaVPQAVCA==", - "dev": true, + "version": "13.6.8", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.8.tgz", + "integrity": "sha512-ZPq0hpJQb6f59B++Ngg4cKexDJTvfOgeiv0sBc4sUm8CaBWH7OQC4kcCgrqbjJ/B2+6vO49exvTmYfdlPtcjbg==", "requires": { - "lib0": "^0.2.49" + "lib0": "^0.2.74" } } } diff --git a/package.json b/package.json index 16141a5..1a12b42 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "dependencies": { "lib0": "^0.2.42", "simple-peer": "^9.11.0", - "y-protocols": "^1.0.5" + "y-protocols": "^1.0.6" }, "devDependencies": { "@rollup/plugin-commonjs": "^11.1.0", @@ -73,13 +73,13 @@ "rollup-plugin-terser": "^5.3.1", "standard": "^14.3.4", "typescript": "^4.4.4", - "yjs": "^13.5.20" + "yjs": "^13.6.8" }, "peerDependencies": { - "yjs": "^13.5.6" + "yjs": "^13.6.8" }, "optionalDependencies": { - "ws": "^8.13.0" + "ws": "^8.14.2" }, "engines": { "node": ">=12"