@pluv/platform-node 3.0.0 → 3.1.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 +6 -6
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/package.json +6 -5
- package/src/platformNode.ts +12 -10
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-node@3.
|
|
2
|
+
> @pluv/platform-node@3.1.1 build /home/runner/work/pluv/pluv/packages/platform-node
|
|
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[32m5.92 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 140ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m7.57 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 142ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5085ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.22 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.22 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @pluv/platform-node
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7b719bf]
|
|
8
|
+
- @pluv/io@3.1.1
|
|
9
|
+
- @pluv/crdt@3.1.1
|
|
10
|
+
- @pluv/types@3.1.1
|
|
11
|
+
|
|
12
|
+
## 3.1.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [a40f4dc]
|
|
17
|
+
- @pluv/io@3.1.0
|
|
18
|
+
- @pluv/crdt@3.1.0
|
|
19
|
+
- @pluv/types@3.1.0
|
|
20
|
+
|
|
3
21
|
## 3.0.0
|
|
4
22
|
|
|
5
23
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ export { WebSocket } from 'ws';
|
|
|
3
3
|
import { Json, IOAuthorize, JsonObject, InferIOAuthorizeUser, BaseUser, Id } from '@pluv/types';
|
|
4
4
|
import { AbstractWebSocket, WebSocketSession, WebSocketSerializedState, AbstractWebSocketConfig, AbstractEventMap, AbstractListener, AbstractPlatform, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, ConvertWebSocketConfig, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
+
import { CrdtLibraryType, NoopCrdtDocFactory } from '@pluv/crdt';
|
|
6
7
|
|
|
7
8
|
declare const identity: <T extends unknown>(x: T) => T;
|
|
8
9
|
|
|
@@ -95,11 +96,11 @@ declare class NodePlatform<TAuthorize extends IOAuthorize<any, any> | null = nul
|
|
|
95
96
|
setSerializedState(webSocket: NodeWebSocket<TAuthorize>, state: WebSocketSerializedState): WebSocketSerializedState;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>, "authorize" | "context" | "platform"> & {
|
|
99
|
+
type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>, "authorize" | "context" | "platform"> & {
|
|
99
100
|
authorize?: PluvIOAuthorize<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TUser, InferInitContextType<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>>>;
|
|
100
101
|
context?: PluvContext<NodePlatform<IOAuthorize<TUser, any>, TMeta>, TContext>;
|
|
101
102
|
types?: InferCallback<TMeta>;
|
|
102
103
|
}>;
|
|
103
|
-
declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>;
|
|
104
|
+
declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>;
|
|
104
105
|
|
|
105
106
|
export { type InferCallback, NodePlatform, type NodePlatformConfig, type PlatformNodeCreateIOParams, infer, platformNode };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { WebSocket } from 'ws';
|
|
|
3
3
|
import { Json, IOAuthorize, JsonObject, InferIOAuthorizeUser, BaseUser, Id } from '@pluv/types';
|
|
4
4
|
import { AbstractWebSocket, WebSocketSession, WebSocketSerializedState, AbstractWebSocketConfig, AbstractEventMap, AbstractListener, AbstractPlatform, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, ConvertWebSocketConfig, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
+
import { CrdtLibraryType, NoopCrdtDocFactory } from '@pluv/crdt';
|
|
6
7
|
|
|
7
8
|
declare const identity: <T extends unknown>(x: T) => T;
|
|
8
9
|
|
|
@@ -95,11 +96,11 @@ declare class NodePlatform<TAuthorize extends IOAuthorize<any, any> | null = nul
|
|
|
95
96
|
setSerializedState(webSocket: NodeWebSocket<TAuthorize>, state: WebSocketSerializedState): WebSocketSerializedState;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>, "authorize" | "context" | "platform"> & {
|
|
99
|
+
type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>, "authorize" | "context" | "platform"> & {
|
|
99
100
|
authorize?: PluvIOAuthorize<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TUser, InferInitContextType<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>>>;
|
|
100
101
|
context?: PluvContext<NodePlatform<IOAuthorize<TUser, any>, TMeta>, TContext>;
|
|
101
102
|
types?: InferCallback<TMeta>;
|
|
102
103
|
}>;
|
|
103
|
-
declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>;
|
|
104
|
+
declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>;
|
|
104
105
|
|
|
105
106
|
export { type InferCallback, NodePlatform, type NodePlatformConfig, type PlatformNodeCreateIOParams, infer, platformNode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-node",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "@pluv/io adapter for node.js",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,16 +20,17 @@
|
|
|
20
20
|
"@types/node": "^22.15.21",
|
|
21
21
|
"@types/ws": "^8.18.1",
|
|
22
22
|
"path-to-regexp": "^8.2.0",
|
|
23
|
-
"@pluv/
|
|
24
|
-
"@pluv/
|
|
23
|
+
"@pluv/crdt": "^3.1.1",
|
|
24
|
+
"@pluv/io": "^3.1.1",
|
|
25
|
+
"@pluv/types": "^3.1.1"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"eslint": "^9.27.0",
|
|
28
29
|
"tsup": "^8.5.0",
|
|
29
30
|
"typescript": "^5.8.3",
|
|
30
31
|
"ws": "^8.18.2",
|
|
31
|
-
"@pluv/tsconfig": "^3.
|
|
32
|
-
"eslint-config-pluv": "^3.
|
|
32
|
+
"@pluv/tsconfig": "^3.1.1",
|
|
33
|
+
"eslint-config-pluv": "^3.1.1"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"ws": "^8.0.0"
|
package/src/platformNode.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
InferInitContextType,
|
|
4
|
-
PluvContext,
|
|
5
|
-
PluvIOAuthorize,
|
|
6
|
-
PluvIOLimits,
|
|
7
|
-
} from "@pluv/io";
|
|
1
|
+
import type { CrdtLibraryType, NoopCrdtDocFactory } from "@pluv/crdt";
|
|
2
|
+
import type { CreateIOParams, InferInitContextType, PluvContext, PluvIOAuthorize } from "@pluv/io";
|
|
8
3
|
import type { BaseUser, Id, IOAuthorize, Json } from "@pluv/types";
|
|
9
4
|
import type { NodePlatformConfig } from "./NodePlatform";
|
|
10
5
|
import { NodePlatform } from "./NodePlatform";
|
|
@@ -14,10 +9,16 @@ export type PlatformNodeCreateIOParams<
|
|
|
14
9
|
TMeta extends Record<string, Json> = {},
|
|
15
10
|
TContext extends Record<string, any> = {},
|
|
16
11
|
TUser extends BaseUser | null = null,
|
|
12
|
+
TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>,
|
|
17
13
|
> = Id<
|
|
18
14
|
NodePlatformConfig<TMeta> &
|
|
19
15
|
Omit<
|
|
20
|
-
CreateIOParams<
|
|
16
|
+
CreateIOParams<
|
|
17
|
+
NodePlatform<IOAuthorize<TUser, TContext>, TMeta>,
|
|
18
|
+
TContext,
|
|
19
|
+
TUser,
|
|
20
|
+
TCrdt
|
|
21
|
+
>,
|
|
21
22
|
"authorize" | "context" | "platform"
|
|
22
23
|
> & {
|
|
23
24
|
authorize?: PluvIOAuthorize<
|
|
@@ -34,9 +35,10 @@ export const platformNode = <
|
|
|
34
35
|
TMeta extends Record<string, Json> = {},
|
|
35
36
|
TContext extends Record<string, any> = {},
|
|
36
37
|
TUser extends BaseUser | null = null,
|
|
38
|
+
TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>,
|
|
37
39
|
>(
|
|
38
|
-
config: PlatformNodeCreateIOParams<TMeta, TContext, TUser> = {},
|
|
39
|
-
): CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser> => {
|
|
40
|
+
config: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt> = {},
|
|
41
|
+
): CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt> => {
|
|
40
42
|
const { authorize, context, crdt, debug, limits } = config;
|
|
41
43
|
|
|
42
44
|
return {
|