@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.
@@ -1,17 +1,17 @@
1
1
 
2
- > @pluv/client@0.3.0 build /home/runner/work/pluv/pluv/packages/client
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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v6.5.0
7
+ CLI tsup v6.6.3
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 34.07 KB
12
- CJS ⚡️ Build success in 83ms
13
- ESM dist/index.mjs 32.92 KB
14
- ESM ⚡️ Build success in 88ms
11
+ ESM dist/index.mjs 33.07 KB
12
+ ESM ⚡️ Build success in 100ms
13
+ CJS dist/index.js 34.23 KB
14
+ CJS ⚡️ Build success in 110ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3519ms
17
- DTS dist/index.d.ts 11.52 KB
16
+ DTS ⚡️ Build success in 2821ms
17
+ DTS dist/index.d.ts 11.47 KB
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, text, unstable__object } from '@pluv/crdt-yjs';
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
- text: () => import_crdt_yjs3.text,
1133
- unstable__object: () => import_crdt_yjs3.unstable__object
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
- text: () => text,
1108
- unstable__object: () => unstable__object
1114
+ object: () => object,
1115
+ text: () => text
1109
1116
  });
1110
- import { array, map, text, unstable__object } from "@pluv/crdt-yjs";
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.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.1.2",
21
- "@pluv/crdt-yjs": "^0.2.0",
22
- "@pluv/types": "^0.1.2"
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.5.0",
29
- "typescript": "^4.9.4",
30
- "yjs": "^13.5.44",
31
- "@pluv/tsconfig": "^0.1.2",
32
- "eslint-config-pluv": "^0.1.3"
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, unstable__object } from "@pluv/crdt-yjs";
1
+ export { array, map, text, object } from "@pluv/crdt-yjs";