From c999d6a74971f5bfa5f173595cbf91cfad469bf8 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 27 Jul 2023 09:07:51 +0100 Subject: [PATCH] deps: upgrade aegir to 40.x.x (#1900) Upgrades aegir and fixes linting errors and typedoc config. --- doc/METRICS.md | 6 +-- doc/package.json | 7 +-- examples/auto-relay/package.json | 4 +- examples/chat/package.json | 4 +- examples/connection-encryption/package.json | 4 +- examples/delegated-routing/package.json | 4 +- examples/discovery-mechanisms/package.json | 4 +- examples/echo/package.json | 4 +- examples/libp2p-in-the-browser/package.json | 4 +- .../peer-and-content-routing/package.json | 4 +- examples/pnet/package.json | 4 +- .../protocol-and-stream-muxing/package.json | 4 +- examples/pubsub/package.json | 4 +- examples/transports/package.json | 4 +- interop/BrowserDockerfile | 7 +-- interop/README.md | 18 +++++++- interop/package.json | 4 +- interop/tsconfig.json | 3 ++ package.json | 10 ++-- .../connection-encryption-noise/package.json | 36 +++++++-------- .../connection-encryption-noise/tsconfig.json | 18 ++------ .../connection-encryption-noise/typedoc.json | 5 ++ packages/crypto/package.json | 9 +--- packages/crypto/src/aes/ciphers-browser.ts | 1 - packages/crypto/src/ciphers/interface.ts | 1 - packages/crypto/src/hmac/lengths.ts | 1 - packages/crypto/src/keys/interface.ts | 3 +- packages/crypto/src/keys/rsa-class.ts | 1 - packages/crypto/test/fixtures/go-aes.ts | 1 - .../crypto/test/fixtures/go-elliptic-key.ts | 1 - .../crypto/test/fixtures/go-key-ed25519.ts | 1 - packages/crypto/test/fixtures/go-key-rsa.ts | 1 - .../crypto/test/fixtures/go-stretch-key.ts | 1 - packages/crypto/test/workaround.spec.ts | 1 - packages/crypto/typedoc.json | 8 ++++ .../interface-compliance-tests/package.json | 7 +-- .../interface-compliance-tests/src/index.ts | 1 - .../src/is-valid-tick.ts | 1 - .../interface-compliance-tests/typedoc.json | 14 ++++++ packages/interface-internal/package.json | 9 +--- packages/interface-internal/src/index.ts | 1 - packages/interface-internal/typedoc.json | 10 ++++ packages/interface/package.json | 5 +- packages/interface/src/errors.ts | 1 - packages/interface/src/keys/index.ts | 1 - packages/interface/src/peer-store/tags.ts | 1 - packages/interface/src/startable.ts | 1 - packages/interface/typedoc.json | 28 +++++++++++ packages/kad-dht/package.json | 5 +- packages/kad-dht/typedoc.json | 5 ++ packages/keychain/package.json | 5 +- packages/keychain/src/errors.ts | 1 - packages/keychain/typedoc.json | 5 ++ packages/libp2p-daemon-client/package.json | 2 +- packages/libp2p-daemon-client/typedoc.json | 5 ++ packages/libp2p-daemon-protocol/package.json | 4 +- packages/libp2p-daemon-protocol/tsconfig.json | 3 ++ packages/libp2p-daemon-protocol/typedoc.json | 7 +++ packages/libp2p-daemon-server/package.json | 2 +- packages/libp2p-daemon-server/typedoc.json | 5 ++ packages/libp2p-daemon/package.json | 2 +- packages/libp2p-daemon/typedoc.json | 5 ++ packages/libp2p/package.json | 5 +- packages/libp2p/src/address-manager/utils.ts | 1 - packages/libp2p/src/autonat/index.ts | 21 +++++++++ packages/libp2p/src/circuit-relay/index.ts | 36 +++++++++++++++ .../src/connection-manager/constants.ts | 1 - packages/libp2p/src/fetch/constants.ts | 1 - packages/libp2p/src/identify/consts.ts | 1 - packages/libp2p/src/ping/constants.ts | 1 - .../content-routing/content-routing.node.ts | 10 ++-- .../libp2p/test/content-routing/dht/utils.ts | 1 - .../test/fixtures/base-options.browser.ts | 1 - packages/libp2p/test/fixtures/swarm.key.ts | 1 - packages/libp2p/tsconfig.json | 3 ++ packages/libp2p/typedoc.json | 13 ++++++ packages/logger/package.json | 5 +- packages/logger/typedoc.json | 5 ++ packages/metrics-prometheus/README.md | 24 +++++++--- packages/metrics-prometheus/package.json | 5 +- packages/metrics-prometheus/typedoc.json | 5 ++ packages/multistream-select/README.md | 20 ++++---- packages/multistream-select/package.json | 5 +- packages/multistream-select/src/constants.ts | 1 - .../multistream-select/src/multistream.ts | 1 - packages/multistream-select/typedoc.json | 5 ++ packages/peer-collections/package.json | 5 +- packages/peer-collections/src/util.ts | 1 - packages/peer-collections/typedoc.json | 5 ++ .../peer-discovery-bootstrap/package.json | 5 +- .../peer-discovery-bootstrap/typedoc.json | 5 ++ packages/peer-discovery-mdns/package.json | 5 +- packages/peer-discovery-mdns/typedoc.json | 5 ++ packages/peer-id-factory/package.json | 5 +- .../test/fixtures/go-private-key.ts | 1 - .../test/fixtures/sample-id.ts | 1 - packages/peer-id-factory/typedoc.json | 5 ++ packages/peer-id/package.json | 5 +- packages/peer-id/typedoc.json | 5 ++ packages/peer-record/package.json | 5 +- packages/peer-record/src/errors.ts | 1 - packages/peer-record/src/index.ts | 1 - .../peer-record/src/peer-record/consts.ts | 1 - packages/peer-record/typedoc.json | 5 ++ packages/peer-store/package.json | 5 +- packages/peer-store/src/errors.ts | 1 - .../src/utils/peer-data-to-datastore-peer.ts | 1 - packages/peer-store/typedoc.json | 5 ++ packages/pubsub-floodsub/package.json | 5 +- packages/pubsub-floodsub/typedoc.json | 5 ++ packages/pubsub-gossipsub/package.json | 2 +- packages/pubsub-gossipsub/src/index.ts | 46 +++++++++---------- packages/pubsub-gossipsub/src/metrics.ts | 2 +- .../pubsub-gossipsub/src/score/peer-score.ts | 4 +- packages/pubsub-gossipsub/src/stream.ts | 2 +- packages/pubsub-gossipsub/src/tracer.ts | 2 +- packages/pubsub-gossipsub/src/types.ts | 2 +- .../src/utils/buildRawMessage.ts | 4 +- .../src/utils/publishConfig.ts | 2 +- .../pubsub-gossipsub/test/2-nodes.spec.ts | 2 +- .../test/allowedTopics.spec.ts | 2 +- .../test/benchmark/index.test.ts | 2 +- .../test/benchmark/protobuf.test.ts | 2 +- .../pubsub-gossipsub/test/decodeRpc.spec.ts | 4 +- .../test/e2e/go-gossipsub.spec.ts | 4 +- .../pubsub-gossipsub/test/floodsub.spec.ts | 2 +- packages/pubsub-gossipsub/test/gossip.spec.ts | 4 +- .../pubsub-gossipsub/test/heartbeat.spec.ts | 2 +- packages/pubsub-gossipsub/test/mesh.spec.ts | 2 +- .../test/signature-policy.spec.ts | 2 +- .../test/utils/create-pubsub.ts | 2 +- packages/pubsub-gossipsub/typedoc.json | 9 ++++ packages/pubsub/package.json | 9 +--- packages/pubsub/src/errors.ts | 1 - packages/pubsub/typedoc.json | 8 ++++ .../stream-multiplexer-mplex/package.json | 5 +- .../test/coder.spec.ts | 2 +- .../stream-multiplexer-mplex/typedoc.json | 5 ++ .../stream-multiplexer-yamux/package.json | 2 +- .../stream-multiplexer-yamux/typedoc.json | 7 +++ packages/transport-tcp/package.json | 5 +- packages/transport-tcp/typedoc.json | 5 ++ packages/transport-webrtc/package.json | 9 ++-- .../src/private-to-public/util.ts | 1 - packages/transport-webrtc/tsconfig.json | 3 ++ packages/transport-webrtc/typedoc.json | 5 ++ packages/transport-websockets/package.json | 5 +- packages/transport-websockets/typedoc.json | 6 +++ packages/transport-webtransport/package.json | 7 +-- packages/transport-webtransport/tsconfig.json | 3 ++ packages/transport-webtransport/typedoc.json | 6 +++ packages/utils/package.json | 5 +- packages/utils/typedoc.json | 11 +++++ 153 files changed, 495 insertions(+), 308 deletions(-) create mode 100644 packages/connection-encryption-noise/typedoc.json create mode 100644 packages/crypto/typedoc.json create mode 100644 packages/interface-compliance-tests/typedoc.json create mode 100644 packages/interface-internal/typedoc.json create mode 100644 packages/interface/typedoc.json create mode 100644 packages/kad-dht/typedoc.json create mode 100644 packages/keychain/typedoc.json create mode 100644 packages/libp2p-daemon-client/typedoc.json create mode 100644 packages/libp2p-daemon-protocol/typedoc.json create mode 100644 packages/libp2p-daemon-server/typedoc.json create mode 100644 packages/libp2p-daemon/typedoc.json create mode 100644 packages/libp2p/typedoc.json create mode 100644 packages/logger/typedoc.json create mode 100644 packages/metrics-prometheus/typedoc.json create mode 100644 packages/multistream-select/typedoc.json create mode 100644 packages/peer-collections/typedoc.json create mode 100644 packages/peer-discovery-bootstrap/typedoc.json create mode 100644 packages/peer-discovery-mdns/typedoc.json create mode 100644 packages/peer-id-factory/typedoc.json create mode 100644 packages/peer-id/typedoc.json create mode 100644 packages/peer-record/typedoc.json create mode 100644 packages/peer-store/typedoc.json create mode 100644 packages/pubsub-floodsub/typedoc.json create mode 100644 packages/pubsub-gossipsub/typedoc.json create mode 100644 packages/pubsub/typedoc.json create mode 100644 packages/stream-multiplexer-mplex/typedoc.json create mode 100644 packages/stream-multiplexer-yamux/typedoc.json create mode 100644 packages/transport-tcp/typedoc.json create mode 100644 packages/transport-webrtc/typedoc.json create mode 100644 packages/transport-websockets/typedoc.json create mode 100644 packages/transport-webtransport/typedoc.json create mode 100644 packages/utils/typedoc.json diff --git a/doc/METRICS.md b/doc/METRICS.md index 0fe2c8e01b..d586fe2130 100644 --- a/doc/METRICS.md +++ b/doc/METRICS.md @@ -86,7 +86,7 @@ class MyClass { A tracked metric can be created by calling either `registerMetric` on the metrics object: ```ts -import type { Metrics } from '@libp2p/interface-metrics' +import type { Metrics } from '@libp2p/interface/metrics' import { prometheusMetrics } from '@libp2p/prometheus-metrics' const metrics: Metrics = prometheusMetrics()() @@ -119,7 +119,7 @@ stopTimer() A metric that is expensive to calculate can be created by passing a `calculate` function that will only be invoked when metrics are being scraped: ```ts -import type { Metrics } from '@libp2p/interface-metrics' +import type { Metrics } from '@libp2p/interface/metrics' import { prometheusMetrics } from '@libp2p/prometheus-metrics' const metrics: Metrics = prometheusMetrics()() @@ -134,7 +134,7 @@ metrics.registerMetric('my_metric', { If several metrics should be grouped together (e.g. for graphing purposes) `registerMetricGroup` can be used instead: ```ts -import type { Metrics } from '@libp2p/interface-metrics' +import type { Metrics } from '@libp2p/interface/metrics' import { prometheusMetrics } from '@libp2p/prometheus-metrics' const metrics: Metrics = prometheusMetrics()() diff --git a/doc/package.json b/doc/package.json index ff989310b1..faba3d9d59 100644 --- a/doc/package.json +++ b/doc/package.json @@ -25,18 +25,15 @@ } }, "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "build": "aegir build", "doc-check": "aegir doc-check" }, "dependencies": { "@chainsafe/libp2p-yamux": "^4.0.2", - "@libp2p/interface-metrics": "^4.0.8", + "@libp2p/interface": "~0.0.1", "@libp2p/mplex": "^8.0.4", "@libp2p/prometheus-metrics": "^1.1.5", "@libp2p/tcp": "^7.0.3", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "libp2p": "^0.45.9", "prom-client": "^14.2.0" }, diff --git a/examples/auto-relay/package.json b/examples/auto-relay/package.json index b7c6e9cd47..e7afa1d087 100644 --- a/examples/auto-relay/package.json +++ b/examples/auto-relay/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/websockets": "^6.0.0", @@ -37,7 +37,7 @@ "libp2p": "^0.45.0" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "p-defer": "^4.0.0", "uint8arrays": "^4.0.4" diff --git a/examples/chat/package.json b/examples/chat/package.json index 7d44677620..68106d5220 100644 --- a/examples/chat/package.json +++ b/examples/chat/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/peer-id-factory": "^2.0.0", @@ -44,7 +44,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "p-defer": "^4.0.0" }, diff --git a/examples/connection-encryption/package.json b/examples/connection-encryption/package.json index 86099b1f91..324fd4a0ef 100644 --- a/examples/connection-encryption/package.json +++ b/examples/connection-encryption/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/tcp": "^7.0.0", @@ -38,7 +38,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/delegated-routing/package.json b/examples/delegated-routing/package.json index cd3696ee76..8d1c63d59d 100644 --- a/examples/delegated-routing/package.json +++ b/examples/delegated-routing/package.json @@ -32,7 +32,7 @@ "start": "react-scripts start" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@libp2p/bootstrap": "^8.0.0", "@libp2p/delegated-content-routing": "^4.0.0", "@libp2p/delegated-peer-routing": "^4.0.0", @@ -46,7 +46,7 @@ "react-scripts": "^5.0.1" }, "devDependencies": { - "aegir": "^39.0.13" + "aegir": "^40.0.1" }, "browserslist": [ ">0.2%", diff --git a/examples/discovery-mechanisms/package.json b/examples/discovery-mechanisms/package.json index ac5c456a32..62f24dd0e3 100644 --- a/examples/discovery-mechanisms/package.json +++ b/examples/discovery-mechanisms/package.json @@ -30,7 +30,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/bootstrap": "^8.0.0", "@libp2p/floodsub": "^7.0.0", @@ -41,7 +41,7 @@ "libp2p": "^0.45.0" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "p-wait-for": "^5.0.2", "uint8arrays": "^4.0.4" diff --git a/examples/echo/package.json b/examples/echo/package.json index 0a24a64d7b..488c15b7d4 100644 --- a/examples/echo/package.json +++ b/examples/echo/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/peer-id-factory": "^2.0.0", @@ -42,7 +42,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "p-defer": "^4.0.0" }, diff --git a/examples/libp2p-in-the-browser/package.json b/examples/libp2p-in-the-browser/package.json index cdf248961d..c45b265ee0 100644 --- a/examples/libp2p-in-the-browser/package.json +++ b/examples/libp2p-in-the-browser/package.json @@ -31,7 +31,7 @@ }, "dependencies": { "@chainsafe/libp2p-gossipsub": "^9.0.0", - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/bootstrap": "^8.0.0", "@libp2p/kad-dht": "^9.0.0", @@ -42,7 +42,7 @@ "libp2p": "^0.45.0" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "playwright": "^1.35.1", "vite": "^2.8.6" diff --git a/examples/peer-and-content-routing/package.json b/examples/peer-and-content-routing/package.json index 95713c3dcf..e5a2fae00a 100644 --- a/examples/peer-and-content-routing/package.json +++ b/examples/peer-and-content-routing/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/kad-dht": "^9.0.0", "@libp2p/mplex": "^8.0.0", @@ -40,7 +40,7 @@ "multiformats": "^12.0.1" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/pnet/package.json b/examples/pnet/package.json index e7a74de131..f0d2247738 100644 --- a/examples/pnet/package.json +++ b/examples/pnet/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/tcp": "^7.0.0", @@ -38,7 +38,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/protocol-and-stream-muxing/package.json b/examples/protocol-and-stream-muxing/package.json index 4053e72e5d..ae08d63228 100644 --- a/examples/protocol-and-stream-muxing/package.json +++ b/examples/protocol-and-stream-muxing/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/tcp": "^7.0.0", @@ -38,7 +38,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/pubsub/package.json b/examples/pubsub/package.json index 2d9d7c9a2d..46c74b808f 100644 --- a/examples/pubsub/package.json +++ b/examples/pubsub/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/floodsub": "^7.0.0", "@libp2p/mplex": "^8.0.0", @@ -38,7 +38,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "execa": "^7.1.1", "p-defer": "^4.0.0" }, diff --git a/examples/transports/package.json b/examples/transports/package.json index 3fff1302d6..9ec94abe15 100644 --- a/examples/transports/package.json +++ b/examples/transports/package.json @@ -29,7 +29,7 @@ "test:example": "node test.js" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/tcp": "^7.0.0", @@ -40,7 +40,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/interop/BrowserDockerfile b/interop/BrowserDockerfile index b235693b02..bc8702348a 100644 --- a/interop/BrowserDockerfile +++ b/interop/BrowserDockerfile @@ -4,10 +4,11 @@ FROM mcr.microsoft.com/playwright COPY --from=node-js-libp2p-head /app/ /app/ WORKDIR /app/interop -RUN npx playwright install -ARG BROWSER=chromium # Options: chromium, firefox, webkit +# Options: chromium, firefox, webkit +ARG BROWSER=chromium ENV BROWSER=$BROWSER # disable colored output and CLI animation from test runners ENV CI true -ENTRYPOINT npm run test:interop:multidim -- --build false --types false -t browser -- --browser $BROWSER +# manually specify runner until https://github.com/hugomrdias/playwright-test/issues/572 is resolved +ENTRYPOINT npm run test:interop:multidim -- --build false --types false -t browser -- --browser $BROWSER --runner mocha diff --git a/interop/README.md b/interop/README.md index bf2bf9a1a7..2b6b88967e 100644 --- a/interop/README.md +++ b/interop/README.md @@ -16,6 +16,8 @@ - [Build another libp2p implementation](#build-another-libp2p-implementation) - [Running Redis](#running-redis) - [Start libp2p](#start-libp2p) + - [node.js](#nodejs-1) + - [Browsers](#browsers-1) - [Start another libp2p implementation](#start-another-libp2p-implementation) - [License](#license) - [Contribution](#contribution) @@ -67,7 +69,7 @@ $ docker build . -f ./interop/BrowserDockerfile -t js-libp2p-browsers - When starting the docker container add `-e GOLOG_LOG_LEVEL=debug` 4. Build the version you want to test against ```console - $ cd impl/$IMPL/$VERSION + $ cd multidim-interop/impl/$IMPL/$VERSION $ make ... ``` @@ -82,14 +84,26 @@ $ docker run --name redis --rm -p 6379:6379 redis:7-alpine ### Start libp2p +#### node.js + ```console $ docker run -e transport=tcp -e muxer=yamux -e security=noise -e is_dialer=true -e redis_addr=redis:6379 --link redis:redis js-libp2p-node ``` +#### Browsers + +```console +$ docker run -e transport=webtransport -e muxer=yamux -e security=noise -e is_dialer=true -e redis_addr=redis:6379 --link redis:redis js-libp2p-browsers +``` + ### Start another libp2p implementation +- Change `go-v0.29` to the implementation you wish to use. +- Ensure one docker run has `is_dialer=false` and the other has `is_dialer=true` +- Ensure the `transport` option is the same for both implementations + ```console -$ docker run -e transport=tcp -e muxer=yamux -e security=noise -e is_dialer=false -e redis_addr=redis:6379 --link redis:redis nim-v1.0 +$ docker run -e transport=tcp -e muxer=yamux -e security=noise -e is_dialer=false -e redis_addr=redis:6379 --link redis:redis go-v0.29 ``` ## License diff --git a/interop/package.json b/interop/package.json index 3942d0e123..3ba0f0d05d 100644 --- a/interop/package.json +++ b/interop/package.json @@ -39,7 +39,7 @@ "test:interop:multidim": "aegir test" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@chainsafe/libp2p-yamux": "^4.0.0", "@libp2p/mplex": "^8.0.0", "@libp2p/tcp": "^7.0.0", @@ -52,7 +52,7 @@ "redis": "4.5.1" }, "devDependencies": { - "aegir": "^39.0.13" + "aegir": "^40.0.1" }, "browser": { "@libp2p/tcp": false diff --git a/interop/tsconfig.json b/interop/tsconfig.json index 75a461899a..cbf9215e81 100644 --- a/interop/tsconfig.json +++ b/interop/tsconfig.json @@ -8,6 +8,9 @@ "test" ], "references": [ + { + "path": "../packages/connection-encryption-noise" + }, { "path": "../packages/libp2p" }, diff --git a/package.json b/package.json index 3a89290cb1..e1bedeee69 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ "release": "run-s build npm:release", "npm:release": "aegir exec --bail false npm -- publish", "release:rc": "aegir release-rc", - "docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs" + "docs": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs -- --exclude interop --exclude examples --exclude doc" }, "devDependencies": { - "aegir": "^39.0.13" + "aegir": "^40.0.1" }, "eslintConfig": { "extends": "ipfs", @@ -45,9 +45,9 @@ ] }, "workspaces": [ - "packages/*", - "interop", + "doc", "examples/*", - "doc/*" + "interop", + "packages/*" ] } diff --git a/packages/connection-encryption-noise/package.json b/packages/connection-encryption-noise/package.json index 4e897e3464..7cda8e6f13 100644 --- a/packages/connection-encryption-noise/package.json +++ b/packages/connection-encryption-noise/package.json @@ -3,23 +3,19 @@ "version": "12.0.1", "author": "ChainSafe ", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-noise#readme", + "homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/connection-encryption-noise#readme", "repository": { "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-noise.git" + "url": "git+https://github.com/libp2p/js-libp2p.git" }, "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-noise/issues" + "url": "https://github.com/libp2p/js-libp2p/issues" }, "keywords": [ "crypto", "libp2p", "noise" ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "type": "module", "types": "./dist/src/index.d.ts", "files": [ @@ -66,35 +62,39 @@ "prepublish": "npm run build" }, "dependencies": { - "@libp2p/crypto": "^1.0.11", + "@libp2p/crypto": "^1.0.0", "@libp2p/interface": "~0.0.1", - "@libp2p/logger": "^2.1.1", + "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^2.0.0", - "@stablelib/chacha20poly1305": "^1.0.1", "@noble/hashes": "^1.3.0", + "@stablelib/chacha20poly1305": "^1.0.1", "@stablelib/x25519": "^1.0.3", + "it-byte-stream": "^1.0.0", "it-length-prefixed": "^9.0.1", "it-length-prefixed-stream": "^1.0.0", - "it-byte-stream": "^1.0.0", - "it-pair": "^2.0.2", + "it-pair": "^2.0.6", "it-pipe": "^3.0.1", "it-stream-types": "^2.0.1", "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.3.2", - "uint8arrays": "^4.0.2" + "uint8arraylist": "^2.4.3", + "uint8arrays": "^4.0.4" }, "devDependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/peer-id-factory": "^2.0.0", - "@types/sinon": "^10.0.14", - "aegir": "^39.0.5", + "@types/sinon": "^10.0.15", + "aegir": "^40.0.1", "iso-random-stream": "^2.0.2", - "protons": "^7.0.0", - "sinon": "^15.0.0" + "protons": "^7.0.2", + "sinon": "^15.1.2" }, "browser": { "./dist/src/alloc-unsafe.js": "./dist/src/alloc-unsafe-browser.js", "util": false }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + }, "private": true } diff --git a/packages/connection-encryption-noise/tsconfig.json b/packages/connection-encryption-noise/tsconfig.json index 15b6697fa5..71d88cad96 100644 --- a/packages/connection-encryption-noise/tsconfig.json +++ b/packages/connection-encryption-noise/tsconfig.json @@ -15,28 +15,16 @@ "path": "../interface" }, { - "path": "../logger" - }, - { - "path": "../peer-id" - }, - { - "path": "../stream-multiplexer-yamux" - }, - { - "path": "../libp2p-daemon-client" + "path": "../interface-compliance-tests" }, { - "path": "../libp2p-daemon-server" + "path": "../logger" }, { - "path": "../interface-compliance-tests" + "path": "../peer-id" }, { "path": "../peer-id-factory" - }, - { - "path": "../transport-tcp" } ] } diff --git a/packages/connection-encryption-noise/typedoc.json b/packages/connection-encryption-noise/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/connection-encryption-noise/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 1198c38db3..92d5cd8db5 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -51,10 +51,6 @@ "types": "./dist/src/aes/index.d.ts", "import": "./dist/src/aes/index.js" }, - "./ciphers": { - "types": "./dist/src/ciphers/index.d.ts", - "import": "./dist/src/ciphers/index.js" - }, "./hmac": { "types": "./dist/src/hmac/index.d.ts", "import": "./dist/src/hmac/index.js" @@ -100,7 +96,7 @@ }, "devDependencies": { "@types/mocha": "^10.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "benchmark": "^2.1.4", "protons": "^7.0.2" }, @@ -111,8 +107,5 @@ "./dist/src/keys/ecdh.js": "./dist/src/keys/ecdh-browser.js", "./dist/src/keys/ed25519.js": "./dist/src/keys/ed25519-browser.js", "./dist/src/keys/rsa.js": "./dist/src/keys/rsa-browser.js" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/crypto/src/aes/ciphers-browser.ts b/packages/crypto/src/aes/ciphers-browser.ts index 88d18d7d95..f78388f721 100644 --- a/packages/crypto/src/aes/ciphers-browser.ts +++ b/packages/crypto/src/aes/ciphers-browser.ts @@ -1,4 +1,3 @@ - import 'node-forge/lib/aes.js' // @ts-expect-error types are missing import forge from 'node-forge/lib/forge.js' diff --git a/packages/crypto/src/ciphers/interface.ts b/packages/crypto/src/ciphers/interface.ts index 08ce7b6b86..f4258e11db 100644 --- a/packages/crypto/src/ciphers/interface.ts +++ b/packages/crypto/src/ciphers/interface.ts @@ -1,4 +1,3 @@ - export interface CreateOptions { algorithm?: string nonceLength?: number diff --git a/packages/crypto/src/hmac/lengths.ts b/packages/crypto/src/hmac/lengths.ts index 396bafc780..925cc690fb 100644 --- a/packages/crypto/src/hmac/lengths.ts +++ b/packages/crypto/src/hmac/lengths.ts @@ -1,4 +1,3 @@ - export default { SHA1: 20, SHA256: 32, diff --git a/packages/crypto/src/keys/interface.ts b/packages/crypto/src/keys/interface.ts index 30bceb1dd2..4630df6a49 100644 --- a/packages/crypto/src/keys/interface.ts +++ b/packages/crypto/src/keys/interface.ts @@ -1,4 +1,3 @@ - export interface JWKKeyPair { privateKey: JsonWebKey publicKey: JsonWebKey @@ -21,7 +20,7 @@ export interface ECDHKey { export interface JWKEncodedPublicKey { kty: string, crv: 'P-256' | 'P-384' | 'P-521', x: string, y: string, ext: boolean } -export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { d: string} +export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { d: string } export interface EnhancedKey { iv: Uint8Array diff --git a/packages/crypto/src/keys/rsa-class.ts b/packages/crypto/src/keys/rsa-class.ts index 7e9d7d8812..83582db8a4 100644 --- a/packages/crypto/src/keys/rsa-class.ts +++ b/packages/crypto/src/keys/rsa-class.ts @@ -1,4 +1,3 @@ - import { CodeError } from '@libp2p/interface/errors' import { sha256 } from 'multiformats/hashes/sha2' // @ts-expect-error types are missing diff --git a/packages/crypto/test/fixtures/go-aes.ts b/packages/crypto/test/fixtures/go-aes.ts index ca653e97c1..4663a67c5a 100644 --- a/packages/crypto/test/fixtures/go-aes.ts +++ b/packages/crypto/test/fixtures/go-aes.ts @@ -1,4 +1,3 @@ - export default { 16: { inputs: [ diff --git a/packages/crypto/test/fixtures/go-elliptic-key.ts b/packages/crypto/test/fixtures/go-elliptic-key.ts index d5435775b8..fe5b9f0c48 100644 --- a/packages/crypto/test/fixtures/go-elliptic-key.ts +++ b/packages/crypto/test/fixtures/go-elliptic-key.ts @@ -1,4 +1,3 @@ - export default { curve: 'P-256', bob: { diff --git a/packages/crypto/test/fixtures/go-key-ed25519.ts b/packages/crypto/test/fixtures/go-key-ed25519.ts index e758d788e1..cbde9c58e4 100644 --- a/packages/crypto/test/fixtures/go-key-ed25519.ts +++ b/packages/crypto/test/fixtures/go-key-ed25519.ts @@ -1,4 +1,3 @@ - export default { // Generation code from https://github.com/libp2p/js-libp2p-crypto/issues/175#issuecomment-634467463 // diff --git a/packages/crypto/test/fixtures/go-key-rsa.ts b/packages/crypto/test/fixtures/go-key-rsa.ts index bfdfd1b3ca..fcaf1d5d92 100644 --- a/packages/crypto/test/fixtures/go-key-rsa.ts +++ b/packages/crypto/test/fixtures/go-key-rsa.ts @@ -1,4 +1,3 @@ - export default { private: { hash: Uint8Array.from([ diff --git a/packages/crypto/test/fixtures/go-stretch-key.ts b/packages/crypto/test/fixtures/go-stretch-key.ts index 4fd4e9c4c0..d2c86cf147 100644 --- a/packages/crypto/test/fixtures/go-stretch-key.ts +++ b/packages/crypto/test/fixtures/go-stretch-key.ts @@ -1,4 +1,3 @@ - export default [{ cipher: 'AES-256' as 'AES-256', hash: 'SHA256' as 'SHA256', diff --git a/packages/crypto/test/workaround.spec.ts b/packages/crypto/test/workaround.spec.ts index 6b96c30b9d..dc455f1ee2 100644 --- a/packages/crypto/test/workaround.spec.ts +++ b/packages/crypto/test/workaround.spec.ts @@ -1,4 +1,3 @@ - /* eslint-env mocha */ import { expect } from 'aegir/chai' import { derivedEmptyPasswordKey } from '../src/ciphers/aes-gcm.browser.js' diff --git a/packages/crypto/typedoc.json b/packages/crypto/typedoc.json new file mode 100644 index 0000000000..635ec8740b --- /dev/null +++ b/packages/crypto/typedoc.json @@ -0,0 +1,8 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/aes/index.ts", + "./src/hmac/index.ts", + "./src/keys/index.ts" + ] +} diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index 2a8e388300..0e69737816 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -118,8 +118,8 @@ "it-map": "^3.0.3", "it-ndjson": "^1.0.3", "it-pair": "^2.0.6", - "it-protobuf-stream": "^1.0.0", "it-pipe": "^3.0.1", + "it-protobuf-stream": "^1.0.0", "it-pushable": "^3.2.0", "it-stream-types": "^2.0.1", "it-to-buffer": "^4.0.2", @@ -135,10 +135,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "protons": "^7.0.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/interface-compliance-tests/src/index.ts b/packages/interface-compliance-tests/src/index.ts index 7aea8b17d5..e9f9db76b3 100644 --- a/packages/interface-compliance-tests/src/index.ts +++ b/packages/interface-compliance-tests/src/index.ts @@ -1,4 +1,3 @@ - export interface TestSetup> { setup: (args?: SetupArgs) => Promise teardown: () => Promise diff --git a/packages/interface-compliance-tests/src/is-valid-tick.ts b/packages/interface-compliance-tests/src/is-valid-tick.ts index 8e6a1c8bcc..307740c060 100644 --- a/packages/interface-compliance-tests/src/is-valid-tick.ts +++ b/packages/interface-compliance-tests/src/is-valid-tick.ts @@ -1,4 +1,3 @@ - /** * A tick is considered valid if it happened between now * and `ms` milliseconds ago diff --git a/packages/interface-compliance-tests/typedoc.json b/packages/interface-compliance-tests/typedoc.json new file mode 100644 index 0000000000..e95a1e2638 --- /dev/null +++ b/packages/interface-compliance-tests/typedoc.json @@ -0,0 +1,14 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/connection/index.ts", + "./src/connection-encryption/index.ts", + "./src/is-valid-tick.ts", + "./src/mocks/index.ts", + "./src/peer-discovery/index.ts", + "./src/peers.ts", + "./src/pubsub/index.ts", + "./src/stream-muxer/index.ts", + "./src/transport/index.ts" + ] +} diff --git a/packages/interface-internal/package.json b/packages/interface-internal/package.json index 5ff257b26a..5e0e634ba1 100644 --- a/packages/interface-internal/package.json +++ b/packages/interface-internal/package.json @@ -60,10 +60,6 @@ "types": "./dist/src/registrar/index.d.ts", "import": "./dist/src/registrar/index.js" }, - "./transport": { - "types": "./dist/src/transport/index.d.ts", - "import": "./dist/src/transport/index.js" - }, "./transport-manager": { "types": "./dist/src/transport-manager/index.d.ts", "import": "./dist/src/transport-manager/index.js" @@ -88,9 +84,6 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^39.0.13" - }, - "typedoc": { - "entryPoint": "./src/index.ts" + "aegir": "^40.0.1" } } diff --git a/packages/interface-internal/src/index.ts b/packages/interface-internal/src/index.ts index 59ad568a72..336ce12bb9 100644 --- a/packages/interface-internal/src/index.ts +++ b/packages/interface-internal/src/index.ts @@ -1,2 +1 @@ - export {} diff --git a/packages/interface-internal/typedoc.json b/packages/interface-internal/typedoc.json new file mode 100644 index 0000000000..93835c957e --- /dev/null +++ b/packages/interface-internal/typedoc.json @@ -0,0 +1,10 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/address-manager/index.ts", + "./src/connection-manager/index.ts", + "./src/record/index.ts", + "./src/registrar/index.ts", + "./src/transport-manager/index.ts" + ] +} diff --git a/packages/interface/package.json b/packages/interface/package.json index 48976e7f8d..dce3225aa8 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -167,11 +167,8 @@ }, "devDependencies": { "@types/sinon": "^10.0.15", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "sinon": "^15.1.2", "sinon-ts": "^1.0.0" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/interface/src/errors.ts b/packages/interface/src/errors.ts index 2913d2a488..a5911adb76 100644 --- a/packages/interface/src/errors.ts +++ b/packages/interface/src/errors.ts @@ -1,4 +1,3 @@ - /** * When this error is thrown it means an operation was aborted, * usually in response to the `abort` event being emitted by an diff --git a/packages/interface/src/keys/index.ts b/packages/interface/src/keys/index.ts index a201e0487b..62fac882c3 100644 --- a/packages/interface/src/keys/index.ts +++ b/packages/interface/src/keys/index.ts @@ -1,4 +1,3 @@ - export interface PublicKey { readonly bytes: Uint8Array verify: (data: Uint8Array, sig: Uint8Array) => Promise diff --git a/packages/interface/src/peer-store/tags.ts b/packages/interface/src/peer-store/tags.ts index 121f6a0e96..771e33935d 100644 --- a/packages/interface/src/peer-store/tags.ts +++ b/packages/interface/src/peer-store/tags.ts @@ -1,2 +1 @@ - export const KEEP_ALIVE = 'keep-alive' diff --git a/packages/interface/src/startable.ts b/packages/interface/src/startable.ts index 5d9be74c9c..fed543ee59 100644 --- a/packages/interface/src/startable.ts +++ b/packages/interface/src/startable.ts @@ -1,4 +1,3 @@ - /** * Implemented by components that have a lifecycle */ diff --git a/packages/interface/typedoc.json b/packages/interface/typedoc.json new file mode 100644 index 0000000000..be7e86d431 --- /dev/null +++ b/packages/interface/typedoc.json @@ -0,0 +1,28 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/connection/index.ts", + "./src/connection-encrypter/index.ts", + "./src/connection-gater/index.ts", + "./src/content-routing/index.ts", + "./src/errors.ts", + "./src/events.ts", + "./src/keychain/index.ts", + "./src/keys/index.ts", + "./src/metrics/index.ts", + "./src/metrics/tracked-map.ts", + "./src/peer-discovery/index.ts", + "./src/peer-id/index.ts", + "./src/peer-info/index.ts", + "./src/peer-routing/index.ts", + "./src/peer-store/index.ts", + "./src/peer-store/tags.ts", + "./src/pubsub/index.ts", + "./src/record/index.ts", + "./src/startable.ts", + "./src/stream-handler/index.ts", + "./src/stream-muxer/index.ts", + "./src/stream-muxer/stream.ts", + "./src/transport/index.ts" + ] +} diff --git a/packages/kad-dht/package.json b/packages/kad-dht/package.json index dba373ded9..81e4ea5c02 100644 --- a/packages/kad-dht/package.json +++ b/packages/kad-dht/package.json @@ -95,7 +95,7 @@ "@types/lodash.range": "^3.2.6", "@types/varint": "^6.0.0", "@types/which": "^3.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "datastore-level": "^10.0.0", "delay": "^6.0.0", "execa": "^7.1.1", @@ -112,8 +112,5 @@ }, "browser": { "./dist/src/routing-table/generated-prefix-list.js": "./dist/src/routing-table/generated-prefix-list-browser.js" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/kad-dht/typedoc.json b/packages/kad-dht/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/kad-dht/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/keychain/package.json b/packages/keychain/package.json index 41909b565a..7fcfa12b14 100644 --- a/packages/keychain/package.json +++ b/packages/keychain/package.json @@ -64,11 +64,8 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^2.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "datastore-core": "^9.1.1", "multiformats": "^12.0.1" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/keychain/src/errors.ts b/packages/keychain/src/errors.ts index 791d87fd3b..c3b11133a3 100644 --- a/packages/keychain/src/errors.ts +++ b/packages/keychain/src/errors.ts @@ -1,4 +1,3 @@ - export enum codes { ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS', ERR_INVALID_KEY_NAME = 'ERR_INVALID_KEY_NAME', diff --git a/packages/keychain/typedoc.json b/packages/keychain/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/keychain/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/libp2p-daemon-client/package.json b/packages/libp2p-daemon-client/package.json index 5e5869b5cb..c5cc3d0926 100644 --- a/packages/libp2p-daemon-client/package.json +++ b/packages/libp2p-daemon-client/package.json @@ -59,7 +59,7 @@ "devDependencies": { "@libp2p/daemon-server": "^5.0.0", "@libp2p/interface-compliance-tests": "^3.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "it-all": "^3.0.1", "it-pipe": "^3.0.1", "sinon": "^15.1.2", diff --git a/packages/libp2p-daemon-client/typedoc.json b/packages/libp2p-daemon-client/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/libp2p-daemon-client/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/libp2p-daemon-protocol/package.json b/packages/libp2p-daemon-protocol/package.json index 8c8a902299..884e4db98e 100644 --- a/packages/libp2p-daemon-protocol/package.json +++ b/packages/libp2p-daemon-protocol/package.json @@ -67,14 +67,14 @@ "build": "aegir build" }, "dependencies": { - "@libp2p/logger": "^2.1.1", "@libp2p/interface": "~0.0.1", + "@libp2p/logger": "^2.0.0", "it-handshake": "^4.1.3", "protons-runtime": "^5.0.0", "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "protons": "^7.0.2" }, "private": true diff --git a/packages/libp2p-daemon-protocol/tsconfig.json b/packages/libp2p-daemon-protocol/tsconfig.json index 82deba0c5b..1a5e68bbdb 100644 --- a/packages/libp2p-daemon-protocol/tsconfig.json +++ b/packages/libp2p-daemon-protocol/tsconfig.json @@ -12,6 +12,9 @@ "references": [ { "path": "../interface" + }, + { + "path": "../logger" } ] } diff --git a/packages/libp2p-daemon-protocol/typedoc.json b/packages/libp2p-daemon-protocol/typedoc.json new file mode 100644 index 0000000000..15cd5d50df --- /dev/null +++ b/packages/libp2p-daemon-protocol/typedoc.json @@ -0,0 +1,7 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/stream-handler.ts", + "./src/upgrader.ts" + ] +} diff --git a/packages/libp2p-daemon-server/package.json b/packages/libp2p-daemon-server/package.json index 059eae1305..2a85a223d7 100644 --- a/packages/libp2p-daemon-server/package.json +++ b/packages/libp2p-daemon-server/package.json @@ -64,7 +64,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "sinon-ts": "^1.0.0" }, "private": true diff --git a/packages/libp2p-daemon-server/typedoc.json b/packages/libp2p-daemon-server/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/libp2p-daemon-server/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/libp2p-daemon/package.json b/packages/libp2p-daemon/package.json index d1d62affbc..d572cc51b0 100644 --- a/packages/libp2p-daemon/package.json +++ b/packages/libp2p-daemon/package.json @@ -53,7 +53,7 @@ "yargs-promise": "^1.1.0" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "sinon": "^15.1.2" }, "private": true diff --git a/packages/libp2p-daemon/typedoc.json b/packages/libp2p-daemon/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/libp2p-daemon/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/libp2p/package.json b/packages/libp2p/package.json index 587f5a5421..d8f0ac63dc 100644 --- a/packages/libp2p/package.json +++ b/packages/libp2p/package.json @@ -176,7 +176,7 @@ "@libp2p/websockets": "^6.0.0", "@types/varint": "^6.0.0", "@types/xsalsa20": "^1.1.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "delay": "^6.0.0", "execa": "^7.1.1", "go-libp2p": "^1.1.1", @@ -193,8 +193,5 @@ "browser": { "./dist/src/config/connection-gater.js": "./dist/src/config/connection-gater.browser.js", "nat-api": false - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/libp2p/src/address-manager/utils.ts b/packages/libp2p/src/address-manager/utils.ts index 54c691a6fb..7062446a86 100644 --- a/packages/libp2p/src/address-manager/utils.ts +++ b/packages/libp2p/src/address-manager/utils.ts @@ -1,4 +1,3 @@ - export function debounce (func: () => void, wait: number): () => void { let timeout: ReturnType | undefined diff --git a/packages/libp2p/src/autonat/index.ts b/packages/libp2p/src/autonat/index.ts index 8d5787156d..63b4d6f849 100644 --- a/packages/libp2p/src/autonat/index.ts +++ b/packages/libp2p/src/autonat/index.ts @@ -1,3 +1,24 @@ +/** + * @packageDocumentation + * + * Use the `autoNATService` function to add support for the [AutoNAT protocol](https://docs.libp2p.io/concepts/nat/autonat/) + * to libp2p. + * + * @example + * + * ```typescript + * import { createLibp2p } from 'libp2p' + * import { autoNATService } from 'libp2p/autonat' + * + * const node = await createLibp2p({ + * // ...other options + * services: { + * autoNAT: autoNATService() + * } + * }) + * ``` + */ + import { setMaxListeners } from 'events' import { logger } from '@libp2p/logger' import { peerIdFromBytes } from '@libp2p/peer-id' diff --git a/packages/libp2p/src/circuit-relay/index.ts b/packages/libp2p/src/circuit-relay/index.ts index 3f39701534..91ab9007e4 100644 --- a/packages/libp2p/src/circuit-relay/index.ts +++ b/packages/libp2p/src/circuit-relay/index.ts @@ -1,3 +1,39 @@ +/** + * @packageDocumentation + * + * The `circuitRelayTransport` allows libp2p to dial and listen on [Circuit Relay](https://docs.libp2p.io/concepts/nat/circuit-relay/) + * addresses. + * + * @example + * + * ```typescript + * import { createLibp2p } from 'libp2p' + * import { circuitRelayTransport } from 'libp2p/circuit-relay' + * + * const node = await createLibp2p({ + * transports: [ + * circuitRelayTransport() + * ] + * }) + * ``` + * + * The `circuitRelayServer` function allows libp2p to function as a [Circuit Relay](https://docs.libp2p.io/concepts/nat/circuit-relay/) + * server. This will not work in browsers. + * + * @example + * + * ```typescript + * import { createLibp2p } from 'libp2p' + * import { circuitRelayServer } from 'libp2p/circuit-relay' + * + * const node = await createLibp2p({ + * services: [ + * circuitRelay: circuitRelayServer() + * ] + * }) + * ``` + */ + import type { Limit } from './pb/index.js' import type { EventEmitter } from '@libp2p/interface/events' import type { PeerMap } from '@libp2p/peer-collections' diff --git a/packages/libp2p/src/connection-manager/constants.ts b/packages/libp2p/src/connection-manager/constants.ts index cc5b78251f..6d0ffb8c9d 100644 --- a/packages/libp2p/src/connection-manager/constants.ts +++ b/packages/libp2p/src/connection-manager/constants.ts @@ -1,4 +1,3 @@ - /** * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout */ diff --git a/packages/libp2p/src/fetch/constants.ts b/packages/libp2p/src/fetch/constants.ts index 1c2551bb05..cbab081bcd 100644 --- a/packages/libp2p/src/fetch/constants.ts +++ b/packages/libp2p/src/fetch/constants.ts @@ -1,4 +1,3 @@ - // https://github.com/libp2p/specs/tree/master/fetch#wire-protocol export const PROTOCOL_VERSION = '0.0.1' export const PROTOCOL_NAME = 'fetch' diff --git a/packages/libp2p/src/identify/consts.ts b/packages/libp2p/src/identify/consts.ts index adb38720af..e65f222951 100644 --- a/packages/libp2p/src/identify/consts.ts +++ b/packages/libp2p/src/identify/consts.ts @@ -1,4 +1,3 @@ - import { version } from '../version.js' export const PROTOCOL_VERSION = 'ipfs/0.1.0' // deprecated diff --git a/packages/libp2p/src/ping/constants.ts b/packages/libp2p/src/ping/constants.ts index deff92c9ce..a7561558e1 100644 --- a/packages/libp2p/src/ping/constants.ts +++ b/packages/libp2p/src/ping/constants.ts @@ -1,4 +1,3 @@ - export const PROTOCOL = '/ipfs/ping/1.0.0' export const PING_LENGTH = 32 export const PROTOCOL_VERSION = '1.0.0' diff --git a/packages/libp2p/test/content-routing/content-routing.node.ts b/packages/libp2p/test/content-routing/content-routing.node.ts index bf6a754b63..66967667ea 100644 --- a/packages/libp2p/test/content-routing/content-routing.node.ts +++ b/packages/libp2p/test/content-routing/content-routing.node.ts @@ -1,5 +1,6 @@ /* eslint-env mocha */ +import { EventTypes, type KadDHT } from '@libp2p/kad-dht' import { peerIdFromString } from '@libp2p/peer-id' import { multiaddr } from '@multiformats/multiaddr' import { expect } from 'aegir/chai' @@ -15,7 +16,6 @@ import { createNode, createPeerId, populateAddressBooks } from '../fixtures/crea import { createRoutingOptions } from './utils.js' import type { ContentRouting } from '@libp2p/interface/content-routing' import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { KadDHT } from '@libp2p/kad-dht' describe('content-routing', () => { describe('no routers', () => { @@ -100,7 +100,7 @@ describe('content-routing', () => { sinon.stub(nodes[0].services.dht, 'findProviders').callsFake(async function * () { yield { from: nodes[0].peerId, - type: 0, + type: EventTypes.PROVIDER, name: 'PROVIDER', providers: [{ id: nodes[0].peerId, @@ -322,7 +322,7 @@ describe('content-routing', () => { sinon.stub(node.services.dht, 'findProviders').callsFake(async function * () { yield { from: providerPeerId, - type: 0, + type: EventTypes.PROVIDER, name: 'PROVIDER', providers: [ result @@ -362,7 +362,7 @@ describe('content-routing', () => { sinon.stub(node.services.dht, 'findProviders').callsFake(async function * () { yield { from: providerPeerId, - type: 0, + type: EventTypes.PROVIDER, name: 'PROVIDER', providers: [ result1 @@ -423,7 +423,7 @@ describe('content-routing', () => { sinon.stub(node.services.dht, 'findProviders').callsFake(async function * () { yield { from: providerPeerId, - type: 0, + type: EventTypes.PROVIDER, name: 'PROVIDER', providers: [ results[0] diff --git a/packages/libp2p/test/content-routing/dht/utils.ts b/packages/libp2p/test/content-routing/dht/utils.ts index d3b85e5872..323637deba 100644 --- a/packages/libp2p/test/content-routing/dht/utils.ts +++ b/packages/libp2p/test/content-routing/dht/utils.ts @@ -1,4 +1,3 @@ - export const subsystemMulticodecs = [ '/ipfs/lan/kad/1.0.0' ] diff --git a/packages/libp2p/test/fixtures/base-options.browser.ts b/packages/libp2p/test/fixtures/base-options.browser.ts index be05e9e199..14c0914169 100644 --- a/packages/libp2p/test/fixtures/base-options.browser.ts +++ b/packages/libp2p/test/fixtures/base-options.browser.ts @@ -1,4 +1,3 @@ - import { mockConnectionGater } from '@libp2p/interface-compliance-tests/mocks' import { mplex } from '@libp2p/mplex' import { webSockets } from '@libp2p/websockets' diff --git a/packages/libp2p/test/fixtures/swarm.key.ts b/packages/libp2p/test/fixtures/swarm.key.ts index 713318010c..ee524766d1 100644 --- a/packages/libp2p/test/fixtures/swarm.key.ts +++ b/packages/libp2p/test/fixtures/swarm.key.ts @@ -1,4 +1,3 @@ - export default '/key/swarm/psk/1.0.0/\n' + '/base16/\n' + '411f0a244cbbc25ecbb2b070d00a1832516ded521eb3ee3aa13189efe2e2b9a2' diff --git a/packages/libp2p/tsconfig.json b/packages/libp2p/tsconfig.json index a56aac9e47..e3088b86ec 100644 --- a/packages/libp2p/tsconfig.json +++ b/packages/libp2p/tsconfig.json @@ -8,6 +8,9 @@ "test" ], "references": [ + { + "path": "../connection-encryption-noise" + }, { "path": "../crypto" }, diff --git a/packages/libp2p/typedoc.json b/packages/libp2p/typedoc.json new file mode 100644 index 0000000000..8ed11ea9f3 --- /dev/null +++ b/packages/libp2p/typedoc.json @@ -0,0 +1,13 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/autonat/index.ts", + "./src/circuit-relay/index.ts", + "./src/fetch/index.ts", + "./src/identify/index.ts", + "./src/insecure/index.ts", + "./src/ping/index.ts", + "./src/pnet/index.ts", + "./src/upnp-nat/index.ts" + ] +} diff --git a/packages/logger/package.json b/packages/logger/package.json index 2812be5760..f242c4c6fd 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -57,11 +57,8 @@ "devDependencies": { "@libp2p/peer-id": "^2.0.0", "@types/debug": "^4.1.7", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "sinon": "^15.1.2", "uint8arrays": "^4.0.4" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/logger/typedoc.json b/packages/logger/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/logger/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/metrics-prometheus/README.md b/packages/metrics-prometheus/README.md index cd5a86c3b4..6dadf9e4e2 100644 --- a/packages/metrics-prometheus/README.md +++ b/packages/metrics-prometheus/README.md @@ -59,27 +59,39 @@ Some useful queries are: #### Data sent/received - rate(libp2p_data_transfer_bytes_total[30s]) +``` +rate(libp2p_data_transfer_bytes_total[30s]) +``` #### CPU usage - rate(process_cpu_user_seconds_total[30s]) * 100 +``` +rate(process_cpu_user_seconds_total[30s]) * 100 +``` #### Memory usage - nodejs_memory_usage_bytes +``` +nodejs_memory_usage_bytes +``` #### DHT query time - libp2p_kad_dht_wan_query_time_seconds +``` +libp2p_kad_dht_wan_query_time_seconds +``` or - libp2p_kad_dht_lan_query_time_seconds +``` +libp2p_kad_dht_lan_query_time_seconds +``` #### TCP transport dialer errors - rate(libp2p_tcp_dialer_errors_total[30s]) +``` +rate(libp2p_tcp_dialer_errors_total[30s]) +``` ## API Docs diff --git a/packages/metrics-prometheus/package.json b/packages/metrics-prometheus/package.json index 13ea318db8..244446cd62 100644 --- a/packages/metrics-prometheus/package.json +++ b/packages/metrics-prometheus/package.json @@ -52,12 +52,9 @@ "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/peer-id-factory": "^2.0.0", "@multiformats/multiaddr": "^12.1.3", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "it-drain": "^3.0.2", "it-pipe": "^3.0.1", "p-defer": "^4.0.0" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/metrics-prometheus/typedoc.json b/packages/metrics-prometheus/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/metrics-prometheus/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/multistream-select/README.md b/packages/multistream-select/README.md index e28849ffbe..ecb617ad0b 100644 --- a/packages/multistream-select/README.md +++ b/packages/multistream-select/README.md @@ -42,15 +42,17 @@ TLDR; multistream-select is protocol multiplexing per connection/stream. [Full s The caller will send "interactive" messages, expecting for some acknowledgement from the callee, which will "select" the handler for the desired and supported protocol: - < /multistream-select/0.3.0 # i speak multistream-select/0.3.0 - > /multistream-select/0.3.0 # ok, let's speak multistream-select/0.3.0 - > /ipfs-dht/0.2.3 # i want to speak ipfs-dht/0.2.3 - < na # ipfs-dht/0.2.3 is not available - > /ipfs-dht/0.1.9 # What about ipfs-dht/0.1.9 ? - < /ipfs-dht/0.1.9 # ok let's speak ipfs-dht/0.1.9 -- in a sense acts as an ACK - > - > - > +``` +< /multistream-select/0.3.0 # i speak multistream-select/0.3.0 +> /multistream-select/0.3.0 # ok, let's speak multistream-select/0.3.0 +> /ipfs-dht/0.2.3 # i want to speak ipfs-dht/0.2.3 +< na # ipfs-dht/0.2.3 is not available +> /ipfs-dht/0.1.9 # What about ipfs-dht/0.1.9 ? +< /ipfs-dht/0.1.9 # ok let's speak ipfs-dht/0.1.9 -- in a sense acts as an ACK +> +> +> +``` ## API Docs diff --git a/packages/multistream-select/package.json b/packages/multistream-select/package.json index 07acef9b10..0aa6c16170 100644 --- a/packages/multistream-select/package.json +++ b/packages/multistream-select/package.json @@ -68,15 +68,12 @@ }, "devDependencies": { "@types/varint": "^6.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "iso-random-stream": "^2.0.2", "it-all": "^3.0.1", "it-map": "^3.0.3", "it-pair": "^2.0.6", "p-timeout": "^6.0.0", "varint": "^6.0.0" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/multistream-select/src/constants.ts b/packages/multistream-select/src/constants.ts index ce5dbb521e..6f1b48364f 100644 --- a/packages/multistream-select/src/constants.ts +++ b/packages/multistream-select/src/constants.ts @@ -1,4 +1,3 @@ - export const PROTOCOL_ID = '/multistream/1.0.0' // Conforming to go-libp2p diff --git a/packages/multistream-select/src/multistream.ts b/packages/multistream-select/src/multistream.ts index 6719fb1ebc..96c5fd1d59 100644 --- a/packages/multistream-select/src/multistream.ts +++ b/packages/multistream-select/src/multistream.ts @@ -1,4 +1,3 @@ - import { CodeError } from '@libp2p/interface/errors' import { logger } from '@libp2p/logger' import { abortableSource } from 'abortable-iterator' diff --git a/packages/multistream-select/typedoc.json b/packages/multistream-select/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/multistream-select/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-collections/package.json b/packages/peer-collections/package.json index c0565b7583..c263150a3a 100644 --- a/packages/peer-collections/package.json +++ b/packages/peer-collections/package.json @@ -53,9 +53,6 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^2.0.0", - "aegir": "^39.0.13" - }, - "typedoc": { - "entryPoint": "./src/index.ts" + "aegir": "^40.0.1" } } diff --git a/packages/peer-collections/src/util.ts b/packages/peer-collections/src/util.ts index 8a79a32c0f..e9e5a1e9f0 100644 --- a/packages/peer-collections/src/util.ts +++ b/packages/peer-collections/src/util.ts @@ -1,4 +1,3 @@ - /** * Calls the passed map function on every entry of the passed iterable iterator */ diff --git a/packages/peer-collections/typedoc.json b/packages/peer-collections/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-collections/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-discovery-bootstrap/package.json b/packages/peer-discovery-bootstrap/package.json index cefaed055c..dbdd4090f3 100644 --- a/packages/peer-discovery-bootstrap/package.json +++ b/packages/peer-discovery-bootstrap/package.json @@ -56,10 +56,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "sinon-ts": "^1.0.0" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/peer-discovery-bootstrap/typedoc.json b/packages/peer-discovery-bootstrap/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-discovery-bootstrap/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-discovery-mdns/package.json b/packages/peer-discovery-mdns/package.json index 405c75c6c3..3469e2ccdb 100644 --- a/packages/peer-discovery-mdns/package.json +++ b/packages/peer-discovery-mdns/package.json @@ -56,11 +56,8 @@ "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/interface-internal": "~0.0.1", "@libp2p/peer-id-factory": "^2.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "p-wait-for": "^5.0.2", "ts-sinon": "^2.0.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/peer-discovery-mdns/typedoc.json b/packages/peer-discovery-mdns/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-discovery-mdns/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-id-factory/package.json b/packages/peer-id-factory/package.json index b4439ebd64..d19904eaa3 100644 --- a/packages/peer-id-factory/package.json +++ b/packages/peer-id-factory/package.json @@ -61,10 +61,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "protons": "^7.0.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/peer-id-factory/test/fixtures/go-private-key.ts b/packages/peer-id-factory/test/fixtures/go-private-key.ts index 5acd665de1..4c388303cb 100644 --- a/packages/peer-id-factory/test/fixtures/go-private-key.ts +++ b/packages/peer-id-factory/test/fixtures/go-private-key.ts @@ -1,4 +1,3 @@ - export default { id: 'QmRLoXS3E73psYaUsma1VSbboTa2J8Z9kso1tpiGLk9WQ4', privKey: 'CAASpwkwggSjAgEAAoIBAQDWBEbO8kc6a5kEks09CKPQargY3p0DCmCczoCT52/RYFqxvH9dI+s+u4ZAvF9aLWOBvFomL7jHZODPxKDrbiNCmyEbViNgZYK+PNbwh0V3ZGbB27X3q8yZtLvYA8dhcNkz/2SHBarSoC4QLA5MXUuSWtVaYMY3MzMnzBF57Jc9Ase7NvHOIUI90M7aN5izP7hxPXpZ+shiN+TyjM8mFxYONG7ZSsY3IxUhtrU5MRzFX+tp1o/gb/aa51mHf7AL3N02j5ABiYbCK97Rbwr03hsBcwgMxoDPJmP3WZ+D5yyPcOIIF1Vd7+4/f7FQJnIw3xr9/jvaFbPyDCVbBOhr9oyxAgMBAAECggEALlrgx2Q8v0+c5hux7p1XdgYXd/OHyKfPw0cLHH4NfylCm6q7X34vLvhJHO5wLMUV/3y/ffPqLu4Pr5DkVfoWExAsvJIMuY1jIzdkStbR2glaJHUlVc7VUxmNcj1nSxi5QwT3TjORC2v8bi5Mroeqnbmk6p15cW1akC0oP+NZ4rG48+WFHRqsBaBusdSOVfA+IiZUqSd1ILysJ1w7aVN3EC7jLjDG43i+P/2BcEHy8TVClGOknJL341bHe3UPdEpmeu6k6aHGlDI4blUMXahCIUh0IdZuj+Vi/TxQME9+3bKIOjQb8RCNm3U3j/uz5gs9SyTjBuYIib9Scj/jDbLh0QKBgQDfLr3go3Q/AR0jb12QjGALJz1lc9ZRX2RQJkqqmYkZwOlHHyl+YJgqOZiO80fUkN0sJ29CmKecXU4gXuHir913Fdceei1ScBSsvZpWtBLhEZXKrRJYq8U0atKUFQADDMGutyB/uGCNeNwR6VcJezHPICvHxQfmWlWHA5VIOEtRPQKBgQD1fID76SkIpF/EaJMnN2alXWWnzKhUBUPGpQtbpwgSfaCBiZ4vr3NQwKBntOOB5QwHmifNZMoqaFQLzC4B/uyTNUcQMQQ6arYav7WQXqXTmW6poTsjUSuSOPx1swsHlYX09SmUwWDfd94XF9UOU0KUfA2/c85ixzNlV5ejkFA4hQKBgEvP3uQN4hD82d8Nl2TgqkdfnvV1cdnWY4buWvK0kOPUqelk5n1tZoMBaZc1gLLuOpMjGiIvJNByyXUpheWxA7POEXLi4b5dIEjFZ0YIiVk21gEw5UiFoMl7d+ihcY2Xqbslrb507SdhZLAY6V3pITRQo06K2XIgQWlJiE4uATepAoGBALZ2vEiBnYZW5vfN4tKbUyhGq3B1pggNgbr8odyV4mIcDlk6OOGov0WeZ5ut0AyUesSLyFnaOIoc0ZuTP/8rxBwG1bMrO8FP39sx83pDX25P9PkQZixyALjGsp+pXOFeOhtAvo9azO5M4j638Bydtjc3neBX62dwOLtyx7tDYN0hAoGAVLmr3w7XMVHTfEuCSzKHyRrOaN2PAuSX31QAji1PwlwVKMylVrb8rRvBOpTicA/wXPX9Q5O/yjegqhqLT/LXAm9ziFzy5b9/9SzXPukKebXXbvc0FOmcsrcxtijlPyUzf9fKM1ShiwqqsgM9eNyZ9GWUJw2GFATCWW7pl7rtnWk=' diff --git a/packages/peer-id-factory/test/fixtures/sample-id.ts b/packages/peer-id-factory/test/fixtures/sample-id.ts index 79f0645c85..23adf8a232 100644 --- a/packages/peer-id-factory/test/fixtures/sample-id.ts +++ b/packages/peer-id-factory/test/fixtures/sample-id.ts @@ -1,4 +1,3 @@ - export default { id: '122019318b6e5e0cf93a2314bf01269a2cc23cd3dcd452d742cdb9379d8646f6e4a9', privKey: 'CAASpgkwggSiAgEAAoIBAQC2SKo/HMFZeBml1AF3XijzrxrfQXdJzjePBZAbdxqKR1Mc6juRHXij6HXYPjlAk01BhF1S3Ll4Lwi0cAHhggf457sMg55UWyeGKeUv0ucgvCpBwlR5cQ020i0MgzjPWOLWq1rtvSbNcAi2ZEVn6+Q2EcHo3wUvWRtLeKz+DZSZfw2PEDC+DGPJPl7f8g7zl56YymmmzH9liZLNrzg/qidokUv5u1pdGrcpLuPNeTODk0cqKB+OUbuKj9GShYECCEjaybJDl9276oalL9ghBtSeEv20kugatTvYy590wFlJkkvyl+nPxIH0EEYMKK9XRWlu9XYnoSfboiwcv8M3SlsjAgMBAAECggEAZtju/bcKvKFPz0mkHiaJcpycy9STKphorpCT83srBVQi59CdFU6Mj+aL/xt0kCPMVigJw8P3/YCEJ9J+rS8BsoWE+xWUEsJvtXoT7vzPHaAtM3ci1HZd302Mz1+GgS8Epdx+7F5p80XAFLDUnELzOzKftvWGZmWfSeDnslwVONkL/1VAzwKy7Ce6hk4SxRE7l2NE2OklSHOzCGU1f78ZzVYKSnS5Ag9YrGjOAmTOXDbKNKN/qIorAQ1bovzGoCwx3iGIatQKFOxyVCyO1PsJYT7JO+kZbhBWRRE+L7l+ppPER9bdLFxs1t5CrKc078h+wuUr05S1P1JjXk68pk3+kQKBgQDeK8AR11373Mzib6uzpjGzgNRMzdYNuExWjxyxAzz53NAR7zrPHvXvfIqjDScLJ4NcRO2TddhXAfZoOPVH5k4PJHKLBPKuXZpWlookCAyENY7+Pd55S8r+a+MusrMagYNljb5WbVTgN8cgdpim9lbbIFlpN6SZaVjLQL3J8TWH6wKBgQDSChzItkqWX11CNstJ9zJyUE20I7LrpyBJNgG1gtvz3ZMUQCn3PxxHtQzN9n1P0mSSYs+jBKPuoSyYLt1wwe10/lpgL4rkKWU3/m1Myt0tveJ9WcqHh6tzcAbb/fXpUFT/o4SWDimWkPkuCb+8j//2yiXk0a/T2f36zKMuZvujqQKBgC6B7BAQDG2H2B/ijofp12ejJU36nL98gAZyqOfpLJ+FeMz4TlBDQ+phIMhnHXA5UkdDapQ+zA3SrFk+6yGk9Vw4Hf46B+82SvOrSbmnMa+PYqKYIvUzR4gg34rL/7AhwnbEyD5hXq4dHwMNsIDq+l2elPjwm/U9V0gdAl2+r50HAoGALtsKqMvhv8HucAMBPrLikhXP/8um8mMKFMrzfqZ+otxfHzlhI0L08Bo3jQrb0Z7ByNY6M8epOmbCKADsbWcVre/AAY0ZkuSZK/CaOXNX/AhMKmKJh8qAOPRY02LIJRBCpfS4czEdnfUhYV/TYiFNnKRj57PPYZdTzUsxa/yVTmECgYBr7slQEjb5Onn5mZnGDh+72BxLNdgwBkhO0OCdpdISqk0F0Pxby22DFOKXZEpiyI9XYP1C8wPiJsShGm2yEwBPWXnrrZNWczaVuCbXHrZkWQogBDG3HGXNdU4MAWCyiYlyinIBpPpoAJZSzpGLmWbMWh28+RJS6AQX6KHrK1o2uw==', diff --git a/packages/peer-id-factory/typedoc.json b/packages/peer-id-factory/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-id-factory/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-id/package.json b/packages/peer-id/package.json index 57ef564846..61e5d610ff 100644 --- a/packages/peer-id/package.json +++ b/packages/peer-id/package.json @@ -53,9 +53,6 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "aegir": "^39.0.13" - }, - "typedoc": { - "entryPoint": "./src/index.ts" + "aegir": "^40.0.1" } } diff --git a/packages/peer-id/typedoc.json b/packages/peer-id/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-id/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-record/package.json b/packages/peer-record/package.json index c6b4c12aaa..e94a846471 100644 --- a/packages/peer-record/package.json +++ b/packages/peer-record/package.json @@ -68,10 +68,7 @@ "devDependencies": { "@libp2p/peer-id-factory": "^2.0.0", "@types/varint": "^6.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "protons": "^7.0.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/peer-record/src/errors.ts b/packages/peer-record/src/errors.ts index 0c09e34d60..84cee84f0e 100644 --- a/packages/peer-record/src/errors.ts +++ b/packages/peer-record/src/errors.ts @@ -1,4 +1,3 @@ - export const codes = { ERR_SIGNATURE_NOT_VALID: 'ERR_SIGNATURE_NOT_VALID' } diff --git a/packages/peer-record/src/index.ts b/packages/peer-record/src/index.ts index 1cba7da4de..51238b79ac 100644 --- a/packages/peer-record/src/index.ts +++ b/packages/peer-record/src/index.ts @@ -1,4 +1,3 @@ - export { RecordEnvelope } from './envelope/index.js' export type { RecordEnvelopeInit } from './envelope/index.js' export { PeerRecord } from './peer-record/index.js' diff --git a/packages/peer-record/src/peer-record/consts.ts b/packages/peer-record/src/peer-record/consts.ts index 8f862e33b2..fefbeb057c 100644 --- a/packages/peer-record/src/peer-record/consts.ts +++ b/packages/peer-record/src/peer-record/consts.ts @@ -1,4 +1,3 @@ - // The domain string used for peer records contained in a Envelope. export const ENVELOPE_DOMAIN_PEER_RECORD = 'libp2p-peer-record' diff --git a/packages/peer-record/typedoc.json b/packages/peer-record/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-record/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/peer-store/package.json b/packages/peer-store/package.json index 37ceba1ef2..93d955f666 100644 --- a/packages/peer-store/package.json +++ b/packages/peer-store/package.json @@ -70,15 +70,12 @@ }, "devDependencies": { "@types/sinon": "^10.0.15", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "datastore-core": "^9.1.1", "delay": "^6.0.0", "p-defer": "^4.0.0", "p-event": "^6.0.0", "protons": "^7.0.2", "sinon": "^15.1.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/peer-store/src/errors.ts b/packages/peer-store/src/errors.ts index 48c52e7e2c..e4074784ca 100644 --- a/packages/peer-store/src/errors.ts +++ b/packages/peer-store/src/errors.ts @@ -1,4 +1,3 @@ - export const codes = { ERR_INVALID_PARAMETERS: 'ERR_INVALID_PARAMETERS' } diff --git a/packages/peer-store/src/utils/peer-data-to-datastore-peer.ts b/packages/peer-store/src/utils/peer-data-to-datastore-peer.ts index f97e6fecd9..fa7ad930ed 100644 --- a/packages/peer-store/src/utils/peer-data-to-datastore-peer.ts +++ b/packages/peer-store/src/utils/peer-data-to-datastore-peer.ts @@ -1,4 +1,3 @@ - import { CodeError } from '@libp2p/interface/errors' import { isMultiaddr } from '@multiformats/multiaddr' import { equals as uint8arrayEquals } from 'uint8arrays/equals' diff --git a/packages/peer-store/typedoc.json b/packages/peer-store/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/peer-store/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/pubsub-floodsub/package.json b/packages/pubsub-floodsub/package.json index e7cf9c1219..f2146d38ea 100644 --- a/packages/pubsub-floodsub/package.json +++ b/packages/pubsub-floodsub/package.json @@ -70,13 +70,10 @@ "@libp2p/peer-id-factory": "^2.0.0", "@multiformats/multiaddr": "^12.1.3", "@types/sinon": "^10.0.15", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "multiformats": "^12.0.1", "p-wait-for": "^5.0.2", "protons": "^7.0.2", "sinon": "^15.1.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/pubsub-floodsub/typedoc.json b/packages/pubsub-floodsub/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/pubsub-floodsub/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/pubsub-gossipsub/package.json b/packages/pubsub-gossipsub/package.json index 2ed693342e..f5136dfb38 100644 --- a/packages/pubsub-gossipsub/package.json +++ b/packages/pubsub-gossipsub/package.json @@ -106,7 +106,7 @@ "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/peer-id-factory": "^2.0.0", "@libp2p/peer-store": "^8.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "datastore-core": "^9.1.1", "delay": "^6.0.0", "mkdirp": "^3.0.1", diff --git a/packages/pubsub-gossipsub/src/index.ts b/packages/pubsub-gossipsub/src/index.ts index 7261abeb06..15059f7bbf 100644 --- a/packages/pubsub-gossipsub/src/index.ts +++ b/packages/pubsub-gossipsub/src/index.ts @@ -1,21 +1,21 @@ import { pipe } from 'it-pipe' import type { Connection, Stream } from '@libp2p/interface/connection' import { peerIdFromBytes, peerIdFromString } from '@libp2p/peer-id' -import { Logger, logger } from '@libp2p/logger' +import { type Logger, logger } from '@libp2p/logger' import type { PeerId } from '@libp2p/interface/peer-id' import { CustomEvent, EventEmitter } from '@libp2p/interface/events' -import { MessageCache, MessageCacheRecord } from './message-cache.js' -import { RPC, IRPC } from './message/rpc.js' +import { MessageCache, type MessageCacheRecord } from './message-cache.js' +import { RPC, type IRPC } from './message/rpc.js' import * as constants from './constants.js' import { shuffle, messageIdToString } from './utils/index.js' import { PeerScore, - PeerScoreParams, - PeerScoreThresholds, + type PeerScoreParams, + type PeerScoreThresholds, createPeerScoreParams, createPeerScoreThresholds, - PeerScoreStatsDump + type PeerScoreStatsDump } from './score/index.js' import { IWantTracer } from './tracer.js' import { SimpleTimeCache } from './utils/time-cache.js' @@ -29,29 +29,29 @@ import { getMetrics, IHaveIgnoreReason, InclusionReason, - Metrics, - MetricsRegister, + type Metrics, + type MetricsRegister, ScorePenalty, - TopicStrToLabel, - ToSendGroupCount + type TopicStrToLabel, + type ToSendGroupCount } from './metrics.js' import { - MsgIdFn, - PublishConfig, - TopicStr, - MsgIdStr, + type MsgIdFn, + type PublishConfig, + type TopicStr, + type MsgIdStr, ValidateError, - PeerIdStr, + type PeerIdStr, MessageStatus, RejectReason, - RejectReasonObj, - FastMsgIdFn, - AddrInfo, - DataTransform, + type RejectReasonObj, + type FastMsgIdFn, + type AddrInfo, + type DataTransform, rejectReasonFromAcceptance, - MsgIdToStrFn, - MessageId, - PublishOpts + type MsgIdToStrFn, + type MessageId, + type PublishOpts } from './types.js' import { buildRawMessage, validateToRawMessage } from './utils/buildRawMessage.js' import { msgIdFnStrictNoSign, msgIdFnStrictSign } from './utils/msgIdFn.js' @@ -77,7 +77,7 @@ import { removeFirstNItemsFromSet, removeItemsFromSet } from './utils/set.js' import { pushable } from 'it-pushable' import { InboundStream, OutboundStream } from './stream.js' import type { Uint8ArrayList } from 'uint8arraylist' -import { decodeRpc, DecodeRPCLimits, defaultDecodeRpcLimits } from './message/decodeRpc.js' +import { decodeRpc, type DecodeRPCLimits, defaultDecodeRpcLimits } from './message/decodeRpc.js' import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' import type { Peer, PeerStore } from '@libp2p/interface/peer-store' import type { Multiaddr } from '@multiformats/multiaddr' diff --git a/packages/pubsub-gossipsub/src/metrics.ts b/packages/pubsub-gossipsub/src/metrics.ts index 343a7b4383..0f3501b2ca 100644 --- a/packages/pubsub-gossipsub/src/metrics.ts +++ b/packages/pubsub-gossipsub/src/metrics.ts @@ -1,7 +1,7 @@ import type { TopicValidatorResult } from '@libp2p/interface/pubsub' import type { IRPC } from './message/rpc.js' import type { PeerScoreThresholds } from './score/peer-score-thresholds.js' -import { MessageStatus, PeerIdStr, RejectReason, RejectReasonObj, TopicStr, ValidateError } from './types.js' +import { MessageStatus, type PeerIdStr, RejectReason, type RejectReasonObj, type TopicStr, ValidateError } from './types.js' /** Topic label as provided in `topicStrToLabel` */ export type TopicLabel = string diff --git a/packages/pubsub-gossipsub/src/score/peer-score.ts b/packages/pubsub-gossipsub/src/score/peer-score.ts index d15b9459e3..d4ea021a5c 100644 --- a/packages/pubsub-gossipsub/src/score/peer-score.ts +++ b/packages/pubsub-gossipsub/src/score/peer-score.ts @@ -1,9 +1,9 @@ -import { PeerScoreParams, validatePeerScoreParams } from './peer-score-params.js' +import { type PeerScoreParams, validatePeerScoreParams } from './peer-score-params.js' import type { PeerStats, TopicStats } from './peer-stats.js' import { computeScore } from './compute-score.js' import { MessageDeliveries, DeliveryRecordStatus } from './message-deliveries.js' import { logger } from '@libp2p/logger' -import { MsgIdStr, PeerIdStr, RejectReason, TopicStr, IPStr } from '../types.js' +import { type MsgIdStr, type PeerIdStr, RejectReason, type TopicStr, type IPStr } from '../types.js' import type { Metrics, ScorePenalty } from '../metrics.js' import { MapDef } from '../utils/set.js' diff --git a/packages/pubsub-gossipsub/src/stream.ts b/packages/pubsub-gossipsub/src/stream.ts index eaf781b80d..d4b954a136 100644 --- a/packages/pubsub-gossipsub/src/stream.ts +++ b/packages/pubsub-gossipsub/src/stream.ts @@ -1,7 +1,7 @@ import type { Stream } from '@libp2p/interface/connection' import { abortableSource } from 'abortable-iterator' import { pipe } from 'it-pipe' -import { pushable, Pushable } from 'it-pushable' +import { pushable, type Pushable } from 'it-pushable' import { encode, decode } from 'it-length-prefixed' import type { Uint8ArrayList } from 'uint8arraylist' diff --git a/packages/pubsub-gossipsub/src/tracer.ts b/packages/pubsub-gossipsub/src/tracer.ts index 8150c305b9..9471129df4 100644 --- a/packages/pubsub-gossipsub/src/tracer.ts +++ b/packages/pubsub-gossipsub/src/tracer.ts @@ -1,4 +1,4 @@ -import { MsgIdStr, MsgIdToStrFn, PeerIdStr, RejectReason } from './types.js' +import { type MsgIdStr, type MsgIdToStrFn, type PeerIdStr, RejectReason } from './types.js' import type { Metrics } from './metrics.js' /** diff --git a/packages/pubsub-gossipsub/src/types.ts b/packages/pubsub-gossipsub/src/types.ts index 41a3cfaac3..9fb512d7cc 100644 --- a/packages/pubsub-gossipsub/src/types.ts +++ b/packages/pubsub-gossipsub/src/types.ts @@ -2,7 +2,7 @@ import type { PeerId } from '@libp2p/interface/peer-id' import type { PrivateKey } from '@libp2p/interface/keys' import type { Multiaddr } from '@multiformats/multiaddr' import type { RPC } from './message/rpc.js' -import { Message, TopicValidatorResult } from '@libp2p/interface/pubsub' +import { type Message, TopicValidatorResult } from '@libp2p/interface/pubsub' export type MsgIdStr = string export type PeerIdStr = string diff --git a/packages/pubsub-gossipsub/src/utils/buildRawMessage.ts b/packages/pubsub-gossipsub/src/utils/buildRawMessage.ts index 17019fca33..407de6581b 100644 --- a/packages/pubsub-gossipsub/src/utils/buildRawMessage.ts +++ b/packages/pubsub-gossipsub/src/utils/buildRawMessage.ts @@ -7,8 +7,8 @@ import type { PublicKey } from '@libp2p/interface/keys' import type { PeerId } from '@libp2p/interface/peer-id' import { equals as uint8ArrayEquals } from 'uint8arrays/equals' import { RPC } from '../message/rpc.js' -import { PublishConfig, PublishConfigType, TopicStr, ValidateError } from '../types.js' -import { StrictSign, StrictNoSign, Message } from '@libp2p/interface/pubsub' +import { type PublishConfig, PublishConfigType, type TopicStr, ValidateError } from '../types.js' +import { StrictSign, StrictNoSign, type Message } from '@libp2p/interface/pubsub' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' export const SignPrefix = uint8ArrayFromString('libp2p-pubsub:') diff --git a/packages/pubsub-gossipsub/src/utils/publishConfig.ts b/packages/pubsub-gossipsub/src/utils/publishConfig.ts index 38962e6da2..892c5ed0e8 100644 --- a/packages/pubsub-gossipsub/src/utils/publishConfig.ts +++ b/packages/pubsub-gossipsub/src/utils/publishConfig.ts @@ -1,7 +1,7 @@ import { unmarshalPrivateKey } from '@libp2p/crypto/keys' import { StrictSign, StrictNoSign } from '@libp2p/interface/pubsub' import type { PeerId } from '@libp2p/interface/peer-id' -import { PublishConfig, PublishConfigType } from '../types.js' +import { type PublishConfig, PublishConfigType } from '../types.js' /** * Prepare a PublishConfig object from a PeerId. diff --git a/packages/pubsub-gossipsub/test/2-nodes.spec.ts b/packages/pubsub-gossipsub/test/2-nodes.spec.ts index 0152cdb542..919fd4330c 100644 --- a/packages/pubsub-gossipsub/test/2-nodes.spec.ts +++ b/packages/pubsub-gossipsub/test/2-nodes.spec.ts @@ -10,7 +10,7 @@ import { connectAllPubSubNodes, connectPubsubNodes, createComponentsArray, - GossipSubAndComponents + type GossipSubAndComponents } from './utils/create-pubsub.js' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' diff --git a/packages/pubsub-gossipsub/test/allowedTopics.spec.ts b/packages/pubsub-gossipsub/test/allowedTopics.spec.ts index 029f82c32b..e1820c23a3 100644 --- a/packages/pubsub-gossipsub/test/allowedTopics.spec.ts +++ b/packages/pubsub-gossipsub/test/allowedTopics.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'aegir/chai' import type { GossipSub } from '../src/index.js' import { pEvent } from 'p-event' -import { connectAllPubSubNodes, createComponentsArray, GossipSubAndComponents } from './utils/create-pubsub.js' +import { connectAllPubSubNodes, createComponentsArray, type GossipSubAndComponents } from './utils/create-pubsub.js' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' diff --git a/packages/pubsub-gossipsub/test/benchmark/index.test.ts b/packages/pubsub-gossipsub/test/benchmark/index.test.ts index 8ed5b512a6..b1440e3047 100644 --- a/packages/pubsub-gossipsub/test/benchmark/index.test.ts +++ b/packages/pubsub-gossipsub/test/benchmark/index.test.ts @@ -4,7 +4,7 @@ import { connectPubsubNodes, createComponentsArray, denseConnect, - GossipSubAndComponents + type GossipSubAndComponents } from '../utils/create-pubsub.js' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { awaitEvents, checkReceivedSubscriptions, checkReceivedSubscription } from '../utils/events.js' diff --git a/packages/pubsub-gossipsub/test/benchmark/protobuf.test.ts b/packages/pubsub-gossipsub/test/benchmark/protobuf.test.ts index 4a30f37cc2..f9017d354b 100644 --- a/packages/pubsub-gossipsub/test/benchmark/protobuf.test.ts +++ b/packages/pubsub-gossipsub/test/benchmark/protobuf.test.ts @@ -1,5 +1,5 @@ import { itBench, setBenchOpts } from '@dapplion/benchmark' -import { IRPC, RPC } from '../../src/message/rpc.js' +import { type IRPC, RPC } from '../../src/message/rpc.js' describe('protobuf', function () { this.timeout(0) diff --git a/packages/pubsub-gossipsub/test/decodeRpc.spec.ts b/packages/pubsub-gossipsub/test/decodeRpc.spec.ts index 0f22163af8..745d0c4739 100644 --- a/packages/pubsub-gossipsub/test/decodeRpc.spec.ts +++ b/packages/pubsub-gossipsub/test/decodeRpc.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'aegir/chai' -import { decodeRpc, DecodeRPCLimits, defaultDecodeRpcLimits } from '../src/message/decodeRpc.js' -import { RPC, IRPC } from '../src/message/index.js' +import { decodeRpc, type DecodeRPCLimits, defaultDecodeRpcLimits } from '../src/message/decodeRpc.js' +import { RPC, type IRPC } from '../src/message/index.js' describe('decodeRpc', () => { const topicID = 'topic' diff --git a/packages/pubsub-gossipsub/test/e2e/go-gossipsub.spec.ts b/packages/pubsub-gossipsub/test/e2e/go-gossipsub.spec.ts index f31b99c864..643f554335 100644 --- a/packages/pubsub-gossipsub/test/e2e/go-gossipsub.spec.ts +++ b/packages/pubsub-gossipsub/test/e2e/go-gossipsub.spec.ts @@ -6,7 +6,7 @@ import { equals as uint8ArrayEquals } from 'uint8arrays/equals' import type { GossipSub } from '../../src/index.js' import { GossipsubD } from '../../src/constants.js' import { fastMsgIdFn } from '../utils/index.js' -import { Message, TopicValidatorResult } from '@libp2p/interface/pubsub' +import { type Message, TopicValidatorResult } from '@libp2p/interface/pubsub' import type { IRPC, RPC } from '../../src/message/rpc.js' import type { Libp2pEvents } from '@libp2p/interface' import pWaitFor from 'p-wait-for' @@ -17,7 +17,7 @@ import { createComponentsArray, createComponents, connectPubsubNodes, - GossipSubAndComponents + type GossipSubAndComponents } from '../utils/create-pubsub.js' import { FloodSub } from '@libp2p/floodsub' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' diff --git a/packages/pubsub-gossipsub/test/floodsub.spec.ts b/packages/pubsub-gossipsub/test/floodsub.spec.ts index 8d18ec3572..d9225e8567 100644 --- a/packages/pubsub-gossipsub/test/floodsub.spec.ts +++ b/packages/pubsub-gossipsub/test/floodsub.spec.ts @@ -4,7 +4,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { pEvent } from 'p-event' import type { SubscriptionChangeData, Message } from '@libp2p/interface/pubsub' import pRetry from 'p-retry' -import { connectPubsubNodes, createComponents, GossipSubAndComponents } from './utils/create-pubsub.js' +import { connectPubsubNodes, createComponents, type GossipSubAndComponents } from './utils/create-pubsub.js' import { FloodSub } from '@libp2p/floodsub' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' diff --git a/packages/pubsub-gossipsub/test/gossip.spec.ts b/packages/pubsub-gossipsub/test/gossip.spec.ts index 76ceee664a..6e80ba8c1d 100644 --- a/packages/pubsub-gossipsub/test/gossip.spec.ts +++ b/packages/pubsub-gossipsub/test/gossip.spec.ts @@ -1,10 +1,10 @@ import { expect } from 'aegir/chai' -import sinon, { SinonStubbedInstance } from 'sinon' +import sinon, { type SinonStubbedInstance } from 'sinon' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { GossipsubDhi } from '../src/constants.js' import { GossipSub } from '../src/index.js' import { pEvent } from 'p-event' -import { connectAllPubSubNodes, createComponentsArray, GossipSubAndComponents } from './utils/create-pubsub.js' +import { connectAllPubSubNodes, createComponentsArray, type GossipSubAndComponents } from './utils/create-pubsub.js' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' import { stubInterface } from 'ts-sinon' diff --git a/packages/pubsub-gossipsub/test/heartbeat.spec.ts b/packages/pubsub-gossipsub/test/heartbeat.spec.ts index f223c11887..2a044f830d 100644 --- a/packages/pubsub-gossipsub/test/heartbeat.spec.ts +++ b/packages/pubsub-gossipsub/test/heartbeat.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'aegir/chai' import { GossipsubHeartbeatInterval } from '../src/constants.js' import { pEvent } from 'p-event' -import { createComponents, GossipSubAndComponents } from './utils/create-pubsub.js' +import { createComponents, type GossipSubAndComponents } from './utils/create-pubsub.js' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' diff --git a/packages/pubsub-gossipsub/test/mesh.spec.ts b/packages/pubsub-gossipsub/test/mesh.spec.ts index ed5b9e1f62..dd6bfbe5bf 100644 --- a/packages/pubsub-gossipsub/test/mesh.spec.ts +++ b/packages/pubsub-gossipsub/test/mesh.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'aegir/chai' import delay from 'delay' import { GossipsubDhi } from '../src/constants.js' import type { GossipSub } from '../src/index.js' -import { connectAllPubSubNodes, createComponentsArray, GossipSubAndComponents } from './utils/create-pubsub.js' +import { connectAllPubSubNodes, createComponentsArray, type GossipSubAndComponents } from './utils/create-pubsub.js' import { stop } from '@libp2p/interface/startable' import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks' import { pEvent } from 'p-event' diff --git a/packages/pubsub-gossipsub/test/signature-policy.spec.ts b/packages/pubsub-gossipsub/test/signature-policy.spec.ts index 0f915b2693..df1faa023c 100644 --- a/packages/pubsub-gossipsub/test/signature-policy.spec.ts +++ b/packages/pubsub-gossipsub/test/signature-policy.spec.ts @@ -7,7 +7,7 @@ import { connectPubsubNodes, createComponents, createComponentsArray, - GossipSubAndComponents + type GossipSubAndComponents } from './utils/create-pubsub.js' describe('signature policy', () => { diff --git a/packages/pubsub-gossipsub/test/utils/create-pubsub.ts b/packages/pubsub-gossipsub/test/utils/create-pubsub.ts index c1c979a982..12bf99409e 100644 --- a/packages/pubsub-gossipsub/test/utils/create-pubsub.ts +++ b/packages/pubsub-gossipsub/test/utils/create-pubsub.ts @@ -1,7 +1,7 @@ import { createRSAPeerId } from '@libp2p/peer-id-factory' import { mockRegistrar, mockConnectionManager, mockNetwork } from '@libp2p/interface-compliance-tests/mocks' import { MemoryDatastore } from 'datastore-core' -import { GossipSub, GossipSubComponents, GossipsubOpts } from '../../src/index.js' +import { GossipSub, type GossipSubComponents, type GossipsubOpts } from '../../src/index.js' import type { PubSub } from '@libp2p/interface/pubsub' import { setMaxListeners } from 'events' import { PersistentPeerStore } from '@libp2p/peer-store' diff --git a/packages/pubsub-gossipsub/typedoc.json b/packages/pubsub-gossipsub/typedoc.json new file mode 100644 index 0000000000..1a59579750 --- /dev/null +++ b/packages/pubsub-gossipsub/typedoc.json @@ -0,0 +1,9 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/message/index.ts", + "./src/metrics.ts", + "./src/score/index.ts", + "./src/types.ts" + ] +} diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 72fc123582..d234929d82 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -52,10 +52,6 @@ "types": "./dist/src/peer-streams.d.ts", "import": "./dist/src/peer-streams.js" }, - "./signature-policy": { - "types": "./dist/src/signature-policy.d.ts", - "import": "./dist/src/signature-policy.js" - }, "./utils": { "types": "./dist/src/utils.d.ts", "import": "./dist/src/utils.js" @@ -104,7 +100,7 @@ "devDependencies": { "@libp2p/peer-id-factory": "^2.0.0", "@types/sinon": "^10.0.15", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "delay": "^6.0.0", "it-pair": "^2.0.6", "p-defer": "^4.0.0", @@ -112,8 +108,5 @@ "protons": "^7.0.2", "protons-runtime": "^5.0.0", "sinon": "^15.1.2" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/pubsub/src/errors.ts b/packages/pubsub/src/errors.ts index 9ea6ed559a..a8429a7c9a 100644 --- a/packages/pubsub/src/errors.ts +++ b/packages/pubsub/src/errors.ts @@ -1,4 +1,3 @@ - export const codes = { /** * Signature policy is invalid diff --git a/packages/pubsub/typedoc.json b/packages/pubsub/typedoc.json new file mode 100644 index 0000000000..a37049da87 --- /dev/null +++ b/packages/pubsub/typedoc.json @@ -0,0 +1,8 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/errors.ts", + "./src/peer-streams.ts", + "./src/utils.ts" + ] +} diff --git a/packages/stream-multiplexer-mplex/package.json b/packages/stream-multiplexer-mplex/package.json index 985efaf975..c24ee90fcf 100644 --- a/packages/stream-multiplexer-mplex/package.json +++ b/packages/stream-multiplexer-mplex/package.json @@ -71,7 +71,7 @@ "devDependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", "@types/varint": "^6.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "cborg": "^2.0.1", "delay": "^6.0.0", "iso-random-stream": "^2.0.2", @@ -86,8 +86,5 @@ }, "browser": { "./dist/src/alloc-unsafe.js": "./dist/src/alloc-unsafe-browser.js" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/stream-multiplexer-mplex/test/coder.spec.ts b/packages/stream-multiplexer-mplex/test/coder.spec.ts index af0b6cb225..550633c16f 100644 --- a/packages/stream-multiplexer-mplex/test/coder.spec.ts +++ b/packages/stream-multiplexer-mplex/test/coder.spec.ts @@ -77,7 +77,7 @@ describe('coder', () => { }) it('should encode zero length body msg', async () => { - const source: Message[][] = [[{ id: 17, type: 0 }]] + const source: Message[][] = [[{ id: 17, type: 0, data: new Uint8ArrayList() }]] const data = uint8ArrayConcat(await all(encode(source))) diff --git a/packages/stream-multiplexer-mplex/typedoc.json b/packages/stream-multiplexer-mplex/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/stream-multiplexer-mplex/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/stream-multiplexer-yamux/package.json b/packages/stream-multiplexer-yamux/package.json index c97dbb26f2..131b7e3f4b 100644 --- a/packages/stream-multiplexer-yamux/package.json +++ b/packages/stream-multiplexer-yamux/package.json @@ -177,7 +177,7 @@ "@dapplion/benchmark": "^0.2.4", "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/mplex": "^8.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "it-drain": "^3.0.2", "it-pair": "^2.0.6", "it-stream-types": "^2.0.1" diff --git a/packages/stream-multiplexer-yamux/typedoc.json b/packages/stream-multiplexer-yamux/typedoc.json new file mode 100644 index 0000000000..76271501d3 --- /dev/null +++ b/packages/stream-multiplexer-yamux/typedoc.json @@ -0,0 +1,7 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/config.ts", + "./src/stream.ts" + ] +} diff --git a/packages/transport-tcp/package.json b/packages/transport-tcp/package.json index 6d1049a05d..676c3f4cb7 100644 --- a/packages/transport-tcp/package.json +++ b/packages/transport-tcp/package.json @@ -60,14 +60,11 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "it-all": "^3.0.1", "it-pipe": "^3.0.1", "p-defer": "^4.0.0", "sinon": "^15.1.2", "uint8arrays": "^4.0.4" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/transport-tcp/typedoc.json b/packages/transport-tcp/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/transport-tcp/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/transport-webrtc/package.json b/packages/transport-webrtc/package.json index c0cffcc1d6..4e49845e30 100644 --- a/packages/transport-webrtc/package.json +++ b/packages/transport-webrtc/package.json @@ -44,7 +44,7 @@ "dep-check": "aegir dep-check" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@libp2p/interface": "~0.0.1", "@libp2p/interface-internal": "~0.0.1", "@libp2p/logger": "^2.0.0", @@ -54,8 +54,8 @@ "abortable-iterator": "^5.0.1", "detect-browser": "^5.3.0", "it-length-prefixed": "^9.0.1", - "it-protobuf-stream": "^1.0.0", "it-pipe": "^3.0.1", + "it-protobuf-stream": "^1.0.0", "it-pushable": "^3.2.0", "it-stream-types": "^2.0.1", "it-to-buffer": "^4.0.2", @@ -73,7 +73,7 @@ "@libp2p/peer-id-factory": "^2.0.0", "@libp2p/websockets": "^6.0.0", "@types/sinon": "^10.0.15", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "delay": "^6.0.0", "it-length": "^3.0.2", "it-map": "^3.0.3", @@ -82,8 +82,5 @@ "protons": "^7.0.2", "sinon": "^15.1.2", "sinon-ts": "^1.0.0" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/transport-webrtc/src/private-to-public/util.ts b/packages/transport-webrtc/src/private-to-public/util.ts index 6ef40af9df..31858d5888 100644 --- a/packages/transport-webrtc/src/private-to-public/util.ts +++ b/packages/transport-webrtc/src/private-to-public/util.ts @@ -1,3 +1,2 @@ - const charset = Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/') export const genUfrag = (len: number): string => [...Array(len)].map(() => charset.at(Math.floor(Math.random() * charset.length))).join('') diff --git a/packages/transport-webrtc/tsconfig.json b/packages/transport-webrtc/tsconfig.json index 95498cc1f3..98fa092578 100644 --- a/packages/transport-webrtc/tsconfig.json +++ b/packages/transport-webrtc/tsconfig.json @@ -9,6 +9,9 @@ "proto_ts" ], "references": [ + { + "path": "../connection-encryption-noise" + }, { "path": "../interface" }, diff --git a/packages/transport-webrtc/typedoc.json b/packages/transport-webrtc/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/transport-webrtc/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/transport-websockets/package.json b/packages/transport-websockets/package.json index 176302c318..d60863f562 100644 --- a/packages/transport-websockets/package.json +++ b/packages/transport-websockets/package.json @@ -83,7 +83,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", - "aegir": "^39.0.13", + "aegir": "^40.0.1", "is-loopback-addr": "^2.0.1", "it-all": "^3.0.1", "it-drain": "^3.0.2", @@ -96,8 +96,5 @@ }, "browser": { "./dist/src/listener.js": "./dist/src/listener.browser.js" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/transport-websockets/typedoc.json b/packages/transport-websockets/typedoc.json new file mode 100644 index 0000000000..72ec6c791e --- /dev/null +++ b/packages/transport-websockets/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/filters.ts" + ] +} diff --git a/packages/transport-webtransport/package.json b/packages/transport-webtransport/package.json index 118575b332..7146b72325 100644 --- a/packages/transport-webtransport/package.json +++ b/packages/transport-webtransport/package.json @@ -64,7 +64,7 @@ "test:chrome-webworker": "aegir test -t webworker" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.1", + "@chainsafe/libp2p-noise": "^12.0.0", "@libp2p/interface": "~0.0.1", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^2.0.0", @@ -74,14 +74,11 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "libp2p": "^0.45.0", "p-defer": "^4.0.0" }, "browser": { "./dist/src/listener.js": "./dist/src/listener.browser.js" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/transport-webtransport/tsconfig.json b/packages/transport-webtransport/tsconfig.json index 0344702f51..b9d653b611 100644 --- a/packages/transport-webtransport/tsconfig.json +++ b/packages/transport-webtransport/tsconfig.json @@ -8,6 +8,9 @@ "test" ], "references": [ + { + "path": "../connection-encryption-noise" + }, { "path": "../interface" }, diff --git a/packages/transport-webtransport/typedoc.json b/packages/transport-webtransport/typedoc.json new file mode 100644 index 0000000000..72ec6c791e --- /dev/null +++ b/packages/transport-webtransport/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/filters.ts" + ] +} diff --git a/packages/utils/package.json b/packages/utils/package.json index 1264dec606..90b7b7fd40 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -95,13 +95,10 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^39.0.13", + "aegir": "^40.0.1", "it-all": "^3.0.1", "it-pair": "^2.0.6", "it-pipe": "^3.0.1", "uint8arrays": "^4.0.4" - }, - "typedoc": { - "entryPoint": "./src/index.ts" } } diff --git a/packages/utils/typedoc.json b/packages/utils/typedoc.json new file mode 100644 index 0000000000..3af8fd78c0 --- /dev/null +++ b/packages/utils/typedoc.json @@ -0,0 +1,11 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/address-sort.ts", + "./src/array-equals.ts", + "./src/ip-port-to-multiaddr.ts", + "./src/multiaddr/is-loopback.ts", + "./src/multiaddr/is-private.ts", + "./src/stream-to-ma-conn.ts" + ] +}