@pluv/io 0.2.0 → 0.2.1
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +9 -0
- package/README.md +75 -7
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.2.
|
|
2
|
+
> @pluv/io@0.2.1 build /home/runner/work/pluv/pluv/packages/io
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m26.79 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 117ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.js [22m[32m28.59 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 95ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m26.79 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 96ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2778ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m12.86 KB[39m
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -39,7 +39,72 @@
|
|
|
39
39
|
|
|
40
40
|
Pluv.IO allows you to build real-time collaborate features with a fully end-to-end type-safe api.
|
|
41
41
|
|
|
42
|
+
### Why
|
|
43
|
+
|
|
44
|
+
So you can do this:
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
usePluvEvent("RECEIVE_MESSAGE", ({ data }) => {
|
|
48
|
+
setMessages([...messages, data.message]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
usePluvBroadcast({
|
|
52
|
+
type: "SEND_MESSAGE",
|
|
53
|
+
data: { message: "Hello world!" },
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
And this:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
const [myCursor, updatePresence] = usePluvMyPresence((me) => me.presence.cursor);
|
|
61
|
+
const cursors = usePluvOthers((others) => {
|
|
62
|
+
return others.map((other) => other.presence.cursor);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const updateCursor = (e: MouseEvent) => {
|
|
67
|
+
updatePresence({ cursor: { x: e.pageX, y: e.pageY } });
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
window.addEventListener("mousemove", updateCursor);
|
|
71
|
+
|
|
72
|
+
return () => {
|
|
73
|
+
window.removeEventListener("mousemove", updateCursor);
|
|
74
|
+
};
|
|
75
|
+
}, [updatePresence]);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div>
|
|
79
|
+
<div style={{ top: myCursor?.y, left: myCursor?.x }} />
|
|
80
|
+
{cursors.map((cursor, i) => (
|
|
81
|
+
<div key={i} style={{ top: cursor?.y, left: cursor?.x }} />
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Also this:
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
const [messages, sharedType] = usePluvStorage("messages");
|
|
92
|
+
|
|
93
|
+
sharedType?.push(["Hello world!"]);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div>
|
|
97
|
+
{messages?.map((message, i) => (
|
|
98
|
+
<div key={i}>{message}</div>
|
|
99
|
+
))}
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
And more. With great **E2E type-safety**, **intellisense** and the **[yjs](https://docs.yjs.dev/) ecosystem**.
|
|
105
|
+
|
|
42
106
|
### Features
|
|
107
|
+
|
|
43
108
|
- ✅ Automatic type safety
|
|
44
109
|
- ✅ Basic events
|
|
45
110
|
- ✅ Rooms
|
|
@@ -56,6 +121,7 @@ Pluv.IO allows you to build real-time collaborate features with a fully end-to-e
|
|
|
56
121
|
- ⬜ Studio (admin & developer panel)
|
|
57
122
|
|
|
58
123
|
### Runtimes
|
|
124
|
+
|
|
59
125
|
- ✅ [Cloudflare Workers](https://workers.cloudflare.com/)
|
|
60
126
|
- ✅ [Node.js](https://nodejs.org/)
|
|
61
127
|
- ✅ **PubSubs**
|
|
@@ -67,6 +133,7 @@ Pluv.IO allows you to build real-time collaborate features with a fully end-to-e
|
|
|
67
133
|
- ⬜ [Prisma](https://www.prisma.io/)
|
|
68
134
|
|
|
69
135
|
### Frontends
|
|
136
|
+
|
|
70
137
|
- ✅ [React.js](https://beta.reactjs.org/)
|
|
71
138
|
- ⬜ [Vue.js](https://vuejs.org/)
|
|
72
139
|
- ⬜ [Svelte](https://svelte.dev/)
|
|
@@ -88,6 +155,7 @@ Before diving into documentation, check out usage instructions for your selected
|
|
|
88
155
|
* [Authentication](https://github.com/pluv-io/pluv/blob/master/docs/authentication.md)
|
|
89
156
|
* [CRDT Storage](https://github.com/pluv-io/pluv/blob/master/docs/crdt-storage.md)
|
|
90
157
|
* [Creating Rooms](https://github.com/pluv-io/pluv/blob/master/docs/creating-rooms.md)
|
|
158
|
+
* [`createIO` API](https://github.com/pluv-io/pluv/blob/master/docs/create-io-api.md)
|
|
91
159
|
* [Custom Events](https://github.com/pluv-io/pluv/blob/master/docs/custom-events.md)
|
|
92
160
|
* [Presence](https://github.com/pluv-io/pluv/blob/master/docs/presence.md)
|
|
93
161
|
* [PubSubs and Persistance](https://github.com/pluv-io/pluv/blob/master/docs/pubsubs-and-persistance.md)
|
|
@@ -95,13 +163,13 @@ Before diving into documentation, check out usage instructions for your selected
|
|
|
95
163
|
|
|
96
164
|
## Related
|
|
97
165
|
|
|
98
|
-
- [@pluv/client](https://
|
|
99
|
-
- [@pluv/crdt-yjs](https://
|
|
100
|
-
- [@pluv/persistance-redis](https://
|
|
101
|
-
- [@pluv/platform-cloudflare](https://
|
|
102
|
-
- [@pluv/platform-node](https://
|
|
103
|
-
- [@pluv/pubsub-redis](https://
|
|
104
|
-
- [@pluv/react](https://
|
|
166
|
+
- [@pluv/client](https://www.npmjs.com/package/@pluv/client) - Framework agnostic client
|
|
167
|
+
- [@pluv/crdt-yjs](https://www.npmjs.com/package/@pluv/crdt-yjs) - Yjs for Pluv.IO
|
|
168
|
+
- [@pluv/persistance-redis](https://www.npmjs.com/package/@pluv/persistance-redis) - Persistance for storage on distributed systems (Node.js only)
|
|
169
|
+
- [@pluv/platform-cloudflare](https://www.npmjs.com/package/@pluv/platform-cloudflare) - Adapter to run @pluv/io on Cloudflare Workers
|
|
170
|
+
- [@pluv/platform-node](https://www.npmjs.com/package/@pluv/platform-node) - Adapter to run @pluv/io on Node.js
|
|
171
|
+
- [@pluv/pubsub-redis](https://www.npmjs.com/package/@pluv/pubsub-redis) - PubSub for rooms across distributed systems
|
|
172
|
+
- [@pluv/react](https://www.npmjs.com/package/@pluv/react) - Integrate @pluv/client with React.js
|
|
105
173
|
|
|
106
174
|
## Credits
|
|
107
175
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@panva/hkdf": "^1.0.2",
|
|
21
|
-
"@pluv/crdt-yjs": "^0.1.
|
|
21
|
+
"@pluv/crdt-yjs": "^0.1.2",
|
|
22
22
|
"@pluv/types": "^0.1.1",
|
|
23
23
|
"chalk": "^4.1.2",
|
|
24
24
|
"jose": "^4.11.2",
|