@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/io@0.2.0 build /home/runner/work/pluv/pluv/packages/io
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
  CLI Building entry: src/index.ts
@@ -8,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 26.79 KB
12
- ESM ⚡️ Build success in 117ms
13
11
  CJS dist/index.js 28.59 KB
14
- CJS ⚡️ Build success in 112ms
12
+ CJS ⚡️ Build success in 95ms
13
+ ESM dist/index.mjs 26.79 KB
14
+ ESM ⚡️ Build success in 96ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2389ms
16
+ DTS ⚡️ Build success in 2778ms
17
17
  DTS dist/index.d.ts 12.86 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b45d642: Fixed links on README
8
+ - 203dfee: Updated README
9
+ - Updated dependencies [b45d642]
10
+ - @pluv/crdt-yjs@0.1.2
11
+
3
12
  ## 0.2.0
4
13
 
5
14
  ### Minor Changes
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://github.com/pluv-io/pluv/tree/master/packages/client) - Framework agnostic client
99
- - [@pluv/crdt-yjs](https://github.com/pluv-io/pluv/tree/master/packages/crdt-yjs) - Yjs for Pluv.IO
100
- - [@pluv/persistance-redis](https://github.com/pluv-io/pluv/tree/master/packages/persistance-redis) - Persistance for storage on distributed systems (Node.js only)
101
- - [@pluv/platform-cloudflare](https://github.com/pluv-io/pluv/tree/master/packages/platform-cloudflare) - Adapter to run @pluv/io on Cloudflare Workers
102
- - [@pluv/platform-node](https://github.com/pluv-io/pluv/tree/master/packages/platform-node) - Adapter to run @pluv/io on Node.js
103
- - [@pluv/pubsub-redis](https://github.com/pluv-io/pluv/tree/master/packages/pubsub-redis) - PubSub for rooms across distributed systems
104
- - [@pluv/react](https://github.com/pluv-io/pluv/tree/master/packages/react) - Integrate @pluv/client with React.js
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.0",
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.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",