Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 5bd24c7

Browse files
hugomrdiasdaviddias
authored andcommitted
fix: remove unused deps (#880)
* chore: remove ipld formats re-export (#872) Prior to this change the `ipld-dag-cbor` and `ipld-dag-pb` modules are re-exported so that can be accessed within the Browser bundle. Those modules normally don't need to be used directly, they are kind of implementation details of IPLD. Hence remove them. BREAKING CHANGE: remove `types.dagCBOR` and `types.dagPB` from public API If you need the `ipld-dag-cbor` or `ipld-dag-pb` module in the Browser, you need to bundle them yourself. * chore: update to ipld-dag-cbor 0.13 No further changes are needed as js-ipfs-api is getting the raw blocks from IPFS and does the whole parsing client-sided in JavaScript. BREAKING CHANGE: dag-cbor nodes now represent links as CID objects The API for [dag-cbor](https://github.com/ipld/js-ipld-dag-cbor) changed. Links are no longer represented as JSON objects (`{"/": "base-encoded-cid"}`, but as [CID objects](https://github.com/ipld/js-cid). `ipfs.dag.get()` and now always return links as CID objects. `ipfs.dag.put()` also expects links to be represented as CID objects. The old-style JSON objects representation is still supported, but deprecated. Prior to this change: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as JSON object representation const putCid = await ipfs.dag.put({link: {'/': cid.toBaseEncodedString()}}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: { '/': <Buffer 12 20 8a…> } } ``` Now: ```js const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5') // Link as CID object const putCid = await ipfs.dag.put({link: cid}) const result = await ipfs.dag.get(putCid) console.log(result.value) ``` Output: ```js { link: CID { codec: 'dag-pb', version: 0, multihash: <Buffer 12 20 8a…> } } ``` See ipld/ipld#44 for more information on why this change was made. * chore: update deps * fix: remove unused deps * chore: remove socket.io, not used anymore
1 parent 6526456 commit 5bd24c7

File tree

3 files changed

+25
-35
lines changed

3 files changed

+25
-35
lines changed

package.json

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,44 @@
2828
},
2929
"dependencies": {
3030
"async": "^2.6.1",
31-
"big.js": "^5.1.2",
32-
"bl": "^2.1.1",
31+
"big.js": "^5.2.2",
32+
"bl": "^2.1.2",
3333
"bs58": "^4.0.1",
34-
"cids": "~0.5.3",
34+
"cids": "~0.5.5",
3535
"concat-stream": "^1.6.2",
36-
"debug": "^3.1.0",
37-
"detect-node": "^2.0.3",
36+
"debug": "^4.1.0",
37+
"detect-node": "^2.0.4",
3838
"end-of-stream": "^1.4.1",
3939
"flatmap": "0.0.3",
40-
"glob": "^7.1.2",
41-
"ipfs-block": "~0.7.1",
42-
"ipfs-unixfs": "~0.1.15",
43-
"ipld-dag-cbor": "~0.12.1",
44-
"ipld-dag-pb": "~0.14.6",
45-
"is-ipfs": "~0.4.2",
40+
"glob": "^7.1.3",
41+
"ipfs-block": "~0.8.0",
42+
"ipfs-unixfs": "~0.1.16",
43+
"ipld-dag-cbor": "~0.13.0",
44+
"ipld-dag-pb": "~0.14.11",
45+
"is-ipfs": "~0.4.7",
4646
"is-pull-stream": "0.0.0",
4747
"is-stream": "^1.1.0",
48-
"libp2p-crypto": "~0.13.0",
48+
"libp2p-crypto": "~0.14.0",
4949
"lodash": "^4.17.11",
5050
"lru-cache": "^4.1.3",
5151
"multiaddr": "^5.0.0",
52-
"multibase": "~0.4.0",
53-
"multihashes": "~0.4.13",
52+
"multibase": "~0.5.0",
53+
"multihashes": "~0.4.14",
5454
"ndjson": "^1.5.0",
5555
"once": "^1.4.0",
56-
"peer-id": "~0.11.0",
56+
"peer-id": "~0.12.0",
5757
"peer-info": "~0.14.1",
5858
"promisify-es6": "^1.0.3",
59-
"pull-defer": "~0.2.2",
59+
"pull-defer": "~0.2.3",
6060
"pull-pushable": "^2.2.0",
6161
"pull-stream-to-stream": "^1.3.4",
6262
"pump": "^3.0.0",
6363
"qs": "^6.5.2",
64-
"readable-stream": "^2.3.6",
64+
"readable-stream": "^3.0.6",
6565
"stream-http": "^3.0.0",
6666
"stream-to-pull-stream": "^1.7.2",
6767
"streamifier": "~0.1.1",
68-
"tar-stream": "^1.6.1",
68+
"tar-stream": "^1.6.2"
6969
"through2": "^2.0.3"
7070
},
7171
"engines": {
@@ -77,19 +77,17 @@
7777
"url": "https://github.com/ipfs/js-ipfs-api"
7878
},
7979
"devDependencies": {
80-
"aegir": "^15.1.0",
80+
"aegir": "^17.0.1",
8181
"browser-process-platform": "~0.1.1",
82-
"chai": "^4.1.2",
82+
"chai": "^4.2.0",
8383
"cross-env": "^5.2.0",
8484
"dirty-chai": "^2.0.1",
85-
"eslint-plugin-react": "^7.10.0",
85+
"eslint-plugin-react": "^7.11.1",
8686
"go-ipfs-dep": "~0.4.17",
8787
"gulp": "^3.9.1",
88-
"interface-ipfs-core": "~0.80.0",
89-
"ipfsd-ctl": "~0.39.0",
90-
"pull-stream": "^3.6.8",
91-
"socket.io": "^2.1.1",
92-
"socket.io-client": "^2.1.1",
88+
"interface-ipfs-core": "~0.81.0",
89+
"ipfsd-ctl": "~0.39.5",
90+
"pull-stream": "^3.6.9",
9391
"stream-equal": "^1.1.1"
9492
},
9593
"keywords": [

src/types.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict'
22

33
const CID = require('cids')
4-
const dagCBOR = require('ipld-dag-cbor')
5-
const dagPB = require('ipld-dag-pb')
64
const multiaddr = require('multiaddr')
75
const multibase = require('multibase')
86
const multihash = require('multihashes')
@@ -12,8 +10,6 @@ const PeerInfo = require('peer-info')
1210
module.exports = () => ({
1311
Buffer: Buffer,
1412
CID: CID,
15-
dagPB: dagPB,
16-
dagCBOR: dagCBOR,
1713
multiaddr: multiaddr,
1814
multibase: multibase,
1915
multihash: multihash,

test/types.spec.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
const PeerId = require('peer-id')
55
const PeerInfo = require('peer-info')
6-
const dagCBOR = require('ipld-dag-cbor')
7-
const dagPB = require('ipld-dag-pb')
86
const multiaddr = require('multiaddr')
97
const multibase = require('multibase')
108
const multihash = require('multihashes')
@@ -47,9 +45,7 @@ describe('.types', function () {
4745
multiaddr: multiaddr,
4846
multibase: multibase,
4947
multihash: multihash,
50-
CID: CID,
51-
dagPB: dagPB,
52-
dagCBOR: dagCBOR
48+
CID: CID
5349
})
5450
})
5551
})

0 commit comments

Comments
 (0)