diff --git a/examples/custom-ipfs-repo/package.json b/examples/custom-ipfs-repo/package.json index 289de68290..f2b8cf33ea 100644 --- a/examples/custom-ipfs-repo/package.json +++ b/examples/custom-ipfs-repo/package.json @@ -12,7 +12,7 @@ "dependencies": { "datastore-fs": "^2.0.0", "ipfs": "^0.51.0", - "ipfs-repo": "^6.0.3", + "ipfs-repo": "^7.0.0", "it-all": "^1.0.4" }, "devDependencies": { diff --git a/examples/traverse-ipld-graphs/package.json b/examples/traverse-ipld-graphs/package.json index 717131b3aa..ff151c9ec1 100644 --- a/examples/traverse-ipld-graphs/package.json +++ b/examples/traverse-ipld-graphs/package.json @@ -15,7 +15,7 @@ "dependencies": { "cids": "^1.0.0", "ipfs": "^0.51.0", - "ipld-block": "^0.10.1", + "ipld-block": "^0.11.0", "ipld-dag-pb": "^0.20.0", "ipld-git": "^0.6.1", "ipld-ethereum": "^5.0.1", diff --git a/packages/interface-ipfs-core/package.json b/packages/interface-ipfs-core/package.json index 4b46bb4395..6ccf0c469b 100644 --- a/packages/interface-ipfs-core/package.json +++ b/packages/interface-ipfs-core/package.json @@ -41,7 +41,7 @@ "ipfs-unixfs": "^2.0.3", "ipfs-unixfs-importer": "^3.0.4", "ipfs-utils": "^4.0.0", - "ipld-block": "^0.10.1", + "ipld-block": "^0.11.0", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", "ipns": "^0.8.0", @@ -52,7 +52,7 @@ "it-drain": "^1.0.3", "it-last": "^1.0.4", "it-map": "^1.0.4", - "it-pushable": "^1.3.1", + "it-pushable": "^1.4.0", "libp2p-crypto": "^0.18.0", "multiaddr": "^8.0.0", "multibase": "^3.0.0", diff --git a/packages/ipfs-cli/package.json b/packages/ipfs-cli/package.json index 1fd62677d0..0e58e35d63 100644 --- a/packages/ipfs-cli/package.json +++ b/packages/ipfs-cli/package.json @@ -44,14 +44,14 @@ "ipfs-http-client": "^48.0.0", "ipfs-http-gateway": "^0.1.0", "ipfs-http-server": "^0.1.0", - "ipfs-repo": "^6.0.3", + "ipfs-repo": "^7.0.0", "ipfs-utils": "^4.0.0", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", "it-all": "^1.0.4", "it-concat": "^1.0.1", "it-first": "^1.0.4", - "it-glob": "0.0.8", + "it-glob": "0.0.10", "it-pipe": "^1.1.0", "jsondiffpatch": "^0.4.1", "just-safe-set": "^2.1.0", diff --git a/packages/ipfs-core-utils/package.json b/packages/ipfs-core-utils/package.json index e55a935137..2818971f0a 100644 --- a/packages/ipfs-core-utils/package.json +++ b/packages/ipfs-core-utils/package.json @@ -38,14 +38,14 @@ }, "license": "MIT", "dependencies": { - "blob-to-it": "0.0.2", - "browser-readablestream-to-it": "0.0.2", + "blob-to-it": "^1.0.1", + "browser-readablestream-to-it": "^1.0.1", "cids": "^1.0.0", "err-code": "^2.0.3", "ipfs-utils": "^4.0.0", "it-all": "^1.0.4", "it-map": "^1.0.4", - "it-peekable": "0.0.1", + "it-peekable": "^1.0.1", "uint8arrays": "^1.1.0" }, "devDependencies": { diff --git a/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.browser.js b/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.browser.js index 690a70f7a3..dc5cb113a6 100644 --- a/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.browser.js +++ b/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.browser.js @@ -34,7 +34,10 @@ async function toBlob (input) { // (Async)Iterator if (input[Symbol.iterator] || input[Symbol.asyncIterator]) { + /** @type {any} peekable */ const peekable = itPeekable(input) + + /** @type {any} value **/ const { value, done } = await peekable.peek() if (done) { diff --git a/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.js b/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.js index 072460f7bf..4a7a125147 100644 --- a/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.js +++ b/packages/ipfs-core-utils/src/files/normalise-input/normalise-content.js @@ -37,12 +37,15 @@ async function * toAsyncIterable (input) { // (Async)Iterator if (input[Symbol.iterator] || input[Symbol.asyncIterator]) { + /** @type {any} peekable */ const peekable = itPeekable(input) + + /** @type {any} value */ const { value, done } = await peekable.peek() if (done) { // make sure empty iterators result in empty files - yield * peekable + yield * [] return } diff --git a/packages/ipfs-core-utils/src/files/normalise-input/normalise-input.js b/packages/ipfs-core-utils/src/files/normalise-input/normalise-input.js index 8b3386779d..9d89695a6c 100644 --- a/packages/ipfs-core-utils/src/files/normalise-input/normalise-input.js +++ b/packages/ipfs-core-utils/src/files/normalise-input/normalise-input.js @@ -46,12 +46,15 @@ module.exports = async function * normaliseInput (input, normaliseContent) { // Iterable if (input[Symbol.iterator] || input[Symbol.asyncIterator]) { + /** @type {any} peekable */ const peekable = itPeekable(input) + + /** @type {any} value **/ const { value, done } = await peekable.peek() if (done) { // make sure empty iterators result in empty files - yield * peekable + yield * [] return } @@ -102,8 +105,8 @@ module.exports = async function * normaliseInput (input, normaliseContent) { async function toFileObject (input, normaliseContent) { // @ts-ignore - Those properties don't exist on most input types const { path, mode, mtime, content } = input - const file = { path: path || '', mode, mtime } + if (content) { file.content = await normaliseContent(content) } else if (!path) { // Not already a file object with path or content prop diff --git a/packages/ipfs-core/.aegir.js b/packages/ipfs-core/.aegir.js index afdbd65c12..0b34b43f69 100644 --- a/packages/ipfs-core/.aegir.js +++ b/packages/ipfs-core/.aegir.js @@ -15,7 +15,7 @@ let sigServerB let ipfsdServer module.exports = { - bundlesize: { maxSize: '520kB' }, + bundlesize: { maxSize: '523kB' }, karma: { files: [{ pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*', diff --git a/packages/ipfs-core/package.json b/packages/ipfs-core/package.json index b7cbc06488..3847e8f186 100644 --- a/packages/ipfs-core/package.json +++ b/packages/ipfs-core/package.json @@ -69,16 +69,16 @@ "hamt-sharding": "^1.0.0", "hashlru": "^2.3.0", "interface-datastore": "^2.0.0", - "ipfs-bitswap": "^3.0.0", + "ipfs-bitswap": "^4.0.0", "ipfs-block-service": "^0.18.0", "ipfs-core-utils": "^0.5.0", - "ipfs-repo": "^6.0.3", + "ipfs-repo": "^7.0.0", "ipfs-unixfs": "^2.0.3", "ipfs-unixfs-exporter": "^3.0.4", "ipfs-unixfs-importer": "^3.0.4", "ipfs-utils": "^4.0.0", - "ipld": "^0.27.2", - "ipld-block": "^0.10.1", + "ipld": "^0.28.0", + "ipld-block": "^0.11.0", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", "ipld-raw": "^6.0.0", @@ -127,7 +127,7 @@ "ipfsd-ctl": "^7.0.2", "ipld-git": "^0.6.1", "iso-random-stream": "^1.1.1", - "iso-url": "^0.4.7", + "iso-url": "^1.0.0", "nanoid": "^3.1.12", "p-event": "^4.2.0", "p-map": "^4.0.0", diff --git a/packages/ipfs-core/src/components/files/index.js b/packages/ipfs-core/src/components/files/index.js index 0ee1e50b2f..88260daadc 100644 --- a/packages/ipfs-core/src/components/files/index.js +++ b/packages/ipfs-core/src/components/files/index.js @@ -94,7 +94,7 @@ function createMfs (options) { /** * @param {Object} context * @param {import('..').IPLD} context.ipld - * @param {import('..').IPLDBlock} context.block + * @param {import('..').Block} context.block * @param {import('..').IPFSBlockService} context.blockService * @param {import('..').IPFSRepo} context.repo * @param {import('..').Preload} context.preload diff --git a/packages/ipfs-core/src/components/init.js b/packages/ipfs-core/src/components/init.js index 219d443e34..30bdc1ad77 100644 --- a/packages/ipfs-core/src/components/init.js +++ b/packages/ipfs-core/src/components/init.js @@ -4,7 +4,6 @@ const log = require('debug')('ipfs:components:init') const PeerId = require('peer-id') const uint8ArrayFromString = require('uint8arrays/from-string') const uint8ArrayToString = require('uint8arrays/to-string') - const mergeOptions = require('merge-options') const getDefaultConfig = require('../runtime/config-nodejs.js') const createRepo = require('../runtime/repo-nodejs') @@ -209,6 +208,7 @@ async function initNewRepo (repo, { privateKey, emptyRepo, algorithm, bits, prof emptyRepo = emptyRepo || false bits = bits == null ? 2048 : Number(bits) + // @ts-ignore https://github.com/schnittstabil/merge-options/pull/26 config = mergeOptions(applyProfiles(profiles, getDefaultConfig()), config) // Verify repo does not exist yet @@ -271,6 +271,7 @@ async function initExistingRepo (repo, { config: newConfig, profiles, pass }) { config = applyProfiles(profiles, config) } if (newConfig) { + // @ts-ignore https://github.com/schnittstabil/merge-options/pull/26 config = mergeOptions(config, newConfig) } await repo.config.set(config) diff --git a/packages/ipfs-core/src/components/name/resolve.js b/packages/ipfs-core/src/components/name/resolve.js index ad3eb704f5..05f74fb0f2 100644 --- a/packages/ipfs-core/src/components/name/resolve.js +++ b/packages/ipfs-core/src/components/name/resolve.js @@ -2,7 +2,6 @@ const debug = require('debug') const errcode = require('err-code') -/** @type {typeof Object.assign} */ const mergeOptions = require('merge-options') const CID = require('cids') const isDomain = require('is-domain-name') @@ -61,7 +60,7 @@ module.exports = ({ dns, ipns, peerId, isOnline, options: constructorOptions }) const { offline } = constructorOptions // TODO: params related logic should be in the core implementation - if (offline && options.nocache) { + if (offline && options && options.nocache) { throw errcode(new Error('cannot specify both offline and nocache'), 'ERR_NOCACHE_AND_OFFLINE') } diff --git a/packages/ipfs-core/src/runtime/ipld.js b/packages/ipfs-core/src/runtime/ipld.js index ab81c6bdd7..fd942f888c 100644 --- a/packages/ipfs-core/src/runtime/ipld.js +++ b/packages/ipfs-core/src/runtime/ipld.js @@ -1,4 +1,5 @@ 'use strict' + const mergeOptions = require('merge-options') const multicodec = require('multicodec') diff --git a/packages/ipfs-http-client/.aegir.js b/packages/ipfs-http-client/.aegir.js index 1cec2c1091..d46ac57684 100644 --- a/packages/ipfs-http-client/.aegir.js +++ b/packages/ipfs-http-client/.aegir.js @@ -16,7 +16,7 @@ const server = createServer({ let echoServer = new EchoServer() module.exports = { - bundlesize: { maxSize: '81kB' }, + bundlesize: { maxSize: '83kB' }, karma: { files: [{ pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*', diff --git a/packages/ipfs-http-client/package.json b/packages/ipfs-http-client/package.json index 9530fc577e..cd1787ee58 100644 --- a/packages/ipfs-http-client/package.json +++ b/packages/ipfs-http-client/package.json @@ -57,11 +57,11 @@ "form-data": "^3.0.0", "ipfs-core-utils": "^0.5.0", "ipfs-utils": "^4.0.0", - "ipld-block": "^0.10.1", + "ipld-block": "^0.11.0", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", "ipld-raw": "^6.0.0", - "iso-url": "^0.4.7", + "iso-url": "^1.0.0", "it-last": "^1.0.4", "it-map": "^1.0.4", "it-tar": "^1.2.2", diff --git a/packages/ipfs-http-gateway/src/resources/gateway.js b/packages/ipfs-http-gateway/src/resources/gateway.js index def38dd744..a76f4a4ac7 100644 --- a/packages/ipfs-http-gateway/src/resources/gateway.js +++ b/packages/ipfs-http-gateway/src/resources/gateway.js @@ -176,7 +176,7 @@ module.exports = { afterHandler (request, h) { const { response } = request - // Add headers to successfult responses (regular or range) + // Add headers to successful responses (regular or range) if (response.statusCode === 200 || response.statusCode === 206) { const path = request.path response.header('X-Ipfs-Path', path) diff --git a/packages/ipfs-message-port-client/.aegir.js b/packages/ipfs-message-port-client/.aegir.js index 688a1713bf..5ef0106a01 100644 --- a/packages/ipfs-message-port-client/.aegir.js +++ b/packages/ipfs-message-port-client/.aegir.js @@ -4,7 +4,7 @@ const EchoServer = require('aegir/utils/echo-server') const echoServer = new EchoServer() module.exports = { - bundlesize: { maxSize: '12kB' }, + bundlesize: { maxSize: '13kB' }, karma: { files: [ { diff --git a/packages/ipfs-message-port-client/package.json b/packages/ipfs-message-port-client/package.json index 950b85e78f..dfacafb02a 100644 --- a/packages/ipfs-message-port-client/package.json +++ b/packages/ipfs-message-port-client/package.json @@ -42,7 +42,7 @@ "dep-check": "aegir dep-check" }, "dependencies": { - "browser-readablestream-to-it": "0.0.2", + "browser-readablestream-to-it": "^1.0.1", "cids": "^1.0.0" }, "devDependencies": { diff --git a/packages/ipfs-message-port-protocol/package.json b/packages/ipfs-message-port-protocol/package.json index 7b61d5931c..36970d5301 100644 --- a/packages/ipfs-message-port-protocol/package.json +++ b/packages/ipfs-message-port-protocol/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "cids": "^1.0.0", - "ipld-block": "^0.10.1" + "ipld-block": "^0.11.0" }, "devDependencies": { "aegir": "^28.0.0", diff --git a/packages/ipfs/package.json b/packages/ipfs/package.json index a03cee4fec..dd34f684e4 100644 --- a/packages/ipfs/package.json +++ b/packages/ipfs/package.json @@ -40,7 +40,7 @@ "debug": "^4.1.1", "ipfs-cli": "^0.1.0", "ipfs-core": "^0.1.0", - "ipfs-repo": "^6.0.3", + "ipfs-repo": "^7.0.0", "semver": "^7.3.2", "update-notifier": "^5.0.0" }, @@ -57,7 +57,7 @@ "ipfs-utils": "^4.0.0", "ipfsd-ctl": "^7.0.2", "iso-random-stream": "^1.1.1", - "iso-url": "^0.4.7", + "iso-url": "^1.0.0", "it-to-buffer": "^1.0.2", "merge-options": "^2.0.0", "nanoid": "^3.1.12",