Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 144aa68

Browse files
committed
fix!: update multiformats to v11.x.x and related depenendcies
`multiformats@11.x.x` shipped with a [breaking change](multiformats/js-multiformats#230) so update all deps using multiformats to the latest version.
1 parent 6be5906 commit 144aa68

File tree

36 files changed

+258
-360
lines changed

36 files changed

+258
-360
lines changed

lerna.json

-23
This file was deleted.

package.json

+27-29
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,39 @@
1717
},
1818
"private": true,
1919
"scripts": {
20-
"link": "lerna link",
21-
"reset": "lerna run clean && rimraf packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json",
22-
"test": "lerna run test",
23-
"test:node": "lerna run test:node",
24-
"test:chrome": "lerna run test:chrome",
25-
"test:chrome-webworker": "lerna run test:chrome-webworker",
26-
"test:firefox": "lerna run test:firefox",
27-
"test:firefox-webworker": "lerna run test:firefox-webworker",
28-
"test:electron-main": "lerna run test:electron-main",
29-
"test:external": "lerna run test:external",
30-
"test:cli": "lerna run test:cli",
31-
"test:interop": "lerna run test:interop",
32-
"test:interface:client": "lerna run test:interface:client",
33-
"test:interface:core": "lerna run test:interface:core",
34-
"test:interface:http-go": "lerna run test:interface:http-go",
35-
"test:interface:http-js": "lerna run test:interface:http-js",
36-
"test:interface:message-port-client": "lerna run test:interface:message-port-client",
37-
"coverage": "lerna run coverage",
38-
"build": "lerna run build",
39-
"clean": "lerna run clean",
40-
"lint": "lerna run lint",
41-
"dep-check": "lerna run dep-check",
20+
"reset": "aegir run clean && aegir clean packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json",
21+
"test": "aegir run test",
22+
"test:node": "aegir run test:node",
23+
"test:chrome": "aegir run test:chrome",
24+
"test:chrome-webworker": "aegir run test:chrome-webworker",
25+
"test:firefox": "aegir run test:firefox",
26+
"test:firefox-webworker": "aegir run test:firefox-webworker",
27+
"test:electron-main": "aegir run test:electron-main",
28+
"test:external": "aegir run test:external",
29+
"test:cli": "aegir run test:cli",
30+
"test:interop": "aegir run test:interop",
31+
"test:interface:client": "aegir run test:interface:client",
32+
"test:interface:core": "aegir run test:interface:core",
33+
"test:interface:http-go": "aegir run test:interface:http-go",
34+
"test:interface:http-js": "aegir run test:interface:http-js",
35+
"test:interface:message-port-client": "aegir run test:interface:message-port-client",
36+
"coverage": "aegir run coverage",
37+
"build": "aegir run build",
38+
"clean": "aegir run clean",
39+
"lint": "aegir run lint",
40+
"dep-check": "aegir run dep-check",
4241
"release": "run-s build npm:release docker:release",
43-
"npm:release": "lerna publish from-package --no-push --no-private --yes",
42+
"npm:release": "aegir publish from-package --no-push --no-private --yes",
4443
"docker:release": "run-s docker:release:*",
4544
"docker:release:build": "docker build . --no-cache --tag js-ipfs:latest --file ./Dockerfile.latest",
4645
"docker:release:tag-latest": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:latest",
4746
"docker:release:tag-version": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
4847
"docker:release:push-latest": "docker push ipfs/js-ipfs:latest",
4948
"docker:release:push-version": "docker push ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
5049
"release:rc": "run-s npm:rc:* docker:rc",
51-
"npm:rc:version": "lerna version prerelease --preid `git rev-parse --short HEAD` --force-publish --no-push --yes",
50+
"npm:rc:version": "aegir version prerelease --preid `git rev-parse --short HEAD` --force-publish --no-push --yes",
5251
"npm:rc:build": "npm run build",
53-
"npm:rc:publish": "lerna publish from-package --no-push --no-private --dist-tag next --yes",
52+
"npm:rc:publish": "aegir publish from-package --no-push --no-private --dist-tag next --yes",
5453
"docker:rc": "run-s docker:rc:*",
5554
"docker:rc:build": "docker build . --no-cache --tag js-ipfs:next --file ./Dockerfile.next",
5655
"docker:rc:tag-next": "docker tag js-ipfs:next docker.io/ipfs/js-ipfs:next",
@@ -59,10 +58,9 @@
5958
"docker:rc:push-rc": "docker push ipfs/js-ipfs:v`npm show ipfs@next version -q`"
6059
},
6160
"devDependencies": {
62-
"lerna": "^6.0.1",
61+
"aegir": "^37.9.0",
6362
"node-fetch": "npm:@achingbrain/node-fetch@^2.6.4",
64-
"npm-run-all": "^4.1.5",
65-
"rimraf": "^3.0.2"
63+
"npm-run-all": "^4.1.5"
6664
},
6765
"eslintConfig": {
6866
"extends": "ipfs",
@@ -73,4 +71,4 @@
7371
"workspaces": [
7472
"packages/*"
7573
]
76-
}
74+
}

packages/interface-ipfs-core/package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,31 @@
6565
},
6666
"dependencies": {
6767
"@ipld/car": "^5.0.0",
68-
"@ipld/dag-cbor": "^8.0.0",
69-
"@ipld/dag-pb": "^3.0.0",
70-
"@libp2p/crypto": "^1.0.0",
71-
"@libp2p/interface-peer-id": "^1.0.4",
68+
"@ipld/dag-cbor": "^9.0.0",
69+
"@ipld/dag-pb": "^4.0.0",
70+
"@libp2p/crypto": "^1.0.7",
71+
"@libp2p/interface-peer-id": "^2.0.0",
7272
"@libp2p/interfaces": "^3.0.3",
73-
"@libp2p/peer-id": "^1.1.10",
74-
"@libp2p/peer-id-factory": "^1.0.10",
73+
"@libp2p/peer-id": "^2.0.0",
74+
"@libp2p/peer-id-factory": "^2.0.0",
7575
"@libp2p/websockets": "^5.0.0",
7676
"@multiformats/multiaddr": "^11.0.0",
7777
"@types/node": "^18.0.0",
7878
"@types/pako": "^2.0.0",
7979
"@types/readable-stream": "^2.3.13",
80-
"aegir": "^37.0.11",
81-
"blockstore-core": "^2.0.1",
80+
"aegir": "^37.9.0",
81+
"blockstore-core": "^3.0.0",
8282
"copyfiles": "^2.4.1",
8383
"dag-jose": "^3.0.1",
8484
"delay": "^5.0.0",
8585
"did-jwt": "^6.2.0",
8686
"err-code": "^3.0.1",
8787
"ipfs-core-types": "^0.13.0",
88-
"ipfs-unixfs": "^8.0.0",
89-
"ipfs-unixfs-importer": "^11.0.0",
88+
"ipfs-unixfs": "^9.0.0",
89+
"ipfs-unixfs-importer": "^12.0.0",
9090
"ipfs-utils": "^9.0.6",
91-
"ipns": "^4.0.0",
92-
"is-ipfs": "^7.0.0",
91+
"ipns": "^5.0.1",
92+
"is-ipfs": "^8.0.0",
9393
"iso-random-stream": "^2.0.2",
9494
"it-all": "^2.0.0",
9595
"it-buffer-stream": "^3.0.0",
@@ -103,15 +103,15 @@
103103
"it-tar": "^6.0.0",
104104
"it-to-buffer": "^3.0.0",
105105
"merge-options": "^3.0.4",
106-
"multiformats": "^10.0.0",
106+
"multiformats": "^11.0.0",
107107
"nanoid": "^4.0.0",
108108
"p-defer": "^4.0.0",
109109
"p-map": "^5.3.0",
110110
"p-retry": "^5.1.0",
111111
"p-wait-for": "^5.0.0",
112112
"pako": "^2.0.4",
113113
"readable-stream": "^4.0.0",
114-
"sinon": "^14.0.0",
114+
"sinon": "^15.0.1",
115115
"uint8arrays": "^4.0.2",
116116
"wherearewe": "^2.0.1"
117117
},

packages/ipfs-cli/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@
6767
"build": "aegir build --no-bundle"
6868
},
6969
"dependencies": {
70-
"@ipld/dag-cbor": "^8.0.0",
71-
"@ipld/dag-json": "^9.0.0",
72-
"@ipld/dag-pb": "^3.0.0",
73-
"@libp2p/logger": "^2.0.0",
74-
"@libp2p/peer-id": "^1.1.10",
70+
"@ipld/dag-cbor": "^9.0.0",
71+
"@ipld/dag-json": "^10.0.0",
72+
"@ipld/dag-pb": "^4.0.0",
73+
"@libp2p/logger": "^2.0.2",
74+
"@libp2p/peer-id": "^2.0.0",
7575
"@multiformats/mafmt": "^11.0.2",
7676
"@multiformats/multiaddr": "^11.0.0",
7777
"@multiformats/multiaddr-to-uri": "^9.0.1",
@@ -90,7 +90,7 @@
9090
"it-split": "^2.0.0",
9191
"it-tar": "^6.0.0",
9292
"jsondiffpatch": "^0.4.1",
93-
"multiformats": "^10.0.0",
93+
"multiformats": "^11.0.0",
9494
"parse-duration": "^1.0.0",
9595
"pretty-bytes": "^6.0.0",
9696
"progress": "^2.0.3",
@@ -99,14 +99,14 @@
9999
"yargs": "^17.4.0"
100100
},
101101
"devDependencies": {
102-
"@libp2p/crypto": "^1.0.0",
102+
"@libp2p/crypto": "^1.0.7",
103103
"@types/get-folder-size": "^3.0.1",
104104
"@types/ncp": "^2.0.5",
105105
"@types/progress": "^2.0.3",
106106
"@types/rimraf": "^3.0.1",
107107
"@types/yargs": "^17.0.10",
108-
"aegir": "^37.0.11",
109-
"ipfs-repo": "^16.0.0",
108+
"aegir": "^37.9.0",
109+
"ipfs-repo": "^17.0.0",
110110
"it-all": "^2.0.0",
111111
"it-first": "^2.0.0",
112112
"it-map": "^2.0.0",
@@ -115,7 +115,7 @@
115115
"ncp": "^2.0.0",
116116
"pako": "^2.0.4",
117117
"rimraf": "^3.0.2",
118-
"sinon": "^14.0.0",
118+
"sinon": "^15.0.1",
119119
"string-argv": "^0.3.1",
120120
"temp-write": "^5.0.0"
121121
}

packages/ipfs-cli/src/commands/cid/base32.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import split from 'it-split'
22
import { CID } from 'multiformats/cid'
33
import { base32 } from 'multiformats/bases/base32'
4+
import { toString as uint8arrayToString } from 'uint8arrays/to-string'
45

56
/**
67
* @typedef {object} Argv
@@ -24,7 +25,7 @@ const command = {
2425
}
2526

2627
for await (const data of input) {
27-
const input = data.toString().trim()
28+
const input = (data instanceof Uint8Array ? uint8arrayToString(data) : data).trim()
2829

2930
if (!input) {
3031
continue

packages/ipfs-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
"merge-options": "^3.0.4"
6767
},
6868
"devDependencies": {
69-
"aegir": "^37.0.11"
69+
"aegir": "^37.9.0"
7070
}
7171
}

packages/ipfs-core-config/package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -94,30 +94,31 @@
9494
"build": "aegir build"
9595
},
9696
"dependencies": {
97-
"@chainsafe/libp2p-gossipsub": "^4.0.0",
98-
"@libp2p/floodsub": "^5.0.0",
97+
"@chainsafe/libp2p-gossipsub": "^5.2.1",
98+
"@libp2p/floodsub": "^6.0.0",
9999
"@libp2p/logger": "^2.0.2",
100-
"@libp2p/mdns": "^5.0.0",
101-
"@libp2p/tcp": "^5.0.0",
102-
"@libp2p/webrtc-star": "^5.0.2",
103-
"blockstore-datastore-adapter": "^4.0.0",
100+
"@libp2p/mdns": "^6.0.0",
101+
"@libp2p/prometheus-metrics": "^1.0.1",
102+
"@libp2p/tcp": "^6.0.2",
103+
"@libp2p/webrtc-star": "^6.0.0",
104+
"blockstore-datastore-adapter": "^5.0.0",
104105
"datastore-core": "^8.0.1",
105106
"datastore-fs": "^8.0.0",
106107
"datastore-level": "^9.0.0",
107108
"err-code": "^3.0.1",
108109
"hashlru": "^2.3.0",
109110
"interface-datastore": "^7.0.0",
110-
"ipfs-repo": "^16.0.0",
111+
"ipfs-repo": "^17.0.0",
111112
"ipfs-utils": "^9.0.6",
112-
"is-ipfs": "^7.0.0",
113+
"is-ipfs": "^8.0.0",
113114
"it-all": "^2.0.0",
114115
"it-drain": "^2.0.0",
115116
"it-foreach": "^1.0.0",
116117
"p-queue": "^7.2.0",
117118
"uint8arrays": "^4.0.2"
118119
},
119120
"devDependencies": {
120-
"aegir": "^37.0.11",
121+
"aegir": "^37.9.0",
121122
"ipfs-core-utils": "^0.17.0"
122123
}
123124
}
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
1-
import { GossipSub } from '@chainsafe/libp2p-gossipsub'
1+
import { gossipsub } from '@chainsafe/libp2p-gossipsub'
22

33
/** @typedef {import('@libp2p/interface-pubsub').PubSub} PubSub */
44

55
/** @type {() => Record<string, (components: any) => PubSub>}>} */
66
export const routers = () => ({
7-
// @ts-expect-error GossubSub is out of date
8-
gossipsub: (/** @type {any} */ components) => {
9-
const gossipsub = new GossipSub({
10-
allowPublishToZeroPeers: true,
11-
fallbackToFloodsub: true,
12-
emitSelf: true,
13-
maxInboundStreams: 64,
14-
maxOutboundStreams: 128
15-
})
16-
// @ts-expect-error GossubSub is out of date
17-
gossipsub.init({
18-
getPeerId () {
19-
return components.peerId
20-
},
21-
getPeerStore () {
22-
return components.peerStore
23-
},
24-
getRegistrar () {
25-
return components.registrar
26-
},
27-
getConnectionManager () {
28-
return components.connectionManager
29-
}
30-
})
31-
32-
return gossipsub
33-
}
7+
gossipsub: gossipsub({
8+
allowPublishToZeroPeers: true,
9+
fallbackToFloodsub: true,
10+
emitSelf: true,
11+
maxInboundStreams: 64,
12+
maxOutboundStreams: 128
13+
})
3414
})

packages/ipfs-core-config/src/libp2p-pubsub-routers.js

+8-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,17 @@
1-
import { GossipSub } from '@chainsafe/libp2p-gossipsub'
1+
import { gossipsub } from '@chainsafe/libp2p-gossipsub'
22
import { floodsub } from '@libp2p/floodsub'
33

44
/** @typedef {import('@libp2p/interface-pubsub').PubSub} PubSub */
55

66
/** @type {() => Record<string, (components: any) => PubSub>}>} */
77
export const routers = () => ({
8-
// @ts-expect-error GossubSub is out of date
9-
gossipsub: (/** @type {any} */ components) => {
10-
const gossipsub = new GossipSub({
11-
allowPublishToZeroPeers: true,
12-
fallbackToFloodsub: true,
13-
emitSelf: true,
14-
maxInboundStreams: 64,
15-
maxOutboundStreams: 128
16-
})
17-
// @ts-expect-error GossubSub is out of date
18-
gossipsub.init({
19-
getPeerId () {
20-
return components.peerId
21-
},
22-
getPeerStore () {
23-
return components.peerStore
24-
},
25-
getRegistrar () {
26-
return components.registrar
27-
},
28-
getConnectionManager () {
29-
return components.connectionManager
30-
}
31-
})
32-
33-
return gossipsub
34-
},
8+
gossipsub: gossipsub({
9+
allowPublishToZeroPeers: true,
10+
fallbackToFloodsub: true,
11+
emitSelf: true,
12+
maxInboundStreams: 64,
13+
maxOutboundStreams: 128
14+
}),
3515
floodsub: floodsub({
3616
emitSelf: true
3717
})

packages/ipfs-core-config/src/libp2p.browser.js

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export function libp2pConfig () {
1919
},
2020
nat: {
2121
enabled: false
22-
},
23-
metrics: {
24-
enabled: true
2522
}
2623
}
2724

0 commit comments

Comments
 (0)