diff --git a/README.md b/README.md index 9d0fa234..17c2080a 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ > JS implementation of the IPFS UnixFS -The UnixFS spec can be found at [ipfs/specs/UNIXFS.md](https://github.com/ipfs/specs/blob/master/UNIXFS.md) - # Packages -- [`/packages/ipfs-unixfs`](./packages/ipfs-unixfs) JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG) -- [`/packages/ipfs-unixfs-exporter`](./packages/ipfs-unixfs-exporter) JavaScript implementation of the UnixFs exporter used by IPFS -- [`/packages/ipfs-unixfs-importer`](./packages/ipfs-unixfs-importer) JavaScript implementation of the UnixFs importer used by IPFS +- [`packages/ipfs-unixfs`](https://github.com/ipfs/js-ipfs-unixfs/tree/main/packages/ipfs-unixfs) JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG) +- [`packages/ipfs-unixfs-exporter`](https://github.com/ipfs/js-ipfs-unixfs/tree/main/packages/ipfs-unixfs-exporter) JavaScript implementation of the UnixFs exporter used by IPFS +- [`packages/ipfs-unixfs-importer`](https://github.com/ipfs/js-ipfs-unixfs/tree/main/packages/ipfs-unixfs-importer) JavaScript implementation of the UnixFs importer used by IPFS + +The UnixFS spec can be found at [ipfs/specs/UNIXFS.md](https://github.com/ipfs/specs/blob/master/UNIXFS.md) # API Docs @@ -23,8 +23,8 @@ The UnixFS spec can be found at [ipfs/specs/UNIXFS.md](https://github.com/ipfs/s Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-ipfs-unixfs/blob/main/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/LICENSE-MIT) / ) # Contribute diff --git a/package.json b/package.json index 3021f1eb..e8139b20 100644 --- a/package.json +++ b/package.json @@ -12,91 +12,6 @@ "url": "https://github.com/ipfs/js-ipfs-unixfs/issues" }, "private": true, - "release": { - "branches": [ - "main" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "major" - }, - { - "revert": true, - "release": "patch" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "type": "deps", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ] - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "section": "Trivial Changes" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "deps", - "section": "Dependencies" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github", - "@semantic-release/git" - ] - }, "scripts": { "reset": "aegir run clean && aegir clean **/node_modules **/package-lock.json", "test": "aegir run test", @@ -113,12 +28,12 @@ "lint": "aegir run lint", "dep-check": "aegir run dep-check", "release": "run-s build docs:no-publish npm:release docs", - "npm:release": "aegir release", + "npm:release": "aegir run release --concurrency 1", "docs": "aegir docs", "docs:no-publish": "aegir docs --publish false" }, "devDependencies": { - "aegir": "^42.2.2", + "aegir": "^44.1.1", "npm-run-all": "^4.1.5" }, "workspaces": [ diff --git a/packages/ipfs-unixfs-exporter/README.md b/packages/ipfs-unixfs-exporter/README.md index 9ddd6bcb..899c2d81 100644 --- a/packages/ipfs-unixfs-exporter/README.md +++ b/packages/ipfs-unixfs-exporter/README.md @@ -75,7 +75,7 @@ $ npm i ipfs-unixfs-exporter ## Browser ` @@ -89,8 +89,8 @@ Loading this module through a script tag will make it's exports available as `Ip Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-exporter/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-exporter/LICENSE-MIT) / ) # Contribute diff --git a/packages/ipfs-unixfs-exporter/package.json b/packages/ipfs-unixfs-exporter/package.json index c007b0c0..0f9c27f4 100644 --- a/packages/ipfs-unixfs-exporter/package.json +++ b/packages/ipfs-unixfs-exporter/package.json @@ -39,6 +39,91 @@ "sourceType": "module" } }, + "release": { + "branches": [ + "main" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "breaking": true, + "release": "major" + }, + { + "revert": true, + "release": "patch" + }, + { + "type": "feat", + "release": "minor" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "docs", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "deps", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Trivial Changes" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] + }, "scripts": { "test": "aegir test", "test:node": "aegir test -t node --cov", @@ -47,44 +132,45 @@ "build": "aegir build", "clean": "aegir clean", "lint": "aegir lint", - "dep-check": "aegir dep-check" + "dep-check": "aegir dep-check", + "release": "aegir release" }, "dependencies": { - "@ipld/dag-cbor": "^9.2.0", - "@ipld/dag-json": "^10.2.0", - "@ipld/dag-pb": "^4.1.0", + "@ipld/dag-cbor": "^9.2.1", + "@ipld/dag-json": "^10.2.2", + "@ipld/dag-pb": "^4.1.2", "@multiformats/murmur3": "^2.1.8", "err-code": "^3.0.1", "hamt-sharding": "^3.0.6", - "interface-blockstore": "^5.2.10", + "interface-blockstore": "^5.3.0", "ipfs-unixfs": "^11.0.0", - "it-filter": "^3.0.4", - "it-last": "^3.0.4", - "it-map": "^3.0.5", - "it-parallel": "^3.0.6", + "it-filter": "^3.1.1", + "it-last": "^3.0.6", + "it-map": "^3.1.1", + "it-parallel": "^3.0.8", "it-pipe": "^3.0.1", "it-pushable": "^3.2.3", - "multiformats": "^13.1.0", + "multiformats": "^13.2.3", "p-queue": "^8.0.1", - "progress-events": "^1.0.0" + "progress-events": "^1.0.1" }, "devDependencies": { - "@types/readable-stream": "^4.0.11", + "@types/readable-stream": "^4.0.15", "@types/sinon": "^17.0.3", - "aegir": "^42.2.5", - "blockstore-core": "^4.4.0", + "aegir": "^44.1.1", + "blockstore-core": "^4.4.1", "delay": "^6.0.0", "ipfs-unixfs-importer": "^15.0.0", "iso-random-stream": "^2.0.2", - "it-all": "^3.0.4", - "it-buffer-stream": "^3.0.6", - "it-drain": "^3.0.5", - "it-first": "^3.0.4", - "it-to-buffer": "^4.0.5", + "it-all": "^3.0.6", + "it-buffer-stream": "^3.0.8", + "it-drain": "^3.0.7", + "it-first": "^3.0.6", + "it-to-buffer": "^4.0.7", "merge-options": "^3.0.4", "readable-stream": "^4.5.2", "sinon": "^17.0.1", - "uint8arrays": "^5.0.3", + "uint8arrays": "^5.1.0", "wherearewe": "^2.0.1" }, "browser": { diff --git a/packages/ipfs-unixfs-importer/README.md b/packages/ipfs-unixfs-importer/README.md index 7ac03ff0..c0f69b4a 100644 --- a/packages/ipfs-unixfs-importer/README.md +++ b/packages/ipfs-unixfs-importer/README.md @@ -92,7 +92,7 @@ $ npm i ipfs-unixfs-importer ## Browser ` @@ -106,8 +106,8 @@ Loading this module through a script tag will make it's exports available as `Ip Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-importer/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-importer/LICENSE-MIT) / ) # Contribute diff --git a/packages/ipfs-unixfs-importer/package.json b/packages/ipfs-unixfs-importer/package.json index cb8af317..48795894 100644 --- a/packages/ipfs-unixfs-importer/package.json +++ b/packages/ipfs-unixfs-importer/package.json @@ -63,6 +63,91 @@ "sourceType": "module" } }, + "release": { + "branches": [ + "main" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "breaking": true, + "release": "major" + }, + { + "revert": true, + "release": "patch" + }, + { + "type": "feat", + "release": "minor" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "docs", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "deps", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Trivial Changes" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] + }, "scripts": { "test": "aegir test", "test:node": "aegir test -t node --cov", @@ -71,30 +156,31 @@ "build": "aegir build", "clean": "aegir clean", "lint": "aegir lint", - "dep-check": "aegir dep-check" + "dep-check": "aegir dep-check", + "release": "aegir release" }, "dependencies": { - "@ipld/dag-pb": "^4.1.0", + "@ipld/dag-pb": "^4.1.2", "@multiformats/murmur3": "^2.1.8", "err-code": "^3.0.1", "hamt-sharding": "^3.0.6", - "interface-blockstore": "^5.2.10", + "interface-blockstore": "^5.3.0", "interface-store": "^5.1.8", "ipfs-unixfs": "^11.0.0", - "it-all": "^3.0.4", - "it-batch": "^3.0.4", - "it-first": "^3.0.4", - "it-parallel-batch": "^3.0.4", - "multiformats": "^13.1.0", - "progress-events": "^1.0.0", + "it-all": "^3.0.6", + "it-batch": "^3.0.6", + "it-first": "^3.0.6", + "it-parallel-batch": "^3.0.6", + "multiformats": "^13.2.3", + "progress-events": "^1.0.1", "rabin-wasm": "^0.1.5", "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.0.3" + "uint8arrays": "^5.1.0" }, "devDependencies": { - "aegir": "^42.2.5", - "blockstore-core": "^4.4.0", - "it-last": "^3.0.4", + "aegir": "^44.1.1", + "blockstore-core": "^4.4.1", + "it-last": "^3.0.6", "wherearewe": "^2.0.1" }, "browser": { diff --git a/packages/ipfs-unixfs-importer/src/dag-builder/file.ts b/packages/ipfs-unixfs-importer/src/dag-builder/file.ts index 41d94ca0..3c3b19af 100644 --- a/packages/ipfs-unixfs-importer/src/dag-builder/file.ts +++ b/packages/ipfs-unixfs-importer/src/dag-builder/file.ts @@ -148,7 +148,7 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions) } } - if ((leaf.unixfs == null) || (leaf.unixfs.data == null)) { + if ((leaf.unixfs?.data == null)) { // node is an intermediate node f.addBlockSize(leaf.unixfs?.fileSize() ?? 0n) } else { diff --git a/packages/ipfs-unixfs-importer/src/dir-flat.ts b/packages/ipfs-unixfs-importer/src/dir-flat.ts index 8783b8c2..b649b430 100644 --- a/packages/ipfs-unixfs-importer/src/dir-flat.ts +++ b/packages/ipfs-unixfs-importer/src/dir-flat.ts @@ -103,7 +103,7 @@ export class DirFlat extends Dir { * @param {number} acc * @param {PBLink} curr */ - (acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), + (acc, curr) => acc + (curr.Tsize ?? 0), 0) this.cid = cid diff --git a/packages/ipfs-unixfs-importer/src/tree-builder.ts b/packages/ipfs-unixfs-importer/src/tree-builder.ts index f84d6fb5..18e94eb0 100644 --- a/packages/ipfs-unixfs-importer/src/tree-builder.ts +++ b/packages/ipfs-unixfs-importer/src/tree-builder.ts @@ -104,7 +104,7 @@ export function defaultTreeBuilder (options: TreeBuilderOptions): TreeBuilder { tree = await addToTree(entry, tree, options) - if (entry.unixfs == null || !entry.unixfs.isDirectory()) { + if (entry.unixfs?.isDirectory() !== true) { yield entry } } diff --git a/packages/ipfs-unixfs/README.md b/packages/ipfs-unixfs/README.md index eb6a4ccc..52198d1f 100644 --- a/packages/ipfs-unixfs/README.md +++ b/packages/ipfs-unixfs/README.md @@ -120,7 +120,7 @@ $ npm i ipfs-unixfs ## Browser ` @@ -134,8 +134,8 @@ Loading this module through a script tag will make it's exports available as `Ip Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs/LICENSE-MIT) / ) # Contribute diff --git a/packages/ipfs-unixfs/package.json b/packages/ipfs-unixfs/package.json index fdeb9c62..e26854aa 100644 --- a/packages/ipfs-unixfs/package.json +++ b/packages/ipfs-unixfs/package.json @@ -42,6 +42,91 @@ "src/unixfs.d.ts" ] }, + "release": { + "branches": [ + "main" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "breaking": true, + "release": "major" + }, + { + "revert": true, + "release": "patch" + }, + { + "type": "feat", + "release": "minor" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "docs", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "deps", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Trivial Changes" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] + }, "scripts": { "generate": "protons src/unixfs.proto", "test": "aegir test", @@ -51,17 +136,18 @@ "build": "aegir build", "clean": "aegir clean", "lint": "aegir lint", - "dep-check": "aegir dep-check" + "dep-check": "aegir dep-check", + "release": "aegir release" }, "dependencies": { "err-code": "^3.0.1", - "protons-runtime": "^5.4.0", + "protons-runtime": "^5.5.0", "uint8arraylist": "^2.4.8" }, "devDependencies": { - "aegir": "^42.2.5", - "protons": "^7.5.0", - "uint8arrays": "^5.0.3" + "aegir": "^44.1.1", + "protons": "^7.6.0", + "uint8arrays": "^5.1.0" }, "browser": { "fs": false