V2 ws store (#310)

* Update TimerService.ts

* refactor: message service publishes to store

* refactor: several type improvements

* V2 ws store wss (#309)

* refactor: shared logging types

* refactor: simplify message service consumption

* refactor: create discrete logging system

* refactor: move socket.io > websocket
This commit is contained in:
Carlos Valente
2023-03-15 22:06:47 +01:00
committed by GitHub
parent 11648ee546
commit 76c8f8a4d5
86 changed files with 1876 additions and 1936 deletions
+65 -118
View File
@@ -47,6 +47,7 @@ importers:
'@testing-library/react': ^13.1.1
'@testing-library/user-event': ^14.1.1
'@types/color': ^3.0.3
'@types/luxon': ^3.2.0
'@types/prop-types': ^15.7.5
'@types/react': ^18.0.26
'@types/react-beautiful-dnd': ^13.1.3
@@ -59,6 +60,7 @@ importers:
axios: ^1.2.0
color: ^4.2.3
csv-stringify: ^6.2.3
deepmerge: ^4.3.0
eslint: ^8.31.0
eslint-config-prettier: ^8.6.0
eslint-plugin-jest: ^27.1.7
@@ -70,7 +72,7 @@ importers:
framer-motion: ^8.0.2
jotai: ^1.10.0
jsdom: ^21.1.0
luxon: ^3.1.0
luxon: ^3.3.0
ontime-types: workspace:*
ontime-utils: workspace:*
prettier: ^2.8.3
@@ -83,8 +85,8 @@ importers:
react-qr-code: ^2.0.11
react-router-dom: ^6.3.0
react-table: ^7.7.0
react-use-websocket: ^4.3.1
sass: ^1.57.1
socket.io-client: ^4.5.4
stylelint: ^14.16.1
stylelint-config-prettier: ^9.0.4
stylelint-config-standard-scss: ^6.1.0
@@ -94,6 +96,7 @@ importers:
vite-plugin-svgr: ^2.4.0
vite-tsconfig-paths: ^4.0.3
web-vitals: ^3.1.1
zustand: ^4.3.6
dependencies:
'@chakra-ui/react': 2.4.8_loo4skotrnm7icurwgkplqpnwq
'@dnd-kit/core': 6.0.7_biqbaboplfbrettd7655fr4n2y
@@ -110,9 +113,10 @@ importers:
axios: 1.2.2
color: 4.2.3
csv-stringify: 6.2.3
deepmerge: 4.3.0
framer-motion: 8.4.3_biqbaboplfbrettd7655fr4n2y
jotai: 1.13.0_react@18.2.0
luxon: 3.2.1
luxon: 3.3.0
react: 18.2.0
react-beautiful-dnd: 13.1.1_biqbaboplfbrettd7655fr4n2y
react-dom: 18.2.0_react@18.2.0
@@ -121,9 +125,10 @@ importers:
react-qr-code: 2.0.11_react@18.2.0
react-router-dom: 6.6.2_biqbaboplfbrettd7655fr4n2y
react-table: 7.8.0_react@18.2.0
socket.io-client: 4.5.4
react-use-websocket: 4.3.1_biqbaboplfbrettd7655fr4n2y
typeface-open-sans: 1.1.13
web-vitals: 3.1.1
zustand: 4.3.6_react@18.2.0
devDependencies:
'@sentry/vite-plugin': 0.3.0
'@tanstack/eslint-plugin-query': 4.21.0
@@ -131,6 +136,7 @@ importers:
'@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y
'@testing-library/user-event': 14.4.3
'@types/color': 3.0.3
'@types/luxon': 3.2.0
'@types/prop-types': 15.7.5
'@types/react': 18.0.26
'@types/react-beautiful-dnd': 13.1.3
@@ -182,6 +188,7 @@ importers:
'@types/express': ^4.17.17
'@types/node': ^16.11.7
'@types/node-osc': ^6.0.0
'@types/websocket': ^1.0.5
'@typescript-eslint/eslint-plugin': ^5.48.1
'@typescript-eslint/parser': ^5.48.1
body-parser: ^1.20.0
@@ -205,10 +212,10 @@ importers:
passport-local: ~1.0.0
prettier: ^2.8.3
shx: ^0.3.4
socket.io: ^4.5.4
ts-node: ^10.9.1
typescript: ^4.9.4
vitest: ^0.27.1
ws: ^8.12.1
dependencies:
'@sentry/node': 7.30.0
'@sentry/tracing': 7.30.0
@@ -226,11 +233,12 @@ importers:
ontime-utils: link:../../packages/utils
passport: 0.6.0
passport-local: 1.0.0
socket.io: 4.5.4
ws: 8.12.1
devDependencies:
'@types/express': 4.17.17
'@types/node': 16.18.11
'@types/node-osc': 6.0.0
'@types/websocket': 1.0.5
'@typescript-eslint/eslint-plugin': 5.48.1_3jon24igvnqaqexgwtxk6nkpse
'@typescript-eslint/parser': 5.48.1_iukboom6ndih5an6iafl45j2fe
esbuild: 0.17.5
@@ -258,19 +266,23 @@ importers:
packages/utils:
specifiers:
'@types/luxon': ^3.2.0
'@typescript-eslint/eslint-plugin': ^5.48.1
'@typescript-eslint/parser': ^5.48.1
eslint: ^8.31.0
eslint-config-prettier: ^8.6.0
eslint-plugin-prettier: ^4.2.1
eslint-plugin-simple-import-sort: ^8.0.0
luxon: ^3.3.0
nanoid: ^4.0.0
prettier: ^2.8.3
typescript: ^4.9.4
vitest: ^0.27.1
dependencies:
luxon: 3.3.0
nanoid: 4.0.0
devDependencies:
'@types/luxon': 3.2.0
'@typescript-eslint/eslint-plugin': 5.48.1_3jon24igvnqaqexgwtxk6nkpse
'@typescript-eslint/parser': 5.48.1_iukboom6ndih5an6iafl45j2fe
eslint: 8.31.0
@@ -2608,10 +2620,6 @@ packages:
engines: {node: '>=6'}
dev: true
/@socket.io/component-emitter/3.1.0:
resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==}
dev: false
/@svgr/babel-plugin-add-jsx-attribute/6.5.1_@babel+core@7.20.12:
resolution: {integrity: sha512-9PYGcXrAxitycIjRmZB+Q0JaN07GZIWaTBIGQzfaZv+qr1n8X1XUEJ5rZ/vx6OVD9RRYlrNnXWExQXcmZeD/BQ==}
engines: {node: '>=10'}
@@ -2906,16 +2914,6 @@ packages:
'@types/node': 18.11.18
dev: true
/@types/cookie/0.4.1:
resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==}
dev: false
/@types/cors/2.8.13:
resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==}
dependencies:
'@types/node': 18.11.18
dev: false
/@types/debug/4.1.7:
resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==}
dependencies:
@@ -3008,6 +3006,10 @@ packages:
resolution: {integrity: sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==}
dev: false
/@types/luxon/3.2.0:
resolution: {integrity: sha512-lGmaGFoaXHuOLXFvuju2bfvZRqxAqkHPx9Y9IQdQABrinJJshJwfNCKV+u7rR3kJbiqfTF/NhOkcxxAFrObyaA==}
dev: true
/@types/mime/3.0.1:
resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==}
dev: true
@@ -3035,6 +3037,7 @@ packages:
/@types/node/18.11.18:
resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==}
dev: true
/@types/normalize-package-data/2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
@@ -3127,6 +3130,12 @@ packages:
dev: true
optional: true
/@types/websocket/1.0.5:
resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==}
dependencies:
'@types/node': 18.11.18
dev: true
/@types/yargs-parser/21.0.0:
resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}
dev: true
@@ -3764,11 +3773,6 @@ packages:
requiresBuild: true
dev: true
/base64id/2.0.0:
resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==}
engines: {node: ^4.5.0 || >= 5.9}
dev: false
/binary-extensions/2.2.0:
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
engines: {node: '>=8'}
@@ -4423,6 +4427,11 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
dev: true
/deepmerge/4.3.0:
resolution: {integrity: sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==}
engines: {node: '>=0.10.0'}
dev: false
/defer-to-connect/1.1.3:
resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==}
dev: true
@@ -4667,45 +4676,6 @@ packages:
once: 1.4.0
dev: true
/engine.io-client/6.2.3:
resolution: {integrity: sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-parser: 5.0.5
ws: 8.2.3
xmlhttprequest-ssl: 2.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/engine.io-parser/5.0.5:
resolution: {integrity: sha512-mjEyaa4zhuuRhaSLOdjEb57X0XPP9JEsnXI4E+ivhwT0GgzUogARx4MqoY1jQyB+4Bkz3BUOmzL7t9RMKmlG3g==}
engines: {node: '>=10.0.0'}
dev: false
/engine.io/6.2.1:
resolution: {integrity: sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==}
engines: {node: '>=10.0.0'}
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.13
'@types/node': 18.11.18
accepts: 1.3.8
base64id: 2.0.0
cookie: 0.4.2
cors: 2.8.5
debug: 4.3.4
engine.io-parser: 5.0.5
ws: 8.2.3
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/entities/4.4.0:
resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==}
engines: {node: '>=0.12'}
@@ -6534,8 +6504,8 @@ packages:
/lru_map/0.3.3:
resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==}
/luxon/3.2.1:
resolution: {integrity: sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==}
/luxon/3.3.0:
resolution: {integrity: sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==}
engines: {node: '>=12'}
dev: false
@@ -7613,6 +7583,16 @@ packages:
react: 18.2.0
dev: false
/react-use-websocket/4.3.1_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-zHPLWrgcqydJaak2O5V9hiz4q2dwkwqNQqpgFVmSuPxLZdsZlnDs8DVHy3WtHH+A6ms/8aHIyX7+7ulOcrnR0Q==}
peerDependencies:
react: '>= 18.0.0'
react-dom: '>= 18.0.0'
dependencies:
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/react/18.2.0:
resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
engines: {node: '>=0.10.0'}
@@ -8025,50 +8005,6 @@ packages:
dev: true
optional: true
/socket.io-adapter/2.4.0:
resolution: {integrity: sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==}
dev: false
/socket.io-client/4.5.4:
resolution: {integrity: sha512-ZpKteoA06RzkD32IbqILZ+Cnst4xewU7ZYK12aS1mzHftFFjpoMz69IuhP/nL25pJfao/amoPI527KnuhFm01g==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-client: 6.2.3
socket.io-parser: 4.2.1
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/socket.io-parser/4.2.1:
resolution: {integrity: sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: false
/socket.io/4.5.4:
resolution: {integrity: sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==}
engines: {node: '>=10.0.0'}
dependencies:
accepts: 1.3.8
base64id: 2.0.0
debug: 4.3.4
engine.io: 6.2.1
socket.io-adapter: 2.4.0
socket.io-parser: 4.2.1
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/source-map-js/1.0.2:
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
engines: {node: '>=0.10.0'}
@@ -9307,12 +9243,12 @@ packages:
optional: true
dev: true
/ws/8.2.3:
resolution: {integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==}
/ws/8.12.1:
resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ^5.0.2
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
@@ -9349,11 +9285,6 @@ packages:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
dev: true
/xmlhttprequest-ssl/2.0.0:
resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==}
engines: {node: '>=0.4.0'}
dev: false
/xtend/4.0.2:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
@@ -9415,3 +9346,19 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
dev: true
/zustand/4.3.6_react@18.2.0:
resolution: {integrity: sha512-6J5zDxjxLE+yukC2XZWf/IyWVKnXT9b9HUv09VJ/bwGCpKNcaTqp7Ws28Xr8jnbvnZcdRaidztAPsXFBIqufiw==}
engines: {node: '>=12.7.0'}
peerDependencies:
immer: '>=9.0'
react: '>=16.8'
peerDependenciesMeta:
immer:
optional: true
react:
optional: true
dependencies:
react: 18.2.0
use-sync-external-store: 1.2.0_react@18.2.0
dev: false