@pluv/platform-node 0.24.1 → 0.25.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/platform-node@0.24.1 build /home/runner/work/pluv/pluv/packages/platform-node
2
+ > @pluv/platform-node@0.25.1 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
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 8.05 KB
12
- ESM ⚡️ Build success in 108ms
13
- CJS dist/index.js 9.83 KB
14
- CJS ⚡️ Build success in 109ms
11
+ CJS dist/index.js 9.84 KB
12
+ CJS ⚡️ Build success in 95ms
13
+ ESM dist/index.mjs 8.07 KB
14
+ ESM ⚡️ Build success in 95ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4092ms
16
+ DTS ⚡️ Build success in 3838ms
17
17
  DTS dist/index.d.mts 3.60 KB
18
18
  DTS dist/index.d.ts 3.60 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,55 @@
1
1
  # @pluv/platform-node
2
2
 
3
+ ## 0.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [3925f7c]
8
+ - @pluv/io@0.25.1
9
+ - @pluv/types@0.25.1
10
+
11
+ ## 0.25.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 9db06ba: **BREAKING **
16
+
17
+ Fixed typos `persistance` to `persistence`.
18
+
19
+ This does mean that all properties referencing `persistance` will need to be fixed. Examples below:
20
+
21
+ ```bash
22
+ # Re-install @pluv/persistence-redis
23
+ pnpm uninstall @pluv/persistance-redis
24
+ pnpm install @pluv/persistence-redis
25
+ ```
26
+
27
+ ```ts
28
+ // Before
29
+ createIO({
30
+ platform: platformNode({
31
+ persistance: new PersistanceRedis(/* ... */),
32
+ }),
33
+ });
34
+
35
+ // After
36
+ createIO({
37
+ platform: platformNode({
38
+ persistence: new PersistenceRedis(/* ... */),
39
+ }),
40
+ });
41
+ ```
42
+
43
+ `@pluv/persistance-redis` has been deprecated for `@pluv/persistence-redis`.
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [4e078ca]
48
+ - Updated dependencies [f556d30]
49
+ - Updated dependencies [9db06ba]
50
+ - @pluv/io@0.25.0
51
+ - @pluv/types@0.25.0
52
+
3
53
  ## 0.24.1
4
54
 
5
55
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistance, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer } from '@pluv/io';
1
+ import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer } from '@pluv/io';
2
2
  import { JsonObject, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
3
3
  import { IncomingMessage, ServerResponse, Server } from 'node:http';
4
4
  import { WebSocket, Server as Server$1 } from 'ws';
@@ -23,10 +23,10 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
23
23
  type NodePlatformConfig = {
24
24
  mode?: WebSocketRegistrationMode;
25
25
  } & ({
26
- persistance?: undefined;
26
+ persistence?: undefined;
27
27
  pubSub?: undefined;
28
28
  } | {
29
- persistance: AbstractPersistance;
29
+ persistence: AbstractPersistence;
30
30
  pubSub: AbstractPubSub;
31
31
  });
32
32
  declare class NodePlatform extends AbstractPlatform<NodeWebSocket> {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistance, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer } from '@pluv/io';
1
+ import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer } from '@pluv/io';
2
2
  import { JsonObject, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
3
3
  import { IncomingMessage, ServerResponse, Server } from 'node:http';
4
4
  import { WebSocket, Server as Server$1 } from 'ws';
@@ -23,10 +23,10 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
23
23
  type NodePlatformConfig = {
24
24
  mode?: WebSocketRegistrationMode;
25
25
  } & ({
26
- persistance?: undefined;
26
+ persistence?: undefined;
27
27
  pubSub?: undefined;
28
28
  } | {
29
- persistance: AbstractPersistance;
29
+ persistence: AbstractPersistence;
30
30
  pubSub: AbstractPubSub;
31
31
  });
32
32
  declare class NodePlatform extends AbstractPlatform<NodeWebSocket> {
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ var handle = (ws) => ({
89
89
  });
90
90
  var createPluvHandler = (config) => {
91
91
  const { authorize, endpoint = "/api/pluv", io, server } = config;
92
- if (io._registrationMode === "detached") {
92
+ if (io._defs.platform._registrationMode === "detached") {
93
93
  throw new Error("Cannot use createPluvHandler in detached mode for Node.js");
94
94
  }
95
95
  const wsServer = new import_ws.Server({ server });
@@ -246,8 +246,8 @@ var NodeWebSocket = class extends import_io.AbstractWebSocket {
246
246
  // src/NodePlatform.ts
247
247
  var NodePlatform = class _NodePlatform extends import_io2.AbstractPlatform {
248
248
  constructor(config = {}) {
249
- const { mode = "attached", persistance, pubSub } = config;
250
- super(persistance && pubSub ? { persistance, pubSub } : {});
249
+ const { mode = "attached", persistence, pubSub } = config;
250
+ super(persistence && pubSub ? { persistence, pubSub } : {});
251
251
  this._registrationMode = mode;
252
252
  }
253
253
  acceptWebSocket(webSocket) {
@@ -255,7 +255,7 @@ var NodePlatform = class _NodePlatform extends import_io2.AbstractPlatform {
255
255
  }
256
256
  convertWebSocket(webSocket, config) {
257
257
  const { room } = config;
258
- return new NodeWebSocket(webSocket, { persistance: this.persistance, room });
258
+ return new NodeWebSocket(webSocket, { persistence: this.persistence, room });
259
259
  }
260
260
  getLastPing(webSocket) {
261
261
  return null;
@@ -272,7 +272,7 @@ var NodePlatform = class _NodePlatform extends import_io2.AbstractPlatform {
272
272
  initialize(config) {
273
273
  return new _NodePlatform(__spreadValues({
274
274
  mode: this._registrationMode,
275
- persistance: this.persistance,
275
+ persistence: this.persistence,
276
276
  pubSub: this.pubSub
277
277
  }, config))._initialize();
278
278
  }
package/dist/index.mjs CHANGED
@@ -55,7 +55,7 @@ var handle = (ws) => ({
55
55
  });
56
56
  var createPluvHandler = (config) => {
57
57
  const { authorize, endpoint = "/api/pluv", io, server } = config;
58
- if (io._registrationMode === "detached") {
58
+ if (io._defs.platform._registrationMode === "detached") {
59
59
  throw new Error("Cannot use createPluvHandler in detached mode for Node.js");
60
60
  }
61
61
  const wsServer = new WsServer({ server });
@@ -212,8 +212,8 @@ var NodeWebSocket = class extends AbstractWebSocket {
212
212
  // src/NodePlatform.ts
213
213
  var NodePlatform = class _NodePlatform extends AbstractPlatform {
214
214
  constructor(config = {}) {
215
- const { mode = "attached", persistance, pubSub } = config;
216
- super(persistance && pubSub ? { persistance, pubSub } : {});
215
+ const { mode = "attached", persistence, pubSub } = config;
216
+ super(persistence && pubSub ? { persistence, pubSub } : {});
217
217
  this._registrationMode = mode;
218
218
  }
219
219
  acceptWebSocket(webSocket) {
@@ -221,7 +221,7 @@ var NodePlatform = class _NodePlatform extends AbstractPlatform {
221
221
  }
222
222
  convertWebSocket(webSocket, config) {
223
223
  const { room } = config;
224
- return new NodeWebSocket(webSocket, { persistance: this.persistance, room });
224
+ return new NodeWebSocket(webSocket, { persistence: this.persistence, room });
225
225
  }
226
226
  getLastPing(webSocket) {
227
227
  return null;
@@ -238,7 +238,7 @@ var NodePlatform = class _NodePlatform extends AbstractPlatform {
238
238
  initialize(config) {
239
239
  return new _NodePlatform(__spreadValues({
240
240
  mode: this._registrationMode,
241
- persistance: this.persistance,
241
+ persistence: this.persistence,
242
242
  pubSub: this.pubSub
243
243
  }, config))._initialize();
244
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-node",
3
- "version": "0.24.1",
3
+ "version": "0.25.1",
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": "^22.5.0",
21
21
  "@types/ws": "^8.5.12",
22
22
  "path-to-regexp": "^7.1.0",
23
- "@pluv/io": "^0.24.1",
24
- "@pluv/types": "^0.24.1"
23
+ "@pluv/io": "^0.25.1",
24
+ "@pluv/types": "^0.25.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "^8.57.0",
28
28
  "tsup": "^8.2.4",
29
29
  "typescript": "^5.5.4",
30
30
  "ws": "^8.18.0",
31
- "@pluv/tsconfig": "^0.24.1",
32
- "eslint-config-pluv": "^0.24.1"
31
+ "@pluv/tsconfig": "^0.25.1",
32
+ "eslint-config-pluv": "^0.25.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "ws": "^8.0.0"
@@ -1,5 +1,5 @@
1
1
  import type {
2
- AbstractPersistance,
2
+ AbstractPersistence,
3
3
  AbstractPlatformConfig,
4
4
  AbstractPubSub,
5
5
  ConvertWebSocketConfig,
@@ -13,17 +13,17 @@ import type { WebSocket } from "ws";
13
13
  import { NodeWebSocket } from "./NodeWebSocket";
14
14
 
15
15
  export type NodePlatformConfig = { mode?: WebSocketRegistrationMode } & (
16
- | { persistance?: undefined; pubSub?: undefined }
17
- | { persistance: AbstractPersistance; pubSub: AbstractPubSub }
16
+ | { persistence?: undefined; pubSub?: undefined }
17
+ | { persistence: AbstractPersistence; pubSub: AbstractPubSub }
18
18
  );
19
19
 
20
20
  export class NodePlatform extends AbstractPlatform<NodeWebSocket> {
21
21
  readonly _registrationMode: WebSocketRegistrationMode;
22
22
 
23
23
  constructor(config: NodePlatformConfig = {}) {
24
- const { mode = "attached", persistance, pubSub } = config;
24
+ const { mode = "attached", persistence, pubSub } = config;
25
25
 
26
- super(persistance && pubSub ? { persistance, pubSub } : {});
26
+ super(persistence && pubSub ? { persistence, pubSub } : {});
27
27
 
28
28
  this._registrationMode = mode;
29
29
  }
@@ -35,7 +35,7 @@ export class NodePlatform extends AbstractPlatform<NodeWebSocket> {
35
35
  public convertWebSocket(webSocket: WebSocket, config: ConvertWebSocketConfig): NodeWebSocket {
36
36
  const { room } = config;
37
37
 
38
- return new NodeWebSocket(webSocket, { persistance: this.persistance, room });
38
+ return new NodeWebSocket(webSocket, { persistence: this.persistence, room });
39
39
  }
40
40
 
41
41
  public getLastPing(webSocket: NodeWebSocket): number | null {
@@ -57,7 +57,7 @@ export class NodePlatform extends AbstractPlatform<NodeWebSocket> {
57
57
  public initialize(config: AbstractPlatformConfig<{}, {}>): this {
58
58
  return new NodePlatform({
59
59
  mode: this._registrationMode,
60
- persistance: this.persistance,
60
+ persistence: this.persistence,
61
61
  pubSub: this.pubSub,
62
62
  ...config,
63
63
  } as NodePlatformConfig)._initialize() as this;
@@ -67,7 +67,7 @@ export const createPluvHandler = <TPluvServer extends PluvServer<NodePlatform, a
67
67
  ): CreatePluvHandlerResult => {
68
68
  const { authorize, endpoint = "/api/pluv", io, server } = config;
69
69
 
70
- if (io._registrationMode === "detached") {
70
+ if (io._defs.platform._registrationMode === "detached") {
71
71
  throw new Error("Cannot use createPluvHandler in detached mode for Node.js");
72
72
  }
73
73