From 902e887e1acac87f607324fa7cb5ad4b14aefcf3 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 20 Jan 2022 14:21:11 +0000 Subject: [PATCH] fix: remove abort-controller deps (#4015) `AbortController` and `AbortSignal` are global in all supported runtimes so we don't need the polyfill any more. BREAKING CHANGE: node 15+ is required --- .github/workflows/test.yml | 24 +++++++++---------- packages/interface-ipfs-core/package.json | 4 +--- .../src/bitswap/wantlist.js | 1 - .../src/pubsub/subscribe.js | 1 - packages/ipfs-core-config/package.json | 2 +- packages/ipfs-core-utils/package.json | 4 ++-- packages/ipfs-core/package.json | 7 +++--- packages/ipfs-core/src/preload.js | 1 - packages/ipfs-core/src/version.js | 2 +- packages/ipfs-http-client/package.json | 6 ++--- packages/ipfs-http-client/src/add-all.js | 1 - packages/ipfs-http-client/src/block/put.js | 1 - .../ipfs-http-client/src/config/replace.js | 1 - packages/ipfs-http-client/src/dag/import.js | 1 - packages/ipfs-http-client/src/dag/put.js | 1 - packages/ipfs-http-client/src/dht/put.js | 1 - packages/ipfs-http-client/src/files/write.js | 1 - .../src/object/patch/append-data.js | 1 - .../src/object/patch/set-data.js | 1 - .../ipfs-http-client/src/pubsub/publish.js | 1 - .../src/pubsub/subscription-tracker.js | 1 - packages/ipfs-http-client/test/pubsub.spec.js | 1 - packages/ipfs-http-server/package.json | 8 +++---- packages/ipfs-http-server/src/index.js | 2 +- .../ipfs-http-server/test/inject/bitswap.js | 1 - .../ipfs-http-server/test/inject/block.js | 1 - .../ipfs-http-server/test/inject/bootstrap.js | 1 - .../ipfs-http-server/test/inject/config.js | 1 - packages/ipfs-http-server/test/inject/dag.js | 1 - packages/ipfs-http-server/test/inject/dht.js | 1 - packages/ipfs-http-server/test/inject/dns.js | 1 - .../ipfs-http-server/test/inject/files.js | 1 - packages/ipfs-http-server/test/inject/id.js | 1 - packages/ipfs-http-server/test/inject/key.js | 1 - .../ipfs-http-server/test/inject/mfs/chmod.js | 1 - .../ipfs-http-server/test/inject/mfs/cp.js | 1 - .../ipfs-http-server/test/inject/mfs/flush.js | 1 - .../ipfs-http-server/test/inject/mfs/ls.js | 1 - .../ipfs-http-server/test/inject/mfs/mkdir.js | 1 - .../ipfs-http-server/test/inject/mfs/mv.js | 1 - .../ipfs-http-server/test/inject/mfs/read.js | 1 - .../ipfs-http-server/test/inject/mfs/rm.js | 1 - .../ipfs-http-server/test/inject/mfs/stat.js | 1 - .../ipfs-http-server/test/inject/mfs/touch.js | 1 - .../ipfs-http-server/test/inject/mfs/write.js | 1 - packages/ipfs-http-server/test/inject/name.js | 1 - .../ipfs-http-server/test/inject/object.js | 1 - packages/ipfs-http-server/test/inject/pin.js | 1 - packages/ipfs-http-server/test/inject/ping.js | 1 - .../ipfs-http-server/test/inject/pubsub.js | 1 - packages/ipfs-http-server/test/inject/repo.js | 1 - .../ipfs-http-server/test/inject/resolve.js | 1 - .../ipfs-http-server/test/inject/stats.js | 1 - .../ipfs-http-server/test/inject/swarm.js | 1 - .../ipfs-http-server/test/inject/version.js | 1 - 55 files changed, 26 insertions(+), 79 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de184f0f7e..758f59a983 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -355,9 +355,9 @@ jobs: - name: ipfs browser video streaming repo: https://github.com/ipfs-examples/js-ipfs-browser-video-streaming.git deps: ipfs-core@$PWD/packages/ipfs-core/dist - - name: ipfs browser vue - repo: https://github.com/ipfs-examples/js-ipfs-browser-vue.git - deps: ipfs-core@$PWD/packages/ipfs-core/dist + #- name: ipfs browser vue + # repo: https://github.com/ipfs-examples/js-ipfs-browser-vue.git + # deps: ipfs-core@$PWD/packages/ipfs-core/dist - name: ipfs browser webpack repo: https://github.com/ipfs-examples/js-ipfs-browser-webpack.git deps: ipfs-core@$PWD/packages/ipfs-core/dist @@ -391,21 +391,21 @@ jobs: - name: ipfs-client add files repo: https://github.com/ipfs-examples/js-ipfs-ipfs-client-add-files.git deps: ipfs@$PWD/packages/ipfs/dist,ipfs-client@$PWD/packages/ipfs-client/dist - - name: ipfs electron js - repo: https://github.com/ipfs-examples/js-ipfs-run-in-electron.git - deps: ipfs-core@$PWD/packages/ipfs-core/dist + #- name: ipfs electron js + # repo: https://github.com/ipfs-examples/js-ipfs-run-in-electron.git + # deps: ipfs-core@$PWD/packages/ipfs-core/dist - name: ipfs running multiple nodes repo: https://github.com/ipfs-examples/js-ipfs-running-multiple-nodes.git deps: ipfs@$PWD/packages/ipfs/dist #- name: ipfs traverse ipld graphs # repo: https://github.com/ipfs-examples/js-ipfs-traverse-ipld-graphs.git # deps: ipfs-core@$PWD/packages/ipfs-core/dist - - name: types with typescript - repo: https://github.com/ipfs-examples/js-ipfs-types-use-ipfs-from-ts.git - deps: ipfs-core@$PWD/packages/ipfs-core/dist - - name: types with typed js - repo: https://github.com/ipfs-examples/js-ipfs-types-use-ipfs-from-typed-js.git - deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs-core-types@$PWD/packages/ipfs-core-types/dist + #- name: types with typescript + # repo: https://github.com/ipfs-examples/js-ipfs-types-use-ipfs-from-ts.git + # deps: ipfs-core@$PWD/packages/ipfs-core/dist + #- name: types with typed js + # repo: https://github.com/ipfs-examples/js-ipfs-types-use-ipfs-from-typed-js.git + # deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs-core-types@$PWD/packages/ipfs-core-types/dist steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/packages/interface-ipfs-core/package.json b/packages/interface-ipfs-core/package.json index e63b572f51..5cc4b8a300 100644 --- a/packages/interface-ipfs-core/package.json +++ b/packages/interface-ipfs-core/package.json @@ -50,7 +50,7 @@ "clean": "rimraf ./dist", "build": "aegir build && copyfiles ./test/fixtures/**/*, ./dist/cjs && copyfiles ./test/fixtures/**/*, ./dist/esm", "lint": "aegir ts -p check && aegir lint", - "dep-check": "aegir dep-check -i abort-controller -i ipfs-core-types -i rimraf -i copyfiles" + "dep-check": "aegir dep-check -i ipfs-core-types -i rimraf -i copyfiles" }, "repository": { "type": "git", @@ -66,7 +66,6 @@ "@ipld/dag-pb": "^2.1.3", "@types/pako": "^1.0.2", "@types/readable-stream": "^2.3.11", - "abort-controller": "^3.0.0", "aegir": "^36.0.1", "blockstore-core": "^1.0.2", "copyfiles": "^2.4.1", @@ -95,7 +94,6 @@ "multiaddr": "^10.0.0", "multiformats": "^9.4.13", "nanoid": "^3.1.23", - "native-abort-controller": "^1.0.3", "p-map": "^4.0.0", "p-retry": "^4.5.0", "pako": "^1.0.2", diff --git a/packages/interface-ipfs-core/src/bitswap/wantlist.js b/packages/interface-ipfs-core/src/bitswap/wantlist.js index f34c87e4ab..0b810dce90 100644 --- a/packages/interface-ipfs-core/src/bitswap/wantlist.js +++ b/packages/interface-ipfs-core/src/bitswap/wantlist.js @@ -5,7 +5,6 @@ import { getDescribe, getIt } from '../utils/mocha.js' import { waitForWantlistKey, waitForWantlistKeyToBeRemoved } from './utils.js' import { isWebWorker } from 'ipfs-utils/src/env.js' import testTimeout from '../utils/test-timeout.js' -import { AbortController } from 'native-abort-controller' import { CID } from 'multiformats/cid' import delay from 'delay' import { ipfsOptionsWebsocketsFilterAll } from '../utils/ipfs-options-websockets-filter-all.js' diff --git a/packages/interface-ipfs-core/src/pubsub/subscribe.js b/packages/interface-ipfs-core/src/pubsub/subscribe.js index a8756c6362..0109f90d04 100644 --- a/packages/interface-ipfs-core/src/pubsub/subscribe.js +++ b/packages/interface-ipfs-core/src/pubsub/subscribe.js @@ -9,7 +9,6 @@ import { waitForPeers, getTopic } from './utils.js' import { expect } from 'aegir/utils/chai.js' import { getDescribe, getIt } from '../utils/mocha.js' import delay from 'delay' -import { AbortController } from 'native-abort-controller' import { isWebWorker, isNode } from 'ipfs-utils/src/env.js' import { ipfsOptionsWebsocketsFilterAll } from '../utils/ipfs-options-websockets-filter-all.js' import first from 'it-first' diff --git a/packages/ipfs-core-config/package.json b/packages/ipfs-core-config/package.json index baab1c81bc..c0006c66ff 100644 --- a/packages/ipfs-core-config/package.json +++ b/packages/ipfs-core-config/package.json @@ -79,7 +79,7 @@ }, "license": "MIT", "dependencies": { - "@chainsafe/libp2p-noise": "^5.0.0", + "@chainsafe/libp2p-noise": "^5.0.1", "blockstore-datastore-adapter": "^2.0.2", "datastore-core": "^6.0.7", "datastore-fs": "^6.0.1", diff --git a/packages/ipfs-core-utils/package.json b/packages/ipfs-core-utils/package.json index 837efa80b7..ac0dbb4268 100644 --- a/packages/ipfs-core-utils/package.json +++ b/packages/ipfs-core-utils/package.json @@ -112,7 +112,7 @@ }, "license": "MIT", "dependencies": { - "any-signal": "^2.1.2", + "any-signal": "^3.0.0", "blob-to-it": "^1.0.1", "browser-readablestream-to-it": "^1.0.1", "debug": "^4.1.1", @@ -130,7 +130,7 @@ "multiformats": "^9.4.13", "nanoid": "^3.1.23", "parse-duration": "^1.0.0", - "timeout-abort-controller": "^2.0.0", + "timeout-abort-controller": "^3.0.0", "uint8arrays": "^3.0.0" }, "devDependencies": { diff --git a/packages/ipfs-core/package.json b/packages/ipfs-core/package.json index 21bffcddce..c4331be01c 100644 --- a/packages/ipfs-core/package.json +++ b/packages/ipfs-core/package.json @@ -62,7 +62,7 @@ "test:electron-renderer": "aegir build --esm-tests && aegir test -t electron-renderer -f ./dist/cjs/browser-test/*.spec.js", "test:bootstrapers": "IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js", "clean": "rimraf ./dist", - "dep-check": "aegir dep-check -i interface-ipfs-core -i ipfs-core-types -i abort-controller -i npm-run-all --i interface-blockstore" + "dep-check": "aegir dep-check -i interface-ipfs-core -i ipfs-core-types -i npm-run-all --i interface-blockstore" }, "dependencies": { "@chainsafe/libp2p-noise": "^5.0.0", @@ -71,7 +71,7 @@ "@ipld/dag-json": "^8.0.1", "@ipld/dag-pb": "^2.1.3", "@multiformats/murmur3": "^1.0.1", - "any-signal": "^2.1.2", + "any-signal": "^3.0.0", "array-shuffle": "^2.0.0", "blockstore-core": "^1.0.2", "blockstore-datastore-adapter": "^2.0.2", @@ -123,11 +123,10 @@ "multiaddr": "^10.0.0", "multiaddr-to-uri": "^8.0.0", "multiformats": "^9.4.13", - "native-abort-controller": "^1.0.3", "pako": "^1.0.2", "parse-duration": "^1.0.0", "peer-id": "^0.16.0", - "timeout-abort-controller": "^2.0.0", + "timeout-abort-controller": "^3.0.0", "uint8arrays": "^3.0.0" }, "devDependencies": { diff --git a/packages/ipfs-core/src/preload.js b/packages/ipfs-core/src/preload.js index 519f703bb0..b5564011bf 100644 --- a/packages/ipfs-core/src/preload.js +++ b/packages/ipfs-core/src/preload.js @@ -3,7 +3,6 @@ import toUri from 'multiaddr-to-uri' import debug from 'debug' import shuffle from 'array-shuffle' -import { AbortController } from 'native-abort-controller' import { preload } from 'ipfs-core-config/preload' /** @type {typeof import('hashlru').default} */ // @ts-ignore - hashlru has incorrect typedefs diff --git a/packages/ipfs-core/src/version.js b/packages/ipfs-core/src/version.js index fd0c8cac85..19ef858467 100644 --- a/packages/ipfs-core/src/version.js +++ b/packages/ipfs-core/src/version.js @@ -1,4 +1,4 @@ export const ipfsCore = '0.13.0' -export const commit = '7375caa8805298fc671ed4080e1023aafe756151' +export const commit = '' export const interfaceIpfsCore = '^0.153.0' diff --git a/packages/ipfs-http-client/package.json b/packages/ipfs-http-client/package.json index 62bc2ef37e..90c168829a 100644 --- a/packages/ipfs-http-client/package.json +++ b/packages/ipfs-http-client/package.json @@ -51,14 +51,13 @@ "test:electron-renderer": "aegir build --esm-tests && aegir test -t electron-renderer -f ./dist/cjs/browser-test/*.spec.js", "lint": "aegir ts -p check && aegir lint", "clean": "rimraf ./dist", - "dep-check": "aegir dep-check -i ipfs-core -i rimraf -i ipfs-core-types -i abort-controller" + "dep-check": "aegir dep-check -i ipfs-core -i rimraf -i ipfs-core-types" }, "dependencies": { "@ipld/dag-cbor": "^7.0.0", "@ipld/dag-json": "^8.0.1", "@ipld/dag-pb": "^2.1.3", - "abort-controller": "^3.0.0", - "any-signal": "^2.1.2", + "any-signal": "^3.0.0", "debug": "^4.1.1", "err-code": "^3.0.1", "ipfs-core-types": "^0.9.0", @@ -69,7 +68,6 @@ "merge-options": "^3.0.4", "multiaddr": "^10.0.0", "multiformats": "^9.4.13", - "native-abort-controller": "^1.0.3", "parse-duration": "^1.0.0", "stream-to-it": "^0.2.2", "uint8arrays": "^3.0.0" diff --git a/packages/ipfs-http-client/src/add-all.js b/packages/ipfs-http-client/src/add-all.js index d15cfa1b3d..3c40b20c5f 100644 --- a/packages/ipfs-http-client/src/add-all.js +++ b/packages/ipfs-http-client/src/add-all.js @@ -4,7 +4,6 @@ import { configure } from './lib/configure.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { toUrlSearchParams } from './lib/to-url-search-params.js' import { abortSignal } from './lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('ipfs-utils/src/types').ProgressFn} IPFSUtilsHttpUploadProgressFn diff --git a/packages/ipfs-http-client/src/block/put.js b/packages/ipfs-http-client/src/block/put.js index 0b1480402d..40e83b62f0 100644 --- a/packages/ipfs-http-client/src/block/put.js +++ b/packages/ipfs-http-client/src/block/put.js @@ -3,7 +3,6 @@ import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { configure } from '../lib/configure.js' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { abortSignal } from '../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions diff --git a/packages/ipfs-http-client/src/config/replace.js b/packages/ipfs-http-client/src/config/replace.js index 47e9268e54..ac14bcfbf0 100644 --- a/packages/ipfs-http-client/src/config/replace.js +++ b/packages/ipfs-http-client/src/config/replace.js @@ -3,7 +3,6 @@ import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { configure } from '../lib/configure.js' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { abortSignal } from '../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions diff --git a/packages/ipfs-http-client/src/dag/import.js b/packages/ipfs-http-client/src/dag/import.js index 1c60c57768..cc2830a11a 100644 --- a/packages/ipfs-http-client/src/dag/import.js +++ b/packages/ipfs-http-client/src/dag/import.js @@ -2,7 +2,6 @@ import { configure } from '../lib/configure.js' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { abortSignal } from '../lib/abort-signal.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' -import { AbortController } from 'native-abort-controller' import { CID } from 'multiformats/cid' /** diff --git a/packages/ipfs-http-client/src/dag/put.js b/packages/ipfs-http-client/src/dag/put.js index 71701942b9..548ac7d54c 100644 --- a/packages/ipfs-http-client/src/dag/put.js +++ b/packages/ipfs-http-client/src/dag/put.js @@ -3,7 +3,6 @@ import { configure } from '../lib/configure.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { abortSignal } from '../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions diff --git a/packages/ipfs-http-client/src/dht/put.js b/packages/ipfs-http-client/src/dht/put.js index 807899df35..b6d220c715 100644 --- a/packages/ipfs-http-client/src/dht/put.js +++ b/packages/ipfs-http-client/src/dht/put.js @@ -2,7 +2,6 @@ import { configure } from '../lib/configure.js' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { abortSignal } from '../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { mapEvent } from './map-event.js' diff --git a/packages/ipfs-http-client/src/files/write.js b/packages/ipfs-http-client/src/files/write.js index 13bf3ac3f9..74796fcae6 100644 --- a/packages/ipfs-http-client/src/files/write.js +++ b/packages/ipfs-http-client/src/files/write.js @@ -4,7 +4,6 @@ import { configure } from '../lib/configure.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { abortSignal } from '../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions 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 1496b15682..cb4bda9281 100644 --- a/packages/ipfs-http-client/src/object/patch/append-data.js +++ b/packages/ipfs-http-client/src/object/patch/append-data.js @@ -3,7 +3,6 @@ import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { configure } from '../../lib/configure.js' import { toUrlSearchParams } from '../../lib/to-url-search-params.js' import { abortSignal } from '../../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../../types').HTTPClientExtraOptions} HTTPClientExtraOptions 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 cb9663f728..2d25e6a0c1 100644 --- a/packages/ipfs-http-client/src/object/patch/set-data.js +++ b/packages/ipfs-http-client/src/object/patch/set-data.js @@ -3,7 +3,6 @@ import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { configure } from '../../lib/configure.js' import { toUrlSearchParams } from '../../lib/to-url-search-params.js' import { abortSignal } from '../../lib/abort-signal.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../../types').HTTPClientExtraOptions} HTTPClientExtraOptions diff --git a/packages/ipfs-http-client/src/pubsub/publish.js b/packages/ipfs-http-client/src/pubsub/publish.js index b393e48893..034996885e 100644 --- a/packages/ipfs-http-client/src/pubsub/publish.js +++ b/packages/ipfs-http-client/src/pubsub/publish.js @@ -3,7 +3,6 @@ import { toUrlSearchParams } from '../lib/to-url-search-params.js' import { multipartRequest } from 'ipfs-core-utils/multipart-request' import { abortSignal } from '../lib/abort-signal.js' import { textToUrlSafeRpc } from '../lib/http-rpc-wire-format.js' -import { AbortController } from 'native-abort-controller' /** * @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions diff --git a/packages/ipfs-http-client/src/pubsub/subscription-tracker.js b/packages/ipfs-http-client/src/pubsub/subscription-tracker.js index 33476ccf02..b2ef51ee8b 100644 --- a/packages/ipfs-http-client/src/pubsub/subscription-tracker.js +++ b/packages/ipfs-http-client/src/pubsub/subscription-tracker.js @@ -1,4 +1,3 @@ -import { AbortController } from 'native-abort-controller' /** * @typedef {import('ipfs-core-types/src/pubsub').MessageHandlerFn} MessageHandlerFn diff --git a/packages/ipfs-http-client/test/pubsub.spec.js b/packages/ipfs-http-client/test/pubsub.spec.js index 538fdae1ee..81d54db985 100644 --- a/packages/ipfs-http-client/test/pubsub.spec.js +++ b/packages/ipfs-http-client/test/pubsub.spec.js @@ -1,7 +1,6 @@ /* eslint-env mocha */ import { expect } from 'aegir/utils/chai.js' -import { AbortController } from 'native-abort-controller' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import defer from 'p-defer' import { factory } from './utils/factory.js' diff --git a/packages/ipfs-http-server/package.json b/packages/ipfs-http-server/package.json index 4d9e3907b4..d13079ca42 100644 --- a/packages/ipfs-http-server/package.json +++ b/packages/ipfs-http-server/package.json @@ -39,7 +39,7 @@ "test": "aegir test -t node", "test:node": "aegir test -t node", "clean": "rimraf ./dist", - "dep-check": "aegir dep-check -i ipfs-http-client -i rimraf -i abort-controller -i ipfs-core-types -i npm-run-all", + "dep-check": "aegir dep-check -i ipfs-http-client -i rimraf -i ipfs-core-types -i npm-run-all", "build": "run-s build:*", "build:update-version": "node scripts/update-version.js", "build:aegir": "aegir build --no-bundle" @@ -49,8 +49,7 @@ "@hapi/content": "^5.0.2", "@hapi/hapi": "^20.0.0", "@ipld/dag-pb": "^2.1.3", - "abort-controller": "^3.0.0", - "any-signal": "^2.1.2", + "any-signal": "^3.0.0", "debug": "^4.1.1", "dlv": "^1.1.3", "err-code": "^3.0.1", @@ -74,10 +73,9 @@ "just-safe-set": "^2.2.1", "multiaddr": "^10.0.0", "multiformats": "^9.4.13", - "native-abort-controller": "^1.0.3", "parse-duration": "^1.0.0", "stream-to-it": "^0.2.2", - "timeout-abort-controller": "^2.0.0", + "timeout-abort-controller": "^3.0.0", "uint8arrays": "^3.0.0", "uri-to-multiaddr": "^6.0.0" }, diff --git a/packages/ipfs-http-server/src/index.js b/packages/ipfs-http-server/src/index.js index b77fbd0262..b0b6f2f026 100644 --- a/packages/ipfs-http-server/src/index.js +++ b/packages/ipfs-http-server/src/index.js @@ -5,9 +5,9 @@ import { Multiaddr } from 'multiaddr' // @ts-expect-error no types import toMultiaddr from 'uri-to-multiaddr' import Boom from '@hapi/boom' -import { AbortController } from 'native-abort-controller' import { routes } from './api/routes/index.js' import { errorHandler } from './error-handler.js' + const LOG = 'ipfs:http-api' const LOG_ERROR = 'ipfs:http-api:error' diff --git a/packages/ipfs-http-server/test/inject/bitswap.js b/packages/ipfs-http-server/test/inject/bitswap.js index d10d9d6357..2c3ae4e2e6 100644 --- a/packages/ipfs-http-server/test/inject/bitswap.js +++ b/packages/ipfs-http-server/test/inject/bitswap.js @@ -5,7 +5,6 @@ import { CID } from 'multiformats/cid' import sinon from 'sinon' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' diff --git a/packages/ipfs-http-server/test/inject/block.js b/packages/ipfs-http-server/test/inject/block.js index a590aac093..f57b8faf5a 100644 --- a/packages/ipfs-http-server/test/inject/block.js +++ b/packages/ipfs-http-server/test/inject/block.js @@ -8,7 +8,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' import { base32 } from 'multiformats/bases/base32' diff --git a/packages/ipfs-http-server/test/inject/bootstrap.js b/packages/ipfs-http-server/test/inject/bootstrap.js index d761529200..dfd915973e 100644 --- a/packages/ipfs-http-server/test/inject/bootstrap.js +++ b/packages/ipfs-http-server/test/inject/bootstrap.js @@ -5,7 +5,6 @@ import qs from 'qs' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' const defaultList = [ 'server0', diff --git a/packages/ipfs-http-server/test/inject/config.js b/packages/ipfs-http-server/test/inject/config.js index 58f326b1d2..bc9a0386d3 100644 --- a/packages/ipfs-http-server/test/inject/config.js +++ b/packages/ipfs-http-server/test/inject/config.js @@ -7,7 +7,6 @@ import streamToPromise from 'stream-to-promise' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' const profiles = { profile1: { diff --git a/packages/ipfs-http-server/test/inject/dag.js b/packages/ipfs-http-server/test/inject/dag.js index 2d9056f519..73f3c8f128 100644 --- a/packages/ipfs-http-server/test/inject/dag.js +++ b/packages/ipfs-http-server/test/inject/dag.js @@ -10,7 +10,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import { matchIterable } from '../utils/match-iterable.js' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base32 } from 'multiformats/bases/base32' import drain from 'it-drain' diff --git a/packages/ipfs-http-server/test/inject/dht.js b/packages/ipfs-http-server/test/inject/dht.js index f65c9fd0d7..772bd416c0 100644 --- a/packages/ipfs-http-server/test/inject/dht.js +++ b/packages/ipfs-http-server/test/inject/dht.js @@ -7,7 +7,6 @@ import { http } from '../utils/http.js' import sinon from 'sinon' import errCode from 'err-code' import { CID } from 'multiformats/cid' -import { AbortSignal } from 'native-abort-controller' import { allNdjson } from '../utils/all-ndjson.js' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import FormData from 'form-data' diff --git a/packages/ipfs-http-server/test/inject/dns.js b/packages/ipfs-http-server/test/inject/dns.js index 980aaff065..322376a0c3 100644 --- a/packages/ipfs-http-server/test/inject/dns.js +++ b/packages/ipfs-http-server/test/inject/dns.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from '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 59e7ba2cad..5cf7c801ed 100644 --- a/packages/ipfs-http-server/test/inject/files.js +++ b/packages/ipfs-http-server/test/inject/files.js @@ -11,7 +11,6 @@ import sinon from 'sinon' import { CID } from 'multiformats/cid' import first from 'it-first' import toBuffer from 'it-to-buffer' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' import { matchIterable } from '../utils/match-iterable.js' diff --git a/packages/ipfs-http-server/test/inject/id.js b/packages/ipfs-http-server/test/inject/id.js index de1e9a1e64..1e9a8c1dc7 100644 --- a/packages/ipfs-http-server/test/inject/id.js +++ b/packages/ipfs-http-server/test/inject/id.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from '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 0ee1c39353..f487a639ab 100644 --- a/packages/ipfs-http-server/test/inject/key.js +++ b/packages/ipfs-http-server/test/inject/key.js @@ -5,7 +5,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from '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 6b42e15e01..2b7c6dfc4d 100644 --- a/packages/ipfs-http-server/test/inject/mfs/chmod.js +++ b/packages/ipfs-http-server/test/inject/mfs/chmod.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 a63dc4dad6..022f2ba07c 100644 --- a/packages/ipfs-http-server/test/inject/mfs/cp.js +++ b/packages/ipfs-http-server/test/inject/mfs/cp.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 db45711238..875eeb0770 100644 --- a/packages/ipfs-http-server/test/inject/mfs/flush.js +++ b/packages/ipfs-http-server/test/inject/mfs/flush.js @@ -5,7 +5,6 @@ import { http } from '../../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' diff --git a/packages/ipfs-http-server/test/inject/mfs/ls.js b/packages/ipfs-http-server/test/inject/mfs/ls.js index e9872b92ac..cafaf41ce6 100644 --- a/packages/ipfs-http-server/test/inject/mfs/ls.js +++ b/packages/ipfs-http-server/test/inject/mfs/ls.js @@ -5,7 +5,6 @@ import { http } from '../../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' const fileCid = CID.parse('bafybeigyov3nzxrqjismjpq7ghkkjorcmozy5rgaikvyieakoqpxfc3rvu') diff --git a/packages/ipfs-http-server/test/inject/mfs/mkdir.js b/packages/ipfs-http-server/test/inject/mfs/mkdir.js index bfeb7fdfe8..ad93c9a5db 100644 --- a/packages/ipfs-http-server/test/inject/mfs/mkdir.js +++ b/packages/ipfs-http-server/test/inject/mfs/mkdir.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 276501f1ec..25ca841ebb 100644 --- a/packages/ipfs-http-server/test/inject/mfs/mv.js +++ b/packages/ipfs-http-server/test/inject/mfs/mv.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 41bbedd7e7..d295655278 100644 --- a/packages/ipfs-http-server/test/inject/mfs/read.js +++ b/packages/ipfs-http-server/test/inject/mfs/read.js @@ -5,7 +5,6 @@ import { http } from '../../utils/http.js' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 43eb014207..2f318f81d0 100644 --- a/packages/ipfs-http-server/test/inject/mfs/rm.js +++ b/packages/ipfs-http-server/test/inject/mfs/rm.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 e0d3fdbee1..07d20790fa 100644 --- a/packages/ipfs-http-server/test/inject/mfs/stat.js +++ b/packages/ipfs-http-server/test/inject/mfs/stat.js @@ -5,7 +5,6 @@ import { http } from '../../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' diff --git a/packages/ipfs-http-server/test/inject/mfs/touch.js b/packages/ipfs-http-server/test/inject/mfs/touch.js index 81de626a12..11ab4986b1 100644 --- a/packages/ipfs-http-server/test/inject/mfs/touch.js +++ b/packages/ipfs-http-server/test/inject/mfs/touch.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { http } from '../../utils/http.js' import sinon from 'sinon' import { testHttpMethod } from '../../utils/test-http-method.js' -import { AbortSignal } from '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 4d88e40c81..1c9c2d08c0 100644 --- a/packages/ipfs-http-server/test/inject/mfs/write.js +++ b/packages/ipfs-http-server/test/inject/mfs/write.js @@ -6,7 +6,6 @@ import { matchIterable } from '../../utils/match-iterable.js' import sinon from 'sinon' import FormData from 'form-data' import streamToPromise from 'stream-to-promise' -import { AbortSignal } from '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 ac0601d048..26b3a6d09a 100644 --- a/packages/ipfs-http-server/test/inject/name.js +++ b/packages/ipfs-http-server/test/inject/name.js @@ -6,7 +6,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' describe('/name', function () { const cid = CID.parse('QmbndGRXYRyfU41TUvc52gMrwq87JJg18QsDPcCeaMcM61') diff --git a/packages/ipfs-http-server/test/inject/object.js b/packages/ipfs-http-server/test/inject/object.js index 44a8c926a3..0a3b079bd2 100644 --- a/packages/ipfs-http-server/test/inject/object.js +++ b/packages/ipfs-http-server/test/inject/object.js @@ -10,7 +10,6 @@ import { http } from '../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' import { UnixFS } from 'ipfs-unixfs' -import { AbortSignal } from 'native-abort-controller' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { base58btc } from 'multiformats/bases/base58' diff --git a/packages/ipfs-http-server/test/inject/pin.js b/packages/ipfs-http-server/test/inject/pin.js index 228b7d814b..e954265302 100644 --- a/packages/ipfs-http-server/test/inject/pin.js +++ b/packages/ipfs-http-server/test/inject/pin.js @@ -7,7 +7,6 @@ import { http } from '../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' import { allNdjson } from '../utils/all-ndjson.js' -import { AbortSignal } from 'native-abort-controller' import { base58btc } from 'multiformats/bases/base58' import { base64 } from 'multiformats/bases/base64' diff --git a/packages/ipfs-http-server/test/inject/ping.js b/packages/ipfs-http-server/test/inject/ping.js index 758a6037b7..b490835d9f 100644 --- a/packages/ipfs-http-server/test/inject/ping.js +++ b/packages/ipfs-http-server/test/inject/ping.js @@ -6,7 +6,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' import { allNdjson } from '../utils/all-ndjson.js' -import { AbortSignal } from '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 d15af82562..ad5d845003 100644 --- a/packages/ipfs-http-server/test/inject/pubsub.js +++ b/packages/ipfs-http-server/test/inject/pubsub.js @@ -6,7 +6,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import FormData from 'form-data' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' import { randomBytes } from 'iso-random-stream' import streamToPromise from 'stream-to-promise' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' diff --git a/packages/ipfs-http-server/test/inject/repo.js b/packages/ipfs-http-server/test/inject/repo.js index dbe6314c6e..466253b64d 100644 --- a/packages/ipfs-http-server/test/inject/repo.js +++ b/packages/ipfs-http-server/test/inject/repo.js @@ -5,7 +5,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' -import { AbortSignal } from 'native-abort-controller' import { allNdjson } from '../utils/all-ndjson.js' describe('/repo', () => { diff --git a/packages/ipfs-http-server/test/inject/resolve.js b/packages/ipfs-http-server/test/inject/resolve.js index 8b73106180..153856a28a 100644 --- a/packages/ipfs-http-server/test/inject/resolve.js +++ b/packages/ipfs-http-server/test/inject/resolve.js @@ -5,7 +5,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' import { CID } from 'multiformats/cid' -import { AbortSignal } from '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 49f5a6891b..6f0ccc2aae 100644 --- a/packages/ipfs-http-server/test/inject/stats.js +++ b/packages/ipfs-http-server/test/inject/stats.js @@ -5,7 +5,6 @@ import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' import { allNdjson } from '../utils/all-ndjson.js' -import { AbortSignal } from '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 7a02ab3147..68af7d1344 100644 --- a/packages/ipfs-http-server/test/inject/swarm.js +++ b/packages/ipfs-http-server/test/inject/swarm.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from '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 5fd88fc92c..3196a3afc8 100644 --- a/packages/ipfs-http-server/test/inject/version.js +++ b/packages/ipfs-http-server/test/inject/version.js @@ -4,7 +4,6 @@ import { expect } from 'aegir/utils/chai.js' import { testHttpMethod } from '../utils/test-http-method.js' import { http } from '../utils/http.js' import sinon from 'sinon' -import { AbortSignal } from 'native-abort-controller' const defaultOptions = { signal: sinon.match.instanceOf(AbortSignal),