Skip to content

Commit 7a12568

Browse files
authored
deps!: update multiformats to 10.x.x and all @ipld/* modules (#265)
Also updates uint8arrays and all the it-* deps. BREAKING CHANGE: CIDs returned are instances from `multiformats@10.x.x` and not `multiformats@9.x.x`
1 parent a5b9cad commit 7a12568

File tree

12 files changed

+88
-75
lines changed

12 files changed

+88
-75
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# js-ipfs-unixfs <!-- omit in toc -->
22

3-
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
4-
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5-
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
3+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
4+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
65
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
76
[![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-unixfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
87

@@ -74,8 +73,12 @@ Licensed under either of
7473

7574
## Contribute
7675

77-
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
76+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).
7877

79-
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
78+
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
79+
80+
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
81+
82+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
8083

8184
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

lerna.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"lerna": "4.0.0",
2+
"lerna": "5.4.0",
33
"useWorkspaces": true,
44
"version": "independent",
55
"command": {
66
"run": {
77
"stream": true
88
}
9-
}
9+
},
10+
"packages": [
11+
"packages/*"
12+
]
1013
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"release": "lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo"
3434
},
3535
"dependencies": {
36-
"lerna": "^5.0.0"
36+
"lerna": "^6.0.1"
3737
},
3838
"workspaces": [
3939
"packages/*"

packages/ipfs-unixfs-exporter/README.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# ipfs-unixfs-exporter <!-- omit in toc -->
22

3-
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
4-
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5-
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
3+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
4+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
65
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
76
[![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-unixfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
87

@@ -236,12 +235,6 @@ for await (const child of recursive('Qmfoo/foo/bar', blockstore)) {
236235
// entries contains all children of the `Qmfoo/foo/bar` directory and it's children
237236
```
238237
239-
[dag API]: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DAG.md
240-
241-
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
242-
243-
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
244-
245238
## Contribute
246239
247240
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-exporter/issues)!
@@ -259,8 +252,18 @@ Licensed under either of
259252
260253
## Contribute
261254
262-
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
255+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).
263256
264-
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
257+
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
258+
259+
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
260+
261+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
265262
266263
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
264+
265+
[dag API]: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DAG.md
266+
267+
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
268+
269+
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs

packages/ipfs-unixfs-exporter/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,21 @@
151151
"release": "aegir release"
152152
},
153153
"dependencies": {
154-
"@ipld/dag-cbor": "^7.0.2",
155-
"@ipld/dag-pb": "^2.0.2",
156-
"@multiformats/murmur3": "^1.0.3",
154+
"@ipld/dag-cbor": "^8.0.0",
155+
"@ipld/dag-pb": "^3.0.0",
156+
"@multiformats/murmur3": "^2.0.0",
157157
"err-code": "^3.0.1",
158158
"hamt-sharding": "^3.0.0",
159159
"interface-blockstore": "^3.0.0",
160160
"ipfs-unixfs": "^7.0.0",
161-
"it-last": "^1.0.5",
162-
"it-parallel": "^2.0.1",
161+
"it-last": "^2.0.0",
162+
"it-map": "^2.0.0",
163+
"it-parallel": "^3.0.0",
163164
"it-pipe": "^2.0.4",
164165
"it-pushable": "^3.1.0",
165-
"it-map": "^1.0.6",
166+
"multiformats": "^10.0.0",
166167
"p-queue": "^7.3.0",
167-
"multiformats": "^9.4.2",
168-
"uint8arrays": "^3.0.0"
168+
"uint8arrays": "^4.0.2"
169169
},
170170
"devDependencies": {
171171
"@types/sinon": "^10.0.0",
@@ -175,9 +175,9 @@
175175
"crypto-browserify": "^3.12.0",
176176
"delay": "^5.0.0",
177177
"ipfs-unixfs-importer": "^10.0.0",
178-
"it-all": "^1.0.5",
179-
"it-buffer-stream": "^2.0.0",
180-
"it-first": "^1.0.6",
178+
"it-all": "^2.0.0",
179+
"it-buffer-stream": "^3.0.0",
180+
"it-first": "^2.0.0",
181181
"merge-options": "^3.0.4",
182182
"native-abort-controller": "^1.0.3",
183183
"sinon": "^14.0.0"

packages/ipfs-unixfs-importer/README.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# ipfs-unixfs-importer <!-- omit in toc -->
22

3-
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
4-
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5-
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
3+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
4+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
65
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
76
[![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-unixfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
87

@@ -167,14 +166,6 @@ Several aspects of the importer are overridable by specifying functions as part
167166
- This function should read `{ cid, path, unixfs, node }` entries from `source` and place them in a directory structure
168167
- It should yield an object with the properties `{ cid, path, unixfs, size }` where `cid` is a `CID`, `path` is a string, `unixfs` is a UnixFS entry and `size` is a `Number`.
169168

170-
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
171-
172-
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
173-
174-
[IPLD]: https://github.com/ipld/js-ipld
175-
176-
[CID]: https://github.com/multiformats/js-cid
177-
178169
## Contribute
179170

180171
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
@@ -192,8 +183,20 @@ Licensed under either of
192183

193184
## Contribute
194185

195-
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
186+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).
196187

197-
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
188+
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
189+
190+
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
191+
192+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
198193

199194
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
195+
196+
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
197+
198+
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
199+
200+
[IPLD]: https://github.com/ipld/js-ipld
201+
202+
[CID]: https://github.com/multiformats/js-cid

packages/ipfs-unixfs-importer/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -151,27 +151,27 @@
151151
"release": "aegir release"
152152
},
153153
"dependencies": {
154-
"@ipld/dag-pb": "^2.0.2",
155-
"@multiformats/murmur3": "^1.0.3",
156-
"bl": "^5.0.0",
154+
"@ipld/dag-pb": "^3.0.0",
155+
"@multiformats/murmur3": "^2.0.0",
157156
"err-code": "^3.0.1",
158157
"hamt-sharding": "^3.0.0",
159158
"interface-blockstore": "^3.0.0",
160159
"ipfs-unixfs": "^7.0.0",
161-
"it-all": "^1.0.5",
162-
"it-batch": "^1.0.8",
163-
"it-first": "^1.0.6",
164-
"it-parallel-batch": "^1.0.9",
160+
"it-all": "^2.0.0",
161+
"it-batch": "^2.0.0",
162+
"it-first": "^2.0.0",
163+
"it-parallel-batch": "^2.0.0",
165164
"merge-options": "^3.0.4",
166-
"multiformats": "^9.4.2",
165+
"multiformats": "^10.0.0",
167166
"rabin-wasm": "^0.1.4",
168-
"uint8arrays": "^3.0.0"
167+
"uint8arraylist": "^2.3.3",
168+
"uint8arrays": "^4.0.2"
169169
},
170170
"devDependencies": {
171171
"aegir": "^37.5.0",
172172
"assert": "^2.0.0",
173173
"blockstore-core": "^2.0.1",
174-
"it-buffer-stream": "^2.0.0",
174+
"it-buffer-stream": "^3.0.0",
175175
"wherearewe": "^2.0.1"
176176
},
177177
"browser": {

packages/ipfs-unixfs-importer/src/chunker/fixed-size.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
// @ts-ignore
2-
import BufferList from 'bl/BufferList.js'
1+
import { Uint8ArrayList } from 'uint8arraylist'
32

43
/**
54
* @type {import('../types').Chunker}
65
*/
76
async function * fixedSizeChunker (source, options) {
8-
let bl = new BufferList()
7+
let list = new Uint8ArrayList()
98
let currentLength = 0
109
let emitted = false
1110
const maxChunkSize = options.maxChunkSize
1211

1312
for await (const buffer of source) {
14-
bl.append(buffer)
13+
list.append(buffer)
1514

1615
currentLength += buffer.length
1716

1817
while (currentLength >= maxChunkSize) {
19-
yield bl.slice(0, maxChunkSize)
18+
yield list.slice(0, maxChunkSize)
2019
emitted = true
2120

2221
// throw away consumed bytes
23-
if (maxChunkSize === bl.length) {
24-
bl = new BufferList()
22+
if (maxChunkSize === list.length) {
23+
list = new Uint8ArrayList()
2524
currentLength = 0
2625
} else {
27-
const newBl = new BufferList()
28-
newBl.append(bl.shallowSlice(maxChunkSize))
29-
bl = newBl
26+
const newBl = new Uint8ArrayList()
27+
newBl.append(list.sublist(maxChunkSize))
28+
list = newBl
3029

3130
// update our offset
3231
currentLength -= maxChunkSize
@@ -36,7 +35,7 @@ async function * fixedSizeChunker (source, options) {
3635

3736
if (!emitted || currentLength) {
3837
// return any remaining bytes or an empty buffer
39-
yield bl.slice(0, currentLength)
38+
yield list.subarray(0, currentLength)
4039
}
4140
}
4241

packages/ipfs-unixfs-importer/src/chunker/rabin.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// @ts-ignore
2-
import BufferList from 'bl/BufferList.js'
1+
import { Uint8ArrayList } from 'uint8arraylist'
32
// @ts-ignore
43
import { create } from 'rabin-wasm'
54
import errcode from 'err-code'
@@ -65,7 +64,7 @@ export default rabinChunker
6564
*/
6665
async function * rabin (source, options) {
6766
const r = await create(options.bits, options.min, options.max, options.window)
68-
const buffers = new BufferList()
67+
const buffers = new Uint8ArrayList()
6968

7069
for await (const chunk of source) {
7170
buffers.append(chunk)
@@ -82,6 +81,6 @@ async function * rabin (source, options) {
8281
}
8382

8483
if (buffers.length) {
85-
yield buffers.slice(0)
84+
yield buffers.subarray(0)
8685
}
8786
}

packages/ipfs-unixfs-importer/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { UnixFS, Mtime } from 'ipfs-unixfs'
2-
import type { CID, CIDVersion } from 'multiformats/cid'
2+
import type { CID, Version as CIDVersion } from 'multiformats/cid'
33
import type { MultihashHasher } from 'multiformats/hashes/interface'
44
import type { BlockCodec } from 'multiformats/codecs/interface'
55
import type { Blockstore } from 'interface-blockstore'

packages/ipfs-unixfs/README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# ipfs-unixfs <!-- omit in toc -->
22

3-
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
4-
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5-
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
3+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
4+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
65
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
76
[![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-unixfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
87

@@ -213,8 +212,12 @@ Licensed under either of
213212

214213
## Contribute
215214

216-
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
215+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).
217216

218-
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
217+
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
218+
219+
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
220+
221+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
219222

220223
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

packages/ipfs-unixfs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"devDependencies": {
164164
"aegir": "^37.5.0",
165165
"protobufjs-cli": "^1.0.0",
166-
"uint8arrays": "^3.0.0"
166+
"uint8arrays": "^4.0.2"
167167
},
168168
"browser": {
169169
"fs": false

0 commit comments

Comments
 (0)