@pluv/io 0.25.3 → 0.25.4

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@0.25.3 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@0.25.4 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@0.25.3 version /home/runner/work/pluv/pluv/packages/io
6
+ > @pluv/io@0.25.4 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 41.69 KB
16
- CJS ⚡️ Build success in 148ms
17
- ESM dist/index.mjs 39.55 KB
18
- ESM ⚡️ Build success in 150ms
15
+ CJS dist/index.js 41.88 KB
16
+ CJS ⚡️ Build success in 104ms
17
+ ESM dist/index.mjs 39.73 KB
18
+ ESM ⚡️ Build success in 125ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 2146ms
20
+ DTS ⚡️ Build success in 2215ms
21
21
  DTS dist/index.d.mts 25.78 KB
22
22
  DTS dist/index.d.ts 25.78 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 0.25.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 7a9080c: Fix not passing all properties to the platform initialization.
8
+ - @pluv/crdt@0.25.4
9
+ - @pluv/types@0.25.4
10
+
3
11
  ## 0.25.3
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -398,13 +398,23 @@ var IORoom = class {
398
398
  this._uninitialize = null;
399
399
  this._authorize = null;
400
400
  this._sessions = /* @__PURE__ */ new Map();
401
- const { authorize: authorize2, context, crdt = import_crdt.noop, debug, onDestroy, onMessage, platform, router } = config;
401
+ const {
402
+ _meta,
403
+ authorize: authorize2,
404
+ context,
405
+ crdt = import_crdt.noop,
406
+ debug,
407
+ onDestroy,
408
+ onMessage,
409
+ platform,
410
+ router
411
+ } = config;
402
412
  this.id = id;
403
413
  this._context = context;
404
414
  this._debug = debug;
405
415
  this._docFactory = crdt.doc(() => ({}));
406
416
  this._router = router;
407
- this._platform = platform.initialize({ context });
417
+ this._platform = platform.initialize(__spreadProps(__spreadValues({}, !!_meta ? { _meta } : {}), { context }));
408
418
  this._listeners = {
409
419
  onDestroy: (event) => onDestroy == null ? void 0 : onDestroy(event),
410
420
  onMessage: (event) => onMessage == null ? void 0 : onMessage(event)
@@ -914,7 +924,7 @@ var IORoom = class {
914
924
  };
915
925
 
916
926
  // src/version.generated.ts
917
- var version = "0.25.3";
927
+ var version = "0.25.4";
918
928
 
919
929
  // src/PluvServer.ts
920
930
  var PluvServer = class {
@@ -1049,12 +1059,10 @@ var PluvServer = class {
1049
1059
  }
1050
1060
  createRoom(room, ...options) {
1051
1061
  var _a, _c;
1052
- const _b = (_a = options[0]) != null ? _a : {}, { debug, onDestroy, onMessage } = _b, platformRoomContext = __objRest(_b, ["debug", "onDestroy", "onMessage"]);
1053
- if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) {
1054
- throw new Error("Unsupported room name");
1055
- }
1062
+ const _b = (_a = options[0]) != null ? _a : {}, { _meta, debug, onDestroy, onMessage } = _b, platformRoomContext = __objRest(_b, ["_meta", "debug", "onDestroy", "onMessage"]);
1063
+ if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) throw new Error("Unsupported room name");
1056
1064
  const roomContext = __spreadValues(__spreadValues({}, this._context), platformRoomContext);
1057
- const newRoom = new IORoom(room, {
1065
+ const newRoom = new IORoom(room, __spreadProps(__spreadValues({}, !!_meta ? { _meta } : {}), {
1058
1066
  authorize: (_c = this._authorize) != null ? _c : void 0,
1059
1067
  context: roomContext,
1060
1068
  crdt: this._crdt,
@@ -1072,7 +1080,7 @@ var PluvServer = class {
1072
1080
  }),
1073
1081
  platform: this._platform,
1074
1082
  router: this._router
1075
- });
1083
+ }));
1076
1084
  this._logDebug(`${import_kleur2.default.blue("Created room:")} ${room}`);
1077
1085
  return newRoom;
1078
1086
  }
package/dist/index.mjs CHANGED
@@ -357,13 +357,23 @@ var IORoom = class {
357
357
  this._uninitialize = null;
358
358
  this._authorize = null;
359
359
  this._sessions = /* @__PURE__ */ new Map();
360
- const { authorize: authorize2, context, crdt = noop, debug, onDestroy, onMessage, platform, router } = config;
360
+ const {
361
+ _meta,
362
+ authorize: authorize2,
363
+ context,
364
+ crdt = noop,
365
+ debug,
366
+ onDestroy,
367
+ onMessage,
368
+ platform,
369
+ router
370
+ } = config;
361
371
  this.id = id;
362
372
  this._context = context;
363
373
  this._debug = debug;
364
374
  this._docFactory = crdt.doc(() => ({}));
365
375
  this._router = router;
366
- this._platform = platform.initialize({ context });
376
+ this._platform = platform.initialize(__spreadProps(__spreadValues({}, !!_meta ? { _meta } : {}), { context }));
367
377
  this._listeners = {
368
378
  onDestroy: (event) => onDestroy == null ? void 0 : onDestroy(event),
369
379
  onMessage: (event) => onMessage == null ? void 0 : onMessage(event)
@@ -873,7 +883,7 @@ var IORoom = class {
873
883
  };
874
884
 
875
885
  // src/version.generated.ts
876
- var version = "0.25.3";
886
+ var version = "0.25.4";
877
887
 
878
888
  // src/PluvServer.ts
879
889
  var PluvServer = class {
@@ -1008,12 +1018,10 @@ var PluvServer = class {
1008
1018
  }
1009
1019
  createRoom(room, ...options) {
1010
1020
  var _a, _c;
1011
- const _b = (_a = options[0]) != null ? _a : {}, { debug, onDestroy, onMessage } = _b, platformRoomContext = __objRest(_b, ["debug", "onDestroy", "onMessage"]);
1012
- if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) {
1013
- throw new Error("Unsupported room name");
1014
- }
1021
+ const _b = (_a = options[0]) != null ? _a : {}, { _meta, debug, onDestroy, onMessage } = _b, platformRoomContext = __objRest(_b, ["_meta", "debug", "onDestroy", "onMessage"]);
1022
+ if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) throw new Error("Unsupported room name");
1015
1023
  const roomContext = __spreadValues(__spreadValues({}, this._context), platformRoomContext);
1016
- const newRoom = new IORoom(room, {
1024
+ const newRoom = new IORoom(room, __spreadProps(__spreadValues({}, !!_meta ? { _meta } : {}), {
1017
1025
  authorize: (_c = this._authorize) != null ? _c : void 0,
1018
1026
  context: roomContext,
1019
1027
  crdt: this._crdt,
@@ -1031,7 +1039,7 @@ var PluvServer = class {
1031
1039
  }),
1032
1040
  platform: this._platform,
1033
1041
  router: this._router
1034
- });
1042
+ }));
1035
1043
  this._logDebug(`${colors2.blue("Created room:")} ${room}`);
1036
1044
  return newRoom;
1037
1045
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "0.25.3",
3
+ "version": "0.25.4",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -21,16 +21,16 @@
21
21
  "jose": "^5.7.0",
22
22
  "kleur": "^4.1.5",
23
23
  "wonka": "^6.3.4",
24
- "@pluv/crdt": "^0.25.3",
25
- "@pluv/types": "^0.25.3"
24
+ "@pluv/crdt": "^0.25.4",
25
+ "@pluv/types": "^0.25.4"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^8.57.0",
29
29
  "genversion": "^3.2.0",
30
30
  "tsup": "^8.2.4",
31
31
  "typescript": "^5.5.4",
32
- "@pluv/tsconfig": "^0.25.3",
33
- "eslint-config-pluv": "^0.25.3"
32
+ "@pluv/tsconfig": "^0.25.4",
33
+ "eslint-config-pluv": "^0.25.4"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
package/src/IORoom.ts CHANGED
@@ -137,7 +137,17 @@ export class IORoom<
137
137
  }
138
138
 
139
139
  constructor(id: string, config: IORoomConfig<TPlatform, TAuthorize, TContext, TEvents>) {
140
- const { authorize, context, crdt = noop, debug, onDestroy, onMessage, platform, router } = config;
140
+ const {
141
+ _meta,
142
+ authorize,
143
+ context,
144
+ crdt = noop,
145
+ debug,
146
+ onDestroy,
147
+ onMessage,
148
+ platform,
149
+ router,
150
+ } = config as IORoomConfig<TPlatform, TAuthorize, TContext, TEvents> & { _meta?: any };
141
151
 
142
152
  this.id = id;
143
153
 
@@ -145,7 +155,7 @@ export class IORoom<
145
155
  this._debug = debug;
146
156
  this._docFactory = crdt.doc(() => ({}));
147
157
  this._router = router;
148
- this._platform = platform.initialize({ context });
158
+ this._platform = platform.initialize({ ...(!!_meta ? { _meta } : {}), context });
149
159
 
150
160
  this._listeners = {
151
161
  onDestroy: (event) => onDestroy?.(event),
package/src/PluvServer.ts CHANGED
@@ -257,11 +257,14 @@ export class PluvServer<
257
257
  room: string,
258
258
  ...options: CreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents>
259
259
  ): IORoom<TPlatform, TAuthorize, TContext, TEvents> {
260
- const { debug, onDestroy, onMessage, ...platformRoomContext } = options[0] ?? {};
260
+ const { _meta, debug, onDestroy, onMessage, ...platformRoomContext } = (options[0] ?? {}) as CreateRoomOptions<
261
+ TPlatform,
262
+ TAuthorize,
263
+ TContext,
264
+ TEvents
265
+ >[0] & { _meta?: any };
261
266
 
262
- if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) {
263
- throw new Error("Unsupported room name");
264
- }
267
+ if (!/^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$/i.test(room)) throw new Error("Unsupported room name");
265
268
 
266
269
  const roomContext = {
267
270
  ...this._context,
@@ -269,6 +272,7 @@ export class PluvServer<
269
272
  } as TContext & InferRoomContextType<TPlatform>;
270
273
 
271
274
  const newRoom = new IORoom<TPlatform, TAuthorize, TContext, TEvents>(room, {
275
+ ...(!!_meta ? { _meta } : {}),
272
276
  authorize: this._authorize ?? undefined,
273
277
  context: roomContext,
274
278
  crdt: this._crdt,
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '0.25.3'
2
+ export const version = '0.25.4'