@pluv/platform-node 0.19.0 → 0.20.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 +7 -0
- package/README.md +0 -57
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-node@0.
|
|
2
|
+
> @pluv/platform-node@0.20.0 build /home/runner/work/pluv/pluv/packages/platform-node
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.ts
|
|
@@ -9,10 +9,10 @@ CLI Target: es6
|
|
|
9
9
|
ESM Build start
|
|
10
10
|
CJS Build start
|
|
11
11
|
ESM dist/index.mjs 6.12 KB
|
|
12
|
-
ESM ⚡️ Build success in
|
|
12
|
+
ESM ⚡️ Build success in 127ms
|
|
13
13
|
CJS dist/index.js 7.93 KB
|
|
14
|
-
CJS ⚡️ Build success in
|
|
14
|
+
CJS ⚡️ Build success in 128ms
|
|
15
15
|
DTS Build start
|
|
16
|
-
DTS ⚡️ Build success in
|
|
16
|
+
DTS ⚡️ Build success in 4198ms
|
|
17
17
|
DTS dist/index.d.mts 2.92 KB
|
|
18
18
|
DTS dist/index.d.ts 2.92 KB
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
> **Disclaimer:**
|
|
2
|
-
> This package is currently in preview and may have breaking changes between versions. Please wait for a `v1.0.0` stable release before using this in production.
|
|
3
|
-
|
|
4
|
-
<h1 align="center">
|
|
5
|
-
<br />
|
|
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
|
-
<br />
|
|
8
|
-
<a href="https://pluv.io/docs/introduction">Pluv.IO (preview)</a>
|
|
9
|
-
<br />
|
|
10
|
-
</h1>
|
|
11
|
-
|
|
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> 💕 <a href="https://docs.yjs.dev/">yjs</a> 💕 and <a href="https://developers.cloudflare.com/">Cloudflare</a> 💕 </h4>
|
|
14
|
-
|
|
15
|
-
<p align="center">
|
|
16
|
-
<a href="https://www.npmjs.com/package/@pluv/platform-node">
|
|
17
|
-
<img src="https://img.shields.io/npm/v/@pluv/platform-node" alt="npm @pluv/platform-node" />
|
|
18
|
-
</a>
|
|
19
|
-
<a href="https://github.com/pluv-io/pluv/blob/master/LICENSE">
|
|
20
|
-
<img alt="GitHub" src="https://img.shields.io/github/license/pluv-io/pluv" alt="License MIT" />
|
|
21
|
-
</a>
|
|
22
|
-
<a href="https://commitizen.github.io/cz-cli/">
|
|
23
|
-
<img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" />
|
|
24
|
-
</a>
|
|
25
|
-
<img src="https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555" alt="TypeScript" />
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
1
|
## `@pluv/platform-node`
|
|
29
2
|
|
|
30
3
|
> Enables [@pluv/io](https://www.npmjs.com/package/@pluv/io) to run on [Node.js](https://nodejs.org/).
|
|
@@ -43,33 +16,3 @@ yarn add @pluv/platform-node ws @types/ws
|
|
|
43
16
|
# pnpm
|
|
44
17
|
pnpm add @pluv/platform-node ws @types/ws
|
|
45
18
|
```
|
|
46
|
-
|
|
47
|
-
## Basic Example
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
import { createIO } from "@pluv/io";
|
|
51
|
-
import { platformNode } from "@pluv/platform-node";
|
|
52
|
-
import Http from "http";
|
|
53
|
-
import WebSocket from "ws";
|
|
54
|
-
|
|
55
|
-
export const io = createIO({ platform: platformNode() });
|
|
56
|
-
export const ioServer = io.server();
|
|
57
|
-
|
|
58
|
-
const server = Http.createServer();
|
|
59
|
-
const wsServer = new WebSocket.Server({ server });
|
|
60
|
-
|
|
61
|
-
const parseRoomId = (url: string): string => {
|
|
62
|
-
/* get room from req.url */
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
wsServer.on("connection", async (ws, req) => {
|
|
66
|
-
const roomId = parseRoomId(req.url);
|
|
67
|
-
const room = ioServer.getRoom(roomId);
|
|
68
|
-
|
|
69
|
-
await room.register(ws);
|
|
70
|
-
});
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Reference
|
|
74
|
-
|
|
75
|
-
Check us out on [GitHub](https://github.com/pluv-io/pluv) for more information on how to use `@pluv/io`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "@pluv/io adapter for node.js",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"@types/node": "^20.14.9",
|
|
21
21
|
"@types/ws": "^8.5.10",
|
|
22
22
|
"path-to-regexp": "^7.0.0",
|
|
23
|
-
"@pluv/io": "^0.
|
|
24
|
-
"@pluv/types": "^0.
|
|
23
|
+
"@pluv/io": "^0.20.0",
|
|
24
|
+
"@pluv/types": "^0.20.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"eslint": "^8.57.0",
|
|
28
28
|
"tsup": "^8.1.0",
|
|
29
29
|
"typescript": "^5.4.5",
|
|
30
|
-
"ws": "^8.
|
|
31
|
-
"@pluv/tsconfig": "^0.
|
|
32
|
-
"eslint-config-pluv": "^0.
|
|
30
|
+
"ws": "^8.18.0",
|
|
31
|
+
"@pluv/tsconfig": "^0.20.0",
|
|
32
|
+
"eslint-config-pluv": "^0.20.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"ws": "^8.0.0"
|