@pluv/io 0.10.2 → 0.11.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 +19 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -3
- package/dist/index.mjs +8 -3
- package/package.json +7 -7
- package/src/IORoom.ts +2 -2
- package/src/PluvIO.ts +10 -2
- package/src/index.ts +2 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.
|
|
2
|
+
> @pluv/io@0.11.0 build /home/runner/work/pluv/pluv/packages/io
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m29.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m31.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m29.30 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 124ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m31.38 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 136ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m17.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4567ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m17.12 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.12 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @pluv/io
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b538f5c: Exported class PluvIO from @pluv/io.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @pluv/crdt-yjs@0.11.0
|
|
12
|
+
- @pluv/types@0.11.0
|
|
13
|
+
|
|
14
|
+
## 0.10.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- a7d3ad1: Exposed context and getInitialProps from @pluv/io.
|
|
19
|
+
- @pluv/crdt-yjs@0.10.3
|
|
20
|
+
- @pluv/types@0.10.3
|
|
21
|
+
|
|
3
22
|
## 0.10.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
|
|
|
257
257
|
debug?: boolean;
|
|
258
258
|
} & InferPlatformRoomContextType<TPlatform>;
|
|
259
259
|
declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, any> = BaseIOAuthorize, TContext extends JsonObject = {}, TInput extends EventRecord<string, any> = {}, TOutputBroadcast extends EventRecord<string, any> = {}, TOutputSelf extends EventRecord<string, any> = {}, TOutputSync extends EventRecord<string, any> = {}> implements IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync> {
|
|
260
|
-
private _context;
|
|
261
|
-
private _getInitialStorage;
|
|
262
260
|
private _rooms;
|
|
263
261
|
readonly _authorize: TAuthorize | null;
|
|
262
|
+
readonly _context: TContext;
|
|
264
263
|
readonly _debug: boolean;
|
|
265
264
|
readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
|
|
265
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
|
|
266
266
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
267
267
|
readonly _platform: TPlatform;
|
|
268
268
|
constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
|
package/dist/index.d.ts
CHANGED
|
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
|
|
|
257
257
|
debug?: boolean;
|
|
258
258
|
} & InferPlatformRoomContextType<TPlatform>;
|
|
259
259
|
declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, any> = BaseIOAuthorize, TContext extends JsonObject = {}, TInput extends EventRecord<string, any> = {}, TOutputBroadcast extends EventRecord<string, any> = {}, TOutputSelf extends EventRecord<string, any> = {}, TOutputSync extends EventRecord<string, any> = {}> implements IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync> {
|
|
260
|
-
private _context;
|
|
261
|
-
private _getInitialStorage;
|
|
262
260
|
private _rooms;
|
|
263
261
|
readonly _authorize: TAuthorize | null;
|
|
262
|
+
readonly _context: TContext;
|
|
264
263
|
readonly _debug: boolean;
|
|
265
264
|
readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
|
|
265
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
|
|
266
266
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
267
267
|
readonly _platform: TPlatform;
|
|
268
268
|
constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
|
package/dist/index.js
CHANGED
|
@@ -83,6 +83,7 @@ __export(src_exports, {
|
|
|
83
83
|
AbstractPlatform: () => AbstractPlatform,
|
|
84
84
|
AbstractPubSub: () => AbstractPubSub,
|
|
85
85
|
AbstractWebSocket: () => AbstractWebSocket,
|
|
86
|
+
PluvIO: () => PluvIO,
|
|
86
87
|
createIO: () => createIO
|
|
87
88
|
});
|
|
88
89
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -632,8 +633,8 @@ var IORoom = class {
|
|
|
632
633
|
};
|
|
633
634
|
}
|
|
634
635
|
_parseMessage(message) {
|
|
635
|
-
const parsed = this._platform.parseData(message.data);
|
|
636
636
|
try {
|
|
637
|
+
const parsed = this._platform.parseData(message.data);
|
|
637
638
|
if (typeof parsed !== "object")
|
|
638
639
|
return null;
|
|
639
640
|
if (typeof parsed.type !== "string")
|
|
@@ -732,10 +733,9 @@ var IORoom = class {
|
|
|
732
733
|
// src/PluvIO.ts
|
|
733
734
|
var PluvIO = class _PluvIO {
|
|
734
735
|
constructor(options) {
|
|
735
|
-
this._context = {};
|
|
736
|
-
this._getInitialStorage = null;
|
|
737
736
|
this._rooms = /* @__PURE__ */ new Map();
|
|
738
737
|
this._authorize = null;
|
|
738
|
+
this._context = {};
|
|
739
739
|
this._events = {
|
|
740
740
|
$GET_OTHERS: {
|
|
741
741
|
resolver: {
|
|
@@ -836,6 +836,7 @@ var PluvIO = class _PluvIO {
|
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
|
+
this._getInitialStorage = null;
|
|
839
840
|
const {
|
|
840
841
|
authorize: authorize2,
|
|
841
842
|
context,
|
|
@@ -941,16 +942,20 @@ var PluvIO = class _PluvIO {
|
|
|
941
942
|
static merge(first, second) {
|
|
942
943
|
var _a;
|
|
943
944
|
const authorize2 = (_a = first._authorize) != null ? _a : void 0;
|
|
945
|
+
const context = first._context;
|
|
944
946
|
const debug = first._debug;
|
|
945
947
|
const platform = first._platform;
|
|
948
|
+
const getInitialStorage = first._getInitialStorage;
|
|
946
949
|
const events1 = first._events;
|
|
947
950
|
const events2 = second._events;
|
|
948
951
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
949
952
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
950
953
|
return new _PluvIO({
|
|
951
954
|
authorize: authorize2,
|
|
955
|
+
context,
|
|
952
956
|
debug,
|
|
953
957
|
events,
|
|
958
|
+
getInitialStorage,
|
|
954
959
|
onRoomDeleted,
|
|
955
960
|
onStorageUpdated,
|
|
956
961
|
platform
|
|
@@ -996,5 +1001,6 @@ var createIO = (params) => {
|
|
|
996
1001
|
AbstractPlatform,
|
|
997
1002
|
AbstractPubSub,
|
|
998
1003
|
AbstractWebSocket,
|
|
1004
|
+
PluvIO,
|
|
999
1005
|
createIO
|
|
1000
1006
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -595,8 +595,8 @@ var IORoom = class {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
_parseMessage(message) {
|
|
598
|
-
const parsed = this._platform.parseData(message.data);
|
|
599
598
|
try {
|
|
599
|
+
const parsed = this._platform.parseData(message.data);
|
|
600
600
|
if (typeof parsed !== "object")
|
|
601
601
|
return null;
|
|
602
602
|
if (typeof parsed.type !== "string")
|
|
@@ -695,10 +695,9 @@ var IORoom = class {
|
|
|
695
695
|
// src/PluvIO.ts
|
|
696
696
|
var PluvIO = class _PluvIO {
|
|
697
697
|
constructor(options) {
|
|
698
|
-
this._context = {};
|
|
699
|
-
this._getInitialStorage = null;
|
|
700
698
|
this._rooms = /* @__PURE__ */ new Map();
|
|
701
699
|
this._authorize = null;
|
|
700
|
+
this._context = {};
|
|
702
701
|
this._events = {
|
|
703
702
|
$GET_OTHERS: {
|
|
704
703
|
resolver: {
|
|
@@ -799,6 +798,7 @@ var PluvIO = class _PluvIO {
|
|
|
799
798
|
}
|
|
800
799
|
}
|
|
801
800
|
};
|
|
801
|
+
this._getInitialStorage = null;
|
|
802
802
|
const {
|
|
803
803
|
authorize: authorize2,
|
|
804
804
|
context,
|
|
@@ -904,16 +904,20 @@ var PluvIO = class _PluvIO {
|
|
|
904
904
|
static merge(first, second) {
|
|
905
905
|
var _a;
|
|
906
906
|
const authorize2 = (_a = first._authorize) != null ? _a : void 0;
|
|
907
|
+
const context = first._context;
|
|
907
908
|
const debug = first._debug;
|
|
908
909
|
const platform = first._platform;
|
|
910
|
+
const getInitialStorage = first._getInitialStorage;
|
|
909
911
|
const events1 = first._events;
|
|
910
912
|
const events2 = second._events;
|
|
911
913
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
912
914
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
913
915
|
return new _PluvIO({
|
|
914
916
|
authorize: authorize2,
|
|
917
|
+
context,
|
|
915
918
|
debug,
|
|
916
919
|
events,
|
|
920
|
+
getInitialStorage,
|
|
917
921
|
onRoomDeleted,
|
|
918
922
|
onStorageUpdated,
|
|
919
923
|
platform
|
|
@@ -958,5 +962,6 @@ export {
|
|
|
958
962
|
AbstractPlatform,
|
|
959
963
|
AbstractPubSub,
|
|
960
964
|
AbstractWebSocket,
|
|
965
|
+
PluvIO,
|
|
961
966
|
createIO
|
|
962
967
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"jose": "^4.14.4",
|
|
22
22
|
"kleur": "^4.1.5",
|
|
23
23
|
"wonka": "^6.3.4",
|
|
24
|
-
"@pluv/crdt-yjs": "^0.
|
|
25
|
-
"@pluv/types": "^0.
|
|
24
|
+
"@pluv/crdt-yjs": "^0.11.0",
|
|
25
|
+
"@pluv/types": "^0.11.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"yjs": "^13.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"eslint": "^8.
|
|
31
|
+
"eslint": "^8.48.0",
|
|
32
32
|
"tsup": "^7.2.0",
|
|
33
|
-
"typescript": "^5.
|
|
33
|
+
"typescript": "^5.2.2",
|
|
34
34
|
"yjs": "^13.6.7",
|
|
35
|
-
"@pluv/tsconfig": "^0.
|
|
36
|
-
"eslint-config-pluv": "^0.
|
|
35
|
+
"@pluv/tsconfig": "^0.11.0",
|
|
36
|
+
"eslint-config-pluv": "^0.11.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/IORoom.ts
CHANGED
|
@@ -605,9 +605,9 @@ export class IORoom<
|
|
|
605
605
|
private _parseMessage(message: {
|
|
606
606
|
data: string | ArrayBuffer;
|
|
607
607
|
}): EventMessage<string, any> | null {
|
|
608
|
-
const parsed = this._platform.parseData(message.data);
|
|
609
|
-
|
|
610
608
|
try {
|
|
609
|
+
const parsed = this._platform.parseData(message.data);
|
|
610
|
+
|
|
611
611
|
if (typeof parsed !== "object") return null;
|
|
612
612
|
if (typeof parsed.type !== "string") return null;
|
|
613
613
|
if (typeof parsed.data !== "object") return null;
|
package/src/PluvIO.ts
CHANGED
|
@@ -107,8 +107,6 @@ export class PluvIO<
|
|
|
107
107
|
> implements
|
|
108
108
|
IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>
|
|
109
109
|
{
|
|
110
|
-
private _context: TContext = {} as TContext;
|
|
111
|
-
private _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
|
|
112
110
|
private _rooms = new Map<
|
|
113
111
|
string,
|
|
114
112
|
IORoom<
|
|
@@ -123,6 +121,7 @@ export class PluvIO<
|
|
|
123
121
|
>();
|
|
124
122
|
|
|
125
123
|
readonly _authorize: TAuthorize | null = null;
|
|
124
|
+
readonly _context: TContext = {} as TContext;
|
|
126
125
|
readonly _debug: boolean;
|
|
127
126
|
readonly _events: InferEventConfig<
|
|
128
127
|
TPlatform,
|
|
@@ -274,6 +273,7 @@ export class PluvIO<
|
|
|
274
273
|
TOutputSelf,
|
|
275
274
|
TOutputSync
|
|
276
275
|
>;
|
|
276
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
|
|
277
277
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
278
278
|
readonly _platform: TPlatform;
|
|
279
279
|
|
|
@@ -492,9 +492,15 @@ export class PluvIO<
|
|
|
492
492
|
> {
|
|
493
493
|
const authorize = (first._authorize ??
|
|
494
494
|
undefined) as InferIOAuthorize<TIO1>;
|
|
495
|
+
const context = first._context as InferIOContext<TIO1>;
|
|
495
496
|
const debug = first._debug;
|
|
496
497
|
const platform = first._platform as InferIOPlatform<TIO1>;
|
|
497
498
|
|
|
499
|
+
const getInitialStorage =
|
|
500
|
+
first._getInitialStorage as GetInitialStorageFn<
|
|
501
|
+
InferIOPlatform<TIO1>
|
|
502
|
+
>;
|
|
503
|
+
|
|
498
504
|
const events1 = first._events;
|
|
499
505
|
const events2 = second._events;
|
|
500
506
|
|
|
@@ -504,8 +510,10 @@ export class PluvIO<
|
|
|
504
510
|
|
|
505
511
|
return new PluvIO({
|
|
506
512
|
authorize,
|
|
513
|
+
context,
|
|
507
514
|
debug,
|
|
508
515
|
events,
|
|
516
|
+
getInitialStorage,
|
|
509
517
|
onRoomDeleted,
|
|
510
518
|
onStorageUpdated,
|
|
511
519
|
platform,
|
package/src/index.ts
CHANGED
|
@@ -27,12 +27,8 @@ export type {
|
|
|
27
27
|
AbstractWebSocketHandleErrorParams,
|
|
28
28
|
} from "./AbstractWebSocket";
|
|
29
29
|
export type { IORoom } from "./IORoom";
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
InferIORoom,
|
|
33
|
-
PluvIO,
|
|
34
|
-
PluvIOConfig,
|
|
35
|
-
} from "./PluvIO";
|
|
30
|
+
export { PluvIO } from "./PluvIO";
|
|
31
|
+
export type { GetRoomOptions, InferIORoom, PluvIOConfig } from "./PluvIO";
|
|
36
32
|
export type {
|
|
37
33
|
AuthorizeModule,
|
|
38
34
|
AuthorizeParams,
|