diff --git a/.travis.yml b/.travis.yml index a92c77b7f2..6c7849fe50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,13 +93,11 @@ jobs: - stage: test name: electron-main - os: osx script: - npm run test:electron-main -- $RUN_SINCE -- -- --bail --timeout 60000 - stage: test name: electron-renderer - os: osx script: - npm run test:electron-renderer -- $RUN_SINCE -- -- --bail --timeout 60000 @@ -115,13 +113,11 @@ jobs: - stage: test name: interop - electron-main - os: osx script: - npm run test:interop -- $RUN_SINCE -- -- -- -t electron-main -f ./test/node.js --bail --timeout 60000 - stage: test name: interop - electron-renderer - os: osx script: - npm run test:interop -- $RUN_SINCE -- -- -- -t electron-renderer -f ./test/browser.js -bail --timeout 60000 @@ -152,13 +148,11 @@ jobs: - stage: test name: js-ipfs interface tests - electron main - os: osx script: - npm run test:interface:core -- $RUN_SINCE -- -- --bail -t electron-main --timeout 60000 - stage: test name: js-ipfs interface tests - electron renderer - os: osx script: - npm run test:interface:core -- $RUN_SINCE -- -- --bail -t electron-renderer --timeout 60000 @@ -214,13 +208,11 @@ jobs: - stage: test name: http-api-client interface tests vs js-ipfs - electron main - os: osx script: - npm run test:interface:http-js -- $RUN_SINCE -- -- --bail -t electron-main --timeout 60000 - stage: test name: http-api-client interface tests vs js-ipfs - electron renderer - os: osx script: - npm run test:interface:http-js -- $RUN_SINCE -- -- --bail -t electron-renderer --timeout 60000 diff --git a/examples/browser-ipns-publish/package.json b/examples/browser-ipns-publish/package.json index 5d0809c862..ba0076d251 100644 --- a/examples/browser-ipns-publish/package.json +++ b/examples/browser-ipns-publish/package.json @@ -15,7 +15,7 @@ "human-crypto-keys": "^0.1.4", "ipfs": "^0.50.1", "ipfs-http-client": "^47.0.0", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "ipns": "^0.8.0", "it-last": "^1.0.4", "p-retry": "^4.2.0", @@ -27,7 +27,7 @@ "devDependencies": { "delay": "^4.4.0", "execa": "^4.0.3", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "go-ipfs": "^0.7.0", "parcel-bundler": "^1.12.4", "path": "^0.12.7", diff --git a/examples/explore-ethereum-blockchain/package.json b/examples/explore-ethereum-blockchain/package.json index 519837b81b..32e55cab39 100644 --- a/examples/explore-ethereum-blockchain/package.json +++ b/examples/explore-ethereum-blockchain/package.json @@ -12,7 +12,7 @@ "devDependencies": { "ipfs": "^0.50.1", "ipfs-http-client": "^47.0.0", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "test-ipfs-example": "^2.0.3" } } diff --git a/examples/http-client-browser-pubsub/package.json b/examples/http-client-browser-pubsub/package.json index df8047a7a7..c07d917489 100644 --- a/examples/http-client-browser-pubsub/package.json +++ b/examples/http-client-browser-pubsub/package.json @@ -21,7 +21,7 @@ "execa": "^4.0.3", "go-ipfs": "^0.7.0", "ipfs": "^0.50.1", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "parcel-bundler": "^1.12.4", "test-ipfs-example": "^2.0.3" } diff --git a/examples/http-client-bundle-webpack/package.json b/examples/http-client-bundle-webpack/package.json index 1b63d6edfd..f4b07c3953 100644 --- a/examples/http-client-bundle-webpack/package.json +++ b/examples/http-client-bundle-webpack/package.json @@ -25,7 +25,7 @@ "copy-webpack-plugin": "^5.0.4", "execa": "^4.0.3", "ipfs": "^0.50.1", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "react-hot-loader": "^4.12.21", "test-ipfs-example": "^2.0.3", "webpack": "^4.43.0", diff --git a/examples/http-client-name-api/package.json b/examples/http-client-name-api/package.json index 4f454b7ba1..d41e2d197b 100644 --- a/examples/http-client-name-api/package.json +++ b/examples/http-client-name-api/package.json @@ -18,7 +18,7 @@ "devDependencies": { "execa": "^4.0.3", "go-ipfs": "^0.7.0", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "parcel-bundler": "^1.12.4", "test-ipfs-example": "^2.0.3" }, diff --git a/packages/interface-ipfs-core/package.json b/packages/interface-ipfs-core/package.json index 6587861570..dc42af9469 100644 --- a/packages/interface-ipfs-core/package.json +++ b/packages/interface-ipfs-core/package.json @@ -31,7 +31,6 @@ ], "license": "MIT", "dependencies": { - "abort-controller": "^3.0.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-subset": "^1.6.0", @@ -41,7 +40,7 @@ "err-code": "^2.0.3", "ipfs-unixfs": "^2.0.3", "ipfs-unixfs-importer": "^3.0.4", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "ipld-block": "^0.10.1", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", @@ -59,6 +58,7 @@ "multibase": "^3.0.0", "multihashing-async": "^2.0.1", "nanoid": "^3.1.12", + "native-abort-controller": "~0.0.3", "p-map": "^4.0.0", "peer-id": "^0.14.1", "readable-stream": "^3.4.0", @@ -67,7 +67,7 @@ }, "devDependencies": { "aegir": "^27.0.0", - "ipfsd-ctl": "^7.0.0" + "ipfsd-ctl": "^7.0.2" }, "contributors": [ "Alan Shaw ", diff --git a/packages/interface-ipfs-core/src/bitswap/wantlist.js b/packages/interface-ipfs-core/src/bitswap/wantlist.js index f22581b32c..1e743966bc 100644 --- a/packages/interface-ipfs-core/src/bitswap/wantlist.js +++ b/packages/interface-ipfs-core/src/bitswap/wantlist.js @@ -5,7 +5,7 @@ const { getDescribe, getIt, expect } = require('../utils/mocha') const { waitForWantlistKey, waitForWantlistKeyToBeRemoved } = require('./utils') const { isWebWorker } = require('ipfs-utils/src/env') const testTimeout = require('../utils/test-timeout') -const AbortController = require('abort-controller') +const AbortController = require('native-abort-controller') const CID = require('cids') const delay = require('delay') diff --git a/packages/interface-ipfs-core/src/pubsub/subscribe.js b/packages/interface-ipfs-core/src/pubsub/subscribe.js index 01a8d7bb4a..aca99579e5 100644 --- a/packages/interface-ipfs-core/src/pubsub/subscribe.js +++ b/packages/interface-ipfs-core/src/pubsub/subscribe.js @@ -9,7 +9,7 @@ const all = require('it-all') const { waitForPeers, getTopic } = require('./utils') const { getDescribe, getIt, expect } = require('../utils/mocha') const delay = require('delay') -const AbortController = require('abort-controller') +const AbortController = require('native-abort-controller') const { isWebWorker, isNode } = require('ipfs-utils/src/env') /** @typedef { import("ipfsd-ctl/src/factory") } Factory */ diff --git a/packages/ipfs-cli/package.json b/packages/ipfs-cli/package.json index 2069dc6cc6..7985f1feb8 100644 --- a/packages/ipfs-cli/package.json +++ b/packages/ipfs-cli/package.json @@ -44,7 +44,7 @@ "ipfs-http-gateway": "0.0.1", "ipfs-http-server": "0.0.1", "ipfs-repo": "^6.0.3", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", "it-all": "^1.0.4", diff --git a/packages/ipfs-core-utils/package.json b/packages/ipfs-core-utils/package.json index f893bc162d..c69180d9e1 100644 --- a/packages/ipfs-core-utils/package.json +++ b/packages/ipfs-core-utils/package.json @@ -32,7 +32,7 @@ "browser-readablestream-to-it": "0.0.2", "cids": "^1.0.0", "err-code": "^2.0.3", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "it-all": "^1.0.4", "it-map": "^1.0.4", "it-peekable": "0.0.1", diff --git a/packages/ipfs-core-utils/test/files/normalise-input.spec.js b/packages/ipfs-core-utils/test/files/normalise-input.spec.js index 203d01a520..d073df1567 100644 --- a/packages/ipfs-core-utils/test/files/normalise-input.spec.js +++ b/packages/ipfs-core-utils/test/files/normalise-input.spec.js @@ -7,11 +7,11 @@ const blobToIt = require('blob-to-it') const uint8ArrayFromString = require('uint8arrays/from-string') const all = require('it-all') const { Blob, ReadableStream } = require('ipfs-utils/src/globalthis') -const { isBrowser, isWebWorker } = require('ipfs-utils/src/env') +const { isBrowser, isWebWorker, isElectronRenderer } = require('ipfs-utils/src/env') let normalise = require('../../src/files/normalise-input') -if (isBrowser || isWebWorker) { +if (isBrowser || isWebWorker || isElectronRenderer) { normalise = require('../../src/files/normalise-input/index.browser') } @@ -34,7 +34,7 @@ async function verifyNormalisation (input) { let content = input[0].content - if (isBrowser || isWebWorker) { + if (isBrowser || isWebWorker || isElectronRenderer) { expect(content).to.be.an.instanceOf(Blob) content = blobToIt(content) } diff --git a/packages/ipfs-core/package.json b/packages/ipfs-core/package.json index 248379b7c5..a6a6862712 100644 --- a/packages/ipfs-core/package.json +++ b/packages/ipfs-core/package.json @@ -45,7 +45,6 @@ "dep-check": "aegir dep-check" }, "dependencies": { - "abort-controller": "^3.0.0", "any-signal": "^2.0.0", "array-shuffle": "^1.0.1", "bignumber.js": "^9.0.0", @@ -69,7 +68,7 @@ "ipfs-unixfs": "^2.0.3", "ipfs-unixfs-exporter": "^3.0.4", "ipfs-unixfs-importer": "^3.0.4", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "ipld": "^0.27.1", "ipld-bitcoin": "^0.4.0", "ipld-block": "^0.10.1", @@ -108,6 +107,7 @@ "multibase": "^3.0.0", "multicodec": "^2.0.1", "multihashing-async": "^2.0.1", + "native-abort-controller": "~0.0.3", "p-defer": "^3.0.0", "p-queue": "^6.6.1", "parse-duration": "^0.4.4", @@ -119,7 +119,7 @@ "devDependencies": { "aegir": "^27.0.0", "delay": "^4.4.0", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "interface-ipfs-core": "^0.140.0", "iso-random-stream": "^1.1.1", "iso-url": "^0.4.7", diff --git a/packages/ipfs-core/src/preload.js b/packages/ipfs-core/src/preload.js index 676276b1a0..782b8e5252 100644 --- a/packages/ipfs-core/src/preload.js +++ b/packages/ipfs-core/src/preload.js @@ -4,7 +4,7 @@ const toUri = require('multiaddr-to-uri') const debug = require('debug') const CID = require('cids') const shuffle = require('array-shuffle') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') const preload = require('./runtime/preload-nodejs') const log = Object.assign( diff --git a/packages/ipfs-http-client/package.json b/packages/ipfs-http-client/package.json index 23c3514b66..267eb9c819 100644 --- a/packages/ipfs-http-client/package.json +++ b/packages/ipfs-http-client/package.json @@ -40,14 +40,13 @@ "dep-check": "aegir dep-check" }, "dependencies": { - "abort-controller": "^3.0.0", "any-signal": "^2.0.0", "bignumber.js": "^9.0.0", "cids": "^1.0.0", "debug": "^4.1.1", "form-data": "^3.0.0", "ipfs-core-utils": "^0.4.0", - "ipfs-utils": "^3.0.0", + "ipfs-utils": "^4.0.0", "ipld-block": "^0.10.1", "ipld-dag-cbor": "^0.17.0", "ipld-dag-pb": "^0.20.0", @@ -65,7 +64,7 @@ "multicodec": "^2.0.1", "multihashes": "^3.0.1", "nanoid": "^3.1.12", - "node-fetch": "^2.6.0", + "native-abort-controller": "~0.0.3", "parse-duration": "^0.4.4", "stream-to-it": "^0.2.2", "uint8arrays": "^1.1.0" @@ -75,7 +74,7 @@ "cross-env": "^7.0.0", "go-ipfs": "^0.7.0", "interface-ipfs-core": "^0.140.0", - "ipfsd-ctl": "^7.0.0", + "ipfsd-ctl": "^7.0.2", "it-all": "^1.0.4", "it-concat": "^1.0.1", "it-pipe": "^1.1.0", diff --git a/packages/ipfs-http-client/src/add-all.js b/packages/ipfs-http-client/src/add-all.js index c5d553f5ec..45d0f755db 100644 --- a/packages/ipfs-http-client/src/add-all.js +++ b/packages/ipfs-http-client/src/add-all.js @@ -6,7 +6,7 @@ const configure = require('./lib/configure') const multipartRequest = require('./lib/multipart-request') const toUrlSearchParams = require('./lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure((api) => { /** diff --git a/packages/ipfs-http-client/src/block/put.js b/packages/ipfs-http-client/src/block/put.js index a23aa5fad0..7f0351e7b4 100644 --- a/packages/ipfs-http-client/src/block/put.js +++ b/packages/ipfs-http-client/src/block/put.js @@ -7,7 +7,7 @@ const multipartRequest = require('../lib/multipart-request') const configure = require('../lib/configure') const toUrlSearchParams = require('../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { /** diff --git a/packages/ipfs-http-client/src/config/replace.js b/packages/ipfs-http-client/src/config/replace.js index 1e73ae2bc2..ee6316404a 100644 --- a/packages/ipfs-http-client/src/config/replace.js +++ b/packages/ipfs-http-client/src/config/replace.js @@ -5,7 +5,7 @@ const multipartRequest = require('../lib/multipart-request') const configure = require('../lib/configure') const toUrlSearchParams = require('../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { return async (config, options = {}) => { diff --git a/packages/ipfs-http-client/src/dag/put.js b/packages/ipfs-http-client/src/dag/put.js index 2540446ea9..dfdd53cace 100644 --- a/packages/ipfs-http-client/src/dag/put.js +++ b/packages/ipfs-http-client/src/dag/put.js @@ -9,7 +9,7 @@ const configure = require('../lib/configure') const multipartRequest = require('../lib/multipart-request') const toUrlSearchParams = require('../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') const multicodec = require('multicodec') module.exports = configure((api, opts) => { diff --git a/packages/ipfs-http-client/src/files/write.js b/packages/ipfs-http-client/src/files/write.js index 6751412b41..f4fe9dc0c3 100644 --- a/packages/ipfs-http-client/src/files/write.js +++ b/packages/ipfs-http-client/src/files/write.js @@ -6,7 +6,7 @@ const configure = require('../lib/configure') const multipartRequest = require('../lib/multipart-request') const toUrlSearchParams = require('../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { return async (path, input, options = {}) => { diff --git a/packages/ipfs-http-client/src/lib/multipart-request.browser.js b/packages/ipfs-http-client/src/lib/multipart-request.browser.js index 550c85ba30..5c2bc3e411 100644 --- a/packages/ipfs-http-client/src/lib/multipart-request.browser.js +++ b/packages/ipfs-http-client/src/lib/multipart-request.browser.js @@ -1,6 +1,6 @@ 'use strict' -const normaliseInput = require('ipfs-core-utils/src/files/normalise-input') +const normaliseInput = require('ipfs-core-utils/src/files/normalise-input/index.browser') const modeToString = require('./mode-to-string') const mtimeToObject = require('./mtime-to-object') const { File, FormData } = require('ipfs-utils/src/globalthis') diff --git a/packages/ipfs-http-client/src/lib/multipart-request.js b/packages/ipfs-http-client/src/lib/multipart-request.js index ba712e02ef..fdde2248bd 100644 --- a/packages/ipfs-http-client/src/lib/multipart-request.js +++ b/packages/ipfs-http-client/src/lib/multipart-request.js @@ -6,6 +6,7 @@ const modeToString = require('../lib/mode-to-string') const mtimeToObject = require('../lib/mtime-to-object') const merge = require('merge-options').bind({ ignoreUndefined: true }) const toStream = require('it-to-stream') +const { isElectronRenderer } = require('ipfs-utils/src/env') async function multipartRequest (source = '', abortController, headers = {}, boundary = `-----------------------------${nanoid()}`) { async function * streamFiles (source) { @@ -73,3 +74,7 @@ async function multipartRequest (source = '', abortController, headers = {}, bou } module.exports = multipartRequest + +if (isElectronRenderer) { + module.exports = require('./multipart-request.browser') +} diff --git a/packages/ipfs-http-client/src/object/patch/append-data.js b/packages/ipfs-http-client/src/object/patch/append-data.js index 9fc22e60b4..36bd09964d 100644 --- a/packages/ipfs-http-client/src/object/patch/append-data.js +++ b/packages/ipfs-http-client/src/object/patch/append-data.js @@ -5,7 +5,7 @@ const multipartRequest = require('../../lib/multipart-request') const configure = require('../../lib/configure') const toUrlSearchParams = require('../../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { return async (cid, data, options = {}) => { diff --git a/packages/ipfs-http-client/src/object/patch/set-data.js b/packages/ipfs-http-client/src/object/patch/set-data.js index 0d00bd6535..b3db064d4b 100644 --- a/packages/ipfs-http-client/src/object/patch/set-data.js +++ b/packages/ipfs-http-client/src/object/patch/set-data.js @@ -5,7 +5,7 @@ const multipartRequest = require('../../lib/multipart-request') const configure = require('../../lib/configure') const toUrlSearchParams = require('../../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { return async (cid, data, options = {}) => { diff --git a/packages/ipfs-http-client/src/object/put.js b/packages/ipfs-http-client/src/object/put.js index 35610f9901..1eed43a3c1 100644 --- a/packages/ipfs-http-client/src/object/put.js +++ b/packages/ipfs-http-client/src/object/put.js @@ -6,7 +6,7 @@ const multipartRequest = require('../lib/multipart-request') const configure = require('../lib/configure') const toUrlSearchParams = require('../lib/to-url-search-params') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') const unit8ArrayToString = require('uint8arrays/to-string') const uint8ArrayFromString = require('uint8arrays/from-string') diff --git a/packages/ipfs-http-client/src/pubsub/publish.js b/packages/ipfs-http-client/src/pubsub/publish.js index f425c45a47..d83cdb2526 100644 --- a/packages/ipfs-http-client/src/pubsub/publish.js +++ b/packages/ipfs-http-client/src/pubsub/publish.js @@ -4,7 +4,7 @@ const configure = require('../lib/configure') const toUrlSearchParams = require('../lib/to-url-search-params') const multipartRequest = require('../lib/multipart-request') const anySignal = require('any-signal') -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') module.exports = configure(api => { return async (topic, data, options = {}) => { diff --git a/packages/ipfs-http-client/src/pubsub/subscription-tracker.js b/packages/ipfs-http-client/src/pubsub/subscription-tracker.js index 8a005e761e..d6da454784 100644 --- a/packages/ipfs-http-client/src/pubsub/subscription-tracker.js +++ b/packages/ipfs-http-client/src/pubsub/subscription-tracker.js @@ -1,6 +1,6 @@ 'use strict' -const AbortController = require('abort-controller').default +const AbortController = require('native-abort-controller') class SubscriptionTracker { constructor () { diff --git a/packages/ipfs-http-server/package.json b/packages/ipfs-http-server/package.json index 5329495399..11129353e4 100644 --- a/packages/ipfs-http-server/package.json +++ b/packages/ipfs-http-server/package.json @@ -31,7 +31,6 @@ "@hapi/boom": "^9.1.0", "@hapi/content": "^5.0.2", "@hapi/hapi": "^20.0.0", - "abort-controller": "^3.0.0", "cids": "^1.0.0", "debug": "^4.1.1", "dlv": "^1.1.3", @@ -63,6 +62,7 @@ "multibase": "^3.0.0", "multicodec": "^2.0.1", "multihashing-async": "^2.0.1", + "native-abort-controller": "~0.0.3", "parse-duration": "^0.4.4", "stream-to-it": "^0.2.2", "streaming-iterables": "^5.0.2", diff --git a/packages/ipfs-http-server/src/index.js b/packages/ipfs-http-server/src/index.js index af446891b8..586d1e4149 100644 --- a/packages/ipfs-http-server/src/index.js +++ b/packages/ipfs-http-server/src/index.js @@ -6,7 +6,7 @@ const debug = require('debug') const multiaddr = require('multiaddr') const toMultiaddr = require('uri-to-multiaddr') const Boom = require('@hapi/boom') -const AbortController = require('abort-controller') +const AbortController = require('native-abort-controller') const errorHandler = require('./error-handler') const LOG = 'ipfs:http-api' @@ -154,6 +154,11 @@ class HttpApi { return h.continue } + // Allow if the user agent includes Electron + if (userAgent.includes('Electron')) { + return h.continue + } + // Allow if the user agent does not start with Mozilla... (i.e. curl) if (!userAgent.startsWith('Mozilla')) { return h.continue diff --git a/packages/ipfs-http-server/test/inject/bitswap.js b/packages/ipfs-http-server/test/inject/bitswap.js index 1095b0ffcc..98caf1787f 100644 --- a/packages/ipfs-http-server/test/inject/bitswap.js +++ b/packages/ipfs-http-server/test/inject/bitswap.js @@ -6,7 +6,7 @@ const CID = require('cids') const sinon = require('sinon') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/bitswap', () => { const cid = new CID('QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR') diff --git a/packages/ipfs-http-server/test/inject/block.js b/packages/ipfs-http-server/test/inject/block.js index 527a495806..2d8629ca37 100644 --- a/packages/ipfs-http-server/test/inject/block.js +++ b/packages/ipfs-http-server/test/inject/block.js @@ -10,7 +10,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') const CID = require('cids') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const sendData = async (data) => { const form = new FormData() diff --git a/packages/ipfs-http-server/test/inject/bootstrap.js b/packages/ipfs-http-server/test/inject/bootstrap.js index b98a6772e7..c8048875cf 100644 --- a/packages/ipfs-http-server/test/inject/bootstrap.js +++ b/packages/ipfs-http-server/test/inject/bootstrap.js @@ -12,7 +12,7 @@ const defaultList = [ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/bootstrap', () => { const validIp4 = '/ip4/101.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z' diff --git a/packages/ipfs-http-server/test/inject/config.js b/packages/ipfs-http-server/test/inject/config.js index f7d6eb8165..ec513c2e83 100644 --- a/packages/ipfs-http-server/test/inject/config.js +++ b/packages/ipfs-http-server/test/inject/config.js @@ -16,7 +16,7 @@ const profiles = { const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { signal: sinon.match.instanceOf(AbortSignal), diff --git a/packages/ipfs-http-server/test/inject/dag.js b/packages/ipfs-http-server/test/inject/dag.js index 34541172c6..f62870069e 100644 --- a/packages/ipfs-http-server/test/inject/dag.js +++ b/packages/ipfs-http-server/test/inject/dag.js @@ -11,7 +11,7 @@ const CID = require('cids') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const toHeadersAndPayload = async (thing) => { const stream = new Readable() diff --git a/packages/ipfs-http-server/test/inject/dht.js b/packages/ipfs-http-server/test/inject/dht.js index 49440001d7..bac0671ceb 100644 --- a/packages/ipfs-http-server/test/inject/dht.js +++ b/packages/ipfs-http-server/test/inject/dht.js @@ -8,7 +8,7 @@ const http = require('../utils/http') const sinon = require('sinon') const errCode = require('err-code') const CID = require('cids') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const allNdjson = require('../utils/all-ndjson') describe('/dht', () => { diff --git a/packages/ipfs-http-server/test/inject/dns.js b/packages/ipfs-http-server/test/inject/dns.js index 95c0fd2406..9965e363ba 100644 --- a/packages/ipfs-http-server/test/inject/dns.js +++ b/packages/ipfs-http-server/test/inject/dns.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { recursive: false, diff --git a/packages/ipfs-http-server/test/inject/files.js b/packages/ipfs-http-server/test/inject/files.js index c0e4311995..8cf18c32c4 100644 --- a/packages/ipfs-http-server/test/inject/files.js +++ b/packages/ipfs-http-server/test/inject/files.js @@ -13,7 +13,7 @@ const sinon = require('sinon') const CID = require('cids') const first = require('it-first') const toBuffer = require('it-to-buffer') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') function matchIterable () { return sinon.match((thing) => Boolean(thing[Symbol.asyncIterator]) || Boolean(thing[Symbol.iterator])) diff --git a/packages/ipfs-http-server/test/inject/id.js b/packages/ipfs-http-server/test/inject/id.js index efc14eed27..1342611d9d 100644 --- a/packages/ipfs-http-server/test/inject/id.js +++ b/packages/ipfs-http-server/test/inject/id.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { signal: sinon.match.instanceOf(AbortSignal), diff --git a/packages/ipfs-http-server/test/inject/key.js b/packages/ipfs-http-server/test/inject/key.js index 0856a6d0a7..1a1345fa4c 100644 --- a/packages/ipfs-http-server/test/inject/key.js +++ b/packages/ipfs-http-server/test/inject/key.js @@ -6,7 +6,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/key', function () { let ipfs diff --git a/packages/ipfs-http-server/test/inject/mfs/chmod.js b/packages/ipfs-http-server/test/inject/mfs/chmod.js index c39f5c88ae..a2e73c3bbf 100644 --- a/packages/ipfs-http-server/test/inject/mfs/chmod.js +++ b/packages/ipfs-http-server/test/inject/mfs/chmod.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { recursive: false, diff --git a/packages/ipfs-http-server/test/inject/mfs/cp.js b/packages/ipfs-http-server/test/inject/mfs/cp.js index 34d1d815a0..f704a1434d 100644 --- a/packages/ipfs-http-server/test/inject/mfs/cp.js +++ b/packages/ipfs-http-server/test/inject/mfs/cp.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { cidVersion: 0, diff --git a/packages/ipfs-http-server/test/inject/mfs/flush.js b/packages/ipfs-http-server/test/inject/mfs/flush.js index e384ef9618..7fbd8c5411 100644 --- a/packages/ipfs-http-server/test/inject/mfs/flush.js +++ b/packages/ipfs-http-server/test/inject/mfs/flush.js @@ -7,7 +7,7 @@ const sinon = require('sinon') const CID = require('cids') const cid = new CID('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { timeout: undefined, diff --git a/packages/ipfs-http-server/test/inject/mfs/ls.js b/packages/ipfs-http-server/test/inject/mfs/ls.js index 0050a1f59d..d6bc9666f7 100644 --- a/packages/ipfs-http-server/test/inject/mfs/ls.js +++ b/packages/ipfs-http-server/test/inject/mfs/ls.js @@ -7,7 +7,7 @@ const sinon = require('sinon') const CID = require('cids') const fileCid = new CID('bafybeigyov3nzxrqjismjpq7ghkkjorcmozy5rgaikvyieakoqpxfc3rvu') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { timeout: undefined, diff --git a/packages/ipfs-http-server/test/inject/mfs/mkdir.js b/packages/ipfs-http-server/test/inject/mfs/mkdir.js index 187863feb1..ea9ce82239 100644 --- a/packages/ipfs-http-server/test/inject/mfs/mkdir.js +++ b/packages/ipfs-http-server/test/inject/mfs/mkdir.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { parents: false, diff --git a/packages/ipfs-http-server/test/inject/mfs/mv.js b/packages/ipfs-http-server/test/inject/mfs/mv.js index 42e789d0e6..296c208e82 100644 --- a/packages/ipfs-http-server/test/inject/mfs/mv.js +++ b/packages/ipfs-http-server/test/inject/mfs/mv.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { parents: false, diff --git a/packages/ipfs-http-server/test/inject/mfs/read.js b/packages/ipfs-http-server/test/inject/mfs/read.js index 2426adfc56..154852edf0 100644 --- a/packages/ipfs-http-server/test/inject/mfs/read.js +++ b/packages/ipfs-http-server/test/inject/mfs/read.js @@ -6,7 +6,7 @@ const http = require('../../utils/http') const uint8ArrayFromString = require('uint8arrays/from-string') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { offset: undefined, diff --git a/packages/ipfs-http-server/test/inject/mfs/rm.js b/packages/ipfs-http-server/test/inject/mfs/rm.js index 3f35471796..9819a1287f 100644 --- a/packages/ipfs-http-server/test/inject/mfs/rm.js +++ b/packages/ipfs-http-server/test/inject/mfs/rm.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { recursive: false, diff --git a/packages/ipfs-http-server/test/inject/mfs/stat.js b/packages/ipfs-http-server/test/inject/mfs/stat.js index fbbf27fa28..adfe6c411a 100644 --- a/packages/ipfs-http-server/test/inject/mfs/stat.js +++ b/packages/ipfs-http-server/test/inject/mfs/stat.js @@ -7,7 +7,7 @@ const sinon = require('sinon') const CID = require('cids') const fileCid = new CID('bafybeigyov3nzxrqjismjpq7ghkkjorcmozy5rgaikvyieakoqpxfc3rvu') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { withLocal: false, diff --git a/packages/ipfs-http-server/test/inject/mfs/touch.js b/packages/ipfs-http-server/test/inject/mfs/touch.js index 26415bbd29..dd52aeed5c 100644 --- a/packages/ipfs-http-server/test/inject/mfs/touch.js +++ b/packages/ipfs-http-server/test/inject/mfs/touch.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const http = require('../../utils/http') const sinon = require('sinon') const testHttpMethod = require('../../utils/test-http-method') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { mtime: undefined, diff --git a/packages/ipfs-http-server/test/inject/mfs/write.js b/packages/ipfs-http-server/test/inject/mfs/write.js index 527e097b3e..2033713ab5 100644 --- a/packages/ipfs-http-server/test/inject/mfs/write.js +++ b/packages/ipfs-http-server/test/inject/mfs/write.js @@ -6,7 +6,7 @@ const http = require('../../utils/http') const sinon = require('sinon') const FormData = require('form-data') const streamToPromise = require('stream-to-promise') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { offset: undefined, diff --git a/packages/ipfs-http-server/test/inject/name.js b/packages/ipfs-http-server/test/inject/name.js index f2b2793c34..7506942311 100644 --- a/packages/ipfs-http-server/test/inject/name.js +++ b/packages/ipfs-http-server/test/inject/name.js @@ -7,7 +7,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/name', function () { const cid = new CID('QmbndGRXYRyfU41TUvc52gMrwq87JJg18QsDPcCeaMcM61') diff --git a/packages/ipfs-http-server/test/inject/object.js b/packages/ipfs-http-server/test/inject/object.js index 31eac87766..b5911322ee 100644 --- a/packages/ipfs-http-server/test/inject/object.js +++ b/packages/ipfs-http-server/test/inject/object.js @@ -12,7 +12,7 @@ const http = require('../utils/http') const sinon = require('sinon') const CID = require('cids') const UnixFS = require('ipfs-unixfs') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const { DAGNode, DAGLink diff --git a/packages/ipfs-http-server/test/inject/pin.js b/packages/ipfs-http-server/test/inject/pin.js index 3a74e88d59..6cf7188006 100644 --- a/packages/ipfs-http-server/test/inject/pin.js +++ b/packages/ipfs-http-server/test/inject/pin.js @@ -9,7 +9,7 @@ const http = require('../utils/http') const sinon = require('sinon') const CID = require('cids') const allNdjson = require('../utils/all-ndjson') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/pin', () => { const cid = new CID('QmfGBRT6BbWJd7yUc2uYdaUZJBbnEFvTqehPFoSMQ6wgdr') diff --git a/packages/ipfs-http-server/test/inject/ping.js b/packages/ipfs-http-server/test/inject/ping.js index ecc954fcf9..ef1f0c07a7 100644 --- a/packages/ipfs-http-server/test/inject/ping.js +++ b/packages/ipfs-http-server/test/inject/ping.js @@ -7,7 +7,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') const allNdjson = require('../utils/all-ndjson') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { count: 10, diff --git a/packages/ipfs-http-server/test/inject/pubsub.js b/packages/ipfs-http-server/test/inject/pubsub.js index e7b97d933c..7570b35acc 100644 --- a/packages/ipfs-http-server/test/inject/pubsub.js +++ b/packages/ipfs-http-server/test/inject/pubsub.js @@ -7,7 +7,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const FormData = require('form-data') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const randomBytes = require('iso-random-stream/src/random') const streamToPromise = require('stream-to-promise') diff --git a/packages/ipfs-http-server/test/inject/repo.js b/packages/ipfs-http-server/test/inject/repo.js index 809f07ec8e..9f0e018986 100644 --- a/packages/ipfs-http-server/test/inject/repo.js +++ b/packages/ipfs-http-server/test/inject/repo.js @@ -6,7 +6,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') const CID = require('cids') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const allNdjson = require('../utils/all-ndjson') describe('/repo', () => { diff --git a/packages/ipfs-http-server/test/inject/resolve.js b/packages/ipfs-http-server/test/inject/resolve.js index 988f195802..8a2619bf47 100644 --- a/packages/ipfs-http-server/test/inject/resolve.js +++ b/packages/ipfs-http-server/test/inject/resolve.js @@ -6,7 +6,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') const CID = require('cids') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { recursive: true, diff --git a/packages/ipfs-http-server/test/inject/stats.js b/packages/ipfs-http-server/test/inject/stats.js index 943933f16a..0f1e5b5623 100644 --- a/packages/ipfs-http-server/test/inject/stats.js +++ b/packages/ipfs-http-server/test/inject/stats.js @@ -6,7 +6,7 @@ const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') const allNdjson = require('../utils/all-ndjson') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/stats', () => { let ipfs diff --git a/packages/ipfs-http-server/test/inject/swarm.js b/packages/ipfs-http-server/test/inject/swarm.js index 92271e1953..c5bf8a6575 100644 --- a/packages/ipfs-http-server/test/inject/swarm.js +++ b/packages/ipfs-http-server/test/inject/swarm.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') describe('/swarm', () => { const multiaddr = '/ip4/127.0.0.1/tcp/4002/p2p/QmfGBRT6BbWJd7yUc2uYdaUZJBbnEFvTqehPFoSMQ6wgdr' diff --git a/packages/ipfs-http-server/test/inject/version.js b/packages/ipfs-http-server/test/inject/version.js index fb47032a70..eba3652828 100644 --- a/packages/ipfs-http-server/test/inject/version.js +++ b/packages/ipfs-http-server/test/inject/version.js @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai') const testHttpMethod = require('../utils/test-http-method') const http = require('../utils/http') const sinon = require('sinon') -const { AbortSignal } = require('abort-controller') +const { AbortSignal } = require('native-abort-controller') const defaultOptions = { signal: sinon.match.instanceOf(AbortSignal), diff --git a/packages/ipfs/package.json b/packages/ipfs/package.json index f957a84231..36d914e537 100644 --- a/packages/ipfs/package.json +++ b/packages/ipfs/package.json @@ -52,8 +52,8 @@ "interface-ipfs-core": "^0.140.0", "ipfs-http-client": "^47.0.1", "ipfs-interop": "^3.0.0", - "ipfs-utils": "^3.0.0", - "ipfsd-ctl": "^7.0.0", + "ipfs-utils": "^4.0.0", + "ipfsd-ctl": "^7.0.2", "iso-random-stream": "^1.1.1", "iso-url": "^0.4.7", "it-to-buffer": "^1.0.2",