From e972a4897c906d3a208a7f39e1a26c3725a05c62 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Thu, 1 Apr 2021 11:12:01 +0200 Subject: [PATCH] chore: update dependencies A few `@ts-ignore`s are needed until js-dag-cbor is updated to work properly with CommonJS and TypeScript types. --- packages/ipfs-unixfs-exporter/package.json | 4 ++-- packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js | 1 + .../src/resolvers/unixfs-v1/content/file.js | 1 + packages/ipfs-unixfs-exporter/test/exporter.spec.js | 3 +++ packages/ipfs-unixfs-importer/package.json | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/ipfs-unixfs-exporter/package.json b/packages/ipfs-unixfs-exporter/package.json index d5128ddd..709c1e6e 100644 --- a/packages/ipfs-unixfs-exporter/package.json +++ b/packages/ipfs-unixfs-exporter/package.json @@ -56,14 +56,14 @@ "util": "^0.12.3" }, "dependencies": { - "@ipld/dag-cbor": "^3.0.0", + "@ipld/dag-cbor": "^4.0.0", "@ipld/dag-pb": "^0.0.1", "err-code": "^3.0.1", "hamt-sharding": "^2.0.0", "ipfs-unixfs": "^4.0.1", "it-last": "^1.0.5", "multicodec": "^3.0.1", - "multiformats": "^4.6.1", + "multiformats": "^6.0.0", "multihashing-async": "^2.1.0" }, "types": "dist/src/index.d.ts", diff --git a/packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js b/packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js index d3ca216f..edfcc056 100644 --- a/packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js +++ b/packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js @@ -13,6 +13,7 @@ const dagCbor = require('@ipld/dag-cbor') */ const resolve = async (cid, name, path, toResolve, resolve, depth, blockService, options) => { const block = await blockService.get(cid) + // @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types const object = dagCbor.decode(block.bytes) let subObject = object let subPath = path diff --git a/packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js b/packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js index d76f0ac9..cb3edb80 100644 --- a/packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js +++ b/packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js @@ -77,6 +77,7 @@ async function * emitBytes (blockService, node, start, end, streamPosition = 0, child = block.bytes break; case mc.DAG_CBOR: + // @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types child = await dagCbor.decode(block.bytes) break; default: diff --git a/packages/ipfs-unixfs-exporter/test/exporter.spec.js b/packages/ipfs-unixfs-exporter/test/exporter.spec.js index 031b4772..7162ecdc 100644 --- a/packages/ipfs-unixfs-exporter/test/exporter.spec.js +++ b/packages/ipfs-unixfs-exporter/test/exporter.spec.js @@ -973,6 +973,7 @@ describe('exporter', () => { it('errors when exporting a non-existent key from a cbor node', async () => { const cborBlock = await Block.encode({ value: { foo: 'bar' }, + // @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types codec: dagCbor, hasher: sha256 }) @@ -992,6 +993,7 @@ describe('exporter', () => { const cborBlock = await Block.encode({ value: node, + // @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types codec: dagCbor, hasher: sha256 }) @@ -1048,6 +1050,7 @@ describe('exporter', () => { it('errors we export a unixfs node that has a non-unixfs/dag-pb child', async () => { const cborBlock = await Block.encode({ value: { foo: 'bar' }, + // @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types codec: dagCbor, hasher: sha256 }) diff --git a/packages/ipfs-unixfs-importer/package.json b/packages/ipfs-unixfs-importer/package.json index 2fbc2a04..dd6446f7 100644 --- a/packages/ipfs-unixfs-importer/package.json +++ b/packages/ipfs-unixfs-importer/package.json @@ -57,7 +57,7 @@ "it-parallel-batch": "^1.0.9", "merge-options": "^3.0.4", "multicodec": "^3.0.1", - "multiformats": "^4.6.1", + "multiformats": "^6.0.0", "multihashing-async": "^2.1.0", "rabin-wasm": "^0.1.4", "uint8arrays": "^2.1.2"