From 8e91334e2445dccc5ca5ce95c83a2acdaa2509c4 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Tue, 13 Apr 2021 13:10:11 +0200 Subject: [PATCH] chore: remove url from node globals --- examples/libp2p-in-the-browser/package.json | 2 +- examples/webrtc-direct/package.json | 2 +- package.json | 4 ++-- scripts/node-globals.js | 1 - src/config.js | 2 +- src/index.js | 5 ----- src/insecure/plaintext.js | 1 - src/metrics/stats.js | 4 ---- 8 files changed, 5 insertions(+), 16 deletions(-) diff --git a/examples/libp2p-in-the-browser/package.json b/examples/libp2p-in-the-browser/package.json index 48f12e876d..9b928e8f7b 100644 --- a/examples/libp2p-in-the-browser/package.json +++ b/examples/libp2p-in-the-browser/package.json @@ -20,7 +20,7 @@ "libp2p-bootstrap": "^0.12.1", "libp2p-mplex": "^0.10.0", "libp2p-noise": "^2.0.0", - "libp2p-webrtc-star": "^0.20.0", + "libp2p-webrtc-star": "^0.22.0", "libp2p-websockets": "^0.15.0" }, "devDependencies": { diff --git a/examples/webrtc-direct/package.json b/examples/webrtc-direct/package.json index 70ac924784..d96c2aed5e 100644 --- a/examples/webrtc-direct/package.json +++ b/examples/webrtc-direct/package.json @@ -24,7 +24,7 @@ "libp2p-bootstrap": "^0.12.1", "libp2p-mplex": "^0.10.1", "libp2p-noise": "^2.0.1", - "libp2p-webrtc-direct": "^0.5.0", + "libp2p-webrtc-direct": "^0.6.0", "peer-id": "^0.14.3" }, "browser": { diff --git a/package.json b/package.json index 8b1cbe1e69..668e840c3e 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "@types/varint": "^6.0.0", "abortable-iterator": "^3.0.0", "aegir": "^33.0.0", + "buffer": "^6.0.3", "chai-bytes": "^0.1.2", "chai-string": "^1.5.0", "delay": "^5.0.0", @@ -157,7 +158,7 @@ "libp2p-mplex": "^0.10.1", "libp2p-noise": "^2.0.0", "libp2p-tcp": "^0.15.1", - "libp2p-webrtc-star": "^0.21.2", + "libp2p-webrtc-star": "^0.22.0", "libp2p-websockets": "^0.15.0", "multihashes": "^4.0.2", "nock": "^13.0.3", @@ -167,7 +168,6 @@ "rimraf": "^3.0.2", "sinon": "^10.0.0", "uint8arrays": "^2.1.3", - "url": "^0.11.0", "util": "^0.12.3" }, "contributors": [ diff --git a/scripts/node-globals.js b/scripts/node-globals.js index bb68e1bd8c..cc0a4c9e9c 100644 --- a/scripts/node-globals.js +++ b/scripts/node-globals.js @@ -1,3 +1,2 @@ // @ts-nocheck export const { Buffer } = require('buffer') -export const url = require('url') diff --git a/src/config.js b/src/config.js index d990a73a91..bbcc6dab47 100644 --- a/src/config.js +++ b/src/config.js @@ -1,7 +1,7 @@ 'use strict' const mergeOptions = require('merge-options') -// @ts-ignore no types in multiaddr +// @ts-ignore no types in multiaddr path const { dnsaddrResolver } = require('multiaddr/src/resolvers') const Constants = require('./constants') diff --git a/src/index.js b/src/index.js index a237fba9f4..bc7a5bab11 100644 --- a/src/index.js +++ b/src/index.js @@ -192,11 +192,6 @@ class Libp2p extends EventEmitter { this._discovery = new Map() // Discovery service instances/references // Create the Connection Manager - // @ts-ignore deprecated, needs to be removed on breaking change - if (this._options.connectionManager.minPeers) { - // @ts-ignore deprecated, needs to be removed on breaking change - this._options.connectionManager.minConnections = this._options.connectionManager.minPeers - } this.connectionManager = new ConnectionManager(this, { autoDial: this._config.peerDiscovery.autoDial, ...this._options.connectionManager diff --git a/src/insecure/plaintext.js b/src/insecure/plaintext.js index dcaddad76f..2ea0458315 100644 --- a/src/insecure/plaintext.js +++ b/src/insecure/plaintext.js @@ -10,7 +10,6 @@ const lp = require('it-length-prefixed') const PeerId = require('peer-id') const { UnexpectedPeerError, InvalidCryptoExchangeError } = require('libp2p-interfaces/src/crypto/errors') -// @ts-ignore protons do not export types const { Exchange, KeyType } = require('./proto') const protocol = '/plaintext/2.0.0' diff --git a/src/metrics/stats.js b/src/metrics/stats.js index 2eefd0d8ec..154392c0ac 100644 --- a/src/metrics/stats.js +++ b/src/metrics/stats.js @@ -72,8 +72,6 @@ class Stats extends EventEmitter { /** * Returns a clone of the current stats. - * - * @returns {Object} */ get snapshot () { return Object.assign({}, this._stats) @@ -81,8 +79,6 @@ class Stats extends EventEmitter { /** * Returns a clone of the internal movingAverages - * - * @returns {typeof Object.assign} */ get movingAverages () { return Object.assign({}, this._movingAverages)