@pluv/io 0.25.3 → 0.26.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 +7 -7
- package/CHANGELOG.md +15 -0
- package/dist/index.js +17 -9
- package/dist/index.mjs +17 -9
- package/package.json +5 -5
- package/src/IORoom.ts +12 -2
- package/src/PluvServer.ts +8 -4
- package/src/version.generated.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.
|
|
2
|
+
> @pluv/io@0.26.0 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.
|
|
6
|
+
> @pluv/io@0.26.0 version /home/runner/work/pluv/pluv/packages/io
|
|
7
7
|
> genversion ./src/version.generated.ts --esm
|
|
8
8
|
|
|
9
9
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
[34mCLI[39m Target: es6
|
|
13
13
|
[34mESM[39m Build start
|
|
14
14
|
[34mCJS[39m Build start
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m39.73 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 128ms
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m41.88 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 134ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 2147ms
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m25.78 KB[39m
|
|
22
22
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m25.78 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @pluv/io
|
|
2
2
|
|
|
3
|
+
## 0.26.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/crdt@0.26.0
|
|
8
|
+
- @pluv/types@0.26.0
|
|
9
|
+
|
|
10
|
+
## 0.25.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 7a9080c: Fix not passing all properties to the platform initialization.
|
|
15
|
+
- @pluv/crdt@0.25.4
|
|
16
|
+
- @pluv/types@0.25.4
|
|
17
|
+
|
|
3
18
|
## 0.25.3
|
|
4
19
|
|
|
5
20
|
### 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 {
|
|
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.
|
|
927
|
+
var version = "0.26.0";
|
|
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 {
|
|
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.
|
|
886
|
+
var version = "0.26.0";
|
|
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.
|
|
3
|
+
"version": "0.26.0",
|
|
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
|
-
"@pluv/types": "^0.
|
|
24
|
+
"@pluv/crdt": "^0.26.0",
|
|
25
|
+
"@pluv/types": "^0.26.0"
|
|
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.
|
|
33
|
-
"eslint-config-pluv": "^0.
|
|
32
|
+
"@pluv/tsconfig": "^0.26.0",
|
|
33
|
+
"eslint-config-pluv": "^0.26.0"
|
|
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 {
|
|
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,
|
package/src/version.generated.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '0.
|
|
2
|
+
export const version = '0.26.0'
|