@pluv/platform-pluv 2.1.0 → 2.2.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 +6 -6
- package/CHANGELOG.md +9 -0
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +7 -7
- package/src/PluvPlatform.ts +8 -1
- package/src/platformPluv.ts +1 -1
- package/src/types.ts +6 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-pluv@2.
|
|
2
|
+
> @pluv/platform-pluv@2.2.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
|
|
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
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m12.46 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 83ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m14.29 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 81ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 7205ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.67 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.67 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -302,7 +302,13 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
|
|
|
302
302
|
const encodedState = data.storage;
|
|
303
303
|
const user = data.user;
|
|
304
304
|
yield Promise.resolve(
|
|
305
|
-
(_f = this._listeners) == null ? void 0 : _f.onUserConnected({
|
|
305
|
+
(_f = this._listeners) == null ? void 0 : _f.onUserConnected({
|
|
306
|
+
context,
|
|
307
|
+
encodedState,
|
|
308
|
+
platform: this,
|
|
309
|
+
room,
|
|
310
|
+
user
|
|
311
|
+
})
|
|
306
312
|
);
|
|
307
313
|
return createSuccessResponse(c, { event, room });
|
|
308
314
|
}
|
|
@@ -314,6 +320,7 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
|
|
|
314
320
|
(_g = this._listeners) == null ? void 0 : _g.onUserDisconnected({
|
|
315
321
|
context,
|
|
316
322
|
encodedState,
|
|
323
|
+
platform: this,
|
|
317
324
|
room,
|
|
318
325
|
user
|
|
319
326
|
})
|
|
@@ -406,7 +413,7 @@ var platformPluv = (config) => {
|
|
|
406
413
|
context,
|
|
407
414
|
crdt,
|
|
408
415
|
debug,
|
|
409
|
-
platform: new PluvPlatform(config)
|
|
416
|
+
platform: () => new PluvPlatform(config)
|
|
410
417
|
};
|
|
411
418
|
};
|
|
412
419
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -272,7 +272,13 @@ var PluvPlatform = class extends AbstractPlatform {
|
|
|
272
272
|
const encodedState = data.storage;
|
|
273
273
|
const user = data.user;
|
|
274
274
|
yield Promise.resolve(
|
|
275
|
-
(_f = this._listeners) == null ? void 0 : _f.onUserConnected({
|
|
275
|
+
(_f = this._listeners) == null ? void 0 : _f.onUserConnected({
|
|
276
|
+
context,
|
|
277
|
+
encodedState,
|
|
278
|
+
platform: this,
|
|
279
|
+
room,
|
|
280
|
+
user
|
|
281
|
+
})
|
|
276
282
|
);
|
|
277
283
|
return createSuccessResponse(c, { event, room });
|
|
278
284
|
}
|
|
@@ -284,6 +290,7 @@ var PluvPlatform = class extends AbstractPlatform {
|
|
|
284
290
|
(_g = this._listeners) == null ? void 0 : _g.onUserDisconnected({
|
|
285
291
|
context,
|
|
286
292
|
encodedState,
|
|
293
|
+
platform: this,
|
|
287
294
|
room,
|
|
288
295
|
user
|
|
289
296
|
})
|
|
@@ -376,7 +383,7 @@ var platformPluv = (config) => {
|
|
|
376
383
|
context,
|
|
377
384
|
crdt,
|
|
378
385
|
debug,
|
|
379
|
-
platform: new PluvPlatform(config)
|
|
386
|
+
platform: () => new PluvPlatform(config)
|
|
380
387
|
};
|
|
381
388
|
};
|
|
382
389
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-pluv",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "@pluv/io adapter for pluv.io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,20 +17,20 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@types/node": "^22.15.
|
|
20
|
+
"@types/node": "^22.15.18",
|
|
21
21
|
"fast-json-stable-stringify": "^2.1.0",
|
|
22
22
|
"hono": "^4.7.9",
|
|
23
23
|
"zod": "^3.24.4",
|
|
24
|
-
"@pluv/crdt": "^2.
|
|
25
|
-
"@pluv/
|
|
26
|
-
"@pluv/
|
|
24
|
+
"@pluv/crdt": "^2.2.0",
|
|
25
|
+
"@pluv/io": "^2.2.0",
|
|
26
|
+
"@pluv/types": "^2.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"eslint": "^9.26.0",
|
|
30
30
|
"tsup": "^8.4.0",
|
|
31
31
|
"typescript": "^5.8.3",
|
|
32
|
-
"@pluv/tsconfig": "^2.
|
|
33
|
-
"eslint-config-pluv": "^2.
|
|
32
|
+
"@pluv/tsconfig": "^2.2.0",
|
|
33
|
+
"eslint-config-pluv": "^2.2.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvPlatform.ts
CHANGED
|
@@ -265,7 +265,13 @@ export class PluvPlatform<
|
|
|
265
265
|
const user = data.user as any;
|
|
266
266
|
|
|
267
267
|
await Promise.resolve(
|
|
268
|
-
this._listeners?.onUserConnected({
|
|
268
|
+
this._listeners?.onUserConnected({
|
|
269
|
+
context,
|
|
270
|
+
encodedState,
|
|
271
|
+
platform: this,
|
|
272
|
+
room,
|
|
273
|
+
user,
|
|
274
|
+
}),
|
|
269
275
|
);
|
|
270
276
|
|
|
271
277
|
return createSuccessResponse(c, { event, room });
|
|
@@ -279,6 +285,7 @@ export class PluvPlatform<
|
|
|
279
285
|
this._listeners?.onUserDisconnected({
|
|
280
286
|
context,
|
|
281
287
|
encodedState,
|
|
288
|
+
platform: this,
|
|
282
289
|
room,
|
|
283
290
|
user,
|
|
284
291
|
}),
|
package/src/platformPluv.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BaseUser,
|
|
3
3
|
GetInitialStorageFn,
|
|
4
|
-
IORoomListenerEvent,
|
|
5
4
|
IOUserConnectedEvent,
|
|
6
5
|
IOUserDisconnectedEvent,
|
|
7
6
|
} from "@pluv/io";
|
|
@@ -21,6 +20,12 @@ export interface PluvIOEndpoints {
|
|
|
21
20
|
createToken: string;
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
export type IORoomListenerEvent<TContext extends Record<string, any>> = {
|
|
24
|
+
context: TContext;
|
|
25
|
+
encodedState: string | null;
|
|
26
|
+
room: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
24
29
|
export type PluvIOListeners<
|
|
25
30
|
TContext extends Record<string, any> = {},
|
|
26
31
|
TUser extends BaseUser = BaseUser,
|