From 7df21b775621bda0c8b24fdab415e0ffbadb39f3 Mon Sep 17 00:00:00 2001 From: Sasha <118575614+weboko@users.noreply.github.com> Date: Tue, 28 Nov 2023 00:40:59 +0100 Subject: [PATCH] chore: add info message with expected WebSocket connection failures (#1733) * audit deps * add info message * add option to hide message * add test * remove only --- package-lock.json | 483 +++++++++---------- packages/interfaces/src/libp2p.ts | 10 +- packages/interfaces/src/protocols.ts | 4 +- packages/sdk/src/create.ts | 18 +- packages/tests/tests/create.optional.spec.ts | 31 ++ 5 files changed, 278 insertions(+), 268 deletions(-) create mode 100644 packages/tests/tests/create.optional.spec.ts diff --git a/package-lock.json b/package-lock.json index 12e9564c2f..dae883a5e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,10 +117,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", + "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -198,42 +199,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/@babel/parser": { - "version": "7.22.16", - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/core/node_modules/@babel/traverse": { - "version": "7.22.20", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core/node_modules/globals": { - "version": "11.12.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/core/node_modules/json5": { "version": "2.2.3", "license": "MIT", @@ -252,10 +217,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.4.tgz", + "integrity": "sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==", "dependencies": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.4", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -396,11 +362,12 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "license": "MIT", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -531,8 +498,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } @@ -575,45 +543,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helpers/node_modules/@babel/parser": { - "version": "7.22.16", - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/helpers/node_modules/@babel/traverse": { - "version": "7.22.20", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers/node_modules/globals": { - "version": "11.12.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -625,7 +558,8 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -637,21 +571,24 @@ }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { "has-flag": "^3.0.0" }, @@ -660,8 +597,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.5", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", + "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1280,28 +1218,19 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/template/node_modules/@babel/parser": { - "version": "7.22.16", - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/traverse": { - "version": "7.22.5", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.4.tgz", + "integrity": "sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==", "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/code-frame": "^7.23.4", + "@babel/generator": "^7.23.4", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.4", + "@babel/types": "^7.23.4", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1311,17 +1240,19 @@ }, "node_modules/@babel/traverse/node_modules/globals": { "version": "11.12.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "engines": { "node": ">=4" } }, "node_modules/@babel/types": { - "version": "7.22.19", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.19", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1950,6 +1881,14 @@ "@ethersproject/logger": "^5.7.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", + "engines": { + "node": ">=14" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.11", "license": "Apache-2.0", @@ -6156,15 +6095,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/busboy": { - "version": "1.6.0", - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } - }, "node_modules/bytes": { "version": "3.1.2", "license": "MIT", @@ -7941,32 +7871,33 @@ } }, "node_modules/depcheck": { - "version": "1.4.6", - "license": "MIT", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/depcheck/-/depcheck-1.4.7.tgz", + "integrity": "sha512-1lklS/bV5chOxwNKA/2XUUk/hPORp8zihZsXflr8x0kLwmcZ9Y9BsS6Hs3ssvA+2wUVbG0U2Ciqvm1SokNjPkA==", "dependencies": { - "@babel/parser": "7.22.5", - "@babel/traverse": "7.22.5", - "@vue/compiler-sfc": "^3.0.5", + "@babel/parser": "^7.23.0", + "@babel/traverse": "^7.23.2", + "@vue/compiler-sfc": "^3.3.4", "callsite": "^1.0.0", - "camelcase": "^6.2.0", - "cosmiconfig": "^7.0.0", - "debug": "^4.2.0", - "deps-regex": "^0.1.4", + "camelcase": "^6.3.0", + "cosmiconfig": "^7.1.0", + "debug": "^4.3.4", + "deps-regex": "^0.2.0", "findup-sync": "^5.0.0", - "ignore": "^5.1.8", - "is-core-module": "^2.4.0", - "js-yaml": "^3.14.0", - "json5": "^2.1.3", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", + "ignore": "^5.2.4", + "is-core-module": "^2.12.0", + "js-yaml": "^3.14.1", + "json5": "^2.2.3", + "lodash": "^4.17.21", + "minimatch": "^7.4.6", "multimatch": "^5.0.0", "please-upgrade-node": "^3.2.0", - "readdirp": "^3.5.0", + "readdirp": "^3.6.0", "require-package-name": "^2.0.1", - "resolve": "^1.18.1", + "resolve": "^1.22.3", "resolve-from": "^5.0.0", - "semver": "^7.3.2", - "yargs": "^16.1.0" + "semver": "^7.5.4", + "yargs": "^16.2.0" }, "bin": { "depcheck": "bin/depcheck.js" @@ -8002,6 +7933,14 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/depcheck/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/depcheck/node_modules/cliui": { "version": "7.0.4", "license": "ISC", @@ -8071,6 +8010,20 @@ "node": ">=6" } }, + "node_modules/depcheck/node_modules/minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/depcheck/node_modules/sprintf-js": { "version": "1.0.3", "license": "BSD-3-Clause" @@ -8155,8 +8108,9 @@ "license": "ISC" }, "node_modules/deps-regex": { - "version": "0.1.4", - "license": "MIT" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/deps-regex/-/deps-regex-0.2.0.tgz", + "integrity": "sha512-PwuBojGMQAYbWkMXOY9Pd/NWCDNHVH12pnS7WHqZkTSeMESe4hwnKKRp0yR87g37113x4JPbo/oIvXY+s/f56Q==" }, "node_modules/dequal": { "version": "2.0.3", @@ -20713,7 +20667,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -20728,7 +20684,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", @@ -22443,6 +22398,8 @@ "node_modules/semantic-release": { "name": "@achingbrain/semantic-release", "version": "21.0.9", + "resolved": "https://registry.npmjs.org/@achingbrain/semantic-release/-/semantic-release-21.0.9.tgz", + "integrity": "sha512-yeLo3IjunA0f7y3aIB8y7x+/AAgFsA5zGB+WK34uNHS+h48eQ177R+9eG6HciNL1OwortMf901oJjG3EACrvpg==", "license": "MIT", "dependencies": { "@semantic-release/commit-analyzer": "^10.0.0", @@ -22484,6 +22441,8 @@ "node_modules/semantic-release-monorepo": { "name": "@achingbrain/semantic-release-monorepo", "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@achingbrain/semantic-release-monorepo/-/semantic-release-monorepo-8.0.2.tgz", + "integrity": "sha512-W11uWo80azi3CrJWP+qPNUYo3crwTw0uMjVkBkyYPPjsu0FgRE9ApSllyzi9gSs5HJxeHZadzas6ppMLDPg/uw==", "license": "MIT", "dependencies": { "debug": "^3.1.0", @@ -22747,6 +22706,8 @@ "node_modules/semantic-release-plugin-decorators": { "name": "@achingbrain/semantic-release-plugin-decorators", "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@achingbrain/semantic-release-plugin-decorators/-/semantic-release-plugin-decorators-4.0.1.tgz", + "integrity": "sha512-KwW4JzhSDuvKFBetdXpHBpI9WvQj4XA7JV13PL0CqZ/bmL6pTr3NV4jSSFjGoBVQ6cCdzxssoOc4glugCB1ECA==", "license": "MIT", "peerDependencies": { "semantic-release": ">=11" @@ -23621,12 +23582,6 @@ "node": ">=8.0" } }, - "node_modules/streamsearch": { - "version": "1.1.0", - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "license": "MIT", @@ -24915,10 +24870,11 @@ "license": "MIT" }, "node_modules/undici": { - "version": "5.25.1", - "license": "MIT", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.1.tgz", + "integrity": "sha512-xcIIvj1LOQH9zAL54iWFkuDEaIVEjLrru7qRpa3GrEEHk6OBhb/LycuUY2m7VCcTuDeLziXCxobQVyKExyGeIA==", "dependencies": { - "busboy": "^1.6.0" + "@fastify/busboy": "^2.0.0" }, "engines": { "node": ">=14.0" @@ -26253,9 +26209,11 @@ "version": "1.0.1" }, "@babel/code-frame": { - "version": "7.22.13", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", + "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", "requires": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "dependencies": { @@ -26304,27 +26262,6 @@ "semver": "^6.3.1" }, "dependencies": { - "@babel/parser": { - "version": "7.22.16" - }, - "@babel/traverse": { - "version": "7.22.20", - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "globals": { - "version": "11.12.0" - }, "json5": { "version": "2.2.3" }, @@ -26334,9 +26271,11 @@ } }, "@babel/generator": { - "version": "7.22.15", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.4.tgz", + "integrity": "sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==", "requires": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.4", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -26433,10 +26372,12 @@ "version": "7.22.20" }, "@babel/helper-function-name": { - "version": "7.22.5", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "requires": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { @@ -26511,7 +26452,9 @@ } }, "@babel/helper-string-parser": { - "version": "7.22.5" + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==" }, "@babel/helper-validator-identifier": { "version": "7.22.20" @@ -26533,33 +26476,12 @@ "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.15", "@babel/types": "^7.22.15" - }, - "dependencies": { - "@babel/parser": { - "version": "7.22.16" - }, - "@babel/traverse": { - "version": "7.22.20", - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "globals": { - "version": "11.12.0" - } } }, "@babel/highlight": { - "version": "7.22.20", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "requires": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -26568,6 +26490,8 @@ "dependencies": { "chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -26575,13 +26499,19 @@ } }, "escape-string-regexp": { - "version": "1.0.5" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "has-flag": { - "version": "3.0.0" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, "supports-color": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "requires": { "has-flag": "^3.0.0" } @@ -26589,7 +26519,9 @@ } }, "@babel/parser": { - "version": "7.22.5" + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", + "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.20.7", @@ -26911,38 +26843,39 @@ "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", "@babel/types": "^7.22.15" - }, - "dependencies": { - "@babel/parser": { - "version": "7.22.16" - } } }, "@babel/traverse": { - "version": "7.22.5", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.4.tgz", + "integrity": "sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==", "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/code-frame": "^7.23.4", + "@babel/generator": "^7.23.4", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.4", + "@babel/types": "^7.23.4", "debug": "^4.1.0", "globals": "^11.1.0" }, "dependencies": { "globals": { - "version": "11.12.0" + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" } } }, "@babel/types": { - "version": "7.22.19", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", "requires": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.19", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -27387,6 +27320,11 @@ "@ethersproject/logger": "^5.7.0" } }, + "@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==" + }, "@humanwhocodes/config-array": { "version": "0.11.11", "requires": { @@ -30327,12 +30265,6 @@ "run-applescript": "^5.0.0" } }, - "busboy": { - "version": "1.6.0", - "requires": { - "streamsearch": "^1.1.0" - } - }, "bytes": { "version": "3.1.2" }, @@ -31378,31 +31310,33 @@ "version": "2.1.0" }, "depcheck": { - "version": "1.4.6", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/depcheck/-/depcheck-1.4.7.tgz", + "integrity": "sha512-1lklS/bV5chOxwNKA/2XUUk/hPORp8zihZsXflr8x0kLwmcZ9Y9BsS6Hs3ssvA+2wUVbG0U2Ciqvm1SokNjPkA==", "requires": { - "@babel/parser": "7.22.5", - "@babel/traverse": "7.22.5", - "@vue/compiler-sfc": "^3.0.5", + "@babel/parser": "^7.23.0", + "@babel/traverse": "^7.23.2", + "@vue/compiler-sfc": "^3.3.4", "callsite": "^1.0.0", - "camelcase": "^6.2.0", - "cosmiconfig": "^7.0.0", - "debug": "^4.2.0", - "deps-regex": "^0.1.4", + "camelcase": "^6.3.0", + "cosmiconfig": "^7.1.0", + "debug": "^4.3.4", + "deps-regex": "^0.2.0", "findup-sync": "^5.0.0", - "ignore": "^5.1.8", - "is-core-module": "^2.4.0", - "js-yaml": "^3.14.0", - "json5": "^2.1.3", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", + "ignore": "^5.2.4", + "is-core-module": "^2.12.0", + "js-yaml": "^3.14.1", + "json5": "^2.2.3", + "lodash": "^4.17.21", + "minimatch": "^7.4.6", "multimatch": "^5.0.0", "please-upgrade-node": "^3.2.0", - "readdirp": "^3.5.0", + "readdirp": "^3.6.0", "require-package-name": "^2.0.1", - "resolve": "^1.18.1", + "resolve": "^1.22.3", "resolve-from": "^5.0.0", - "semver": "^7.3.2", - "yargs": "^16.1.0" + "semver": "^7.5.4", + "yargs": "^16.2.0" }, "dependencies": { "ansi-regex": { @@ -31420,6 +31354,14 @@ "sprintf-js": "~1.0.2" } }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, "cliui": { "version": "7.0.4", "requires": { @@ -31463,6 +31405,14 @@ "json5": { "version": "2.2.3" }, + "minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, "sprintf-js": { "version": "1.0.3" }, @@ -31516,7 +31466,9 @@ "version": "2.3.1" }, "deps-regex": { - "version": "0.1.4" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/deps-regex/-/deps-regex-0.2.0.tgz", + "integrity": "sha512-PwuBojGMQAYbWkMXOY9Pd/NWCDNHVH12pnS7WHqZkTSeMESe4hwnKKRp0yR87g37113x4JPbo/oIvXY+s/f56Q==" }, "dequal": { "version": "2.0.3" @@ -39072,7 +39024,9 @@ } }, "postcss": { - "version": "8.4.30", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "requires": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", @@ -40069,6 +40023,8 @@ }, "semantic-release": { "version": "npm:@achingbrain/semantic-release@21.0.9", + "resolved": "https://registry.npmjs.org/@achingbrain/semantic-release/-/semantic-release-21.0.9.tgz", + "integrity": "sha512-yeLo3IjunA0f7y3aIB8y7x+/AAgFsA5zGB+WK34uNHS+h48eQ177R+9eG6HciNL1OwortMf901oJjG3EACrvpg==", "requires": { "@semantic-release/commit-analyzer": "^10.0.0", "@semantic-release/error": "^4.0.0", @@ -40147,7 +40103,8 @@ } }, "semantic-release-monorepo": { - "version": "npm:@achingbrain/semantic-release-monorepo@8.0.2", + "version": "https://registry.npmjs.org/@achingbrain/semantic-release-monorepo/-/semantic-release-monorepo-8.0.2.tgz", + "integrity": "sha512-W11uWo80azi3CrJWP+qPNUYo3crwTw0uMjVkBkyYPPjsu0FgRE9ApSllyzi9gSs5HJxeHZadzas6ppMLDPg/uw==", "requires": { "debug": "^3.1.0", "execa": "^0.8.0", @@ -40308,7 +40265,8 @@ } }, "semantic-release-plugin-decorators": { - "version": "npm:@achingbrain/semantic-release-plugin-decorators@4.0.1", + "version": "https://registry.npmjs.org/@achingbrain/semantic-release-plugin-decorators/-/semantic-release-plugin-decorators-4.0.1.tgz", + "integrity": "sha512-KwW4JzhSDuvKFBetdXpHBpI9WvQj4XA7JV13PL0CqZ/bmL6pTr3NV4jSSFjGoBVQ6cCdzxssoOc4glugCB1ECA==", "requires": {} }, "semver": { @@ -40803,9 +40761,6 @@ "fs-extra": "^8.1.0" } }, - "streamsearch": { - "version": "1.1.0" - }, "string_decoder": { "version": "1.3.0", "requires": { @@ -41558,9 +41513,11 @@ "dev": true }, "undici": { - "version": "5.25.1", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.1.tgz", + "integrity": "sha512-xcIIvj1LOQH9zAL54iWFkuDEaIVEjLrru7qRpa3GrEEHk6OBhb/LycuUY2m7VCcTuDeLziXCxobQVyKExyGeIA==", "requires": { - "busboy": "^1.6.0" + "@fastify/busboy": "^2.0.0" } }, "unicode-canonical-property-names-ecmascript": { diff --git a/packages/interfaces/src/libp2p.ts b/packages/interfaces/src/libp2p.ts index 75f335cbb1..e657000e3a 100644 --- a/packages/interfaces/src/libp2p.ts +++ b/packages/interfaces/src/libp2p.ts @@ -1,6 +1,6 @@ import type { GossipSub } from "@chainsafe/libp2p-gossipsub"; import type { Libp2p as BaseLibp2p } from "@libp2p/interface"; -import type { Libp2pInit } from "libp2p"; +import type { Libp2pInit, Libp2pOptions } from "libp2p"; import type { identifyService } from "libp2p/identify"; import type { PingService } from "libp2p/ping"; @@ -19,3 +19,11 @@ export type Libp2pComponents = Parameters< export type Libp2p = BaseLibp2p & { components: Libp2pComponents; }; + +export type CreateLibp2pOptions = Libp2pOptions & { + /** + * Hides WebSocket info message in console. + * @default false + */ + hideWebSocketInfo?: boolean; +}; diff --git a/packages/interfaces/src/protocols.ts b/packages/interfaces/src/protocols.ts index a6b8e18043..dd81c484e2 100644 --- a/packages/interfaces/src/protocols.ts +++ b/packages/interfaces/src/protocols.ts @@ -1,8 +1,8 @@ import type { Libp2p } from "@libp2p/interface"; import type { PeerId } from "@libp2p/interface/peer-id"; import type { Peer, PeerStore } from "@libp2p/interface/peer-store"; -import type { Libp2pOptions } from "libp2p"; +import type { CreateLibp2pOptions } from "./libp2p.js"; import type { IDecodedMessage } from "./message.js"; import type { PubsubTopic } from "./misc.js"; @@ -47,7 +47,7 @@ export type ProtocolCreateOptions = { * allowing its omission and letting Waku set good defaults. * Notes that some values are overridden by {@link @waku/core!WakuNode} to ensure it implements the Waku protocol. */ - libp2p?: Partial; + libp2p?: Partial; /** * Byte array used as key for the noise protocol used for connection encryption * by [`Libp2p.create`](https://github.com/libp2p/js-libp2p/blob/master/doc/API.md#create) diff --git a/packages/sdk/src/create.ts b/packages/sdk/src/create.ts index 5114cfe9b1..67a2ca81b0 100644 --- a/packages/sdk/src/create.ts +++ b/packages/sdk/src/create.ts @@ -15,6 +15,7 @@ import { } from "@waku/core"; import { enrTree, wakuDnsDiscovery } from "@waku/dns-discovery"; import type { + CreateLibp2pOptions, FullNode, Libp2p, Libp2pComponents, @@ -24,7 +25,7 @@ import type { } from "@waku/interfaces"; import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange"; import { RelayCreateOptions, wakuGossipSub, wakuRelay } from "@waku/relay"; -import { createLibp2p, Libp2pOptions } from "libp2p"; +import { createLibp2p } from "libp2p"; import { identifyService } from "libp2p/identify"; import { pingService } from "libp2p/ping"; @@ -183,9 +184,22 @@ type PubsubService = { export async function defaultLibp2p( wakuGossipSub?: PubsubService["pubsub"], - options?: Partial, + options?: Partial, userAgent?: string ): Promise { + if (!options?.hideWebSocketInfo) { + /* eslint-disable no-console */ + console.info( + "%cIgnore WebSocket connection failures", + "background: gray; color: white; font-size: x-large" + ); + console.info( + "%cWaku tries to discover peers and some of them are expected to fail", + "background: gray; color: white; font-size: x-large" + ); + /* eslint-enable no-console */ + } + const pubsubService: PubsubService = wakuGossipSub ? { pubsub: wakuGossipSub } : {}; diff --git a/packages/tests/tests/create.optional.spec.ts b/packages/tests/tests/create.optional.spec.ts new file mode 100644 index 0000000000..dfa2309006 --- /dev/null +++ b/packages/tests/tests/create.optional.spec.ts @@ -0,0 +1,31 @@ +import { createLightNode, LightNode } from "@waku/sdk"; +import { expect } from "chai"; +import sinon, { SinonSpy } from "sinon"; + +import { tearDownNodes } from "../src/index.js"; + +describe("Craete node", () => { + let waku: LightNode; + let consoleInfoSpy: SinonSpy; + + beforeEach(() => { + consoleInfoSpy = sinon.spy(console as any, "info"); + }); + + afterEach(async () => { + consoleInfoSpy.restore(); + await tearDownNodes([], waku); + }); + + it("should log info about WebSocket failures to console when hideWebSocketInfo disabled", async () => { + waku = await createLightNode(); + expect(consoleInfoSpy.callCount).to.be.equal(2); + }); + + it("should not log info about WebSocket failures to console when hideWebSocketInfo enabled", async () => { + waku = await createLightNode({ + libp2p: { hideWebSocketInfo: true } + }); + expect(consoleInfoSpy.callCount).to.be.equal(0); + }); +});