websocket-text-relay 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -15,18 +15,18 @@ WTR currently has plugins for Neovim and VSCode.
|
|
|
15
15
|
### 2. Verify the webserver is running with the status UI
|
|
16
16
|
|
|
17
17
|
The websocket server hosts its own status UI on the same port as the websocket server. You can view
|
|
18
|
-
the status UI and verify everything is running by first starting up your text editor and then opening your browser to [http://localhost:38378](http://localhost:38378)
|
|
18
|
+
the status UI and verify everything is running by first starting up your text editor, enabling the server, and then opening your browser to [http://localhost:38378](http://localhost:38378)
|
|
19
19
|
|
|
20
20
|
### 3. Connect to the websocket server from the front end application
|
|
21
21
|
|
|
22
|
+
If you want to use this as a learning tool to play around with UI concepts using simple projects involving 1 html, css, and javascript file,
|
|
23
|
+
then check out [live-demo-vanillajs](https://github.com/niels4/live-demo-vanillajs). This is a great setup for following along with any short and focused web development tutorials.
|
|
24
|
+
|
|
22
25
|
To use this on a professional level project that gives you the option to use modules, typescript, and react, I recommend using vite along with
|
|
23
26
|
the plugin [vite-plugin-websocket-text-relay](https://github.com/niels4/vite-plugin-websocket-text-relay). This plugin gives you all the power of vite when developing while also hooking
|
|
24
27
|
the live text updates into Vite's hot module reload system. See [live-demo-vite](https://github.com/niels4/live-demo-vite) for a complete project setup with Typescript, React, Vite, ViTest, and a simple router.
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
then check out [live-demo-vanillajs](https://github.com/niels4/live-demo-vanillajs). This is a great setup for following along with any short and focused web development tutorials.
|
|
28
|
-
|
|
29
|
-
And finally, the status UI for this project was also created using live updates from websocket-text-relay.
|
|
29
|
+
The status UI for this project was also created using live updates from websocket-text-relay.
|
|
30
30
|
In addition to giving you live feedback on the status and activity of the application, it is also meant to serve as a
|
|
31
31
|
reference UI project that doesn't use any external dependencies.
|
|
32
32
|
|
package/biome.json
CHANGED
package/changelog.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "websocket-text-relay",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "An LSP server for sending live file updates from your text editor to the front end via websockets.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"websocket-text-relay": "./start.js"
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/niels4/websocket-text-relay#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ws": "8.
|
|
40
|
+
"ws": "8.20.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@biomejs/biome": "2.4.
|
|
44
|
-
"@types/node": "25.
|
|
45
|
-
"typescript": "
|
|
43
|
+
"@biomejs/biome": "2.4.13",
|
|
44
|
+
"@types/node": "25.6.0",
|
|
45
|
+
"typescript": "6.0.3"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -3,6 +3,8 @@ const { drawText, drawSvgElement } = __WTR__
|
|
|
3
3
|
const parentGroup = document.getElementById("headers_group")
|
|
4
4
|
parentGroup.innerHTML = ""
|
|
5
5
|
|
|
6
|
+
const leftHeaderText = "editors"
|
|
7
|
+
const rightHeaderText = "clients"
|
|
6
8
|
const legendCircleRadius = 0.014
|
|
7
9
|
|
|
8
10
|
const baseLineY = -0.73
|
|
@@ -10,7 +12,7 @@ const xOffset = 0.86
|
|
|
10
12
|
const legendY = baseLineY + 0.05
|
|
11
13
|
|
|
12
14
|
// left header
|
|
13
|
-
drawText({ x: -xOffset, y: baseLineY, text:
|
|
15
|
+
drawText({ x: -xOffset, y: baseLineY, text: leftHeaderText, className: "header", parent: parentGroup })
|
|
14
16
|
|
|
15
17
|
// left legend
|
|
16
18
|
let circleStart = -xOffset + 0.093
|
|
@@ -55,7 +57,7 @@ drawText({
|
|
|
55
57
|
drawText({
|
|
56
58
|
x: xOffset,
|
|
57
59
|
y: baseLineY,
|
|
58
|
-
text:
|
|
60
|
+
text: rightHeaderText,
|
|
59
61
|
className: ["header", "right_header"],
|
|
60
62
|
parent: parentGroup,
|
|
61
63
|
})
|