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

Commit 061d77c

Browse files
authored
chore: update deps (#3514)
BREAKING CHANGE: ipfs-repo upgrade requires repo migration to v10
1 parent 7e188f2 commit 061d77c

File tree

181 files changed

+693
-687
lines changed

Some content is hidden

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

181 files changed

+693
-687
lines changed

.github/workflows/bundlesize.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [12.x]
13+
node-version: [14.x]
1414
project:
1515
- packages/ipfs-core-utils
1616
- packages/ipfs-core

.github/workflows/typecheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
node-version: [12.x]
12+
node-version: [14.x]
1313
project:
1414
- packages/ipfs-core-utils
1515
- packages/ipfs-core

.travis.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
- name: external - sidetree
6464

6565
include:
66-
# manual install step, we do this to cache the installed files for subsequent steps
6766
- stage: test
6867
name: lint
6968
script:
@@ -272,9 +271,8 @@ jobs:
272271
- stage: test
273272
name: examples
274273
script:
275-
# Travis lets scripts continue even if previous steps fail: https://github.com/travis-ci/travis-ci/issues/1066
276-
- npm run build -- --scope={ipfs-core,ipfs,ipfs-http-client,ipfs-message-port-*} &&
277-
npm run configure-examples &&
274+
# Travis lets scripts continue even if previous steps fail so need to use &&: https://github.com/travis-ci/travis-ci/issues/1066
275+
- npm run configure-examples &&
278276
npm run test -- --scope=example* --concurrency=1
279277

280278
- stage: release-rc

examples/browser-exchange-files/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"execa": "^4.0.3",
1616
"http-server": "^0.12.3",
1717
"ipfs-http-client": "^48.2.2",
18-
"uint8arrays": "^1.1.0"
18+
"uint8arrays": "^2.0.5"
1919
},
2020
"dependencies": {
2121
"ipfs": "^0.53.2",

examples/browser-ipns-publish/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"human-crypto-keys": "^0.1.4",
1616
"ipfs": "^0.53.2",
1717
"ipfs-http-client": "^48.2.2",
18-
"ipfs-utils": "^5.0.0",
18+
"ipfs-utils": "^6.0.0",
1919
"ipns": "^0.8.0",
2020
"it-last": "^1.0.4",
2121
"p-retry": "^4.2.0",
22-
"uint8arrays": "^1.1.0"
22+
"uint8arrays": "^2.0.5"
2323
},
2424
"browserslist": [
2525
"last 2 versions and not dead and > 2%"

examples/circuit-relaying/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ipfs": "^0.53.2",
1919
"ipfs-pubsub-room": "^2.0.1",
2020
"libp2p-websockets": "^0.15.0",
21-
"uint8arrays": "^1.1.0"
21+
"uint8arrays": "^2.0.5"
2222
},
2323
"devDependencies": {
2424
"execa": "^4.0.3",

examples/custom-ipfs-repo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"datastore-fs": "^2.0.0",
1414
"ipfs": "^0.53.2",
15-
"ipfs-repo": "^7.0.0",
15+
"ipfs-repo": "^8.0.0",
1616
"it-all": "^1.0.4"
1717
},
1818
"devDependencies": {

examples/custom-ipld-formats/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"ipfs-http-client": "^48.2.2",
1818
"multicodec": "^2.0.1",
1919
"multihashing-async": "^2.0.1",
20-
"uint8arrays": "^1.1.0"
20+
"uint8arrays": "^2.0.5"
2121
}
2222
}

examples/ipfs-101/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"ipfs": "^0.53.2",
1414
"it-all": "^1.0.4",
15-
"uint8arrays": "^1.1.0"
15+
"uint8arrays": "^2.0.5"
1616
},
1717
"devDependencies": {
1818
"test-ipfs-example": "^2.0.3"

examples/run-in-electron/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"author": "David Dias <[email protected]>",
1717
"license": "MIT",
1818
"devDependencies": {
19-
"electron": "^6.0.0",
20-
"electron-rebuild": "^1.8.4",
19+
"electron": "^11.2.1",
20+
"electron-rebuild": "^2.3.4",
2121
"ipfs": "^0.53.2",
2222
"test-ipfs-example": "^2.0.3"
2323
},

examples/test-ipfs-example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"fs-extra": "^9.0.1",
1313
"http-server": "^0.12.3",
1414
"nightwatch": "^1.2.4",
15-
"uint8arrays": "^1.1.0",
15+
"uint8arrays": "^2.0.5",
1616
"which": "^2.0.1"
1717
}
1818
}

examples/types-use-ipfs-from-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ipfs": "^0.53.2"
66
},
77
"devDependencies": {
8-
"typescript": "4.0.x"
8+
"typescript": "4.1.x"
99
},
1010
"scripts": {
1111
"test": "tsc --noEmit"

examples/types-use-ipfs-from-typed-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ipfs": "^0.53.2"
66
},
77
"devDependencies": {
8-
"typescript": "4.0.x"
8+
"typescript": "4.1.x"
99
},
1010
"scripts": {
1111
"test": "tsc --noEmit"

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "JavaScript implementation of the IPFS specification",
55
"scripts": {
6-
"postinstall": "lerna bootstrap && npm run build -- --scope=ipfs-grpc-protocol",
6+
"postinstall": "lerna bootstrap",
77
"link": "lerna link",
88
"reset": "lerna run clean && rimraf packages/*/node_modules node_modules",
99
"test": "lerna run test",
@@ -23,11 +23,10 @@
2323
"test:interface:message-port-client": "lerna run test:interface:message-port-client",
2424
"coverage": "lerna run coverage",
2525
"build": "lerna run build",
26-
"build:types": "lerna run build:types",
2726
"clean": "lerna run clean",
2827
"lint": "lerna run lint",
2928
"dep-check": "lerna run dep-check",
30-
"configure-examples": "run-s release:pre:add-examples release:pre:add-hoisted-modules release:pre:reinstall",
29+
"configure-examples": "run-s release:pre:add-examples release:pre:add-hoisted-modules release:pre:reinstall && npm run build -- --scope={ipfs-core,ipfs,ipfs-http-client,ipfs-message-port-*}",
3130
"release": "run-s release:pre:* release:publish docker:release release:post:*",
3231
"release:pre:non-dirty-repo": "git diff --quiet",
3332
"release:pre:update-contributors": "aegir release --lint=false --test=false --bump=false --build=false --changelog=false --commit=false --tag=false --push=false --ghrelease=false --docs=false --publish=false",

packages/interface-ipfs-core/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"license": "MIT",
3232
"dependencies": {
33-
"aegir": "^29.2.2",
33+
"aegir": "^30.3.0",
3434
"chai": "^4.2.0",
3535
"chai-as-promised": "^7.1.1",
3636
"chai-subset": "^1.6.0",
@@ -40,7 +40,7 @@
4040
"err-code": "^2.0.3",
4141
"ipfs-unixfs": "^2.0.3",
4242
"ipfs-unixfs-importer": "^5.0.0",
43-
"ipfs-utils": "^5.0.0",
43+
"ipfs-utils": "^6.0.0",
4444
"ipld-block": "^0.11.0",
4545
"ipld-dag-cbor": "^0.17.0",
4646
"ipld-dag-pb": "^0.20.0",
@@ -51,6 +51,7 @@
5151
"it-buffer-stream": "^1.0.5",
5252
"it-concat": "^1.0.1",
5353
"it-drain": "^1.0.3",
54+
"it-first": "^1.0.4",
5455
"it-last": "^1.0.4",
5556
"it-map": "^1.0.4",
5657
"it-pushable": "^1.4.0",
@@ -64,7 +65,7 @@
6465
"p-map": "^4.0.0",
6566
"peer-id": "^0.14.1",
6667
"readable-stream": "^3.4.0",
67-
"uint8arrays": "^1.1.0"
68+
"uint8arrays": "^2.0.5"
6869
},
6970
"contributors": [
7071
"Alan Shaw <[email protected]>",

packages/interface-ipfs-core/src/add.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ module.exports = (common, options) => {
346346
})
347347

348348
it('should not add from an invalid url', () => {
349-
return expect(ipfs.add(urlSource('123http://invalid'))).to.eventually.be.rejected()
349+
return expect(() => ipfs.add(urlSource('123http://invalid'))).to.throw()
350350
})
351351

352352
it('should respect raw leaves when file is smaller than one block and no metadata is present', async () => {

packages/interface-ipfs-core/src/files/write.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ module.exports = (common, options) => {
452452

453453
const actualBytes = uint8ArrayConcat(await all(ipfs.files.read(fileName)))
454454

455-
for (var i = 0; i < newDataStream.length; i++) {
455+
for (let i = 0; i < newDataStream.length; i++) {
456456
if (newDataStream[i] !== actualBytes[i]) {
457457
if (initialStream[i] === actualBytes[i]) {
458458
throw new Error(`Bytes at index ${i} were not overwritten - expected ${newDataStream[i]} actual ${initialStream[i]}`)

packages/interface-ipfs-core/src/pin/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const CID = require('cids')
66
const drain = require('it-drain')
77
const map = require('it-map')
88
const fromString = require('uint8arrays/from-string')
9+
const first = require('it-first')
910

1011
const pinTypes = {
1112
direct: 'direct',
@@ -93,10 +94,9 @@ const expectNotPinned = (ipfs, cid, type = pinTypes.all) => {
9394

9495
async function isPinnedWithType (ipfs, cid, type) {
9596
try {
96-
for await (const _ of ipfs.pin.ls({ paths: cid, type })) { // eslint-disable-line no-unused-vars
97-
return true
98-
}
99-
return false
97+
const res = await first(ipfs.pin.ls({ paths: cid, type }))
98+
99+
return Boolean(res)
100100
} catch (err) {
101101
return false
102102
}

packages/interface-ipfs-core/src/pubsub/subscribe.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const delay = require('delay')
1212
const AbortController = require('native-abort-controller')
1313
const { isWebWorker, isNode } = require('ipfs-utils/src/env')
1414
const getIpfsOptions = require('../utils/ipfs-options-websockets-filter-all')
15+
const first = require('it-first')
1516

1617
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
1718
/**
@@ -68,14 +69,12 @@ module.exports = (common, options) => {
6869

6970
await ipfs1.pubsub.publish(topic, uint8ArrayFromString('hi'))
7071

71-
for await (const msg of msgStream) {
72-
expect(uint8ArrayToString(msg.data)).to.equal('hi')
73-
expect(msg).to.have.property('seqno')
74-
expect(msg.seqno).to.be.an.instanceof(Uint8Array)
75-
expect(msg.topicIDs[0]).to.eq(topic)
76-
expect(msg).to.have.property('from', ipfs1.peerId.id)
77-
break
78-
}
72+
const msg = await first(msgStream)
73+
expect(uint8ArrayToString(msg.data)).to.equal('hi')
74+
expect(msg).to.have.property('seqno')
75+
expect(msg.seqno).to.be.an.instanceof(Uint8Array)
76+
expect(msg.topicIDs[0]).to.eq(topic)
77+
expect(msg).to.have.property('from', ipfs1.peerId.id)
7978
})
8079

8180
it('should subscribe to one topic with options', async () => {

packages/interface-ipfs-core/src/swarm/peers.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ module.exports = (common, options) => {
108108

109109
it('should list peers only once even if they have multiple addresses', async () => {
110110
// TODO: Change to port 0, needs: https://github.com/ipfs/interface-ipfs-core/issues/152
111-
const config = getConfig(isBrowser && common.opts.type !== 'go' ? [
112-
'/ip4/127.0.0.1/tcp/14578/ws/p2p-webrtc-star',
113-
'/ip4/127.0.0.1/tcp/14579/ws/p2p-webrtc-star'
114-
] : [
115-
'/ip4/127.0.0.1/tcp/26545/ws',
116-
'/ip4/127.0.0.1/tcp/26546/ws'
117-
])
111+
const config = getConfig(isBrowser && common.opts.type !== 'go'
112+
? [
113+
'/ip4/127.0.0.1/tcp/14578/ws/p2p-webrtc-star',
114+
'/ip4/127.0.0.1/tcp/14579/ws/p2p-webrtc-star'
115+
]
116+
: [
117+
'/ip4/127.0.0.1/tcp/26545/ws',
118+
'/ip4/127.0.0.1/tcp/26546/ws'
119+
])
118120

119121
const nodeA = (await common.spawn({ type: 'proc', ipfsOptions })).api
120122
const nodeB = (await common.spawn({

packages/ipfs-cli/package.json

+8-10
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020
},
2121
"scripts": {
2222
"lint": "aegir lint",
23-
"build": "npm run build:types",
24-
"build:types": "tsc --build",
23+
"prepare": "aegir build --no-bundle",
2524
"test": "npm run test:node",
2625
"test:node": "aegir test -t node",
2726
"coverage": "nyc --reporter=text --reporter=lcov npm run test:node",
2827
"clean": "rimraf ./dist",
29-
"dep-check": "aegir dep-check -i @types/yargs -i typescript -i cid-tool"
28+
"dep-check": "aegir dep-check -i @types/yargs -i cid-tool"
3029
},
3130
"dependencies": {
3231
"bignumber.js": "^9.0.0",
@@ -41,8 +40,8 @@
4140
"ipfs-core-utils": "^0.6.1",
4241
"ipfs-daemon": "^0.4.2",
4342
"ipfs-http-client": "^48.2.2",
44-
"ipfs-repo": "^7.0.0",
45-
"ipfs-utils": "^5.0.0",
43+
"ipfs-repo": "^8.0.0",
44+
"ipfs-utils": "^6.0.0",
4645
"ipld-dag-cbor": "^0.17.0",
4746
"ipld-dag-pb": "^0.20.0",
4847
"it-all": "^1.0.4",
@@ -63,18 +62,17 @@
6362
"progress": "^2.0.3",
6463
"stream-to-it": "^0.2.2",
6564
"streaming-iterables": "^5.0.2",
66-
"uint8arrays": "^1.1.0",
65+
"uint8arrays": "^2.0.5",
6766
"yargs": "^16.0.3"
6867
},
6968
"devDependencies": {
70-
"@types/yargs": "^15.0.9",
71-
"aegir": "^29.2.2",
69+
"@types/yargs": "^16.0.0",
70+
"aegir": "^30.3.0",
7271
"nanoid": "^3.1.12",
7372
"ncp": "^2.0.0",
7473
"rimraf": "^3.0.2",
7574
"sinon": "^9.0.3",
7675
"string-argv": "^0.3.1",
77-
"temp-write": "^4.0.0",
78-
"typescript": "4.0.x"
76+
"temp-write": "^4.0.0"
7977
}
8078
}

packages/ipfs-cli/src/commands/add.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
} = require('../utils')
1515
const { cidToString } = require('ipfs-core-utils/src/cid')
1616
const globSource = require('ipfs-utils/src/files/glob-source')
17-
const parseDuration = require('parse-duration').default
17+
const { default: parseDuration } = require('parse-duration')
1818

1919
async function getTotalBytes (paths) {
2020
const sizes = await Promise.all(paths.map(p => getFolderSize(p)))
@@ -255,10 +255,10 @@ module.exports = {
255255
mtime
256256
})
257257
: {
258-
content: getStdin(),
259-
mode,
260-
mtime
261-
} // Pipe to ipfs.add tagging with mode and mtime
258+
content: getStdin(),
259+
mode,
260+
mtime
261+
} // Pipe to ipfs.add tagging with mode and mtime
262262

263263
let finalCid
264264

packages/ipfs-cli/src/commands/bitswap/stat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const multibase = require('multibase')
44
const { cidToString } = require('ipfs-core-utils/src/cid')
55
const prettyBytes = require('pretty-bytes')
6-
const parseDuration = require('parse-duration').default
6+
const { default: parseDuration } = require('parse-duration')
77

88
module.exports = {
99
command: 'stat',

packages/ipfs-cli/src/commands/bitswap/unwant.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const multibase = require('multibase')
44
const { cidToString } = require('ipfs-core-utils/src/cid')
5-
const parseDuration = require('parse-duration').default
5+
const { default: parseDuration } = require('parse-duration')
66

77
module.exports = {
88
command: 'unwant <key>',

packages/ipfs-cli/src/commands/bitswap/wantlist.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const multibase = require('multibase')
44
const { cidToString } = require('ipfs-core-utils/src/cid')
5-
const parseDuration = require('parse-duration').default
5+
const { default: parseDuration } = require('parse-duration')
66

77
module.exports = {
88
command: 'wantlist [peer]',

packages/ipfs-cli/src/commands/block/get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const parseDuration = require('parse-duration').default
3+
const { default: parseDuration } = require('parse-duration')
44
const uint8ArrayToString = require('uint8arrays/to-string')
55

66
module.exports = {

0 commit comments

Comments
 (0)