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

Commit 0cee4a4

Browse files
authored
feat!: upgrade libp2p to 0.40.x (#4237)
Upgrades all deps to support `[email protected]`. BREAKING CHANGE: ipfs is now bundled with [email protected] which has different config
1 parent dfc43d4 commit 0cee4a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+466
-323
lines changed

.github/workflows/test.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
with:
5151
node-version: ${{ matrix.node }}
5252
- uses: ipfs/aegir/actions/cache-node-modules@master
53-
- run: npm run test:node -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
53+
- run: npx lerna run test:node --since ${{ github.event.pull_request.base.sha }} --concurrency 1
5454
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
5555
with:
5656
flags: node
@@ -67,7 +67,7 @@ jobs:
6767
with:
6868
node-version: lts/*
6969
- uses: ipfs/aegir/actions/cache-node-modules@master
70-
- run: npm run test:chrome -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
70+
- run: npx lerna run test:chrome --since ${{ github.event.pull_request.base.sha }} --concurrency 1
7171
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
7272
with:
7373
flags: chrome
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
node-version: lts/*
8686
- uses: ipfs/aegir/actions/cache-node-modules@master
87-
- run: npm run test:chrome-webworker -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
87+
- run: npx lerna run test:chrome-webworker --since ${{ github.event.pull_request.base.sha }} --concurrency 1
8888
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
8989
with:
9090
flags: chrome-webworker
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
node-version: lts/*
103103
- uses: ipfs/aegir/actions/cache-node-modules@master
104-
- run: npm run test:firefox -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
104+
- run: npx lerna run test:firefox --since ${{ github.event.pull_request.base.sha }} --concurrency 1
105105
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
106106
with:
107107
flags: firefox
@@ -119,7 +119,7 @@ jobs:
119119
node-version: lts/*
120120
- uses: ipfs/aegir/actions/cache-node-modules@master
121121
- run: npx playwright install --with-deps
122-
- run: npm run test:firefox-webworker -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
122+
- run: npx lerna run test:firefox-webworker --since ${{ github.event.pull_request.base.sha }} --concurrency 1
123123
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
124124
with:
125125
flags: firefox-webworker
@@ -138,7 +138,7 @@ jobs:
138138
- uses: ipfs/aegir/actions/cache-node-modules@master
139139
- uses: GabrielBB/xvfb-action@v1
140140
with:
141-
run: npm run test:electron-main -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
141+
run: npx lerna run test:electron-main --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
142142
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
143143
with:
144144
flags: electron-main
@@ -162,7 +162,7 @@ jobs:
162162
- uses: ipfs/aegir/actions/cache-node-modules@master
163163
- run: npm install
164164
- run: npm run build
165-
- run: npm run test:interop -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -- -t ${{ matrix.type }} --bail
165+
- run: npx lerna run test:interop --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -t ${{ matrix.type }} --bail
166166
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
167167
with:
168168
flags: interop-${{ matrix.type }}
@@ -190,7 +190,7 @@ jobs:
190190
node-version: lts/*
191191
- run: npm install
192192
- run: npm run build
193-
- run: npm run ${{ matrix.suite }} -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -t ${{ matrix.type }}
193+
- run: npx lerna run ${{ matrix.suite }} --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -t ${{ matrix.type }} --bail
194194
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
195195
with:
196196
flags: interface-${{ matrix.type }}
@@ -208,7 +208,7 @@ jobs:
208208
node-version: lts/*
209209
- uses: ipfs/aegir/actions/cache-node-modules@master
210210
- run: npx playwright install --with-deps
211-
- run: npm run test:interface:message-port-client -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
211+
- run: npx lerna run test:interface:message-port-client --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
212212

213213
release:
214214
runs-on: ubuntu-latest

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"docker:rc:push-rc": "docker push ipfs/js-ipfs:v`npm show ipfs@next version -q`"
6060
},
6161
"devDependencies": {
62-
"lerna": "^5.0.0",
62+
"lerna": "^6.0.1",
6363
"node-fetch": "npm:@achingbrain/node-fetch@^2.6.4",
6464
"npm-run-all": "^4.1.5",
6565
"rimraf": "^3.0.2"

packages/interface-ipfs-core/package.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -64,46 +64,46 @@
6464
"dep-check": "aegir dep-check -i ipfs-core-types -i copyfiles -i @libp2p/interfaces"
6565
},
6666
"dependencies": {
67-
"@ipld/car": "^4.1.0",
68-
"@ipld/dag-cbor": "^7.0.0",
69-
"@ipld/dag-pb": "^2.1.3",
67+
"@ipld/car": "^5.0.0",
68+
"@ipld/dag-cbor": "^8.0.0",
69+
"@ipld/dag-pb": "^3.0.0",
7070
"@libp2p/crypto": "^1.0.0",
7171
"@libp2p/interface-peer-id": "^1.0.4",
7272
"@libp2p/interfaces": "^3.0.3",
7373
"@libp2p/peer-id": "^1.1.10",
7474
"@libp2p/peer-id-factory": "^1.0.10",
75-
"@libp2p/websockets": "^3.0.0",
75+
"@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",
8080
"aegir": "^37.0.11",
8181
"blockstore-core": "^2.0.1",
8282
"copyfiles": "^2.4.1",
83-
"dag-jose": "^2.0.1",
83+
"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.12.1",
88-
"ipfs-unixfs": "^7.0.0",
89-
"ipfs-unixfs-importer": "^10.0.2",
88+
"ipfs-unixfs": "^8.0.0",
89+
"ipfs-unixfs-importer": "^11.0.0",
9090
"ipfs-utils": "^9.0.6",
91-
"ipns": "^3.0.0",
91+
"ipns": "^4.0.0",
9292
"is-ipfs": "^7.0.0",
9393
"iso-random-stream": "^2.0.2",
94-
"it-all": "^1.0.4",
95-
"it-buffer-stream": "^2.0.0",
96-
"it-concat": "^2.0.0",
97-
"it-drain": "^1.0.3",
98-
"it-first": "^1.0.6",
99-
"it-last": "^1.0.4",
100-
"it-map": "^1.0.6",
94+
"it-all": "^2.0.0",
95+
"it-buffer-stream": "^3.0.0",
96+
"it-concat": "^3.0.1",
97+
"it-drain": "^2.0.0",
98+
"it-first": "^2.0.0",
99+
"it-last": "^2.0.0",
100+
"it-map": "^2.0.0",
101101
"it-pipe": "^2.0.3",
102102
"it-pushable": "^3.0.0",
103103
"it-tar": "^6.0.0",
104-
"it-to-buffer": "^2.0.0",
104+
"it-to-buffer": "^3.0.0",
105105
"merge-options": "^3.0.4",
106-
"multiformats": "^9.5.1",
106+
"multiformats": "^10.0.0",
107107
"nanoid": "^4.0.0",
108108
"p-defer": "^4.0.0",
109109
"p-map": "^5.3.0",
@@ -112,7 +112,7 @@
112112
"pako": "^2.0.4",
113113
"readable-stream": "^4.0.0",
114114
"sinon": "^14.0.0",
115-
"uint8arrays": "^3.0.0"
115+
"uint8arrays": "^4.0.2"
116116
},
117117
"browser": {
118118
"fs": false,

packages/interface-ipfs-core/src/miscellaneous/dns.js

+27-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export function testDns (factory, options) {
2929
after(() => factory.clean())
3030

3131
it('should non-recursively resolve ipfs.io', async function () {
32+
const domain = 'ipfs.io'
33+
3234
try {
33-
const res = await ipfs.dns('ipfs.io', { recursive: false })
35+
const res = await ipfs.dns(domain, { recursive: false })
3436

3537
// matches pattern /ipns/<ipnsaddress>
3638
expect(res).to.match(/\/ipns\/.+$/)
@@ -40,13 +42,21 @@ export function testDns (factory, options) {
4042
return this.skip()
4143
}
4244

45+
// happens when running tests offline
46+
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
47+
// @ts-expect-error this is mocha
48+
return this.skip()
49+
}
50+
4351
throw err
4452
}
4553
})
4654

4755
it('should recursively resolve ipfs.io', async function () {
56+
const domain = 'ipfs.io'
57+
4858
try {
49-
const res = await ipfs.dns('ipfs.io', { recursive: true })
59+
const res = await ipfs.dns(domain, { recursive: true })
5060

5161
// matches pattern /ipfs/<hash>
5262
expect(res).to.match(/\/ipfs\/.+$/)
@@ -56,13 +66,21 @@ export function testDns (factory, options) {
5666
return this.skip()
5767
}
5868

69+
// happens when running tests offline
70+
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
71+
// @ts-expect-error this is mocha
72+
return this.skip()
73+
}
74+
5975
throw err
6076
}
6177
})
6278

6379
it('should resolve subdomain docs.ipfs.io', async function () {
80+
const domain = 'docs.ipfs.io'
81+
6482
try {
65-
const res = await ipfs.dns('docs.ipfs.io')
83+
const res = await ipfs.dns(domain)
6684

6785
// matches pattern /ipfs/<hash>
6886
expect(res).to.match(/\/ipfs\/.+$/)
@@ -72,6 +90,12 @@ export function testDns (factory, options) {
7290
return this.skip()
7391
}
7492

93+
// happens when running tests offline
94+
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
95+
// @ts-expect-error this is mocha
96+
return this.skip()
97+
}
98+
7599
throw err
76100
}
77101
})

packages/interface-ipfs-core/src/miscellaneous/resolve.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,21 @@ export function testResolve (factory, options) {
9696
it('should resolve an IPNS DNS link', async function () {
9797
// @ts-expect-error this is mocha
9898
this.retries(3)
99-
const resolved = await ipfs.resolve('/ipns/ipfs.io')
99+
const domain = 'ipfs.io'
100100

101-
expect(isIpfs.ipfsPath(resolved)).to.be.true()
101+
try {
102+
const resolved = await ipfs.resolve(`/ipns/${domain}`)
103+
104+
expect(isIpfs.ipfsPath(resolved)).to.be.true()
105+
} catch (/** @type {any} */ err) {
106+
// happens when running tests offline
107+
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
108+
// @ts-expect-error this is mocha
109+
return this.skip()
110+
}
111+
112+
throw err
113+
}
102114
})
103115

104116
it('should resolve IPNS link recursively by default', async function () {

0 commit comments

Comments
 (0)