Skip to content

Commit b2124c2

Browse files
authored
fix: update stream deps (#3055)
Updates it-byte-stream, it-length-prefixed-stream, etc.
1 parent f4035c0 commit b2124c2

File tree

20 files changed

+32
-24
lines changed

20 files changed

+32
-24
lines changed

packages/connection-encrypter-plaintext/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@libp2p/crypto": "^5.0.15",
5656
"@libp2p/interface": "^2.7.0",
5757
"@libp2p/peer-id": "^5.1.0",
58-
"it-protobuf-stream": "^1.1.5",
58+
"it-protobuf-stream": "^2.0.1",
5959
"it-stream-types": "^2.0.2",
6060
"protons-runtime": "^5.5.0",
6161
"uint8arraylist": "^2.4.8",

packages/interface-compliance-tests/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@
122122
"any-signal": "^4.1.1",
123123
"delay": "^6.0.0",
124124
"it-all": "^3.0.6",
125-
"it-byte-stream": "^1.1.0",
125+
"it-byte-stream": "^2.0.1",
126126
"it-drain": "^3.0.7",
127127
"it-map": "^3.1.1",
128128
"it-ndjson": "^1.0.7",
129129
"it-pair": "^2.0.6",
130130
"it-pipe": "^3.0.1",
131-
"it-protobuf-stream": "^1.1.5",
131+
"it-protobuf-stream": "^2.0.1",
132132
"it-pushable": "^3.2.3",
133133
"it-stream-types": "^2.0.2",
134134
"it-to-buffer": "^4.0.7",

packages/kad-dht/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"it-merge": "^3.0.5",
7676
"it-parallel": "^3.0.8",
7777
"it-pipe": "^3.0.1",
78-
"it-protobuf-stream": "^1.1.5",
78+
"it-protobuf-stream": "^2.0.1",
7979
"it-take": "^3.0.6",
8080
"mortice": "^3.0.6",
8181
"multiformats": "^13.3.1",

packages/kad-dht/src/routing-table/k-bucket.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { xor as uint8ArrayXor } from 'uint8arrays/xor'
66
import { PeerDistanceList } from '../peer-distance-list.js'
77
import { convertPeerId } from '../utils.js'
88
import { KBUCKET_SIZE, LAST_PING_THRESHOLD, PING_OLD_CONTACT_COUNT, PREFIX_LENGTH } from './index.js'
9-
import type { PeerId } from '@libp2p/interface'
10-
import type { AbortOptions } from 'it-protobuf-stream'
9+
import type { PeerId, AbortOptions } from '@libp2p/interface'
1110

1211
export interface PingFunction {
1312
/**

packages/libp2p/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"any-signal": "^4.1.1",
108108
"datastore-core": "^10.0.2",
109109
"interface-datastore": "^8.3.1",
110-
"it-byte-stream": "^1.1.0",
110+
"it-byte-stream": "^2.0.1",
111111
"it-merge": "^3.0.5",
112112
"it-parallel": "^3.0.8",
113113
"merge-options": "^3.0.4",

packages/libp2p/src/connection-monitor.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export class ConnectionMonitor implements Startable {
111111
bs.write(randomBytes(PING_LENGTH), {
112112
signal
113113
}),
114-
bs.read(PING_LENGTH, {
114+
bs.read({
115+
bytes: PING_LENGTH,
115116
signal
116117
})
117118
])

packages/multistream-select/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"dependencies": {
6161
"@libp2p/interface": "^2.7.0",
6262
"it-length-prefixed": "^10.0.1",
63-
"it-length-prefixed-stream": "^1.2.0",
63+
"it-length-prefixed-stream": "^2.0.1",
6464
"it-stream-types": "^2.0.2",
6565
"p-defer": "^4.0.1",
6666
"race-signal": "^1.1.2",

packages/pnet/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"dependencies": {
5353
"@libp2p/crypto": "^5.0.15",
5454
"@libp2p/interface": "^2.7.0",
55-
"it-byte-stream": "^1.1.0",
55+
"it-byte-stream": "^2.0.1",
5656
"it-map": "^3.1.1",
5757
"it-pair": "^2.0.6",
5858
"it-pipe": "^3.0.1",

packages/pnet/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ class PreSharedKeyConnectionProtector implements ConnectionProtector {
136136
bytes.write(localNonce, {
137137
signal
138138
}),
139-
bytes.read(NONCE_LENGTH, {
139+
bytes.read({
140+
bytes: NONCE_LENGTH,
140141
signal
141142
})
142143
])

packages/protocol-autonat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@libp2p/utils": "^6.6.0",
6060
"@multiformats/multiaddr": "^12.3.3",
6161
"any-signal": "^4.1.1",
62-
"it-protobuf-stream": "^1.1.5",
62+
"it-protobuf-stream": "^2.0.1",
6363
"multiformats": "^13.3.1",
6464
"protons-runtime": "^5.5.0",
6565
"uint8arraylist": "^2.4.8"

packages/protocol-dcutr/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@multiformats/multiaddr": "^12.3.3",
5959
"@multiformats/multiaddr-matcher": "^1.6.0",
6060
"delay": "^6.0.0",
61-
"it-protobuf-stream": "^1.1.5",
61+
"it-protobuf-stream": "^2.0.1",
6262
"protons-runtime": "^5.5.0",
6363
"uint8arraylist": "^2.4.8"
6464
},

packages/protocol-echo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@libp2p/interface": "^2.7.0",
5555
"@libp2p/interface-internal": "^2.3.9",
5656
"@multiformats/multiaddr": "^12.3.3",
57-
"it-byte-stream": "^1.1.0",
57+
"it-byte-stream": "^2.0.1",
5858
"it-pipe": "^3.0.1"
5959
},
6060
"devDependencies": {

packages/protocol-echo/src/echo.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export class Echo implements Startable, EchoInterface {
5858

5959
const [, output] = await Promise.all([
6060
bytes.write(buf, options),
61-
bytes.read(buf.byteLength, options)
61+
bytes.read({
62+
...options,
63+
bytes: buf.byteLength
64+
})
6265
])
6366

6467
await stream.close(options)

packages/protocol-fetch/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"dependencies": {
5555
"@libp2p/interface": "^2.7.0",
5656
"@libp2p/interface-internal": "^2.3.9",
57-
"it-protobuf-stream": "^1.1.5",
57+
"it-protobuf-stream": "^2.0.1",
5858
"protons-runtime": "^5.5.0",
5959
"uint8arraylist": "^2.4.8",
6060
"uint8arrays": "^5.1.0"

packages/protocol-identify/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@multiformats/multiaddr-matcher": "^1.6.0",
6363
"it-drain": "^3.0.7",
6464
"it-parallel": "^3.0.8",
65-
"it-protobuf-stream": "^1.1.5",
65+
"it-protobuf-stream": "^2.0.1",
6666
"protons-runtime": "^5.5.0",
6767
"uint8arraylist": "^2.4.8",
6868
"uint8arrays": "^5.1.0"

packages/protocol-ping/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@libp2p/interface": "^2.7.0",
5555
"@libp2p/interface-internal": "^2.3.9",
5656
"@multiformats/multiaddr": "^12.3.3",
57-
"it-byte-stream": "^1.1.0",
57+
"it-byte-stream": "^2.0.1",
5858
"uint8arrays": "^5.1.0"
5959
},
6060
"devDependencies": {

packages/protocol-ping/src/ping.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export class PingService implements Startable, PingServiceInterface {
6969
stream?.abort(new TimeoutError('ping timeout'))
7070
})
7171

72-
const buf = await bytes.read(PING_LENGTH, {
72+
const buf = await bytes.read({
73+
bytes: PING_LENGTH,
7374
signal
7475
})
7576
await bytes.write(buf, {
@@ -136,7 +137,10 @@ export class PingService implements Startable, PingServiceInterface {
136137

137138
const [, result] = await Promise.all([
138139
bytes.write(data, options),
139-
bytes.read(PING_LENGTH, options)
140+
bytes.read({
141+
...options,
142+
bytes: PING_LENGTH
143+
})
140144
])
141145

142146
const ms = Date.now() - start

packages/transport-circuit-relay-v2/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@multiformats/multiaddr": "^12.3.3",
6363
"@multiformats/multiaddr-matcher": "^1.6.0",
6464
"any-signal": "^4.1.1",
65-
"it-protobuf-stream": "^1.1.5",
65+
"it-protobuf-stream": "^2.0.1",
6666
"it-stream-types": "^2.0.2",
6767
"multiformats": "^13.3.1",
6868
"nanoid": "^5.0.9",

packages/transport-webrtc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"detect-browser": "^5.3.0",
6767
"get-port": "^7.1.0",
6868
"it-length-prefixed": "^10.0.1",
69-
"it-protobuf-stream": "^1.1.5",
69+
"it-protobuf-stream": "^2.0.1",
7070
"it-pushable": "^3.2.3",
7171
"it-stream-types": "^2.0.2",
7272
"multiformats": "^13.3.1",

packages/transport-webrtc/src/private-to-private/util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { RTCIceCandidate } from '../webrtc/index.js'
66
import { Message } from './pb/message.js'
77
import type { WebRTCDialEvents } from './transport.js'
88
import type { RTCPeerConnection } from '../webrtc/index.js'
9-
import type { LoggerOptions, Stream } from '@libp2p/interface'
10-
import type { AbortOptions, MessageStream } from 'it-protobuf-stream'
9+
import type { AbortOptions, LoggerOptions, Stream } from '@libp2p/interface'
10+
import type { MessageStream } from 'it-protobuf-stream'
1111
import type { DeferredPromise } from 'p-defer'
1212
import type { ProgressOptions } from 'progress-events'
1313

0 commit comments

Comments
 (0)