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

Commit

Permalink
feat!: upgrade libp2p to 0.40.x (#4237)
Browse files Browse the repository at this point in the history
Upgrades all deps to support `libp2p@0.40.x`.

BREAKING CHANGE: ipfs is now bundled with libp2p@0.40.x which has different config
  • Loading branch information
achingbrain authored Oct 24, 2022
1 parent dfc43d4 commit 0cee4a4
Show file tree
Hide file tree
Showing 72 changed files with 466 additions and 323 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run test:node -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:node --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: node
Expand All @@ -67,7 +67,7 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run test:chrome -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:chrome --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: chrome
Expand All @@ -84,7 +84,7 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run test:chrome-webworker -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:chrome-webworker --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: chrome-webworker
Expand All @@ -101,7 +101,7 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run test:firefox -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:firefox --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: firefox
Expand All @@ -119,7 +119,7 @@ jobs:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx playwright install --with-deps
- run: npm run test:firefox-webworker -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:firefox-webworker --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: firefox-webworker
Expand All @@ -138,7 +138,7 @@ jobs:
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:electron-main -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
run: npx lerna run test:electron-main --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: electron-main
Expand All @@ -162,7 +162,7 @@ jobs:
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm install
- run: npm run build
- run: npm run test:interop -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -- -t ${{ matrix.type }} --bail
- run: npx lerna run test:interop --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -t ${{ matrix.type }} --bail
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: interop-${{ matrix.type }}
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
node-version: lts/*
- run: npm install
- run: npm run build
- run: npm run ${{ matrix.suite }} -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -t ${{ matrix.type }}
- run: npx lerna run ${{ matrix.suite }} --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -t ${{ matrix.type }} --bail
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
flags: interface-${{ matrix.type }}
Expand All @@ -208,7 +208,7 @@ jobs:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx playwright install --with-deps
- run: npm run test:interface:message-port-client -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
- run: npx lerna run test:interface:message-port-client --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail

release:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"docker:rc:push-rc": "docker push ipfs/js-ipfs:v`npm show ipfs@next version -q`"
},
"devDependencies": {
"lerna": "^5.0.0",
"lerna": "^6.0.1",
"node-fetch": "npm:@achingbrain/node-fetch@^2.6.4",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2"
Expand Down
36 changes: 18 additions & 18 deletions packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,46 +64,46 @@
"dep-check": "aegir dep-check -i ipfs-core-types -i copyfiles -i @libp2p/interfaces"
},
"dependencies": {
"@ipld/car": "^4.1.0",
"@ipld/dag-cbor": "^7.0.0",
"@ipld/dag-pb": "^2.1.3",
"@ipld/car": "^5.0.0",
"@ipld/dag-cbor": "^8.0.0",
"@ipld/dag-pb": "^3.0.0",
"@libp2p/crypto": "^1.0.0",
"@libp2p/interface-peer-id": "^1.0.4",
"@libp2p/interfaces": "^3.0.3",
"@libp2p/peer-id": "^1.1.10",
"@libp2p/peer-id-factory": "^1.0.10",
"@libp2p/websockets": "^3.0.0",
"@libp2p/websockets": "^5.0.0",
"@multiformats/multiaddr": "^11.0.0",
"@types/node": "^18.0.0",
"@types/pako": "^2.0.0",
"@types/readable-stream": "^2.3.13",
"aegir": "^37.0.11",
"blockstore-core": "^2.0.1",
"copyfiles": "^2.4.1",
"dag-jose": "^2.0.1",
"dag-jose": "^3.0.1",
"delay": "^5.0.0",
"did-jwt": "^6.2.0",
"err-code": "^3.0.1",
"ipfs-core-types": "^0.12.1",
"ipfs-unixfs": "^7.0.0",
"ipfs-unixfs-importer": "^10.0.2",
"ipfs-unixfs": "^8.0.0",
"ipfs-unixfs-importer": "^11.0.0",
"ipfs-utils": "^9.0.6",
"ipns": "^3.0.0",
"ipns": "^4.0.0",
"is-ipfs": "^7.0.0",
"iso-random-stream": "^2.0.2",
"it-all": "^1.0.4",
"it-buffer-stream": "^2.0.0",
"it-concat": "^2.0.0",
"it-drain": "^1.0.3",
"it-first": "^1.0.6",
"it-last": "^1.0.4",
"it-map": "^1.0.6",
"it-all": "^2.0.0",
"it-buffer-stream": "^3.0.0",
"it-concat": "^3.0.1",
"it-drain": "^2.0.0",
"it-first": "^2.0.0",
"it-last": "^2.0.0",
"it-map": "^2.0.0",
"it-pipe": "^2.0.3",
"it-pushable": "^3.0.0",
"it-tar": "^6.0.0",
"it-to-buffer": "^2.0.0",
"it-to-buffer": "^3.0.0",
"merge-options": "^3.0.4",
"multiformats": "^9.5.1",
"multiformats": "^10.0.0",
"nanoid": "^4.0.0",
"p-defer": "^4.0.0",
"p-map": "^5.3.0",
Expand All @@ -112,7 +112,7 @@
"pako": "^2.0.4",
"readable-stream": "^4.0.0",
"sinon": "^14.0.0",
"uint8arrays": "^3.0.0"
"uint8arrays": "^4.0.2"
},
"browser": {
"fs": false,
Expand Down
30 changes: 27 additions & 3 deletions packages/interface-ipfs-core/src/miscellaneous/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export function testDns (factory, options) {
after(() => factory.clean())

it('should non-recursively resolve ipfs.io', async function () {
const domain = 'ipfs.io'

try {
const res = await ipfs.dns('ipfs.io', { recursive: false })
const res = await ipfs.dns(domain, { recursive: false })

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

// happens when running tests offline
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
// @ts-expect-error this is mocha
return this.skip()
}

throw err
}
})

it('should recursively resolve ipfs.io', async function () {
const domain = 'ipfs.io'

try {
const res = await ipfs.dns('ipfs.io', { recursive: true })
const res = await ipfs.dns(domain, { recursive: true })

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

// happens when running tests offline
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
// @ts-expect-error this is mocha
return this.skip()
}

throw err
}
})

it('should resolve subdomain docs.ipfs.io', async function () {
const domain = 'docs.ipfs.io'

try {
const res = await ipfs.dns('docs.ipfs.io')
const res = await ipfs.dns(domain)

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

// happens when running tests offline
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
// @ts-expect-error this is mocha
return this.skip()
}

throw err
}
})
Expand Down
16 changes: 14 additions & 2 deletions packages/interface-ipfs-core/src/miscellaneous/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,21 @@ export function testResolve (factory, options) {
it('should resolve an IPNS DNS link', async function () {
// @ts-expect-error this is mocha
this.retries(3)
const resolved = await ipfs.resolve('/ipns/ipfs.io')
const domain = 'ipfs.io'

expect(isIpfs.ipfsPath(resolved)).to.be.true()
try {
const resolved = await ipfs.resolve(`/ipns/${domain}`)

expect(isIpfs.ipfsPath(resolved)).to.be.true()
} catch (/** @type {any} */ err) {
// happens when running tests offline
if (err.message.includes(`ECONNREFUSED ${domain}`)) {
// @ts-expect-error this is mocha
return this.skip()
}

throw err
}
})

it('should resolve IPNS link recursively by default', async function () {
Expand Down
Loading

0 comments on commit 0cee4a4

Please sign in to comment.