@pluv/client 0.5.1 → 0.6.1
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 +30 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +9 -9
- package/src/MockedRoom.ts +2 -2
- package/src/PluvClient.ts +4 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.
|
|
2
|
+
> @pluv/client@0.6.1 build /home/runner/work/pluv/pluv/packages/client
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v6.
|
|
7
|
+
[34mCLI[39m tsup v6.7.0
|
|
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[32m33.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m34.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m33.09 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 127ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m34.25 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 133ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5189ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.50 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @pluv/client
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 19433af: updated MockedRoomProvider events to allow partial events
|
|
8
|
+
- 74870ee: bumped dependencies
|
|
9
|
+
- Updated dependencies [74870ee]
|
|
10
|
+
- @pluv/crdt-yjs@0.3.3
|
|
11
|
+
- @pluv/types@0.1.5
|
|
12
|
+
|
|
13
|
+
## 0.6.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- e1308e3: changed `PluvClient.createRoom` to have optional options.
|
|
18
|
+
- e1308e3: changed `PluvClient.enter` to return the `PluvRoom` that was entered.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 9516a4e: updated typescript to 5.0
|
|
23
|
+
- 7b6da1c: bumped dependencies
|
|
24
|
+
- e9c1514: bumped dependencies
|
|
25
|
+
- 9d1829c: chore: bumped dependencies
|
|
26
|
+
- Updated dependencies [9516a4e]
|
|
27
|
+
- Updated dependencies [7b6da1c]
|
|
28
|
+
- Updated dependencies [e9c1514]
|
|
29
|
+
- Updated dependencies [9d1829c]
|
|
30
|
+
- @pluv/crdt-yjs@0.3.2
|
|
31
|
+
- @pluv/types@0.1.4
|
|
32
|
+
|
|
3
33
|
## 0.5.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -187,8 +187,8 @@ declare class PluvClient<TIO extends IOLike = IOLike> {
|
|
|
187
187
|
private _wsEndpoint;
|
|
188
188
|
private _rooms;
|
|
189
189
|
constructor(options: PluvClientOptions<TIO>);
|
|
190
|
-
createRoom: <TPresence extends JsonObject = {}, TStorage extends Record<string, AbstractType<any>> = {}>(room: string, options
|
|
191
|
-
enter: (room: string | PluvRoom<TIO, JsonObject, any>) => Promise<
|
|
190
|
+
createRoom: <TPresence extends JsonObject = {}, TStorage extends Record<string, AbstractType<any>> = {}>(room: string, options?: PluvRoomOptions<TIO, TPresence, TStorage>) => PluvRoom<TIO, TPresence, TStorage>;
|
|
191
|
+
enter: (room: string | PluvRoom<TIO, JsonObject, any>) => Promise<PluvRoom<TIO, JsonObject, any>>;
|
|
192
192
|
getRoom: <TPresence extends JsonObject = {}, TStorage extends Record<string, AbstractType<any>> = {}>(room: string) => PluvRoom<TIO, TPresence, TStorage> | null;
|
|
193
193
|
getRooms: () => readonly PluvRoom<TIO, JsonObject, any>[];
|
|
194
194
|
leave: (room: string | PluvRoom<TIO, JsonObject, any>) => void;
|
|
@@ -197,9 +197,9 @@ declare class PluvClient<TIO extends IOLike = IOLike> {
|
|
|
197
197
|
|
|
198
198
|
declare const createClient: <TIO extends IOLike<_pluv_types.IOAuthorize<any, any>, {}, {}> = IOLike<_pluv_types.IOAuthorize<any, any>, {}, {}>>(options: PluvClientOptions<TIO>) => PluvClient<TIO>;
|
|
199
199
|
|
|
200
|
-
type MockedRoomEvents<TIO extends IOLike> = {
|
|
200
|
+
type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
201
201
|
[P in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>[P]>) => Partial<InferIOOutput<TIO>>;
|
|
202
|
-
}
|
|
202
|
+
}>;
|
|
203
203
|
type MockedRoomConfig<TIO extends IOLike, TPresence extends JsonObject = {}, TStorage extends Record<string, AbstractType<any>> = {}> = {
|
|
204
204
|
events?: MockedRoomEvents<TIO>;
|
|
205
205
|
} & Omit<CrdtManagerOptions<TStorage>, "encodedState"> & UsersManagerConfig<TPresence>;
|
package/dist/index.js
CHANGED
|
@@ -962,7 +962,7 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
962
962
|
var PluvClient = class {
|
|
963
963
|
constructor(options) {
|
|
964
964
|
this._rooms = /* @__PURE__ */ new Map();
|
|
965
|
-
this.createRoom = (room, options) => {
|
|
965
|
+
this.createRoom = (room, options = {}) => {
|
|
966
966
|
const oldRoom = this.getRoom(room);
|
|
967
967
|
if (oldRoom)
|
|
968
968
|
return oldRoom;
|
|
@@ -986,6 +986,7 @@ var PluvClient = class {
|
|
|
986
986
|
this._rooms.set(toEnter.id, toEnter);
|
|
987
987
|
yield toEnter.connect();
|
|
988
988
|
this._logDebug(`Entered room: ${room}`);
|
|
989
|
+
return toEnter;
|
|
989
990
|
});
|
|
990
991
|
this.getRoom = (room) => {
|
|
991
992
|
const found = this._rooms.get(room);
|
package/dist/index.mjs
CHANGED
|
@@ -937,7 +937,7 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
937
937
|
var PluvClient = class {
|
|
938
938
|
constructor(options) {
|
|
939
939
|
this._rooms = /* @__PURE__ */ new Map();
|
|
940
|
-
this.createRoom = (room, options) => {
|
|
940
|
+
this.createRoom = (room, options = {}) => {
|
|
941
941
|
const oldRoom = this.getRoom(room);
|
|
942
942
|
if (oldRoom)
|
|
943
943
|
return oldRoom;
|
|
@@ -961,6 +961,7 @@ var PluvClient = class {
|
|
|
961
961
|
this._rooms.set(toEnter.id, toEnter);
|
|
962
962
|
yield toEnter.connect();
|
|
963
963
|
this._logDebug(`Entered room: ${room}`);
|
|
964
|
+
return toEnter;
|
|
964
965
|
});
|
|
965
966
|
this.getRoom = (room) => {
|
|
966
967
|
const found = this._rooms.get(room);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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.
|
|
21
|
-
"@pluv/crdt-yjs": "^0.3.
|
|
22
|
-
"@pluv/types": "^0.1.
|
|
20
|
+
"wonka": "^6.3.1",
|
|
21
|
+
"@pluv/crdt-yjs": "^0.3.3",
|
|
22
|
+
"@pluv/types": "^0.1.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"yjs": "^13.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"tsup": "^6.
|
|
29
|
-
"typescript": "^
|
|
30
|
-
"yjs": "^13.5.
|
|
31
|
-
"@pluv/tsconfig": "^0.1.
|
|
32
|
-
"eslint-config-pluv": "^0.1.
|
|
28
|
+
"tsup": "^6.7.0",
|
|
29
|
+
"typescript": "^5.0.3",
|
|
30
|
+
"yjs": "^13.5.51",
|
|
31
|
+
"@pluv/tsconfig": "^0.1.4",
|
|
32
|
+
"eslint-config-pluv": "^0.1.8"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/MockedRoom.ts
CHANGED
|
@@ -29,11 +29,11 @@ import { ConnectionState } from "./types";
|
|
|
29
29
|
import type { UsersManagerConfig } from "./UsersManager";
|
|
30
30
|
import { UsersManager } from "./UsersManager";
|
|
31
31
|
|
|
32
|
-
export type MockedRoomEvents<TIO extends IOLike> = {
|
|
32
|
+
export type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
33
33
|
[P in keyof InferIOInput<TIO>]: (
|
|
34
34
|
data: Id<InferIOInput<TIO>[P]>
|
|
35
35
|
) => Partial<InferIOOutput<TIO>>;
|
|
36
|
-
}
|
|
36
|
+
}>;
|
|
37
37
|
|
|
38
38
|
export type MockedRoomConfig<
|
|
39
39
|
TIO extends IOLike,
|
package/src/PluvClient.ts
CHANGED
|
@@ -32,7 +32,7 @@ export class PluvClient<TIO extends IOLike = IOLike> {
|
|
|
32
32
|
TStorage extends Record<string, AbstractType<any>> = {}
|
|
33
33
|
>(
|
|
34
34
|
room: string,
|
|
35
|
-
options: PluvRoomOptions<TIO, TPresence, TStorage>
|
|
35
|
+
options: PluvRoomOptions<TIO, TPresence, TStorage> = {}
|
|
36
36
|
): PluvRoom<TIO, TPresence, TStorage> => {
|
|
37
37
|
const oldRoom = this.getRoom<TPresence, TStorage>(room);
|
|
38
38
|
|
|
@@ -56,7 +56,7 @@ export class PluvClient<TIO extends IOLike = IOLike> {
|
|
|
56
56
|
|
|
57
57
|
public enter = async (
|
|
58
58
|
room: string | PluvRoom<TIO, JsonObject, any>
|
|
59
|
-
): Promise<
|
|
59
|
+
): Promise<PluvRoom<TIO, JsonObject, any>> => {
|
|
60
60
|
const toEnter = typeof room === "string" ? this.getRoom(room) : room;
|
|
61
61
|
|
|
62
62
|
if (!toEnter) {
|
|
@@ -68,6 +68,8 @@ export class PluvClient<TIO extends IOLike = IOLike> {
|
|
|
68
68
|
await toEnter.connect();
|
|
69
69
|
|
|
70
70
|
this._logDebug(`Entered room: ${room}`);
|
|
71
|
+
|
|
72
|
+
return toEnter;
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
public getRoom = <
|