@pluv/io 0.35.3 → 0.36.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.
@@ -1,22 +1,22 @@
1
1
 
2
- > @pluv/io@0.35.3 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@0.36.0 build /home/runner/work/pluv/pluv/packages/io
3
3
  > pnpm run version && tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
 
6
- > @pluv/io@0.35.3 version /home/runner/work/pluv/pluv/packages/io
6
+ > @pluv/io@0.36.0 version /home/runner/work/pluv/pluv/packages/io
7
7
  > genversion ./src/version.generated.ts --esm
8
8
 
9
9
  CLI Building entry: src/index.ts
10
10
  CLI Using tsconfig: tsconfig.json
11
- CLI tsup v8.3.6
11
+ CLI tsup v8.4.0
12
12
  CLI Target: es6
13
13
  ESM Build start
14
14
  CJS Build start
15
- CJS dist/index.js 45.71 KB
16
- CJS ⚡️ Build success in 151ms
17
- ESM dist/index.mjs 43.53 KB
18
- ESM ⚡️ Build success in 151ms
15
+ ESM dist/index.mjs 43.58 KB
16
+ ESM ⚡️ Build success in 124ms
17
+ CJS dist/index.js 45.75 KB
18
+ CJS ⚡️ Build success in 124ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 2696ms
21
- DTS dist/index.d.mts 29.63 KB
22
- DTS dist/index.d.ts 29.63 KB
20
+ DTS ⚡️ Build success in 2384ms
21
+ DTS dist/index.d.mts 29.65 KB
22
+ DTS dist/index.d.ts 29.65 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 0.36.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@0.36.0
8
+ - @pluv/types@0.36.0
9
+
10
+ ## 0.35.4
11
+
12
+ ### Patch Changes
13
+
14
+ - 5d3a56f: Fix error emitted about `platformCloudflare` not supporting `fetch` when deployed to Cloudflare Workers.
15
+ - @pluv/crdt@0.35.4
16
+ - @pluv/types@0.35.4
17
+
3
18
  ## 0.35.3
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonObject, MaybePromise, IOAuthorize, IOEventMessage, EventRecord, InputZodLike, ProcedureLike, IORouterLike, InferIOAuthorizeUser, Id, Maybe, BaseUser, UndefinedProps, InferEventMessage, InferEventsOutput, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
1
+ import { JsonObject, MaybePromise, IOAuthorize, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, BaseUser, UndefinedProps, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
2
2
  export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
3
3
  import { AbstractCrdtDocFactory, AbstractCrdtDoc } from '@pluv/crdt';
4
4
 
@@ -281,7 +281,7 @@ declare abstract class AbstractPlatform<TWebSocket extends AbstractWebSocket = A
281
281
  persistence: AbstractPersistence;
282
282
  pubSub: AbstractPubSub;
283
283
  readonly _createToken?: (params: JWTEncodeParams<any, any>) => Promise<string>;
284
- _fetch?: (req: any) => Promise<any>;
284
+ _fetch?: (...args: any[]) => Promise<any>;
285
285
  abstract readonly _config: TConfig;
286
286
  abstract readonly _name: string;
287
287
  constructor(config?: AbstractPlatformConfig<TRoomContext>);
@@ -415,7 +415,7 @@ declare class PluvServer<TPlatform extends AbstractPlatform<any> = AbstractPlatf
415
415
  private readonly _getInitialStorage;
416
416
  private readonly _platform;
417
417
  private readonly _router;
418
- get fetch(): (req: any) => Promise<any>;
418
+ get fetch(): NonNullable<typeof this$1._platform._fetch>;
419
419
  /**
420
420
  * @ignore
421
421
  * @readonly
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonObject, MaybePromise, IOAuthorize, IOEventMessage, EventRecord, InputZodLike, ProcedureLike, IORouterLike, InferIOAuthorizeUser, Id, Maybe, BaseUser, UndefinedProps, InferEventMessage, InferEventsOutput, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
1
+ import { JsonObject, MaybePromise, IOAuthorize, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, BaseUser, UndefinedProps, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
2
2
  export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
3
3
  import { AbstractCrdtDocFactory, AbstractCrdtDoc } from '@pluv/crdt';
4
4
 
@@ -281,7 +281,7 @@ declare abstract class AbstractPlatform<TWebSocket extends AbstractWebSocket = A
281
281
  persistence: AbstractPersistence;
282
282
  pubSub: AbstractPubSub;
283
283
  readonly _createToken?: (params: JWTEncodeParams<any, any>) => Promise<string>;
284
- _fetch?: (req: any) => Promise<any>;
284
+ _fetch?: (...args: any[]) => Promise<any>;
285
285
  abstract readonly _config: TConfig;
286
286
  abstract readonly _name: string;
287
287
  constructor(config?: AbstractPlatformConfig<TRoomContext>);
@@ -415,7 +415,7 @@ declare class PluvServer<TPlatform extends AbstractPlatform<any> = AbstractPlatf
415
415
  private readonly _getInitialStorage;
416
416
  private readonly _platform;
417
417
  private readonly _router;
418
- get fetch(): (req: any) => Promise<any>;
418
+ get fetch(): NonNullable<typeof this$1._platform._fetch>;
419
419
  /**
420
420
  * @ignore
421
421
  * @readonly
package/dist/index.js CHANGED
@@ -998,7 +998,7 @@ var IORoom = class {
998
998
  };
999
999
 
1000
1000
  // src/version.generated.ts
1001
- var version = "0.35.3";
1001
+ var version = "0.36.0";
1002
1002
 
1003
1003
  // src/PluvServer.ts
1004
1004
  var PluvServer = class {
@@ -1123,8 +1123,10 @@ var PluvServer = class {
1123
1123
  };
1124
1124
  }
1125
1125
  get fetch() {
1126
- if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
1127
- return this._platform._fetch;
1126
+ return (...args) => {
1127
+ if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
1128
+ return this._platform._fetch(...args);
1129
+ };
1128
1130
  }
1129
1131
  /**
1130
1132
  * @ignore
package/dist/index.mjs CHANGED
@@ -956,7 +956,7 @@ var IORoom = class {
956
956
  };
957
957
 
958
958
  // src/version.generated.ts
959
- var version = "0.35.3";
959
+ var version = "0.36.0";
960
960
 
961
961
  // src/PluvServer.ts
962
962
  var PluvServer = class {
@@ -1081,8 +1081,10 @@ var PluvServer = class {
1081
1081
  };
1082
1082
  }
1083
1083
  get fetch() {
1084
- if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
1085
- return this._platform._fetch;
1084
+ return (...args) => {
1085
+ if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
1086
+ return this._platform._fetch(...args);
1087
+ };
1086
1088
  }
1087
1089
  /**
1088
1090
  * @ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "0.35.3",
3
+ "version": "0.36.0",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,19 +18,19 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@panva/hkdf": "^1.2.1",
21
- "jose": "^5.9.6",
21
+ "jose": "^5.10.0",
22
22
  "kleur": "^4.1.5",
23
23
  "wonka": "^6.3.4",
24
- "@pluv/crdt": "^0.35.3",
25
- "@pluv/types": "^0.35.3"
24
+ "@pluv/crdt": "^0.36.0",
25
+ "@pluv/types": "^0.36.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^8.57.1",
29
29
  "genversion": "^3.2.0",
30
- "tsup": "^8.3.6",
30
+ "tsup": "^8.4.0",
31
31
  "typescript": "^5.7.3",
32
- "@pluv/tsconfig": "^0.35.3",
33
- "eslint-config-pluv": "^0.35.3"
32
+ "@pluv/tsconfig": "^0.36.0",
33
+ "eslint-config-pluv": "^0.36.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
@@ -43,7 +43,7 @@ export abstract class AbstractPlatform<
43
43
  public pubSub: AbstractPubSub;
44
44
 
45
45
  public readonly _createToken?: (params: JWTEncodeParams<any, any>) => Promise<string>;
46
- public _fetch?: (req: any) => Promise<any>;
46
+ public _fetch?: (...args: any[]) => Promise<any>;
47
47
  public abstract readonly _config: TConfig;
48
48
  public abstract readonly _name: string;
49
49
 
package/src/PluvServer.ts CHANGED
@@ -199,10 +199,12 @@ export class PluvServer<
199
199
  private readonly _platform: TPlatform;
200
200
  private readonly _router: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
201
201
 
202
- public get fetch() {
203
- if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
202
+ public get fetch(): NonNullable<typeof this._platform._fetch> {
203
+ return ((...args: any[]): Promise<any> => {
204
+ if (!this._platform._fetch) throw new Error(`\`${this._platform._name}\` does not support \`fetch\``);
204
205
 
205
- return this._platform._fetch;
206
+ return this._platform._fetch(...args);
207
+ }) as NonNullable<typeof this._platform._fetch>;
206
208
  }
207
209
 
208
210
  /**
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '0.35.3'
2
+ export const version = '0.36.0'