diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index d57c2a02..3833fc22 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,3 +1,6 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + name: Automerge on: [ pull_request ] diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml index 8630dc5c..1d6c6ebe 100644 --- a/.github/workflows/js-test-and-release.yml +++ b/.github/workflows/js-test-and-release.yml @@ -1,3 +1,6 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + name: test & maybe release on: push: diff --git a/package.json b/package.json index 93cb3cdc..9af4a81c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "release": "lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo" }, "dependencies": { - "lerna": "^4.0.0" + "lerna": "^5.0.0" }, "workspaces": [ "packages/*" diff --git a/packages/ipfs-unixfs-exporter/CHANGELOG.md b/packages/ipfs-unixfs-exporter/CHANGELOG.md index d5564f82..7109d821 100644 --- a/packages/ipfs-unixfs-exporter/CHANGELOG.md +++ b/packages/ipfs-unixfs-exporter/CHANGELOG.md @@ -1,3 +1,31 @@ +## [ipfs-unixfs-exporter-v7.0.9](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v7.0.8...ipfs-unixfs-exporter-v7.0.9) (2022-05-27) + + +### Trivial Changes + +* bump @ipld/dag-cbor from 6.0.15 to 7.0.2 ([#216](https://github.com/ipfs/js-ipfs-unixfs/issues/216)) ([daeb686](https://github.com/ipfs/js-ipfs-unixfs/commit/daeb68612ab2491f5906a5cb7a9c25fec0b3ce57)) +* bump sinon from 11.1.2 to 14.0.0 ([#213](https://github.com/ipfs/js-ipfs-unixfs/issues/213)) ([5ab15c1](https://github.com/ipfs/js-ipfs-unixfs/commit/5ab15c18a412d18fddc18cacc6b0c775320cb814)) + +## [ipfs-unixfs-exporter-v7.0.8](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v7.0.7...ipfs-unixfs-exporter-v7.0.8) (2022-05-04) + + +### Bug Fixes + +* metadata on small files without raw leaves ([#212](https://github.com/ipfs/js-ipfs-unixfs/issues/212)) ([bef09cd](https://github.com/ipfs/js-ipfs-unixfs/commit/bef09cdb143808305d7947f57eba3aac33298c23)) + +## [ipfs-unixfs-exporter-v7.0.7](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-exporter-v7.0.6...ipfs-unixfs-exporter-v7.0.7) (2022-04-26) + + +### Bug Fixes + +* do not add metadata to leaves ([#193](https://github.com/ipfs/js-ipfs-unixfs/issues/193)) ([f5d3a67](https://github.com/ipfs/js-ipfs-unixfs/commit/f5d3a670e163632913229a1b75ec12a2d6847326)) + + +### Trivial Changes + +* switch to auto-release ([#208](https://github.com/ipfs/js-ipfs-unixfs/issues/208)) ([99386e6](https://github.com/ipfs/js-ipfs-unixfs/commit/99386e61979214e8ef79915800a6ed7154938342)) +* update readmes ([#188](https://github.com/ipfs/js-ipfs-unixfs/issues/188)) ([273a141](https://github.com/ipfs/js-ipfs-unixfs/commit/273a141b5ee3805bd0ef2dc8ed7870f8c6c8a820)) + # Change Log All notable changes to this project will be documented in this file. diff --git a/packages/ipfs-unixfs-exporter/package.json b/packages/ipfs-unixfs-exporter/package.json index 6170862f..88e1e2a2 100644 --- a/packages/ipfs-unixfs-exporter/package.json +++ b/packages/ipfs-unixfs-exporter/package.json @@ -151,22 +151,22 @@ "release": "semantic-release" }, "dependencies": { - "@ipld/dag-cbor": "^6.0.4", + "@ipld/dag-cbor": "^7.0.2", "@ipld/dag-pb": "^2.0.2", "@multiformats/murmur3": "^1.0.3", "err-code": "^3.0.1", "hamt-sharding": "^2.0.0", - "interface-blockstore": "^1.0.0", + "interface-blockstore": "^2.0.3", "ipfs-unixfs": "^6.0.0", "it-last": "^1.0.5", "multiformats": "^9.4.2", "uint8arrays": "^3.0.0" }, "devDependencies": { - "@types/mocha": "^8.2.1", "@types/sinon": "^10.0.0", "abort-controller": "^3.0.0", "aegir": "^36.2.3", + "blockstore-core": "^1.0.5", "copy": "^0.3.2", "crypto-browserify": "^3.12.0", "events": "^3.3.0", @@ -179,7 +179,7 @@ "nyc": "^15.0.0", "readable-stream": "^3.6.0", "rimraf": "^3.0.2", - "sinon": "^11.1.1", + "sinon": "^14.0.0", "util": "^0.12.3" }, "browser": { diff --git a/packages/ipfs-unixfs-exporter/test/helpers/block.js b/packages/ipfs-unixfs-exporter/test/helpers/block.js index a415ed5c..5072a6e5 100644 --- a/packages/ipfs-unixfs-exporter/test/helpers/block.js +++ b/packages/ipfs-unixfs-exporter/test/helpers/block.js @@ -1,5 +1,5 @@ import errCode from 'err-code' -import { BlockstoreAdapter } from 'interface-blockstore' +import { BaseBlockstore } from 'blockstore-core' import { base58btc } from 'multiformats/bases/base58' /** @@ -7,7 +7,7 @@ import { base58btc } from 'multiformats/bases/base58' */ function createBlockApi () { - class MockBlockstore extends BlockstoreAdapter { + class MockBlockstore extends BaseBlockstore { constructor () { super() diff --git a/packages/ipfs-unixfs-exporter/test/importer.spec.js b/packages/ipfs-unixfs-exporter/test/importer.spec.js index 2639f570..192557fd 100644 --- a/packages/ipfs-unixfs-exporter/test/importer.spec.js +++ b/packages/ipfs-unixfs-exporter/test/importer.spec.js @@ -1073,6 +1073,24 @@ strategies.forEach((strategy) => { expect(child).to.have.property('unixfs') expect(child).to.not.have.nested.property('unixfs.mtime') }) + + it('should add metadata to the root node of a small file without raw leaves', async () => { + this.timeout(60 * 1000) + + const mode = 511 + + const entries = await all(importer([{ + path: '/foo/file1.txt', + content: asAsyncIterable(smallFile), + mode + }], block, { + rawLeaves: false + })) + + const root = await exporter(entries[0].cid, block) + + expect(root).to.have.nested.property('unixfs.mode', 511) + }) }) }) diff --git a/packages/ipfs-unixfs-importer/CHANGELOG.md b/packages/ipfs-unixfs-importer/CHANGELOG.md index 9ab9427c..f872931d 100644 --- a/packages/ipfs-unixfs-importer/CHANGELOG.md +++ b/packages/ipfs-unixfs-importer/CHANGELOG.md @@ -1,3 +1,25 @@ +## [ipfs-unixfs-importer-v9.0.8](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-importer-v9.0.7...ipfs-unixfs-importer-v9.0.8) (2022-05-04) + + +### Bug Fixes + +* metadata on small files without raw leaves ([#212](https://github.com/ipfs/js-ipfs-unixfs/issues/212)) ([bef09cd](https://github.com/ipfs/js-ipfs-unixfs/commit/bef09cdb143808305d7947f57eba3aac33298c23)) + +## [ipfs-unixfs-importer-v9.0.7](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-importer-v9.0.6...ipfs-unixfs-importer-v9.0.7) (2022-04-26) + + +### Bug Fixes + +* do not add metadata to leaves ([#193](https://github.com/ipfs/js-ipfs-unixfs/issues/193)) ([f5d3a67](https://github.com/ipfs/js-ipfs-unixfs/commit/f5d3a670e163632913229a1b75ec12a2d6847326)) +* don't split paths on `^` characters ([#192](https://github.com/ipfs/js-ipfs-unixfs/issues/192)) ([9a69908](https://github.com/ipfs/js-ipfs-unixfs/commit/9a699082fcfc6f14304628f7c49d47c55b089745)) + + +### Trivial Changes + +* switch to auto-release ([#208](https://github.com/ipfs/js-ipfs-unixfs/issues/208)) ([99386e6](https://github.com/ipfs/js-ipfs-unixfs/commit/99386e61979214e8ef79915800a6ed7154938342)) +* switch to gh actions ([#175](https://github.com/ipfs/js-ipfs-unixfs/issues/175)) ([395852b](https://github.com/ipfs/js-ipfs-unixfs/commit/395852bdff00f0dfda299ad1d35ed1bee0386d9c)) +* update readmes ([#188](https://github.com/ipfs/js-ipfs-unixfs/issues/188)) ([273a141](https://github.com/ipfs/js-ipfs-unixfs/commit/273a141b5ee3805bd0ef2dc8ed7870f8c6c8a820)) + # Change Log All notable changes to this project will be documented in this file. diff --git a/packages/ipfs-unixfs-importer/package.json b/packages/ipfs-unixfs-importer/package.json index a28ba538..f4dede13 100644 --- a/packages/ipfs-unixfs-importer/package.json +++ b/packages/ipfs-unixfs-importer/package.json @@ -147,7 +147,7 @@ "clean": "rimraf ./dist", "lint": "aegir ts -p check && aegir lint", "coverage": "nyc -s npm run test -t node && nyc report --reporter=html", - "de-pcheck": "aegir dep-check -i @types/mocha -i nyc -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i assert", + "de-pcheck": "aegir dep-check -i @types/mocha -i nyc -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i assert -i interface-blockstore", "release": "semantic-release" }, "dependencies": { @@ -156,7 +156,7 @@ "bl": "^5.0.0", "err-code": "^3.0.1", "hamt-sharding": "^2.0.0", - "interface-blockstore": "^1.0.0", + "interface-blockstore": "^2.0.3", "ipfs-unixfs": "^6.0.0", "it-all": "^1.0.5", "it-batch": "^1.0.8", @@ -168,9 +168,9 @@ "uint8arrays": "^3.0.0" }, "devDependencies": { - "@types/mocha": "^8.2.1", "aegir": "^36.2.3", "assert": "^2.0.0", + "blockstore-core": "^1.0.5", "copy": "^0.3.2", "crypto-browserify": "^3.12.0", "events": "^3.3.0", diff --git a/packages/ipfs-unixfs-importer/src/dag-builder/file/index.js b/packages/ipfs-unixfs-importer/src/dag-builder/file/index.js index f8ef36cb..100a9500 100644 --- a/packages/ipfs-unixfs-importer/src/dag-builder/file/index.js +++ b/packages/ipfs-unixfs-importer/src/dag-builder/file/index.js @@ -78,7 +78,7 @@ const reduce = (file, blockstore, options) => { if (leaves.length === 1 && leaves[0].single && options.reduceSingleLeafToSelf) { const leaf = leaves[0] - if (leaf.cid.code === rawCodec.code && (file.mtime !== undefined || file.mode !== undefined)) { + if (file.mtime !== undefined || file.mode !== undefined) { // only one leaf node which is a buffer - we have metadata so convert it into a // UnixFS entry otherwise we'll have nowhere to store the metadata let buffer = await blockstore.get(leaf.cid) diff --git a/packages/ipfs-unixfs-importer/test/helpers/block.js b/packages/ipfs-unixfs-importer/test/helpers/block.js index a415ed5c..5072a6e5 100644 --- a/packages/ipfs-unixfs-importer/test/helpers/block.js +++ b/packages/ipfs-unixfs-importer/test/helpers/block.js @@ -1,5 +1,5 @@ import errCode from 'err-code' -import { BlockstoreAdapter } from 'interface-blockstore' +import { BaseBlockstore } from 'blockstore-core' import { base58btc } from 'multiformats/bases/base58' /** @@ -7,7 +7,7 @@ import { base58btc } from 'multiformats/bases/base58' */ function createBlockApi () { - class MockBlockstore extends BlockstoreAdapter { + class MockBlockstore extends BaseBlockstore { constructor () { super() diff --git a/packages/ipfs-unixfs/CHANGELOG.md b/packages/ipfs-unixfs/CHANGELOG.md index 4aaecedc..47099297 100644 --- a/packages/ipfs-unixfs/CHANGELOG.md +++ b/packages/ipfs-unixfs/CHANGELOG.md @@ -1,3 +1,10 @@ +## [ipfs-unixfs-v6.0.8](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-v6.0.7...ipfs-unixfs-v6.0.8) (2022-05-27) + + +### Bug Fixes + +* update deps ([#220](https://github.com/ipfs/js-ipfs-unixfs/issues/220)) ([08e851e](https://github.com/ipfs/js-ipfs-unixfs/commit/08e851e9c0dedf15f3a737157978a767343334f0)) + ## [ipfs-unixfs-v6.0.7](https://github.com/ipfs/js-ipfs-unixfs/compare/ipfs-unixfs-v6.0.6...ipfs-unixfs-v6.0.7) (2022-04-26) diff --git a/packages/ipfs-unixfs/package.json b/packages/ipfs-unixfs/package.json index 910fed22..7afe45e5 100644 --- a/packages/ipfs-unixfs/package.json +++ b/packages/ipfs-unixfs/package.json @@ -159,7 +159,6 @@ "protobufjs": "^6.10.2" }, "devDependencies": { - "@types/mocha": "^8.2.1", "aegir": "^36.2.3", "copy": "^0.3.2", "mkdirp": "^1.0.4",