@pluv/io 0.44.2 → 1.0.0

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,9 +1,9 @@
1
1
 
2
- > @pluv/io@0.44.2 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@1.0.0 build /home/runner/work/pluv/pluv/packages/io
3
3
  > pnpm run version && tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
 
6
- > @pluv/io@0.44.2 version /home/runner/work/pluv/pluv/packages/io
6
+ > @pluv/io@1.0.0 version /home/runner/work/pluv/pluv/packages/io
7
7
  > genversion ./src/version.generated.ts --esm
8
8
 
9
9
  CLI Building entry: src/index.ts
@@ -12,11 +12,11 @@
12
12
  CLI Target: es6
13
13
  ESM Build start
14
14
  CJS Build start
15
- CJS dist/index.js 52.90 KB
16
- CJS ⚡️ Build success in 124ms
17
15
  ESM dist/index.mjs 50.73 KB
18
- ESM ⚡️ Build success in 125ms
16
+ ESM ⚡️ Build success in 132ms
17
+ CJS dist/index.js 52.90 KB
18
+ CJS ⚡️ Build success in 133ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3111ms
20
+ DTS ⚡️ Build success in 2976ms
21
21
  DTS dist/index.d.mts 32.19 KB
22
22
  DTS dist/index.d.ts 32.19 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - af94706: pluv.io is now stable and production ready!
8
+
9
+ With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
10
+
11
+ Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [af94706]
16
+ - @pluv/crdt@1.0.0
17
+ - @pluv/types@1.0.0
18
+
3
19
  ## 0.44.2
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -1,16 +1,11 @@
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
-
4
- <h1 align="center">
5
- <br />
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" />
7
- <br />
8
- <a href="https://pluv.io/docs/introduction">Pluv.IO (preview)</a>
9
- <br />
10
- </h1>
1
+ <div align="center">
2
+ <a href="https://pluv.io/docs/introduction">
3
+ <img src="https://github.com/pluv-io/pluv/blob/master/assets/pluv-icon-192x192.png?raw=true" alt="Pluv.IO" width="156" style="border-radius:16px" />
4
+ </a>
5
+ </div>
11
6
 
12
- <h3 align="center">Multi-platform, E2E type-safe realtime packages</h3>
13
- <h4 align="center">💕 Inspired by <a href="https://trpc.io">trpc</a> 💕 <a href="https://docs.yjs.dev/">yjs</a> 💕 and <a href="https://developers.cloudflare.com/">Cloudflare</a> 💕 </h4>
7
+ <h1 align="center">pluv.io</h1>
8
+ <h3 align="center">TypeSafe Primitives for a Realtime Web</h3>
14
9
 
15
10
  <p align="center">
16
11
  <a href="https://www.npmjs.com/package/@pluv/io">
@@ -24,93 +19,163 @@
24
19
  </a>
25
20
  <img src="https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555" alt="TypeScript" />
26
21
  </p>
27
-
28
- <p align="center">
29
- <a href="#intro">Intro</a> •
30
- <a href="#usage">Usage</a> •
31
- <a href="#related">Related</a> •
32
- <a href="#credits">Credits</a> •
33
- <a href="#license">License</a>
34
- </p>
22
+ <h4 align="center">💕 Inspired by <a href="https://trpc.io">trpc</a> 💕 <a href="https://docs.yjs.dev/">yjs</a> 💕 <br />and <a href="https://workers.cloudflare.com/">Cloudflare Workers</a> 💕</h4>
35
23
 
36
24
  ## Intro
37
25
 
38
- pluv.io allows you to more easily build real-time collaborative experiences with a fully end-to-end type-safe api and the ecosystem of existing CRDT implementations such as **[yjs](https://docs.yjs.dev/)**.
39
-
40
- **👉 See full documentation on [pluv.io](https://pluv.io/docs/introduction). 👈**
41
-
42
- ### Features
43
-
44
- - ✅ Automatic type safety
26
+ **[pluv.io](https://pluv.io) allows you to more easily build realtime multiplayer experiences with a fully typesafe API and powerful abstractions as primitives, so that you can focus on building for your end users.**
27
+
28
+ Self-host on [Cloudflare Workers](https://pluv.io/docs/quickstart/cloudflare-workers) or [Node.js](https://pluv.io/docs/quickstart/nodejs); or [get started on the pluv.io network](https://pluv.io/signup).
29
+
30
+ ## Preview
31
+
32
+ Create your pluv.io backend
33
+
34
+ ```ts
35
+ // backend
36
+ const io = createIO(platformNode({ crdt: yjs }));
37
+
38
+ export const ioServer = io.server({
39
+ router: io.router({
40
+ sendGreeting: io.procedure
41
+ .input(z.object({ message: z.string() }))
42
+ .broadcast(({ message }) => ({
43
+ receiveGreeting: { message }
44
+ }))
45
+ })
46
+ });
47
+ ```
48
+
49
+ Create your frontend client with your backend types
50
+
51
+ ```ts
52
+ // frontend
53
+ const types = infer((i) => ({ io: i<typeof ioServer> }));
54
+ const io = createClient({
55
+ types,
56
+ initialStorage: yjs.doc(() => ({
57
+ messages: yjs.array<string>(),
58
+ })),
59
+ presence: z.object({
60
+ selectionId: z.string().nullable()
61
+ })
62
+ });
63
+
64
+ const {
65
+ event,
66
+ useBroadcast,
67
+ useMyPresence,
68
+ useOthers,
69
+ useStorage
70
+ } = createBundle(io);
71
+ ```
72
+
73
+ Use powerful primitives to build realtime features
74
+
75
+ ```tsx
76
+ // react
77
+ event.receiveGreeting.useEvent(({ data }) => { /* ... */});
78
+ // ^? const data: { message: string }
79
+
80
+ const broadcast = useBroadcast();
81
+
82
+ broadcast.sendGreeting({ message: "hello world" });
83
+ // ^? const sendGreeting: (data: { message: string }) => void
84
+
85
+ const [mySelection, update] = useMyPresence((presence) => {
86
+ // ^? const mySelection: string | null
87
+ return presence.selectionId;
88
+ });
89
+
90
+ const others = useOthers((others) => {
91
+ // ^? const others = string[]
92
+ return others.map((other) => other.presence.selectionId);
93
+ });
94
+
95
+ const [
96
+ messages,
97
+ // ^? const messages: string[] | null
98
+ sharedType
99
+ // ^? YArray<string> | null
100
+ ] = useStorage("messages");
101
+ ```
102
+
103
+ ## Documentation
104
+
105
+ The full documentation is available at [pluv.io](https://pluv.io/docs/introduction).
106
+
107
+ ## Features
108
+
109
+ - ✅ Automatic type-safety
45
110
  - ✅ Basic events
46
111
  - ✅ Rooms
47
112
  - ✅ Authentication
48
113
  - ✅ Awareness + Presence
49
114
  - ✅ [CRDTs](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type)
50
- - ✅ [Yjs](https://docs.yjs.dev/)
51
- - ✅ **Shared Types**
52
- - ✅ [Map](https://docs.yjs.dev/api/shared-types/y.map)
53
- - ✅ [Array](https://docs.yjs.dev/api/shared-types/y.array)
54
- - ✅ [Text](https://docs.yjs.dev/api/shared-types/y.text)
55
- - ✅ [XmlFragment](https://docs.yjs.dev/api/shared-types/y.xmlfragment)
56
- - ✅ [XmlElement](https://docs.yjs.dev/api/shared-types/y.xmlelement)
57
- - ✅ [XmlText](https://docs.yjs.dev/api/shared-types/y.xmltext)
58
- - ✅ [Loro](https://loro.dev/)
59
- - ✅ **Containers**
60
- - ✅ List
61
- - ✅ Map
62
- - ✅ Text
63
- - ⬜ Tree
115
+ - ✅ [Yjs](https://docs.yjs.dev/)
116
+ - ⬜ [Provider](https://github.com/yjs/yjs?tab=readme-ov-file#providers) (Coming soon!)
117
+ - ✅ **Shared Types**
118
+ - ✅ [Map](https://docs.yjs.dev/api/shared-types/y.map)
119
+ - ✅ [Array](https://docs.yjs.dev/api/shared-types/y.array)
120
+ - ✅ [Text](https://docs.yjs.dev/api/shared-types/y.text)
121
+ - ✅ [XmlFragment](https://docs.yjs.dev/api/shared-types/y.xmlfragment)
122
+ - ✅ [XmlElement](https://docs.yjs.dev/api/shared-types/y.xmlelement)
123
+ - ✅ [XmlText](https://docs.yjs.dev/api/shared-types/y.xmltext)
124
+ - ✅ [Loro](https://loro.dev/) (preview)
125
+ - ✅ **Containers**
126
+ - ✅ List
127
+ - ✅ Map
128
+ - ✅ Text
129
+ - ⬜ Tree
64
130
  - ⬜ Studio (admin & developer panel)
65
131
 
66
- ### Runtimes
132
+ ## Runtimes
67
133
 
68
134
  - ✅ [Cloudflare Workers](https://workers.cloudflare.com/)
135
+ - **WebSocket API**
136
+ - ✅ [Hibernation API](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api) (default, recommended)
137
+ - ✅ [Standard API](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-standard-api)
138
+ - **State Persistence**
139
+ - ✅ [SQLite-backed Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/access-durable-objects-storage/#create-sqlite-backed-durable-object-class) (default, recommended)
140
+ - ✅ [Key-value storage-backed Durable Object](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/#create-durable-object-class-with-key-value-storage)
69
141
  - ✅ [Node.js](https://nodejs.org/)
70
- - ✅ **PubSubs**
71
- - ✅ [Redis](https://redis.io/)
72
- - ⬜ [RabbitMQ](https://www.rabbitmq.com/)
73
- - ⬜ [Kafka](https://kafka.apache.org/)
74
- - ✅ **CRDT State Persistence**
75
- - ✅ [Redis](https://redis.io/)
76
- - ⬜ [Prisma](https://www.prisma.io/)
142
+ - ✅ **PubSubs**
143
+ - ✅ [Redis](https://redis.io/) (preview)
144
+ - ⬜ [MQTT](https://mqtt.org/)
145
+ - ✅ **State Persistence**
146
+ - ✅ In-memory (default)
147
+ - ✅ [Redis](https://redis.io/) (preview)
77
148
 
78
- ### Frontends
149
+ ## Frontends Frameworks
79
150
 
80
151
  - ✅ [React.js](https://react.dev/)
81
152
  - ⬜ [Solid.js](https://www.solidjs.com/)
82
153
  - ⬜ [Vue.js](https://vuejs.org/)
83
154
  - ⬜ [Svelte](https://svelte.dev/)
84
155
 
85
- ## Usage
86
-
87
- Before diving into documentation, check out usage instructions for your selected platform:
88
-
89
- ### Documentation
90
-
91
- Documentation is available at [pluv.io](https://pluv.io/docs/introduction).
92
-
93
- ## Related
156
+ ## Packages
94
157
 
158
+ - [@pluv/io](https://www.npmjs.com/package/@pluv/io) - Server
95
159
  - [@pluv/client](https://www.npmjs.com/package/@pluv/client) - Framework agnostic client
96
- - [@pluv/crdt-loro](https://www.npmjs.com/package/@pluv/crdt-loro) - Loro CRDT for Pluv.IO
97
- - [@pluv/crdt-yjs](https://www.npmjs.com/package/@pluv/crdt-yjs) - Yjs CRDT for Pluv.IO
160
+ - [@pluv/react](https://www.npmjs.com/package/@pluv/react) - Integrate @pluv/client with React.js
161
+ - [@pluv/platform-pluv](https://www.npmjs.com/package/@pluv/platform-node) - Adapter to run on pluv.io
162
+ - [@pluv/platform-cloudflare](https://www.npmjs.com/package/@pluv/platform-cloudflare) - Adapter to run on Cloudflare Workers
163
+ - [@pluv/platform-node](https://www.npmjs.com/package/@pluv/platform-node) - Adapter to run on Node.js
164
+ - [@pluv/crdt-yjs](https://www.npmjs.com/package/@pluv/crdt-yjs) - Yjs CRDT adapter
165
+ - [@pluv/crdt-loro](https://www.npmjs.com/package/@pluv/crdt-loro) - Loro CRDT adapter
98
166
  - [@pluv/persistence-redis](https://www.npmjs.com/package/@pluv/persistence-redis) - Persistence for storage on distributed systems (Node.js only)
99
- - [@pluv/platform-cloudflare](https://www.npmjs.com/package/@pluv/platform-cloudflare) - Adapter to run @pluv/io on Cloudflare Workers
100
- - [@pluv/platform-node](https://www.npmjs.com/package/@pluv/platform-node) - Adapter to run @pluv/io on Node.js
167
+ - [@pluv/persistence-cloudflare-transactional-storage](https://www.npmjs.com/package/@pluv/persistence-cloudflare-transactional-storage) - Durable Object persistent state for WebSocket hibernation
101
168
  - [@pluv/pubsub-redis](https://www.npmjs.com/package/@pluv/pubsub-redis) - PubSub for rooms across distributed systems
102
- - [@pluv/react](https://www.npmjs.com/package/@pluv/react) - Integrate @pluv/client with React.js
103
169
 
104
170
  ## Credits
105
171
 
106
172
  This software uses the following open source tooling and libraries:
107
173
 
108
- - [Loro](https://loro.dev/)
109
- - [Yjs](https://yjs.dev/)
110
- - [Node.js](https://nodejs.org/)
111
174
  - [Cloudflare Workers](https://workers.cloudflare.com/)
112
- - [ioredis](https://github.com/luin/ioredis)
175
+ - [Node.js](https://nodejs.org/)
113
176
  - [React.js](https://reactjs.org/)
177
+ - [Yjs](https://yjs.dev/)
178
+ - [Loro](https://loro.dev/)
114
179
 
115
180
  ## License
116
181
 
package/dist/index.js CHANGED
@@ -1141,7 +1141,7 @@ var pickBy = (obj, by) => {
1141
1141
  };
1142
1142
 
1143
1143
  // src/version.generated.ts
1144
- var version = "0.44.2";
1144
+ var version = "1.0.0";
1145
1145
 
1146
1146
  // src/PluvServer.ts
1147
1147
  var PluvServer = class {
package/dist/index.mjs CHANGED
@@ -1099,7 +1099,7 @@ var pickBy = (obj, by) => {
1099
1099
  };
1100
1100
 
1101
1101
  // src/version.generated.ts
1102
- var version = "0.44.2";
1102
+ var version = "1.0.0";
1103
1103
 
1104
1104
  // src/PluvServer.ts
1105
1105
  var PluvServer = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "0.44.2",
3
+ "version": "1.0.0",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -21,16 +21,16 @@
21
21
  "jose": "^5.10.0",
22
22
  "kleur": "^4.1.5",
23
23
  "wonka": "^6.3.5",
24
- "@pluv/crdt": "^0.44.2",
25
- "@pluv/types": "^0.44.2"
24
+ "@pluv/crdt": "^1.0.0",
25
+ "@pluv/types": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^9.25.1",
29
29
  "genversion": "^3.2.0",
30
30
  "tsup": "^8.4.0",
31
31
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^0.44.2",
33
- "eslint-config-pluv": "^0.44.2"
32
+ "@pluv/tsconfig": "^1.0.0",
33
+ "eslint-config-pluv": "^1.0.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '0.44.2'
2
+ export const version = '1.0.0'