@replit/river 0.1.3 → 0.1.5

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.
@@ -9,7 +9,7 @@ export class StdioTransport extends Transport {
9
9
  input: stdin,
10
10
  output: stdout,
11
11
  });
12
- rl.on('line', this.onMessage);
12
+ rl.on('line', (msg) => this.onMessage(msg));
13
13
  }
14
14
  send(msg) {
15
15
  const id = msg.id;
@@ -1,4 +1,5 @@
1
- import type WebSocket from 'ws';
1
+ /// <reference types="ws" />
2
+ import type WebSocket from 'isomorphic-ws';
2
3
  import { Transport } from './types';
3
4
  import { MessageId, OpaqueTransportMessage, TransportClientId } from './message';
4
5
  export declare class WebSocketTransport extends Transport {
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import http from 'http';
3
- import WebSocket, { WebSocketServer } from 'ws';
3
+ import WebSocket from 'isomorphic-ws';
4
+ import { WebSocketServer } from 'ws';
4
5
  import { Transport } from './types';
5
6
  import { OpaqueTransportMessage } from './message';
6
7
  export declare function createWebSocketServer(server: http.Server): Promise<WebSocket.Server<typeof WebSocket, typeof http.IncomingMessage>>;
@@ -1,4 +1,5 @@
1
- import WebSocket, { WebSocketServer } from 'ws';
1
+ import WebSocket from 'isomorphic-ws';
2
+ import { WebSocketServer } from 'ws';
2
3
  import { WebSocketTransport } from './ws';
3
4
  export async function createWebSocketServer(server) {
4
5
  return new WebSocketServer({ server });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@replit/river",
3
3
  "description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -10,6 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@sinclair/typebox": "^0.31.8",
13
+ "isomorphic-ws": "^5.0.0",
13
14
  "it-pushable": "^3.2.1",
14
15
  "nanoid": "^4.0.2",
15
16
  "ws": "^8.13.0"