starpc 0.49.1 → 0.49.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.
- package/dist/srpc/server.d.ts +2 -3
- package/go.mod +8 -8
- package/go.sum +14 -14
- package/integration/integration.go +2 -0
- package/package.json +13 -16
- package/srpc/server-http_js.go +1 -1
- package/srpc/server.ts +2 -3
- package/integration/tsconfig.json +0 -11
package/dist/srpc/server.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { LookupMethod } from './mux.js';
|
|
2
2
|
import { ServerRPC } from './server-rpc.js';
|
|
3
3
|
import type { StreamHandler } from './conn.js';
|
|
4
|
-
import { PacketStream } from './stream.js';
|
|
5
|
-
import { RpcStreamHandler } from '../rpcstream/rpcstream.js';
|
|
4
|
+
import { HandleStreamFunc, PacketStream } from './stream.js';
|
|
6
5
|
export declare class Server implements StreamHandler {
|
|
7
6
|
private lookupMethod;
|
|
8
7
|
constructor(lookupMethod: LookupMethod);
|
|
9
|
-
get rpcStreamHandler():
|
|
8
|
+
get rpcStreamHandler(): HandleStreamFunc;
|
|
10
9
|
startRpc(): ServerRPC;
|
|
11
10
|
handlePacketStream(stream: PacketStream): ServerRPC;
|
|
12
11
|
}
|
package/go.mod
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
module github.com/aperturerobotics/starpc
|
|
2
2
|
|
|
3
|
-
go 1.25
|
|
3
|
+
go 1.25.0
|
|
4
4
|
|
|
5
5
|
require (
|
|
6
|
-
github.com/aperturerobotics/common v0.32.
|
|
6
|
+
github.com/aperturerobotics/common v0.32.1 // latest
|
|
7
7
|
github.com/aperturerobotics/protobuf-go-lite v0.12.2 // latest
|
|
8
|
-
github.com/aperturerobotics/util v1.
|
|
8
|
+
github.com/aperturerobotics/util v1.33.0 // latest
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
require (
|
|
12
12
|
github.com/aperturerobotics/abseil-cpp v0.0.0-20260131110040-4bb56e2f9017 // aperture-2
|
|
13
13
|
github.com/aperturerobotics/cli v1.1.0 // indirect
|
|
14
|
-
github.com/aperturerobotics/go-protoc-wasi v0.0.0-
|
|
14
|
+
github.com/aperturerobotics/go-protoc-wasi v0.0.0-20260329113540-600516012db3 // indirect
|
|
15
15
|
github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20251104042408-0c9eb8a3f726 // indirect
|
|
16
16
|
github.com/aperturerobotics/protobuf v0.0.0-20260203024654-8201686529c4 // wasi
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
require (
|
|
20
|
-
github.com/aperturerobotics/go-websocket v1.8.15-0.
|
|
20
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260329113544-74dbfb8f11c6 // master
|
|
21
21
|
github.com/libp2p/go-yamux/v4 v4.0.2 // latest
|
|
22
22
|
github.com/pkg/errors v0.9.1 // latest
|
|
23
23
|
github.com/sirupsen/logrus v1.9.5-0.20260309202648-9f0600962f75 // latest
|
|
@@ -25,10 +25,10 @@ require (
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
require (
|
|
28
|
-
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-
|
|
28
|
+
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-20260329113538-218ccd8f20e0 // indirect
|
|
29
29
|
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
|
30
30
|
github.com/tetratelabs/wazero v1.11.0 // indirect
|
|
31
31
|
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect
|
|
32
|
-
golang.org/x/mod v0.
|
|
33
|
-
golang.org/x/sys v0.
|
|
32
|
+
golang.org/x/mod v0.34.0 // indirect
|
|
33
|
+
golang.org/x/sys v0.42.0 // indirect
|
|
34
34
|
)
|
package/go.sum
CHANGED
|
@@ -2,22 +2,22 @@ github.com/aperturerobotics/abseil-cpp v0.0.0-20260131110040-4bb56e2f9017 h1:3U7
|
|
|
2
2
|
github.com/aperturerobotics/abseil-cpp v0.0.0-20260131110040-4bb56e2f9017/go.mod h1:lNSJTKECIUFAnfeSqy01kXYTYe1BHubW7198jNX3nEw=
|
|
3
3
|
github.com/aperturerobotics/cli v1.1.0 h1:7a+YRC+EY3npAnTzhHV5gLCiw91KS0Ts3XwLILGOsT8=
|
|
4
4
|
github.com/aperturerobotics/cli v1.1.0/go.mod h1:M7BFP9wow5ytTzMyJQOOO991fGfsUqdTI7gGEsHfTQ8=
|
|
5
|
-
github.com/aperturerobotics/common v0.32.
|
|
6
|
-
github.com/aperturerobotics/common v0.32.
|
|
7
|
-
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-
|
|
8
|
-
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-
|
|
9
|
-
github.com/aperturerobotics/go-protoc-wasi v0.0.0-
|
|
10
|
-
github.com/aperturerobotics/go-protoc-wasi v0.0.0-
|
|
11
|
-
github.com/aperturerobotics/go-websocket v1.8.15-0.
|
|
12
|
-
github.com/aperturerobotics/go-websocket v1.8.15-0.
|
|
5
|
+
github.com/aperturerobotics/common v0.32.1 h1:pvmmDBttGnQM5HBoe8T1xHeHmFg2L7ecPZjx1oHLIX0=
|
|
6
|
+
github.com/aperturerobotics/common v0.32.1/go.mod h1:6I+CZvcNEXf7Abd0tFVbMgOJ/pFE8C4qlYG9KZvBAnc=
|
|
7
|
+
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-20260329113538-218ccd8f20e0 h1:6/3RSSlPEQ6LeidslB1ZCJkxW+MnfYDkvdWMDklDXw4=
|
|
8
|
+
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-20260329113538-218ccd8f20e0/go.mod h1:OBb/beWmr/pDIZAUfi86j/4tBh2v5ctTxKMqSnh9c/4=
|
|
9
|
+
github.com/aperturerobotics/go-protoc-wasi v0.0.0-20260329113540-600516012db3 h1:lp+V8RYcBwTX1p81swkpZn5fhw1wn2xLorzETIxRyZQ=
|
|
10
|
+
github.com/aperturerobotics/go-protoc-wasi v0.0.0-20260329113540-600516012db3/go.mod h1:vEq8i7EKb32+KXGtIEZjjhNns+BdsL2dUMw4uhy3578=
|
|
11
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260329113544-74dbfb8f11c6 h1:Utc1F7jdCc6/HrwwIikJFXt/hXxkWIWETLp/CsG6Gl0=
|
|
12
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260329113544-74dbfb8f11c6/go.mod h1:9KnSGuqxSXbdB/Oi0I6vvfPLkclfJwMGAQaDDGVgGow=
|
|
13
13
|
github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20251104042408-0c9eb8a3f726 h1:4B1F0DzuqPzb6WqgCjWaqDD7JU9RDsevQG5OP0DFBgs=
|
|
14
14
|
github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20251104042408-0c9eb8a3f726/go.mod h1:SvGGBv3OVxUyqO0ZxA/nvs6z3cg7NIbZ64TnbV2OISo=
|
|
15
15
|
github.com/aperturerobotics/protobuf v0.0.0-20260203024654-8201686529c4 h1:4Dy3BAHh2kgVdHAqtlwcFsgY0kAwUe2m3rfFcaGwGQg=
|
|
16
16
|
github.com/aperturerobotics/protobuf v0.0.0-20260203024654-8201686529c4/go.mod h1:tMgO7y6SJo/d9ZcvrpNqIQtdYT9de+QmYaHOZ4KnhOg=
|
|
17
17
|
github.com/aperturerobotics/protobuf-go-lite v0.12.2 h1:ujwTKgpIYAVsv8VljB6PPMY5SI8i8m/NlIHAkkuxQcU=
|
|
18
18
|
github.com/aperturerobotics/protobuf-go-lite v0.12.2/go.mod h1:lGH3s5ArCTXKI4wJdlNpaybUtwSjfAG0vdWjxOfMcF8=
|
|
19
|
-
github.com/aperturerobotics/util v1.
|
|
20
|
-
github.com/aperturerobotics/util v1.
|
|
19
|
+
github.com/aperturerobotics/util v1.33.0 h1:l7Aql7rlFZaGPRS+lzFC7h0zuLE0WyR3nPVXgCYMW88=
|
|
20
|
+
github.com/aperturerobotics/util v1.33.0/go.mod h1:FOKm51ZpgLsRszA4e7mjvqrt6J6Pju5GjSJg1Qz4Ouo=
|
|
21
21
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
22
22
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
23
23
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
@@ -38,10 +38,10 @@ github.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbw
|
|
|
38
38
|
github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU=
|
|
39
39
|
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg=
|
|
40
40
|
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
|
41
|
-
golang.org/x/mod v0.
|
|
42
|
-
golang.org/x/mod v0.
|
|
43
|
-
golang.org/x/sys v0.
|
|
44
|
-
golang.org/x/sys v0.
|
|
41
|
+
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
|
|
42
|
+
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
|
|
43
|
+
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
|
44
|
+
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
|
45
45
|
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
|
46
46
|
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
|
47
47
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.2",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"clean": "rimraf ./dist",
|
|
65
|
-
"build": "bun run clean && tsc --
|
|
65
|
+
"build": "bun run clean && tsc --outDir ./dist/",
|
|
66
66
|
"check": "bun run typecheck",
|
|
67
67
|
"typecheck": "tsgo --noEmit",
|
|
68
68
|
"deps": "depcheck --ignores 'bufferutil,utf-8-validate,rimraf,starpc,@aptre/protobuf-es-lite,tsx'",
|
|
@@ -109,23 +109,23 @@
|
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@eslint/js": "^10.0.0",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
113
|
-
"@typescript-eslint/parser": "^8.
|
|
112
|
+
"@typescript-eslint/eslint-plugin": "^8.57.2",
|
|
113
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
114
114
|
"depcheck": "^1.4.6",
|
|
115
|
-
"esbuild": "^0.27.
|
|
116
|
-
"eslint": "^10.0
|
|
115
|
+
"esbuild": "^0.27.4",
|
|
116
|
+
"eslint": "^10.1.0",
|
|
117
117
|
"eslint-config-prettier": "^10.0.0",
|
|
118
118
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
119
|
-
"globals": "^17.
|
|
120
|
-
"happy-dom": "^20.
|
|
119
|
+
"globals": "^17.4.0",
|
|
120
|
+
"happy-dom": "^20.8.9",
|
|
121
121
|
"husky": "^9.1.7",
|
|
122
|
-
"lint-staged": "^16.
|
|
122
|
+
"lint-staged": "^16.4.0",
|
|
123
123
|
"prettier": "^3.8.1",
|
|
124
124
|
"rimraf": "^6.1.3",
|
|
125
125
|
"tsx": "^4.20.4",
|
|
126
|
-
"typescript": "^
|
|
127
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
128
|
-
"vitest": "^4.
|
|
126
|
+
"typescript": "^6.0.0",
|
|
127
|
+
"@typescript/native-preview": "^7.0.0-dev.20260330.1",
|
|
128
|
+
"vitest": "^4.1.2"
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@aptre/it-ws": "^1.1.2",
|
|
@@ -139,9 +139,6 @@
|
|
|
139
139
|
"it-pushable": "^3.2.3",
|
|
140
140
|
"it-stream-types": "^2.0.2",
|
|
141
141
|
"uint8arraylist": "^2.4.7",
|
|
142
|
-
"ws": "^8.
|
|
143
|
-
},
|
|
144
|
-
"resolutions": {
|
|
145
|
-
"@aptre/protobuf-es-lite": "1.0.2"
|
|
142
|
+
"ws": "^8.20.0"
|
|
146
143
|
}
|
|
147
144
|
}
|
package/srpc/server-http_js.go
CHANGED
|
@@ -10,7 +10,7 @@ import "errors"
|
|
|
10
10
|
type HTTPServer struct{}
|
|
11
11
|
|
|
12
12
|
// NewHTTPServer builds a http server / handler.
|
|
13
|
-
func NewHTTPServer(mux Mux, path string) (*HTTPServer, error) {
|
|
13
|
+
func NewHTTPServer(mux Mux, path string, websocketOpts any) (*HTTPServer, error) {
|
|
14
14
|
return nil, errors.New("srpc: http server not implemented on js")
|
|
15
15
|
}
|
|
16
16
|
|
package/srpc/server.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { LookupMethod } from './mux.js'
|
|
|
4
4
|
import { ServerRPC } from './server-rpc.js'
|
|
5
5
|
import { decodePacketSource, encodePacketSource } from './packet.js'
|
|
6
6
|
import type { StreamHandler } from './conn.js'
|
|
7
|
-
import { PacketStream } from './stream.js'
|
|
8
|
-
import { RpcStreamHandler } from '../rpcstream/rpcstream.js'
|
|
7
|
+
import { HandleStreamFunc, PacketStream } from './stream.js'
|
|
9
8
|
|
|
10
9
|
// Server implements the SRPC server in TypeScript with a Mux.
|
|
11
10
|
export class Server implements StreamHandler {
|
|
@@ -18,7 +17,7 @@ export class Server implements StreamHandler {
|
|
|
18
17
|
|
|
19
18
|
// rpcStreamHandler implements the RpcStreamHandler interface.
|
|
20
19
|
// uses handlePacketDuplex (expects 1 buf = 1 Packet)
|
|
21
|
-
public get rpcStreamHandler():
|
|
20
|
+
public get rpcStreamHandler(): HandleStreamFunc {
|
|
22
21
|
return async (stream: PacketStream) => {
|
|
23
22
|
const rpc = this.startRpc()
|
|
24
23
|
return pipe(stream, decodePacketSource, rpc, encodePacketSource, stream)
|