@pluv/platform-cloudflare 0.15.0 → 0.16.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 +5 -5
- package/CHANGELOG.md +8 -0
- package/README.md +3 -7
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +8 -8
- package/src/createPluvHandler.ts +12 -11
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-cloudflare@0.
|
|
2
|
+
> @pluv/platform-cloudflare@0.16.0 build /home/runner/work/pluv/pluv/packages/platform-cloudflare
|
|
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 v8.0.
|
|
7
|
+
[34mCLI[39m tsup v8.0.2
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mCJS[39m [1mdist/index.js [22m[32m6.93 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 107ms
|
|
13
13
|
[32mESM[39m [1mdist/index.mjs [22m[32m5.80 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 107ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3453ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m2.94 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.94 KB[39m
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<br />
|
|
6
6
|
<img src="https://github.com/pluv-io/pluv/blob/master/assets/pluv-icon-192x192.png?raw=true" alt="Pluv.IO" width="180" style="border-radius:16px" />
|
|
7
7
|
<br />
|
|
8
|
-
Pluv.IO (preview)
|
|
8
|
+
<a href="https://pluv.io/docs/introduction">Pluv.IO (preview)</a>
|
|
9
9
|
<br />
|
|
10
10
|
</h1>
|
|
11
11
|
|
|
12
12
|
<h3 align="center">Multi-platform, E2E type-safe realtime packages</h3>
|
|
13
|
-
<h4 align="center">💕 Inspired by <a href="https://trpc.io">trpc</a> 💕
|
|
13
|
+
<h4 align="center">💕 Inspired by <a href="https://trpc.io">trpc</a> 💕 <a href="https://docs.yjs.dev/">yjs</a> 💕 and <a href="https://developers.cloudflare.com/">Cloudflare</a> 💕 </h4>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<a href="https://www.npmjs.com/package/@pluv/platform-cloudflare">
|
|
@@ -19,14 +19,10 @@
|
|
|
19
19
|
<a href="https://github.com/pluv-io/pluv/blob/master/LICENSE">
|
|
20
20
|
<img alt="GitHub" src="https://img.shields.io/github/license/pluv-io/pluv" alt="License MIT" />
|
|
21
21
|
</a>
|
|
22
|
-
<img src="https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555" alt="TypeScript" />
|
|
23
22
|
<a href="https://commitizen.github.io/cz-cli/">
|
|
24
23
|
<img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" />
|
|
25
24
|
</a>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<p align="center">
|
|
29
|
-
<img src="https://github.com/pluv-io/pluv/blob/master/assets/demo-events.gif?raw=true" alt="Demo" />
|
|
25
|
+
<img src="https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555" alt="TypeScript" />
|
|
30
26
|
</p>
|
|
31
27
|
|
|
32
28
|
## `@pluv/platform-cloudflare`
|
package/dist/index.js
CHANGED
|
@@ -165,14 +165,14 @@ var import_io2 = require("@pluv/io");
|
|
|
165
165
|
// src/CloudflareWebSocket.ts
|
|
166
166
|
var import_io = require("@pluv/io");
|
|
167
167
|
var CloudflareWebSocket = class extends import_io.AbstractWebSocket {
|
|
168
|
+
get readyState() {
|
|
169
|
+
return this.webSocket.readyState;
|
|
170
|
+
}
|
|
168
171
|
constructor(webSocket, config) {
|
|
169
172
|
const { room, sessionId, userId } = config;
|
|
170
173
|
super({ room, sessionId, userId });
|
|
171
174
|
this.webSocket = webSocket;
|
|
172
175
|
}
|
|
173
|
-
get readyState() {
|
|
174
|
-
return this.webSocket.readyState;
|
|
175
|
-
}
|
|
176
176
|
addEventListener(type, handler) {
|
|
177
177
|
this.webSocket.addEventListener(type, handler);
|
|
178
178
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -141,14 +141,14 @@ import {
|
|
|
141
141
|
AbstractWebSocket
|
|
142
142
|
} from "@pluv/io";
|
|
143
143
|
var CloudflareWebSocket = class extends AbstractWebSocket {
|
|
144
|
+
get readyState() {
|
|
145
|
+
return this.webSocket.readyState;
|
|
146
|
+
}
|
|
144
147
|
constructor(webSocket, config) {
|
|
145
148
|
const { room, sessionId, userId } = config;
|
|
146
149
|
super({ room, sessionId, userId });
|
|
147
150
|
this.webSocket = webSocket;
|
|
148
151
|
}
|
|
149
|
-
get readyState() {
|
|
150
|
-
return this.webSocket.readyState;
|
|
151
|
-
}
|
|
152
152
|
addEventListener(type, handler) {
|
|
153
153
|
this.webSocket.addEventListener(type, handler);
|
|
154
154
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-cloudflare",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "@pluv/io adapter for cloudflare workers",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"path-to-regexp": "^6.2.1",
|
|
21
|
-
"@pluv/io": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/io": "^0.16.0",
|
|
22
|
+
"@pluv/types": "^0.16.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@cloudflare/workers-types": "^4.
|
|
25
|
+
"@cloudflare/workers-types": "^4.20240208.0",
|
|
26
26
|
"eslint": "^8.56.0",
|
|
27
|
-
"tsup": "^8.0.
|
|
28
|
-
"typescript": "^5.
|
|
29
|
-
"@pluv/tsconfig": "^0.
|
|
30
|
-
"eslint-config-pluv": "^0.
|
|
27
|
+
"tsup": "^8.0.2",
|
|
28
|
+
"typescript": "^5.3.3",
|
|
29
|
+
"@pluv/tsconfig": "^0.16.0",
|
|
30
|
+
"eslint-config-pluv": "^0.16.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/createPluvHandler.ts
CHANGED
|
@@ -51,17 +51,18 @@ export interface CreatePluvHandlerResult<
|
|
|
51
51
|
|
|
52
52
|
type InferCloudflarePluvHandlerEnv<
|
|
53
53
|
TPluv extends PluvIO<CloudflarePlatform, any, any, any, any, any, any>,
|
|
54
|
-
> =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
> =
|
|
55
|
+
TPluv extends PluvIO<
|
|
56
|
+
CloudflarePlatform<infer IEnv>,
|
|
57
|
+
any,
|
|
58
|
+
any,
|
|
59
|
+
any,
|
|
60
|
+
any,
|
|
61
|
+
any,
|
|
62
|
+
any
|
|
63
|
+
>
|
|
64
|
+
? IEnv
|
|
65
|
+
: {};
|
|
65
66
|
|
|
66
67
|
export const createPluvHandler = <
|
|
67
68
|
TPluv extends PluvIO<CloudflarePlatform, any, any, any, any, any, any>,
|