From 47f3d5a8da2fe5fac37ce5a894a700c898a8cf68 Mon Sep 17 00:00:00 2001
From: web3-bot <81333946+web3-bot@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:17:16 +0200
Subject: [PATCH 1/4] update .github/workflows/js-test-and-release.yml (#250)

---
 .github/workflows/js-test-and-release.yml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml
index 8030ec65..b02826b1 100644
--- a/.github/workflows/js-test-and-release.yml
+++ b/.github/workflows/js-test-and-release.yml
@@ -15,7 +15,7 @@ jobs:
   check:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
     - uses: actions/setup-node@v2
       with:
         node-version: lts/*
@@ -32,7 +32,7 @@ jobs:
         node: [16]
       fail-fast: true
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: ${{ matrix.node }}
@@ -46,7 +46,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -60,7 +60,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -74,7 +74,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -88,7 +88,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -102,7 +102,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -116,7 +116,7 @@ jobs:
     needs: check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions/setup-node@v2
         with:
           node-version: lts/*
@@ -131,7 +131,7 @@ jobs:
     runs-on: ubuntu-latest
     if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
         with:
           fetch-depth: 0
       - uses: actions/setup-node@v2

From 33433660a1f762d3e9b9a431cfb956136821cfb1 Mon Sep 17 00:00:00 2001
From: Alex Potsides <alex@achingbrain.net>
Date: Wed, 31 Aug 2022 08:09:00 +0200
Subject: [PATCH 2/4] fix: specify return type of the importer to generate
 correct types (#251)

If we don't to this, we end up importing deep paths from `unixfs` in the generated types which aren't in the exports map so fail when people are compiling their dependencies.

Fixes #214
---
 packages/ipfs-unixfs-exporter/src/types.ts                 | 7 +++++++
 .../ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js    | 5 +----
 packages/ipfs-unixfs-importer/src/index.js                 | 1 +
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/packages/ipfs-unixfs-exporter/src/types.ts b/packages/ipfs-unixfs-exporter/src/types.ts
index 5675ccd5..e1210b4b 100644
--- a/packages/ipfs-unixfs-exporter/src/types.ts
+++ b/packages/ipfs-unixfs-exporter/src/types.ts
@@ -2,6 +2,7 @@ import type { CID } from 'multiformats/cid'
 import type { UnixFS } from 'ipfs-unixfs'
 import type { PBNode } from '@ipld/dag-pb'
 import type { Blockstore } from 'interface-blockstore'
+import type { Bucket } from 'hamt-sharding'
 
 export interface ExporterOptions {
   offset?: number
@@ -68,3 +69,9 @@ export type UnixfsV1FileContent = AsyncIterable<Uint8Array> | Iterable<Uint8Arra
 export type UnixfsV1DirectoryContent = AsyncIterable<UnixFSEntry> | Iterable<UnixFSEntry>
 export type UnixfsV1Content = UnixfsV1FileContent | UnixfsV1DirectoryContent
 export interface UnixfsV1Resolver { (cid: CID, node: PBNode, unixfs: UnixFS, path: string, resolve: Resolve, depth: number, blockstore: Blockstore): (options: ExporterOptions) => UnixfsV1Content }
+
+export interface ShardTraversalContext {
+  hamtDepth: number
+  rootBucket: Bucket<boolean>
+  lastBucket: Bucket<boolean>
+}
diff --git a/packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js b/packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js
index c3a38322..d089532d 100644
--- a/packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js
+++ b/packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js
@@ -81,10 +81,7 @@ const toBucketPath = (position) => {
 }
 
 /**
- * @typedef {object} ShardTraversalContext
- * @property {number} hamtDepth
- * @property {Bucket<boolean>} rootBucket
- * @property {Bucket<boolean>} lastBucket
+ * @typedef {import('../types').ShardTraversalContext} ShardTraversalContext
  *
  * @param {PBNode} node
  * @param {string} name
diff --git a/packages/ipfs-unixfs-importer/src/index.js b/packages/ipfs-unixfs-importer/src/index.js
index 522aefac..80044289 100644
--- a/packages/ipfs-unixfs-importer/src/index.js
+++ b/packages/ipfs-unixfs-importer/src/index.js
@@ -25,6 +25,7 @@ import treeBuilderFn from './tree-builder.js'
  * @param {AsyncIterable<ImportCandidate> | Iterable<ImportCandidate> | ImportCandidate} source
  * @param {Blockstore} blockstore
  * @param {UserImporterOptions} options
+ * @returns {AsyncGenerator<ImportResult, void, unknown>}
  */
 export async function * importer (source, blockstore, options = {}) {
   const opts = defaultOptions(options)

From e409fc4af7d0a8918bc5cb8a7817115ec6dbd42e Mon Sep 17 00:00:00 2001
From: semantic-release-bot <semantic-release-bot@martynus.net>
Date: Wed, 31 Aug 2022 06:15:59 +0000
Subject: [PATCH 3/4] chore(release): 10.0.2 [skip ci]

## [ipfs-unixfs-importer-v10.0.2](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-importer-v10.0.1...ipfs-unixfs-importer-v10.0.2) (2022-08-31)

### Bug Fixes

* specify return type of the importer to generate correct types ([#251](https://github.com/ipfs/js-ipfs-unixfs/issues/251)) ([3343366](https://github.com/ipfs/js-ipfs-unixfs/commit/33433660a1f762d3e9b9a431cfb956136821cfb1)), closes [#214](https://github.com/ipfs/js-ipfs-unixfs/issues/214)
---
 packages/ipfs-unixfs-importer/CHANGELOG.md | 7 +++++++
 packages/ipfs-unixfs-importer/package.json | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/packages/ipfs-unixfs-importer/CHANGELOG.md b/packages/ipfs-unixfs-importer/CHANGELOG.md
index d27cf6c2..3f5a5df2 100644
--- a/packages/ipfs-unixfs-importer/CHANGELOG.md
+++ b/packages/ipfs-unixfs-importer/CHANGELOG.md
@@ -1,3 +1,10 @@
+## [ipfs-unixfs-importer-v10.0.2](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-importer-v10.0.1...ipfs-unixfs-importer-v10.0.2) (2022-08-31)
+
+
+### Bug Fixes
+
+* specify return type of the importer to generate correct types ([#251](https://github.com/ipfs/js-ipfs-unixfs/issues/251)) ([3343366](https://github.com/ipfs/js-ipfs-unixfs/commit/33433660a1f762d3e9b9a431cfb956136821cfb1)), closes [#214](https://github.com/ipfs/js-ipfs-unixfs/issues/214)
+
 ## [ipfs-unixfs-importer-v10.0.1](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-importer-v10.0.0...ipfs-unixfs-importer-v10.0.1) (2022-08-16)
 
 
diff --git a/packages/ipfs-unixfs-importer/package.json b/packages/ipfs-unixfs-importer/package.json
index 3f0c81c2..5a80e3e6 100644
--- a/packages/ipfs-unixfs-importer/package.json
+++ b/packages/ipfs-unixfs-importer/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ipfs-unixfs-importer",
-  "version": "10.0.1",
+  "version": "10.0.2",
   "description": "JavaScript implementation of the UnixFs importer used by IPFS",
   "license": "Apache-2.0 OR MIT",
   "homepage": "https://github.com/ipfs/js-ipfs-unixfs/tree/master/packages/ipfs-unixfs-importer#readme",

From 99a830dadc400df16d1fd3a5e92943d43c09b2d6 Mon Sep 17 00:00:00 2001
From: semantic-release-bot <semantic-release-bot@martynus.net>
Date: Wed, 31 Aug 2022 06:16:16 +0000
Subject: [PATCH 4/4] chore(release): 8.0.5 [skip ci]

## [ipfs-unixfs-exporter-v8.0.5](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v8.0.4...ipfs-unixfs-exporter-v8.0.5) (2022-08-31)

### Bug Fixes

* specify return type of the importer to generate correct types ([#251](https://github.com/ipfs/js-ipfs-unixfs/issues/251)) ([3343366](https://github.com/ipfs/js-ipfs-unixfs/commit/33433660a1f762d3e9b9a431cfb956136821cfb1)), closes [#214](https://github.com/ipfs/js-ipfs-unixfs/issues/214)
---
 packages/ipfs-unixfs-exporter/CHANGELOG.md | 7 +++++++
 packages/ipfs-unixfs-exporter/package.json | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/packages/ipfs-unixfs-exporter/CHANGELOG.md b/packages/ipfs-unixfs-exporter/CHANGELOG.md
index ce10dc99..ec447b0f 100644
--- a/packages/ipfs-unixfs-exporter/CHANGELOG.md
+++ b/packages/ipfs-unixfs-exporter/CHANGELOG.md
@@ -1,3 +1,10 @@
+## [ipfs-unixfs-exporter-v8.0.5](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v8.0.4...ipfs-unixfs-exporter-v8.0.5) (2022-08-31)
+
+
+### Bug Fixes
+
+* specify return type of the importer to generate correct types ([#251](https://github.com/ipfs/js-ipfs-unixfs/issues/251)) ([3343366](https://github.com/ipfs/js-ipfs-unixfs/commit/33433660a1f762d3e9b9a431cfb956136821cfb1)), closes [#214](https://github.com/ipfs/js-ipfs-unixfs/issues/214)
+
 ## [ipfs-unixfs-exporter-v8.0.4](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v8.0.3...ipfs-unixfs-exporter-v8.0.4) (2022-08-17)
 
 
diff --git a/packages/ipfs-unixfs-exporter/package.json b/packages/ipfs-unixfs-exporter/package.json
index 5355b9ed..1db85149 100644
--- a/packages/ipfs-unixfs-exporter/package.json
+++ b/packages/ipfs-unixfs-exporter/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ipfs-unixfs-exporter",
-  "version": "8.0.4",
+  "version": "8.0.5",
   "description": "JavaScript implementation of the UnixFs exporter used by IPFS",
   "license": "Apache-2.0 OR MIT",
   "homepage": "https://github.com/ipfs/js-ipfs-unixfs/tree/master/packages/ipfs-unixfs-exporter#readme",