@pluv/platform-pluv 0.30.2 → 0.31.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 +4 -4
- package/CHANGELOG.md +87 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/PluvPlatform.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-pluv@0.
|
|
2
|
+
> @pluv/platform-pluv@0.31.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
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m3.65 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 72ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m4.83 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 72ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 6981ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m2.29 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.29 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# @pluv/platform-pluv
|
|
2
2
|
|
|
3
|
+
## 0.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b3c31d7: **BREAKING**
|
|
8
|
+
|
|
9
|
+
Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// @pluv/platform-node example
|
|
13
|
+
|
|
14
|
+
import { platformNode } from "@pluv/platform-node";
|
|
15
|
+
import { createIO } from "@pluv/io";
|
|
16
|
+
import type { IncomingMessage } from "node:http";
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
|
|
19
|
+
const io = createIO({
|
|
20
|
+
// If using a function authorize parameter, `req` is now available as a param
|
|
21
|
+
authorize: ({ req }) => ({
|
|
22
|
+
required: true,
|
|
23
|
+
secret: "MY-CUSTOM-SECRET",
|
|
24
|
+
user: z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
}),
|
|
27
|
+
}),
|
|
28
|
+
platformNode(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Before
|
|
32
|
+
io.createToken({
|
|
33
|
+
room: "my-custom-room",
|
|
34
|
+
user: { id: "abc123" },
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// After
|
|
38
|
+
io.createToken({
|
|
39
|
+
room: "my-custom-room",
|
|
40
|
+
user: { id: "abc123" },
|
|
41
|
+
|
|
42
|
+
// Previously not required, but now required
|
|
43
|
+
req: req as IncomingMessage,
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
// @pluv/platform-cloudflare example
|
|
49
|
+
|
|
50
|
+
import { platformCloudflare } from "@pluv/platform-cloudflare";
|
|
51
|
+
import { createIO } from "@pluv/io";
|
|
52
|
+
import { z } from "zod";
|
|
53
|
+
|
|
54
|
+
const io = createIO({
|
|
55
|
+
// If using a function authorize parameter, `env` and `request` are now available as params
|
|
56
|
+
authorize: ({ env, request }) => ({
|
|
57
|
+
required: true,
|
|
58
|
+
secret: "MY-CUSTOM-SECRET",
|
|
59
|
+
user: z.object({
|
|
60
|
+
id: z.string(),
|
|
61
|
+
}),
|
|
62
|
+
}),
|
|
63
|
+
platformCloudflare(),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Before
|
|
67
|
+
io.createToken({
|
|
68
|
+
room: "my-custom-room",
|
|
69
|
+
user: { id: "abc123" },
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// After
|
|
73
|
+
io.createToken({
|
|
74
|
+
room: "my-custom-room",
|
|
75
|
+
user: { id: "abc123" },
|
|
76
|
+
|
|
77
|
+
// Previously not required, but now required
|
|
78
|
+
env: env as Env,
|
|
79
|
+
request: request as Request,
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [b3c31d7]
|
|
86
|
+
- @pluv/io@0.31.0
|
|
87
|
+
- @pluv/crdt@0.31.0
|
|
88
|
+
- @pluv/types@0.31.0
|
|
89
|
+
|
|
3
90
|
## 0.30.2
|
|
4
91
|
|
|
5
92
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ declare class PluvPlatform extends AbstractPlatform {
|
|
|
11
11
|
getSerializedState(webSocket: any): WebSocketSerializedState | null;
|
|
12
12
|
getSessionId(webSocket: any): string | null;
|
|
13
13
|
getWebSockets(): readonly any[];
|
|
14
|
-
initialize(config: AbstractPlatformConfig<{}
|
|
14
|
+
initialize(config: AbstractPlatformConfig<{}>): this;
|
|
15
15
|
parseData(data: string | ArrayBuffer): Record<string, any>;
|
|
16
16
|
randomUUID(): string;
|
|
17
17
|
setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class PluvPlatform extends AbstractPlatform {
|
|
|
11
11
|
getSerializedState(webSocket: any): WebSocketSerializedState | null;
|
|
12
12
|
getSessionId(webSocket: any): string | null;
|
|
13
13
|
getWebSockets(): readonly any[];
|
|
14
|
-
initialize(config: AbstractPlatformConfig<{}
|
|
14
|
+
initialize(config: AbstractPlatformConfig<{}>): this;
|
|
15
15
|
parseData(data: string | ArrayBuffer): Record<string, any>;
|
|
16
16
|
randomUUID(): string;
|
|
17
17
|
setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-pluv",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "@pluv/io adapter for pluv.io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"@types/node": "^22.7.4",
|
|
21
21
|
"hono": "^4.6.3",
|
|
22
22
|
"zod": "^3.23.8",
|
|
23
|
-
"@pluv/crdt": "^0.
|
|
24
|
-
"@pluv/io": "^0.
|
|
25
|
-
"@pluv/types": "^0.
|
|
23
|
+
"@pluv/crdt": "^0.31.0",
|
|
24
|
+
"@pluv/io": "^0.31.0",
|
|
25
|
+
"@pluv/types": "^0.31.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"eslint": "^8.57.0",
|
|
29
29
|
"tsup": "^8.3.0",
|
|
30
30
|
"typescript": "^5.6.2",
|
|
31
|
-
"@pluv/tsconfig": "^0.
|
|
32
|
-
"eslint-config-pluv": "^0.
|
|
31
|
+
"@pluv/tsconfig": "^0.31.0",
|
|
32
|
+
"eslint-config-pluv": "^0.31.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvPlatform.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class PluvPlatform extends AbstractPlatform {
|
|
|
34
34
|
throw new Error("Not implemented");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
public initialize(config: AbstractPlatformConfig<{}
|
|
37
|
+
public initialize(config: AbstractPlatformConfig<{}>): this {
|
|
38
38
|
throw new Error("Not implemented");
|
|
39
39
|
}
|
|
40
40
|
|