@pluv/crdt-yjs 0.0.0 → 0.1.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/crdt-yjs@0.0.0 build /home/runner/work/pluv/pluv/packages/crdt-yjs
2
+ > @pluv/crdt-yjs@0.1.1 build /home/runner/work/pluv/pluv/packages/crdt-yjs
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,9 +9,9 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  CJS dist/index.js 4.01 KB
12
- CJS ⚡️ Build success in 54ms
12
+ CJS ⚡️ Build success in 55ms
13
13
  ESM dist/index.mjs 2.88 KB
14
- ESM ⚡️ Build success in 55ms
14
+ ESM ⚡️ Build success in 60ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 1412ms
16
+ DTS ⚡️ Build success in 1535ms
17
17
  DTS dist/index.d.ts 2.61 KB
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # @pluv/crdt-yjs
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 24016e6: Updated dependencies
8
+ - Updated dependencies [24016e6]
9
+ - @pluv/types@0.1.1
10
+
11
+ ## 0.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - a22f525: Added documentation
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [a22f525]
20
+ - @pluv/types@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Shoubhit Dash
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ <h1 align="center">
2
+ <br>
3
+ <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">
4
+ <br>
5
+ Pluv.IO (preview)
6
+ <br>
7
+ </h1>
8
+
9
+ <h3 align="center">Multi-platform, E2E type-safe realtime packages</h3>
10
+ <h4 align="center">💕 Inspired by <a href="https://trpc.io">trpc</a> 💕 Built with <a href="https://docs.yjs.dev/">yjs</a> 💕</h4>
11
+
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/@pluv/crdt-yjs">
14
+ <img src="https://img.shields.io/npm/v/@pluv/crdt-yjs" alt="npm @pluv/crdt-yjs" />
15
+ </a>
16
+ <a href="https://github.com/pluv-io/pluv/blob/master/LICENSE">
17
+ <img alt="GitHub" src="https://img.shields.io/github/license/pluv-io/pluv" alt="License MIT" />
18
+ </a>
19
+ <img src="https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555" alt="TypeScript">
20
+ <a href="https://commitizen.github.io/cz-cli/">
21
+ <img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" />
22
+ </a>
23
+ <img src="https://img.shields.io/badge/docs-coming%20soon!-blue" alt="Docs coming soon!" />
24
+ </p>
25
+
26
+ <p align="center">
27
+ <a href="#intro">Intro</a> •
28
+ <a href="#usage">Usage</a> •
29
+ <a href="#credits">Credits</a> •
30
+ <a href="#related">Related</a> •
31
+ <a href="#license">License</a>
32
+ </p>
33
+
34
+ <img src="https://github.com/pluv-io/pluv/blob/master/assets/demo-events.gif?raw=true" alt="Demo" />
35
+
36
+ ## `@pluv/crdt-yjs`
37
+
38
+ > Yjs adapter for [@pluv/client](https://img.shields.io/npm/v/@pluv/client) and [@pluv/io](https://img.shields.io/npm/v/@pluv/io).
39
+
40
+ ## Installation
41
+
42
+ > **Note**
43
+ > This package is already re-exported from @pluv/client, @pluv/react and @pluv/io as `y`, so you likely do not need to install this directly.
44
+
45
+ ```bash
46
+ # npm
47
+ npm install @pluv/crdt-yjs yjs
48
+
49
+ # yarn
50
+ yarn add @pluv/crdt-yjs yjs
51
+
52
+ # pnpm
53
+ pnpm add @pluv/crdt-yjs yjs
54
+ ```
55
+
56
+ ## Basic Example
57
+
58
+ ```ts
59
+ import { createClient, y } from "@pluv/client";
60
+ import { z } from "zod";
61
+ // Import the PluvIO instance as a type from your server file
62
+ import { type io } from "./server";
63
+
64
+ const client = createClient<typeof io>({ /* client config here */ });
65
+
66
+ type Presence = {};
67
+
68
+ interface Storage {
69
+ groceryList: { [food: string]: number };
70
+ messages: readonly { name: string; message: string }[]
71
+ }
72
+
73
+ // Create a room to join
74
+ const room = client.createRoom<Presence, Storage>("my-room", {
75
+ initialStorage: () => ({
76
+ groceryList: y.map([
77
+ ["apricots", 2],
78
+ ["bread", 3],
79
+ ["cheese", 5],
80
+ ]),
81
+ messages: y.array([]),
82
+ }),
83
+ presence: z.object({}),
84
+ });
85
+ ```
86
+
87
+ ## Reference
88
+
89
+ Check us out on [GitHub](https://github.com/pluv-io/pluv) for more information on how to use `@pluv/io`.
90
+
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "@pluv/crdt-yjs",
3
- "version": "0.0.0",
3
+ "version": "0.1.1",
4
+ "description": "yjs for @pluv/io",
5
+ "author": "leedavidcs",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/pluv-io/pluv",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/pluv-io/pluv.git",
11
+ "directory": "packages/crdt-yjs"
12
+ },
4
13
  "main": "./dist/index.js",
5
14
  "module": "./dist/index.mjs",
6
15
  "types": "./dist/index.d.ts",
@@ -8,15 +17,15 @@
8
17
  "access": "public"
9
18
  },
10
19
  "dependencies": {
11
- "@pluv/types": "^0.0.0",
12
- "js-base64": "^3.7.3"
20
+ "@pluv/types": "^0.1.1",
21
+ "js-base64": "^3.7.4"
13
22
  },
14
23
  "peerDependencies": {
15
24
  "yjs": "^13.0.0"
16
25
  },
17
26
  "devDependencies": {
18
- "@pluv/tsconfig": "^0.0.0",
19
- "eslint-config-pluv": "^0.0.0",
27
+ "@pluv/tsconfig": "^0.1.1",
28
+ "eslint-config-pluv": "^0.1.1",
20
29
  "tsup": "^6.5.0",
21
30
  "typescript": "^4.9.4",
22
31
  "yjs": "^13.5.44"