From b07e6db7409bb4256dc87cbf6b62a69c92fe1a8c Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 15 Jun 2022 13:25:34 +0100 Subject: [PATCH] feat!: update libp2p interfaces (#67) BREAKING CHANGE: uses new single-issue libp2p interface modules --- .github/workflows/js-test-and-release.yml | 14 ++++---- README.md | 40 +++++++++++++++-------- package.json | 9 ++--- src/dht/peer-routing.ts | 2 +- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml index 8630dc5..f3f9e72 100644 --- a/.github/workflows/js-test-and-release.yml +++ b/.github/workflows/js-test-and-release.yml @@ -35,7 +35,7 @@ jobs: node-version: ${{ matrix.node }} - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:node - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: node @@ -50,7 +50,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:chrome - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: chrome @@ -65,7 +65,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:chrome-webworker - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: chrome-webworker @@ -80,7 +80,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:firefox - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: firefox @@ -95,7 +95,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:firefox-webworker - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: firefox-webworker @@ -110,7 +110,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npx xvfb-maybe npm run --if-present test:electron-main - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: electron-main @@ -125,7 +125,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npx xvfb-maybe npm run --if-present test:electron-renderer - - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: directory: ./.nyc_output flags: electron-renderer diff --git a/README.md b/README.md index 38c6057..27f29c3 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,31 @@ -# Interoperability Tests for libp2p +# @libp2p/interop -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai/) -[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) -[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io) +[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) +[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) +[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) +[![codecov](https://img.shields.io/codecov/c/github/libp2p/interop.svg?style=flat-square)](https://codecov.io/gh/libp2p/interop) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/interop/actions/workflows/js-test-and-release.yml) -> Interoperability tests for libp2p Implementations +> Interoperability Tests for libp2p -This repository will be used for interop tests. +## Table of contents -## Usage +- [Install](#install) +- [Usage](#usage) + - [Running the tests](#running-the-tests) +- [Contribute](#contribute) +- [License](#license) +- [Contribution](#contribution) -### Install +## Install +```console +$ npm i @libp2p/interop ``` -> npm install @libp2p/interop -``` + +This repository will be used for interop tests. + +## Usage ### Running the tests @@ -67,5 +77,9 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c Licensed under either of - * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0) - * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT) +- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](LICENSE-MIT) / ) + +## Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/package.json b/package.json index ddccf93..050fc71 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ ], "exports": { ".": { + "types": "./src/index.d.ts", "import": "./dist/src/index.js" } }, @@ -128,8 +129,8 @@ }, "dependencies": { "@libp2p/daemon-client": "^1.0.0", - "@libp2p/interfaces": "^2.0.1", - "@libp2p/logger": "^1.1.2", + "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.8", "@multiformats/multiaddr": "^10.1.8", "it-all": "^1.0.6", @@ -139,9 +140,9 @@ "uint8arrays": "^3.0.0" }, "devDependencies": { - "aegir": "^37.0.9" + "aegir": "^37.2.0" }, "peerDependencies": { - "aegir": "^37.0.9" + "aegir": "^37.2.0" } } diff --git a/src/dht/peer-routing.ts b/src/dht/peer-routing.ts index 555187d..9fbe560 100644 --- a/src/dht/peer-routing.ts +++ b/src/dht/peer-routing.ts @@ -3,7 +3,7 @@ import { expect } from 'aegir/chai' import type { Daemon, DaemonFactory, NodeType, SpawnOptions } from '../index.js' import pRetry from 'p-retry' -import type { PeerInfo } from '@libp2p/interfaces/peer-info' +import type { PeerInfo } from '@libp2p/interface-peer-info' export function peerRoutingTests (factory: DaemonFactory) { const nodeTypes: NodeType[] = ['js', 'go']