@pluv/io 0.2.0 → 0.2.2
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 +4 -4
- package/CHANGELOG.md +18 -0
- package/README.md +80 -11
- package/package.json +7 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.2.
|
|
2
|
+
> @pluv/io@0.2.2 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
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m26.79 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 104ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m28.59 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 106ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2852ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m12.86 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @pluv/io
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fe80d7b: added preview disclaimer about breaking changes in the readme
|
|
8
|
+
- Updated dependencies [fe80d7b]
|
|
9
|
+
- @pluv/crdt-yjs@0.1.3
|
|
10
|
+
- @pluv/types@0.1.2
|
|
11
|
+
|
|
12
|
+
## 0.2.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- b45d642: Fixed links on README
|
|
17
|
+
- 203dfee: Updated README
|
|
18
|
+
- Updated dependencies [b45d642]
|
|
19
|
+
- @pluv/crdt-yjs@0.1.2
|
|
20
|
+
|
|
3
21
|
## 0.2.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
> **Disclaimer:**
|
|
2
|
+
> This package is currently in preview and may have breaking changes between versions. Please wait for a `v1.0.0` stable release before using this in production.
|
|
3
|
+
|
|
1
4
|
<h1 align="center">
|
|
2
5
|
<br>
|
|
3
6
|
<img src="https://github.com/pluv-io/pluv/blob/master/assets/pluv-icon-192x192.png?raw=true" alt="Pluv.IO" width="180" style="border-radius:16px">
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
<a href="https://commitizen.github.io/cz-cli/">
|
|
21
24
|
<img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" />
|
|
22
25
|
</a>
|
|
23
|
-
<img src="https://img.shields.io/badge/
|
|
26
|
+
<img src="https://img.shields.io/badge/website-coming%20soon!-blue" alt="Website coming soon!" />
|
|
24
27
|
</p>
|
|
25
28
|
|
|
26
29
|
<p align="center">
|
|
@@ -33,13 +36,76 @@
|
|
|
33
36
|
|
|
34
37
|
<img src="https://github.com/pluv-io/pluv/blob/master/assets/demo-events.gif?raw=true" alt="Demo" />
|
|
35
38
|
|
|
36
|
-
<h3 align="center">Documentation Website coming soon!</h3>
|
|
37
|
-
|
|
38
39
|
## Intro
|
|
39
40
|
|
|
40
41
|
Pluv.IO allows you to build real-time collaborate features with a fully end-to-end type-safe api.
|
|
41
42
|
|
|
43
|
+
### Why?
|
|
44
|
+
|
|
45
|
+
So you can do this:
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
usePluvEvent("RECEIVE_MESSAGE", ({ data }) => {
|
|
49
|
+
setMessages([...messages, data.message]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
usePluvBroadcast({
|
|
53
|
+
type: "SEND_MESSAGE",
|
|
54
|
+
data: { message: "Hello world!" },
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
And this:
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
const [myCursor, updatePresence] = usePluvMyPresence((me) => me.presence.cursor);
|
|
62
|
+
const cursors = usePluvOthers((others) => {
|
|
63
|
+
return others.map((other) => other.presence.cursor);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const updateCursor = (e: MouseEvent) => {
|
|
68
|
+
updatePresence({ cursor: { x: e.pageX, y: e.pageY } });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
window.addEventListener("mousemove", updateCursor);
|
|
72
|
+
|
|
73
|
+
return () => {
|
|
74
|
+
window.removeEventListener("mousemove", updateCursor);
|
|
75
|
+
};
|
|
76
|
+
}, [updatePresence]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div>
|
|
80
|
+
<div style={{ top: myCursor?.y, left: myCursor?.x }} />
|
|
81
|
+
{cursors.map((cursor, i) => (
|
|
82
|
+
<div key={i} style={{ top: cursor?.y, left: cursor?.x }} />
|
|
83
|
+
))}
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Also this:
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
const [messages, sharedType] = usePluvStorage("messages");
|
|
93
|
+
|
|
94
|
+
sharedType?.push(["Hello world!"]);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div>
|
|
98
|
+
{messages?.map((message, i) => (
|
|
99
|
+
<div key={i}>{message}</div>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
And more. With **E2E type-safety**, **great intellisense** and the **[yjs](https://docs.yjs.dev/) ecosystem**.
|
|
106
|
+
|
|
42
107
|
### Features
|
|
108
|
+
|
|
43
109
|
- ✅ Automatic type safety
|
|
44
110
|
- ✅ Basic events
|
|
45
111
|
- ✅ Rooms
|
|
@@ -56,6 +122,7 @@ Pluv.IO allows you to build real-time collaborate features with a fully end-to-e
|
|
|
56
122
|
- ⬜ Studio (admin & developer panel)
|
|
57
123
|
|
|
58
124
|
### Runtimes
|
|
125
|
+
|
|
59
126
|
- ✅ [Cloudflare Workers](https://workers.cloudflare.com/)
|
|
60
127
|
- ✅ [Node.js](https://nodejs.org/)
|
|
61
128
|
- ✅ **PubSubs**
|
|
@@ -67,6 +134,7 @@ Pluv.IO allows you to build real-time collaborate features with a fully end-to-e
|
|
|
67
134
|
- ⬜ [Prisma](https://www.prisma.io/)
|
|
68
135
|
|
|
69
136
|
### Frontends
|
|
137
|
+
|
|
70
138
|
- ✅ [React.js](https://beta.reactjs.org/)
|
|
71
139
|
- ⬜ [Vue.js](https://vuejs.org/)
|
|
72
140
|
- ⬜ [Svelte](https://svelte.dev/)
|
|
@@ -75,7 +143,7 @@ Pluv.IO allows you to build real-time collaborate features with a fully end-to-e
|
|
|
75
143
|
|
|
76
144
|
Before diving into documentation, check out usage instructions for your selected platform:
|
|
77
145
|
|
|
78
|
-
> **Note
|
|
146
|
+
> **Note:**
|
|
79
147
|
> `@pluv/io`, `@pluv/client`, `@pluv/crdt-yjs` and `@pluv/react` all require [yjs](https://docs.yjs.dev/) as a peer dependency.
|
|
80
148
|
|
|
81
149
|
### Platforms
|
|
@@ -88,6 +156,7 @@ Before diving into documentation, check out usage instructions for your selected
|
|
|
88
156
|
* [Authentication](https://github.com/pluv-io/pluv/blob/master/docs/authentication.md)
|
|
89
157
|
* [CRDT Storage](https://github.com/pluv-io/pluv/blob/master/docs/crdt-storage.md)
|
|
90
158
|
* [Creating Rooms](https://github.com/pluv-io/pluv/blob/master/docs/creating-rooms.md)
|
|
159
|
+
* [`createIO` API](https://github.com/pluv-io/pluv/blob/master/docs/create-io-api.md)
|
|
91
160
|
* [Custom Events](https://github.com/pluv-io/pluv/blob/master/docs/custom-events.md)
|
|
92
161
|
* [Presence](https://github.com/pluv-io/pluv/blob/master/docs/presence.md)
|
|
93
162
|
* [PubSubs and Persistance](https://github.com/pluv-io/pluv/blob/master/docs/pubsubs-and-persistance.md)
|
|
@@ -95,13 +164,13 @@ Before diving into documentation, check out usage instructions for your selected
|
|
|
95
164
|
|
|
96
165
|
## Related
|
|
97
166
|
|
|
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://
|
|
167
|
+
- [@pluv/client](https://www.npmjs.com/package/@pluv/client) - Framework agnostic client
|
|
168
|
+
- [@pluv/crdt-yjs](https://www.npmjs.com/package/@pluv/crdt-yjs) - Yjs for Pluv.IO
|
|
169
|
+
- [@pluv/persistance-redis](https://www.npmjs.com/package/@pluv/persistance-redis) - Persistance for storage on distributed systems (Node.js only)
|
|
170
|
+
- [@pluv/platform-cloudflare](https://www.npmjs.com/package/@pluv/platform-cloudflare) - Adapter to run @pluv/io on Cloudflare Workers
|
|
171
|
+
- [@pluv/platform-node](https://www.npmjs.com/package/@pluv/platform-node) - Adapter to run @pluv/io on Node.js
|
|
172
|
+
- [@pluv/pubsub-redis](https://www.npmjs.com/package/@pluv/pubsub-redis) - PubSub for rooms across distributed systems
|
|
173
|
+
- [@pluv/react](https://www.npmjs.com/package/@pluv/react) - Integrate @pluv/client with React.js
|
|
105
174
|
|
|
106
175
|
## Credits
|
|
107
176
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@panva/hkdf": "^1.0.2",
|
|
21
|
-
"@pluv/crdt-yjs": "^0.1.1",
|
|
22
|
-
"@pluv/types": "^0.1.1",
|
|
23
21
|
"chalk": "^4.1.2",
|
|
24
22
|
"jose": "^4.11.2",
|
|
25
|
-
"wonka": "^6.1.2"
|
|
23
|
+
"wonka": "^6.1.2",
|
|
24
|
+
"@pluv/crdt-yjs": "^0.1.3",
|
|
25
|
+
"@pluv/types": "^0.1.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"yjs": "^13.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@pluv/tsconfig": "^0.1.1",
|
|
32
|
-
"eslint-config-pluv": "^0.1.1",
|
|
33
31
|
"tsup": "^6.5.0",
|
|
34
32
|
"typescript": "^4.9.4",
|
|
35
|
-
"yjs": "^13.5.44"
|
|
33
|
+
"yjs": "^13.5.44",
|
|
34
|
+
"@pluv/tsconfig": "^0.1.2",
|
|
35
|
+
"eslint-config-pluv": "^0.1.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|