@pluv/io 3.2.0 → 3.2.2

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@3.2.0 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@3.2.2 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@3.2.0 version /home/runner/work/pluv/pluv/packages/io
6
+ > @pluv/io@3.2.2 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 55.81 KB
16
- CJS ⚡️ Build success in 118ms
17
- ESM dist/index.mjs 53.63 KB
18
- ESM ⚡️ Build success in 123ms
15
+ ESM dist/index.mjs 53.72 KB
16
+ ESM ⚡️ Build success in 142ms
17
+ CJS dist/index.js 55.90 KB
18
+ CJS ⚡️ Build success in 144ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 4090ms
21
- DTS dist/index.d.mts 34.23 KB
22
- DTS dist/index.d.ts 34.23 KB
20
+ DTS ⚡️ Build success in 4218ms
21
+ DTS dist/index.d.mts 34.33 KB
22
+ DTS dist/index.d.ts 34.33 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 3.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [8665dbe]
8
+ - @pluv/types@3.2.2
9
+ - @pluv/crdt@3.2.2
10
+
11
+ ## 3.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - @pluv/crdt@3.2.1
16
+ - @pluv/types@3.2.1
17
+
3
18
  ## 3.2.0
4
19
 
5
20
  ### Minor Changes
@@ -1135,11 +1150,9 @@
1135
1150
  ### Minor Changes
1136
1151
 
1137
1152
  - 6ac8a46: \* Fixed errors thrown when using Cloudflare's websocket hibernation API caused by rooms being re-used between different instances of DurableObjects.
1138
-
1139
1153
  - Add configurable `onDelete` and `onMessage` event listeners that can be set when rooms are created.
1140
1154
 
1141
1155
  **BREAKING**
1142
-
1143
1156
  - Changed `PluvServer.getRoom` to `PluvServer.createRoom`. This means `PluvServer` only handles room creation. Room management must now be handled manually. This mainly affects manually creating rooms with `@pluv/platform-node`, and will likely not affect you if you are either using `createPluvHandler` on any platform, or if you are using `@pluv/platform-cloudflare`.
1144
1157
 
1145
1158
  ```ts
@@ -1452,7 +1465,6 @@
1452
1465
 
1453
1466
  - 329dbcd: Narrowed types for `user` within the session object of an event resolver.
1454
1467
  - 99b5ca9: ## Breaking Changes
1455
-
1456
1468
  - `@pluv/io` has been updated to introduce `PluvProcedure`, `PluvRouter` and `PluvServer`. This change is intended to improve the ergonomics of declaring events and simplifying inferences of event types.
1457
1469
 
1458
1470
  ### Before:
@@ -1655,7 +1667,6 @@
1655
1667
  ### Minor Changes
1656
1668
 
1657
1669
  - 4280220: ## Breaking Changes
1658
-
1659
1670
  - Storage types are now kept on the root of the document.
1660
1671
  - Previously, `@pluv/crdt-yjs` kept all shared-types on a hidden Yjs Map called `storage` on the root of the Yjs Doc. Now all shared-types are kept on the root of the Yjs Doc instead. This behavior should be more in-line with how shared-types are documented to be used from Yjs.
1661
1672
  - `@pluv/client` and `@pluv/react` no-longer re-export `@pluv/crdt-yjs`. This package will now need to be installed separately.
package/dist/index.d.mts CHANGED
@@ -414,6 +414,11 @@ declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<
414
414
  private _emitSyncState;
415
415
  private _ensureDetached;
416
416
  private _getAbstractWs;
417
+ /**
418
+ * TODO
419
+ * @description Revisit any cast types
420
+ * @date July 17, 2025
421
+ */
417
422
  private _getAuthorizedUser;
418
423
  private _getContext;
419
424
  private _getInitialDoc;
package/dist/index.d.ts CHANGED
@@ -414,6 +414,11 @@ declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<
414
414
  private _emitSyncState;
415
415
  private _ensureDetached;
416
416
  private _getAbstractWs;
417
+ /**
418
+ * TODO
419
+ * @description Revisit any cast types
420
+ * @date July 17, 2025
421
+ */
417
422
  private _getAuthorizedUser;
418
423
  private _getContext;
419
424
  private _getInitialDoc;
package/dist/index.js CHANGED
@@ -773,6 +773,11 @@ var IORoom = class {
773
773
  const sessions = Array.from(this._sessions.values());
774
774
  return (_b = sessions.find((pluvWs) => pluvWs.webSocket === webSocket)) != null ? _b : null;
775
775
  }
776
+ /**
777
+ * TODO
778
+ * @description Revisit any cast types
779
+ * @date July 17, 2025
780
+ */
776
781
  _getAuthorizedUser(token, options) {
777
782
  return __async(this, null, function* () {
778
783
  var _a;
@@ -1190,7 +1195,7 @@ var IORoom = class {
1190
1195
  };
1191
1196
 
1192
1197
  // src/version.generated.ts
1193
- var version = "3.2.0";
1198
+ var version = "3.2.2";
1194
1199
 
1195
1200
  // src/PluvServer.ts
1196
1201
  var PluvServer = class {
package/dist/index.mjs CHANGED
@@ -731,6 +731,11 @@ var IORoom = class {
731
731
  const sessions = Array.from(this._sessions.values());
732
732
  return (_b = sessions.find((pluvWs) => pluvWs.webSocket === webSocket)) != null ? _b : null;
733
733
  }
734
+ /**
735
+ * TODO
736
+ * @description Revisit any cast types
737
+ * @date July 17, 2025
738
+ */
734
739
  _getAuthorizedUser(token, options) {
735
740
  return __async(this, null, function* () {
736
741
  var _a;
@@ -1148,7 +1153,7 @@ var IORoom = class {
1148
1153
  };
1149
1154
 
1150
1155
  // src/version.generated.ts
1151
- var version = "3.2.0";
1156
+ var version = "3.2.2";
1152
1157
 
1153
1158
  // src/PluvServer.ts
1154
1159
  var PluvServer = class {
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "@pluv/io server-side websocket manager",
5
- "author": "leedavidcs",
5
+ "author": {
6
+ "email": "david@pluv.io",
7
+ "name": "i3dly",
8
+ "url": "https://github.com/i3dly"
9
+ },
6
10
  "license": "MIT",
7
11
  "homepage": "https://github.com/pluv-io/pluv",
8
12
  "repository": {
@@ -21,16 +25,16 @@
21
25
  "jose": "^5.10.0",
22
26
  "kleur": "^4.1.5",
23
27
  "wonka": "^6.3.5",
24
- "@pluv/crdt": "^3.2.0",
25
- "@pluv/types": "^3.2.0"
28
+ "@pluv/crdt": "^3.2.2",
29
+ "@pluv/types": "^3.2.2"
26
30
  },
27
31
  "devDependencies": {
28
- "eslint": "^9.28.0",
32
+ "eslint": "^9.31.0",
29
33
  "genversion": "^3.2.0",
30
34
  "tsup": "^8.5.0",
31
35
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^3.2.0",
33
- "eslint-config-pluv": "^3.2.0"
36
+ "@pluv/tsconfig": "^3.2.2",
37
+ "eslint-config-pluv": "^3.2.2"
34
38
  },
35
39
  "scripts": {
36
40
  "build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
package/src/IORoom.ts CHANGED
@@ -603,14 +603,19 @@ export class IORoom<
603
603
  return sessions.find((pluvWs) => pluvWs.webSocket === webSocket) ?? null;
604
604
  }
605
605
 
606
+ /**
607
+ * TODO
608
+ * @description Revisit any cast types
609
+ * @date July 17, 2025
610
+ */
606
611
  private async _getAuthorizedUser(
607
612
  token: Maybe<string>,
608
613
  options: WebSocketRegisterConfig<TPlatform>,
609
614
  ): Promise<InferIOAuthorizeUser<TAuthorize>> {
610
615
  const ioAuthorize = this._getIOAuthorize(options);
611
616
 
612
- if (!ioAuthorize) return null as InferIOAuthorizeUser<InferIOAuthorize<this>>;
613
- if (!token) return null as InferIOAuthorizeUser<InferIOAuthorize<this>>;
617
+ if (!ioAuthorize) return null as any;
618
+ if (!token) return null as any;
614
619
 
615
620
  if (!ioAuthorize.secret)
616
621
  throw new Error("`authorize` was specified without a valid secret");
@@ -624,7 +629,7 @@ export class IORoom<
624
629
  this._logDebug(colors.blue("Could not decode token:"));
625
630
  this._logDebug(token);
626
631
 
627
- return null as InferIOAuthorizeUser<InferIOAuthorize<this>>;
632
+ return null as any;
628
633
  }
629
634
 
630
635
  if (payload.room !== this.id) {
@@ -632,7 +637,7 @@ export class IORoom<
632
637
  this._logDebug(colors.blue("Received:"), payload.room);
633
638
  this._logDebug(token);
634
639
 
635
- return null as InferIOAuthorizeUser<InferIOAuthorize<this>>;
640
+ return null as any;
636
641
  }
637
642
 
638
643
  try {
@@ -640,7 +645,7 @@ export class IORoom<
640
645
  } catch {
641
646
  this._logDebug(`${colors.blue("Token fails validation:")} ${token}`);
642
647
 
643
- return null as InferIOAuthorizeUser<InferIOAuthorize<this>>;
648
+ return null as any;
644
649
  }
645
650
  }
646
651
 
@@ -1184,7 +1189,7 @@ export class IORoom<
1184
1189
  options: { type: "self" },
1185
1190
  room: this.id,
1186
1191
  type,
1187
- user: sender.user ?? null,
1192
+ user: (sender.user ?? null) as BaseUser | null,
1188
1193
  });
1189
1194
  });
1190
1195
  });
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '3.2.0'
2
+ export const version = '3.2.2'