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

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
Depends on:

- [ ] ipfs/eslint-config-ipfs#4

BREAKING CHANGE: ipfs-repo dep update requires an database migration to v10
  • Loading branch information
achingbrain committed Jan 31, 2021
1 parent 7e188f2 commit e4d8796
Show file tree
Hide file tree
Showing 180 changed files with 697 additions and 689 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bundlesize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
project:
- packages/ipfs-core-utils
- packages/ipfs-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
project:
- packages/ipfs-core-utils
- packages/ipfs-core
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-exchange-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"execa": "^4.0.3",
"http-server": "^0.12.3",
"ipfs-http-client": "^48.2.2",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
},
"dependencies": {
"ipfs": "^0.53.2",
Expand Down
4 changes: 2 additions & 2 deletions examples/browser-ipns-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"human-crypto-keys": "^0.1.4",
"ipfs": "^0.53.2",
"ipfs-http-client": "^48.2.2",
"ipfs-utils": "^5.0.0",
"ipfs-utils": "^6.0.0",
"ipns": "^0.8.0",
"it-last": "^1.0.4",
"p-retry": "^4.2.0",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
},
"browserslist": [
"last 2 versions and not dead and > 2%"
Expand Down
2 changes: 1 addition & 1 deletion examples/circuit-relaying/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ipfs": "^0.53.2",
"ipfs-pubsub-room": "^2.0.1",
"libp2p-websockets": "^0.15.0",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
},
"devDependencies": {
"execa": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-ipfs-repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"datastore-fs": "^2.0.0",
"ipfs": "^0.53.2",
"ipfs-repo": "^7.0.0",
"ipfs-repo": "^8.0.0",
"it-all": "^1.0.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-ipld-formats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"ipfs-http-client": "^48.2.2",
"multicodec": "^2.0.1",
"multihashing-async": "^2.0.1",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
}
}
2 changes: 1 addition & 1 deletion examples/ipfs-101/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"ipfs": "^0.53.2",
"it-all": "^1.0.4",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
},
"devDependencies": {
"test-ipfs-example": "^2.0.3"
Expand Down
4 changes: 2 additions & 2 deletions examples/run-in-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"devDependencies": {
"electron": "^6.0.0",
"electron-rebuild": "^1.8.4",
"electron": "^11.2.1",
"electron-rebuild": "^2.3.4",
"ipfs": "^0.53.2",
"test-ipfs-example": "^2.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/test-ipfs-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fs-extra": "^9.0.1",
"http-server": "^0.12.3",
"nightwatch": "^1.2.4",
"uint8arrays": "^1.1.0",
"uint8arrays": "^2.0.5",
"which": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion examples/types-use-ipfs-from-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ipfs": "^0.53.2"
},
"devDependencies": {
"typescript": "4.0.x"
"typescript": "4.1.x"
},
"scripts": {
"test": "tsc --noEmit"
Expand Down
2 changes: 1 addition & 1 deletion examples/types-use-ipfs-from-typed-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ipfs": "^0.53.2"
},
"devDependencies": {
"typescript": "4.0.x"
"typescript": "4.1.x"
},
"scripts": {
"test": "tsc --noEmit"
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "JavaScript implementation of the IPFS specification",
"scripts": {
"postinstall": "lerna bootstrap && npm run build -- --scope=ipfs-grpc-protocol",
"postinstall": "lerna bootstrap",
"link": "lerna link",
"reset": "lerna run clean && rimraf packages/*/node_modules node_modules",
"test": "lerna run test",
Expand All @@ -23,7 +23,6 @@
"test:interface:message-port-client": "lerna run test:interface:message-port-client",
"coverage": "lerna run coverage",
"build": "lerna run build",
"build:types": "lerna run build:types",
"clean": "lerna run clean",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
Expand Down
7 changes: 4 additions & 3 deletions packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"license": "MIT",
"dependencies": {
"aegir": "^29.2.2",
"aegir": "^30.3.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
Expand All @@ -40,7 +40,7 @@
"err-code": "^2.0.3",
"ipfs-unixfs": "^2.0.3",
"ipfs-unixfs-importer": "^5.0.0",
"ipfs-utils": "^5.0.0",
"ipfs-utils": "^6.0.0",
"ipld-block": "^0.11.0",
"ipld-dag-cbor": "^0.17.0",
"ipld-dag-pb": "^0.20.0",
Expand All @@ -51,6 +51,7 @@
"it-buffer-stream": "^1.0.5",
"it-concat": "^1.0.1",
"it-drain": "^1.0.3",
"it-first": "^1.0.4",
"it-last": "^1.0.4",
"it-map": "^1.0.4",
"it-pushable": "^1.4.0",
Expand All @@ -64,7 +65,7 @@
"p-map": "^4.0.0",
"peer-id": "^0.14.1",
"readable-stream": "^3.4.0",
"uint8arrays": "^1.1.0"
"uint8arrays": "^2.0.5"
},
"contributors": [
"Alan Shaw <alan.shaw@protocol.ai>",
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ module.exports = (common, options) => {
})

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

it('should respect raw leaves when file is smaller than one block and no metadata is present', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/files/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ module.exports = (common, options) => {

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

for (var i = 0; i < newDataStream.length; i++) {
for (let i = 0; i < newDataStream.length; i++) {
if (newDataStream[i] !== actualBytes[i]) {
if (initialStream[i] === actualBytes[i]) {
throw new Error(`Bytes at index ${i} were not overwritten - expected ${newDataStream[i]} actual ${initialStream[i]}`)
Expand Down
8 changes: 4 additions & 4 deletions packages/interface-ipfs-core/src/pin/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const CID = require('cids')
const drain = require('it-drain')
const map = require('it-map')
const fromString = require('uint8arrays/from-string')
const first = require('it-first')

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

async function isPinnedWithType (ipfs, cid, type) {
try {
for await (const _ of ipfs.pin.ls({ paths: cid, type })) { // eslint-disable-line no-unused-vars
return true
}
return false
const res = await first(ipfs.pin.ls({ paths: cid, type }))

return Boolean(res)
} catch (err) {
return false
}
Expand Down
15 changes: 7 additions & 8 deletions packages/interface-ipfs-core/src/pubsub/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const delay = require('delay')
const AbortController = require('native-abort-controller')
const { isWebWorker, isNode } = require('ipfs-utils/src/env')
const getIpfsOptions = require('../utils/ipfs-options-websockets-filter-all')
const first = require('it-first')

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

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

for await (const msg of msgStream) {
expect(uint8ArrayToString(msg.data)).to.equal('hi')
expect(msg).to.have.property('seqno')
expect(msg.seqno).to.be.an.instanceof(Uint8Array)
expect(msg.topicIDs[0]).to.eq(topic)
expect(msg).to.have.property('from', ipfs1.peerId.id)
break
}
const msg = await first(msgStream)
expect(uint8ArrayToString(msg.data)).to.equal('hi')
expect(msg).to.have.property('seqno')
expect(msg.seqno).to.be.an.instanceof(Uint8Array)
expect(msg.topicIDs[0]).to.eq(topic)
expect(msg).to.have.property('from', ipfs1.peerId.id)
})

it('should subscribe to one topic with options', async () => {
Expand Down
16 changes: 9 additions & 7 deletions packages/interface-ipfs-core/src/swarm/peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ module.exports = (common, options) => {

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

const nodeA = (await common.spawn({ type: 'proc', ipfsOptions })).api
const nodeB = (await common.spawn({
Expand Down
18 changes: 8 additions & 10 deletions packages/ipfs-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
},
"scripts": {
"lint": "aegir lint",
"build": "npm run build:types",
"build:types": "tsc --build",
"prepare": "aegir build --no-bundle",
"test": "npm run test:node",
"test:node": "aegir test -t node",
"coverage": "nyc --reporter=text --reporter=lcov npm run test:node",
"clean": "rimraf ./dist",
"dep-check": "aegir dep-check -i @types/yargs -i typescript -i cid-tool"
"dep-check": "aegir dep-check -i @types/yargs -i cid-tool"
},
"dependencies": {
"bignumber.js": "^9.0.0",
Expand All @@ -41,8 +40,8 @@
"ipfs-core-utils": "^0.6.1",
"ipfs-daemon": "^0.4.2",
"ipfs-http-client": "^48.2.2",
"ipfs-repo": "^7.0.0",
"ipfs-utils": "^5.0.0",
"ipfs-repo": "^8.0.0",
"ipfs-utils": "^6.0.0",
"ipld-dag-cbor": "^0.17.0",
"ipld-dag-pb": "^0.20.0",
"it-all": "^1.0.4",
Expand All @@ -63,18 +62,17 @@
"progress": "^2.0.3",
"stream-to-it": "^0.2.2",
"streaming-iterables": "^5.0.2",
"uint8arrays": "^1.1.0",
"uint8arrays": "^2.0.5",
"yargs": "^16.0.3"
},
"devDependencies": {
"@types/yargs": "^15.0.9",
"aegir": "^29.2.2",
"@types/yargs": "^16.0.0",
"aegir": "^30.3.0",
"nanoid": "^3.1.12",
"ncp": "^2.0.0",
"rimraf": "^3.0.2",
"sinon": "^9.0.3",
"string-argv": "^0.3.1",
"temp-write": "^4.0.0",
"typescript": "4.0.x"
"temp-write": "^4.0.0"
}
}
24 changes: 12 additions & 12 deletions packages/ipfs-cli/src/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {
} = require('../utils')
const { cidToString } = require('ipfs-core-utils/src/cid')
const globSource = require('ipfs-utils/src/files/glob-source')
const parseDuration = require('parse-duration').default
const { default: parseDuration } = require('parse-duration')

async function getTotalBytes (paths) {
const sizes = await Promise.all(paths.map(p => getFolderSize(p)))
Expand Down Expand Up @@ -247,18 +247,18 @@ module.exports = {

const source = file
? globSource(file, {
recursive,
hidden,
preserveMode,
preserveMtime,
mode,
mtime
})
recursive,
hidden,
preserveMode,
preserveMtime,
mode,
mtime
})
: {
content: getStdin(),
mode,
mtime
} // Pipe to ipfs.add tagging with mode and mtime
content: getStdin(),
mode,
mtime
} // Pipe to ipfs.add tagging with mode and mtime

let finalCid

Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/bitswap/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const multibase = require('multibase')
const { cidToString } = require('ipfs-core-utils/src/cid')
const prettyBytes = require('pretty-bytes')
const parseDuration = require('parse-duration').default
const { default: parseDuration } = require('parse-duration')

module.exports = {
command: 'stat',
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/bitswap/unwant.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = {
command: 'unwant <key>',
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/bitswap/wantlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = {
command: 'wantlist [peer]',
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/block/get.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

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

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/block/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs')
const multibase = require('multibase')
const concat = require('it-concat')
const { cidToString } = require('ipfs-core-utils/src/cid')
const parseDuration = require('parse-duration').default
const { default: parseDuration } = require('parse-duration')

module.exports = {
command: 'put [block]',
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-cli/src/commands/block/rm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const parseDuration = require('parse-duration').default
const { default: parseDuration } = require('parse-duration')

module.exports = {
command: 'rm <hash...>',
Expand Down
Loading

0 comments on commit e4d8796

Please sign in to comment.