@pluv/io 0.6.0 → 0.7.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.
- package/.eslintrc.js +2 -2
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +50 -0
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +10 -8
- package/src/PluvIO.ts +1 -1
package/.eslintrc.js
CHANGED
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.
|
|
2
|
+
> @pluv/io@0.7.0 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
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup
|
|
7
|
+
[34mCLI[39m tsup v7.0.0
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m31.05 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 81ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m28.99 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 84ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4546ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.03 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @pluv/io
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 829d31b: Added support for defining persistant frontend storage for rooms via a new `addons` option on rooms.
|
|
8
|
+
|
|
9
|
+
This also introduces the first new addon `@pluv/addon-indexeddb`, which is more-or-less the equivalent to `y-indexeddb` which you can install like so:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install @pluv/addon-indexeddb
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To use this new addon, simply pass it to options when creating a room:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { addonIndexedDB } from "@pluv/addon-indexeddb";
|
|
19
|
+
import { createClient } from "@pluv/client";
|
|
20
|
+
|
|
21
|
+
const client = createClient({
|
|
22
|
+
// ...
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const room = client.createRoom("my-new-room", {
|
|
26
|
+
addons: [
|
|
27
|
+
// Define your addons in an array like so
|
|
28
|
+
addonIndexedDB(),
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or when using `@pluv/react`:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
const PluvRoom = createRoomBundle({
|
|
37
|
+
// ...
|
|
38
|
+
addons: [
|
|
39
|
+
// Define your addons in an array like so
|
|
40
|
+
addonIndexedDB(),
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 8d11672: bumped dependencies to latest
|
|
48
|
+
- Updated dependencies [8d11672]
|
|
49
|
+
- Updated dependencies [829d31b]
|
|
50
|
+
- @pluv/crdt-yjs@0.4.0
|
|
51
|
+
- @pluv/types@0.2.1
|
|
52
|
+
|
|
3
53
|
## 0.6.0
|
|
4
54
|
|
|
5
55
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -727,7 +727,7 @@ var IORoom = class {
|
|
|
727
727
|
};
|
|
728
728
|
|
|
729
729
|
// src/PluvIO.ts
|
|
730
|
-
var PluvIO = class {
|
|
730
|
+
var PluvIO = class _PluvIO {
|
|
731
731
|
constructor(options) {
|
|
732
732
|
this._context = {};
|
|
733
733
|
this._getInitialStorage = null;
|
|
@@ -818,7 +818,7 @@ var PluvIO = class {
|
|
|
818
818
|
},
|
|
819
819
|
$UPDATE_STORAGE: {
|
|
820
820
|
resolver: ({ origin, update }, { context, doc: doc2, room }) => {
|
|
821
|
-
if (origin === "$
|
|
821
|
+
if (origin === "$INITIALIZED" && Object.keys(doc2.toJSON()).length) {
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
const updated = doc2.applyUpdate(update);
|
|
@@ -878,9 +878,9 @@ var PluvIO = class {
|
|
|
878
878
|
const newEvent = {
|
|
879
879
|
[event]: config
|
|
880
880
|
};
|
|
881
|
-
return
|
|
881
|
+
return _PluvIO.merge(
|
|
882
882
|
this,
|
|
883
|
-
new
|
|
883
|
+
new _PluvIO({
|
|
884
884
|
events: newEvent,
|
|
885
885
|
platform: this._platform
|
|
886
886
|
})
|
|
@@ -942,7 +942,7 @@ var PluvIO = class {
|
|
|
942
942
|
const events2 = second._events;
|
|
943
943
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
944
944
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
945
|
-
return new
|
|
945
|
+
return new _PluvIO({
|
|
946
946
|
authorize: authorize2,
|
|
947
947
|
debug,
|
|
948
948
|
events,
|
package/dist/index.mjs
CHANGED
|
@@ -690,7 +690,7 @@ var IORoom = class {
|
|
|
690
690
|
};
|
|
691
691
|
|
|
692
692
|
// src/PluvIO.ts
|
|
693
|
-
var PluvIO = class {
|
|
693
|
+
var PluvIO = class _PluvIO {
|
|
694
694
|
constructor(options) {
|
|
695
695
|
this._context = {};
|
|
696
696
|
this._getInitialStorage = null;
|
|
@@ -781,7 +781,7 @@ var PluvIO = class {
|
|
|
781
781
|
},
|
|
782
782
|
$UPDATE_STORAGE: {
|
|
783
783
|
resolver: ({ origin, update }, { context, doc: doc2, room }) => {
|
|
784
|
-
if (origin === "$
|
|
784
|
+
if (origin === "$INITIALIZED" && Object.keys(doc2.toJSON()).length) {
|
|
785
785
|
return;
|
|
786
786
|
}
|
|
787
787
|
const updated = doc2.applyUpdate(update);
|
|
@@ -841,9 +841,9 @@ var PluvIO = class {
|
|
|
841
841
|
const newEvent = {
|
|
842
842
|
[event]: config
|
|
843
843
|
};
|
|
844
|
-
return
|
|
844
|
+
return _PluvIO.merge(
|
|
845
845
|
this,
|
|
846
|
-
new
|
|
846
|
+
new _PluvIO({
|
|
847
847
|
events: newEvent,
|
|
848
848
|
platform: this._platform
|
|
849
849
|
})
|
|
@@ -905,7 +905,7 @@ var PluvIO = class {
|
|
|
905
905
|
const events2 = second._events;
|
|
906
906
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
907
907
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
908
|
-
return new
|
|
908
|
+
return new _PluvIO({
|
|
909
909
|
authorize: authorize2,
|
|
910
910
|
debug,
|
|
911
911
|
events,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,21 +18,23 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@panva/hkdf": "^1.1.1",
|
|
21
|
+
"@playwright/test": "^1.35.1",
|
|
22
|
+
"@types/react": "^18.2.13",
|
|
21
23
|
"jose": "^4.14.4",
|
|
22
24
|
"kleur": "^4.1.5",
|
|
23
25
|
"wonka": "^6.3.2",
|
|
24
|
-
"@pluv/crdt-yjs": "^0.
|
|
25
|
-
"@pluv/types": "^0.2.
|
|
26
|
+
"@pluv/crdt-yjs": "^0.4.0",
|
|
27
|
+
"@pluv/types": "^0.2.1"
|
|
26
28
|
},
|
|
27
29
|
"peerDependencies": {
|
|
28
30
|
"yjs": "^13.0.0"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"tsup": "^
|
|
32
|
-
"typescript": "^5.
|
|
33
|
-
"yjs": "^13.6.
|
|
34
|
-
"@pluv/tsconfig": "^0.1.
|
|
35
|
-
"eslint-config-pluv": "^0.1.
|
|
33
|
+
"tsup": "^7.0.0",
|
|
34
|
+
"typescript": "^5.1.3",
|
|
35
|
+
"yjs": "^13.6.4",
|
|
36
|
+
"@pluv/tsconfig": "^0.1.7",
|
|
37
|
+
"eslint-config-pluv": "^0.1.13"
|
|
36
38
|
},
|
|
37
39
|
"scripts": {
|
|
38
40
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvIO.ts
CHANGED