@pluv/client 0.3.0 → 0.5.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +27 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -8
- package/dist/index.mjs +16 -9
- package/package.json +9 -9
- package/src/MockedRoom.ts +0 -4
- package/src/y.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.
|
|
2
|
+
> @pluv/client@0.5.0 build /home/runner/work/pluv/pluv/packages/client
|
|
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 v6.
|
|
7
|
+
[34mCLI[39m tsup v6.6.3
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m33.07 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 100ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m34.23 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 110ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2821ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.47 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @pluv/client
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 327a6ef: renamed y.unstable\_\_object to y.object
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 78a6119: Fixed MockedRoom not sending storage updates
|
|
12
|
+
- 8bf62cb: bumped dependencies
|
|
13
|
+
- 7e52685: Bumped dependencies
|
|
14
|
+
- b1cb325: Updated dependencies
|
|
15
|
+
- 8e97fb2: Updated dependencies
|
|
16
|
+
- Updated dependencies [8bf62cb]
|
|
17
|
+
- Updated dependencies [7e52685]
|
|
18
|
+
- Updated dependencies [b1cb325]
|
|
19
|
+
- Updated dependencies [327a6ef]
|
|
20
|
+
- Updated dependencies [8e97fb2]
|
|
21
|
+
- @pluv/crdt-yjs@0.3.0
|
|
22
|
+
- @pluv/types@0.1.3
|
|
23
|
+
|
|
24
|
+
## 0.4.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- 595e66f: added mocked-room for mocking a client-side room for testing
|
|
29
|
+
|
|
3
30
|
## 0.3.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InferYjsSharedTypeJson, array, map,
|
|
1
|
+
import { InferYjsSharedTypeJson, array, map, object, text } from '@pluv/crdt-yjs';
|
|
2
2
|
export { InferYjsSharedTypeJson } from '@pluv/crdt-yjs';
|
|
3
3
|
import * as _pluv_types from '@pluv/types';
|
|
4
4
|
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, InferIOInput, InputZodLike, InferIOAuthorizeRequired } from '@pluv/types';
|
|
@@ -230,14 +230,14 @@ declare class MockedRoom<TIO extends IOLike, TPresence extends JsonObject = {},
|
|
|
230
230
|
|
|
231
231
|
declare const y_array: typeof array;
|
|
232
232
|
declare const y_map: typeof map;
|
|
233
|
+
declare const y_object: typeof object;
|
|
233
234
|
declare const y_text: typeof text;
|
|
234
|
-
declare const y_unstable__object: typeof unstable__object;
|
|
235
235
|
declare namespace y {
|
|
236
236
|
export {
|
|
237
237
|
y_array as array,
|
|
238
238
|
y_map as map,
|
|
239
|
+
y_object as object,
|
|
239
240
|
y_text as text,
|
|
240
|
-
y_unstable__object as unstable__object,
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
|
package/dist/index.js
CHANGED
|
@@ -779,6 +779,13 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
779
779
|
return oldState;
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* TODO
|
|
784
|
+
* @description Determine if ws was closed with a code for closing without retries.
|
|
785
|
+
* Otherwise, attempt to retry again with incremental backoff
|
|
786
|
+
* @author leedavidcs
|
|
787
|
+
* @date August 19, 2022
|
|
788
|
+
*/
|
|
782
789
|
_onClose(event) {
|
|
783
790
|
this._logDebug("WebSocket closed");
|
|
784
791
|
!!event.reason && this._logDebug(event.reason);
|
|
@@ -790,6 +797,12 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
790
797
|
return oldState;
|
|
791
798
|
});
|
|
792
799
|
}
|
|
800
|
+
/**
|
|
801
|
+
* TODO
|
|
802
|
+
* @description Handle websocket errors in a meaningful way, should they occur
|
|
803
|
+
* @author leedavidcs
|
|
804
|
+
* @date August 19, 2022
|
|
805
|
+
*/
|
|
793
806
|
_onError() {
|
|
794
807
|
}
|
|
795
808
|
_onMessage(event) {
|
|
@@ -1100,12 +1113,6 @@ var MockedRoom = class extends AbstractRoom {
|
|
|
1100
1113
|
const origin = _origin != null ? _origin : null;
|
|
1101
1114
|
if (!this._crdtManager)
|
|
1102
1115
|
return;
|
|
1103
|
-
if (!this._state.webSocket)
|
|
1104
|
-
return;
|
|
1105
|
-
if (!this._state.connection.id)
|
|
1106
|
-
return;
|
|
1107
|
-
if (this._state.webSocket.readyState !== WebSocket.OPEN)
|
|
1108
|
-
return;
|
|
1109
1116
|
if (origin === "$STORAGE_UPDATED")
|
|
1110
1117
|
return;
|
|
1111
1118
|
const sharedTypes = this._crdtManager.doc.getSharedTypes();
|
|
@@ -1129,8 +1136,8 @@ var y_exports = {};
|
|
|
1129
1136
|
__export(y_exports, {
|
|
1130
1137
|
array: () => import_crdt_yjs3.array,
|
|
1131
1138
|
map: () => import_crdt_yjs3.map,
|
|
1132
|
-
|
|
1133
|
-
|
|
1139
|
+
object: () => import_crdt_yjs3.object,
|
|
1140
|
+
text: () => import_crdt_yjs3.text
|
|
1134
1141
|
});
|
|
1135
1142
|
var import_crdt_yjs3 = require("@pluv/crdt-yjs");
|
|
1136
1143
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -754,6 +754,13 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
754
754
|
return oldState;
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
|
+
/**
|
|
758
|
+
* TODO
|
|
759
|
+
* @description Determine if ws was closed with a code for closing without retries.
|
|
760
|
+
* Otherwise, attempt to retry again with incremental backoff
|
|
761
|
+
* @author leedavidcs
|
|
762
|
+
* @date August 19, 2022
|
|
763
|
+
*/
|
|
757
764
|
_onClose(event) {
|
|
758
765
|
this._logDebug("WebSocket closed");
|
|
759
766
|
!!event.reason && this._logDebug(event.reason);
|
|
@@ -765,6 +772,12 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
765
772
|
return oldState;
|
|
766
773
|
});
|
|
767
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* TODO
|
|
777
|
+
* @description Handle websocket errors in a meaningful way, should they occur
|
|
778
|
+
* @author leedavidcs
|
|
779
|
+
* @date August 19, 2022
|
|
780
|
+
*/
|
|
768
781
|
_onError() {
|
|
769
782
|
}
|
|
770
783
|
_onMessage(event) {
|
|
@@ -1075,12 +1088,6 @@ var MockedRoom = class extends AbstractRoom {
|
|
|
1075
1088
|
const origin = _origin != null ? _origin : null;
|
|
1076
1089
|
if (!this._crdtManager)
|
|
1077
1090
|
return;
|
|
1078
|
-
if (!this._state.webSocket)
|
|
1079
|
-
return;
|
|
1080
|
-
if (!this._state.connection.id)
|
|
1081
|
-
return;
|
|
1082
|
-
if (this._state.webSocket.readyState !== WebSocket.OPEN)
|
|
1083
|
-
return;
|
|
1084
1091
|
if (origin === "$STORAGE_UPDATED")
|
|
1085
1092
|
return;
|
|
1086
1093
|
const sharedTypes = this._crdtManager.doc.getSharedTypes();
|
|
@@ -1104,10 +1111,10 @@ var y_exports = {};
|
|
|
1104
1111
|
__export(y_exports, {
|
|
1105
1112
|
array: () => array,
|
|
1106
1113
|
map: () => map,
|
|
1107
|
-
|
|
1108
|
-
|
|
1114
|
+
object: () => object,
|
|
1115
|
+
text: () => text
|
|
1109
1116
|
});
|
|
1110
|
-
import { array, map, text,
|
|
1117
|
+
import { array, map, text, object } from "@pluv/crdt-yjs";
|
|
1111
1118
|
export {
|
|
1112
1119
|
AbstractRoom,
|
|
1113
1120
|
ConnectionState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "@pluv/io frontend client",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"wonka": "^6.
|
|
21
|
-
"@pluv/crdt-yjs": "^0.
|
|
22
|
-
"@pluv/types": "^0.1.
|
|
20
|
+
"wonka": "^6.2.3",
|
|
21
|
+
"@pluv/crdt-yjs": "^0.3.0",
|
|
22
|
+
"@pluv/types": "^0.1.3"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"yjs": "^13.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"tsup": "^6.
|
|
29
|
-
"typescript": "^4.9.
|
|
30
|
-
"yjs": "^13.5.
|
|
31
|
-
"@pluv/tsconfig": "^0.1.
|
|
32
|
-
"eslint-config-pluv": "^0.1.
|
|
28
|
+
"tsup": "^6.6.3",
|
|
29
|
+
"typescript": "^4.9.5",
|
|
30
|
+
"yjs": "^13.5.49",
|
|
31
|
+
"@pluv/tsconfig": "^0.1.3",
|
|
32
|
+
"eslint-config-pluv": "^0.1.4"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/MockedRoom.ts
CHANGED
|
@@ -187,10 +187,6 @@ export class MockedRoom<
|
|
|
187
187
|
const origin = _origin ?? null;
|
|
188
188
|
|
|
189
189
|
if (!this._crdtManager) return;
|
|
190
|
-
if (!this._state.webSocket) return;
|
|
191
|
-
if (!this._state.connection.id) return;
|
|
192
|
-
if (this._state.webSocket.readyState !== WebSocket.OPEN) return;
|
|
193
|
-
|
|
194
190
|
if (origin === "$STORAGE_UPDATED") return;
|
|
195
191
|
|
|
196
192
|
const sharedTypes = this._crdtManager.doc.getSharedTypes();
|
package/src/y.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { array, map, text,
|
|
1
|
+
export { array, map, text, object } from "@pluv/crdt-yjs";
|