@pluv/client 0.40.0 → 0.40.2

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/client@0.40.0 build /home/runner/work/pluv/pluv/packages/client
2
+ > @pluv/client@0.40.2 build /home/runner/work/pluv/pluv/packages/client
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 49.44 KB
12
- ESM ⚡️ Build success in 141ms
13
- CJS dist/index.js 50.76 KB
14
- CJS ⚡️ Build success in 142ms
11
+ CJS dist/index.js 50.77 KB
12
+ CJS ⚡️ Build success in 96ms
13
+ ESM dist/index.mjs 49.45 KB
14
+ ESM ⚡️ Build success in 99ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3317ms
16
+ DTS ⚡️ Build success in 3346ms
17
17
  DTS dist/index.d.mts 24.50 KB
18
18
  DTS dist/index.d.ts 24.50 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @pluv/client
2
2
 
3
+ ## 0.40.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 6fbc2fe: Update `PluvClient.createRoom` so that the 2nd parameter is optional.
8
+ - @pluv/crdt@0.40.2
9
+ - @pluv/types@0.40.2
10
+
11
+ ## 0.40.1
12
+
13
+ ### Patch Changes
14
+
15
+ - @pluv/crdt@0.40.1
16
+ - @pluv/types@0.40.1
17
+
3
18
  ## 0.40.0
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -263,7 +263,7 @@ declare class PluvClient<TIO extends IOLike<any, any>, TPresence extends JsonObj
263
263
  };
264
264
  get procedure(): PluvProcedure<TIO, {}, {}, TPresence, TStorage>;
265
265
  constructor(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>);
266
- createRoom: <TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}>(room: string, options: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents>) => PluvRoom<TIO, TMetadata, TPresence, TStorage, TEvents>;
266
+ createRoom: <TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}>(room: string, options?: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents>) => PluvRoom<TIO, TMetadata, TPresence, TStorage, TEvents>;
267
267
  enter: (room: string | PluvRoom<TIO, TMetadata, any, any, any>, ...args: EnterRoomParams<TMetadata>) => Promise<PluvRoom<TIO, TMetadata, TPresence, TStorage, any>>;
268
268
  getRoom: (room: string) => PluvRoom<TIO, TMetadata, TPresence, TStorage, any> | null;
269
269
  getRooms: () => readonly PluvRoom<TIO, TMetadata, TPresence, TStorage, any>[];
package/dist/index.d.ts CHANGED
@@ -263,7 +263,7 @@ declare class PluvClient<TIO extends IOLike<any, any>, TPresence extends JsonObj
263
263
  };
264
264
  get procedure(): PluvProcedure<TIO, {}, {}, TPresence, TStorage>;
265
265
  constructor(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>);
266
- createRoom: <TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}>(room: string, options: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents>) => PluvRoom<TIO, TMetadata, TPresence, TStorage, TEvents>;
266
+ createRoom: <TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}>(room: string, options?: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents>) => PluvRoom<TIO, TMetadata, TPresence, TStorage, TEvents>;
267
267
  enter: (room: string | PluvRoom<TIO, TMetadata, any, any, any>, ...args: EnterRoomParams<TMetadata>) => Promise<PluvRoom<TIO, TMetadata, TPresence, TStorage, any>>;
268
268
  getRoom: (room: string) => PluvRoom<TIO, TMetadata, TPresence, TStorage, any> | null;
269
269
  getRooms: () => readonly PluvRoom<TIO, TMetadata, TPresence, TStorage, any>[];
package/dist/index.js CHANGED
@@ -1226,7 +1226,7 @@ var PluvClient = class {
1226
1226
  constructor(options) {
1227
1227
  this._publicKey = null;
1228
1228
  this._rooms = /* @__PURE__ */ new Map();
1229
- this.createRoom = (room, options) => {
1229
+ this.createRoom = (room, options = {}) => {
1230
1230
  var _a;
1231
1231
  const oldRoom = this.getRoom(room);
1232
1232
  if (oldRoom) return oldRoom;
@@ -1297,7 +1297,7 @@ var PluvClient = class {
1297
1297
  _logDebug(...data) {
1298
1298
  var _a;
1299
1299
  if (((_a = process == null ? void 0 : process.env) == null ? void 0 : _a.NODE_ENV) === "production") return;
1300
- this._debug && console.log(...data);
1300
+ if (this._debug) console.log(...data);
1301
1301
  }
1302
1302
  };
1303
1303
 
package/dist/index.mjs CHANGED
@@ -1195,7 +1195,7 @@ var PluvClient = class {
1195
1195
  constructor(options) {
1196
1196
  this._publicKey = null;
1197
1197
  this._rooms = /* @__PURE__ */ new Map();
1198
- this.createRoom = (room, options) => {
1198
+ this.createRoom = (room, options = {}) => {
1199
1199
  var _a;
1200
1200
  const oldRoom = this.getRoom(room);
1201
1201
  if (oldRoom) return oldRoom;
@@ -1266,7 +1266,7 @@ var PluvClient = class {
1266
1266
  _logDebug(...data) {
1267
1267
  var _a;
1268
1268
  if (((_a = process == null ? void 0 : process.env) == null ? void 0 : _a.NODE_ENV) === "production") return;
1269
- this._debug && console.log(...data);
1269
+ if (this._debug) console.log(...data);
1270
1270
  }
1271
1271
  };
1272
1272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/client",
3
- "version": "0.40.0",
3
+ "version": "0.40.2",
4
4
  "description": "@pluv/io frontend client",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "wonka": "^6.3.5",
21
- "@pluv/crdt": "^0.40.0",
22
- "@pluv/types": "^0.40.0"
21
+ "@pluv/crdt": "^0.40.2",
22
+ "@pluv/types": "^0.40.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "eslint": "^9.24.0",
26
26
  "tsup": "^8.4.0",
27
27
  "typescript": "^5.8.3",
28
- "@pluv/tsconfig": "^0.40.0",
29
- "eslint-config-pluv": "^0.40.0"
28
+ "@pluv/tsconfig": "^0.40.2",
29
+ "eslint-config-pluv": "^0.40.2"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/PluvClient.ts CHANGED
@@ -92,7 +92,7 @@ export class PluvClient<
92
92
 
93
93
  public createRoom = <TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}>(
94
94
  room: string,
95
- options: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents>,
95
+ options: CreateRoomOptions<TIO, TPresence, TStorage, TMetadata, TEvents> = {},
96
96
  ): PluvRoom<TIO, TMetadata, TPresence, TStorage, TEvents> => {
97
97
  const oldRoom = this.getRoom(room);
98
98
 
@@ -171,9 +171,8 @@ export class PluvClient<
171
171
  }
172
172
 
173
173
  private _logDebug(...data: any[]): void {
174
- // eslint-disable-next-line turbo/no-undeclared-env-vars
175
174
  if (process?.env?.NODE_ENV === "production") return;
176
175
 
177
- this._debug && console.log(...data);
176
+ if (this._debug) console.log(...data);
178
177
  }
179
178
  }