Skip to content

Commit 872cba5

Browse files
deps(dev): bump aegir from 40.0.13 to 41.1.11 (#137)
Bumps [aegir](https://github.com/ipfs/aegir) from 40.0.13 to 41.1.11. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v40.0.13...v41.1.11) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <alex@achingbrain.net>
1 parent bf3d9e1 commit 872cba5

File tree

5 files changed

+260
-40
lines changed

5 files changed

+260
-40
lines changed

.github/workflows/js-test-and-release.yml

+187-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: test & maybe release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
workflow_dispatch:
99

@@ -16,10 +16,189 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19-
js-test-and-release:
20-
uses: pl-strflt/uci/.github/workflows/js-test-and-release.yml@v0.0
21-
secrets:
22-
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
23-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
24-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25-
UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}
19+
check:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: lts/*
26+
- uses: ipfs/aegir/actions/cache-node-modules@master
27+
- run: npm run --if-present lint
28+
- run: npm run --if-present dep-check
29+
- run: npm run --if-present doc-check
30+
31+
test-node:
32+
needs: check
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [windows-latest, ubuntu-latest, macos-latest]
37+
node: [lts/*]
38+
fail-fast: true
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-node@v3
42+
with:
43+
node-version: ${{ matrix.node }}
44+
- uses: ipfs/aegir/actions/cache-node-modules@master
45+
- run: npm run --if-present test:node
46+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
47+
with:
48+
flags: node
49+
files: .coverage/*,packages/*/.coverage/*
50+
51+
test-chrome:
52+
needs: check
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: actions/setup-node@v3
57+
with:
58+
node-version: lts/*
59+
- uses: ipfs/aegir/actions/cache-node-modules@master
60+
- run: npm run --if-present test:chrome
61+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
62+
with:
63+
flags: chrome
64+
files: .coverage/*,packages/*/.coverage/*
65+
66+
test-chrome-webworker:
67+
needs: check
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: actions/setup-node@v3
72+
with:
73+
node-version: lts/*
74+
- uses: ipfs/aegir/actions/cache-node-modules@master
75+
- run: npm run --if-present test:chrome-webworker
76+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
77+
with:
78+
flags: chrome-webworker
79+
files: .coverage/*,packages/*/.coverage/*
80+
81+
test-firefox:
82+
needs: check
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v3
86+
- uses: actions/setup-node@v3
87+
with:
88+
node-version: lts/*
89+
- uses: ipfs/aegir/actions/cache-node-modules@master
90+
- run: npm run --if-present test:firefox
91+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
92+
with:
93+
flags: firefox
94+
files: .coverage/*,packages/*/.coverage/*
95+
96+
test-firefox-webworker:
97+
needs: check
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v3
101+
- uses: actions/setup-node@v3
102+
with:
103+
node-version: lts/*
104+
- uses: ipfs/aegir/actions/cache-node-modules@master
105+
- run: npm run --if-present test:firefox-webworker
106+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
107+
with:
108+
flags: firefox-webworker
109+
files: .coverage/*,packages/*/.coverage/*
110+
111+
test-webkit:
112+
needs: check
113+
runs-on: ${{ matrix.os }}
114+
strategy:
115+
matrix:
116+
os: [ubuntu-latest, macos-latest]
117+
node: [lts/*]
118+
fail-fast: true
119+
steps:
120+
- uses: actions/checkout@v3
121+
- uses: actions/setup-node@v3
122+
with:
123+
node-version: lts/*
124+
- uses: ipfs/aegir/actions/cache-node-modules@master
125+
- run: npm run --if-present test:webkit
126+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
127+
with:
128+
flags: webkit
129+
files: .coverage/*,packages/*/.coverage/*
130+
131+
test-webkit-webworker:
132+
needs: check
133+
runs-on: ${{ matrix.os }}
134+
strategy:
135+
matrix:
136+
os: [ubuntu-latest, macos-latest]
137+
node: [lts/*]
138+
fail-fast: true
139+
steps:
140+
- uses: actions/checkout@v3
141+
- uses: actions/setup-node@v3
142+
with:
143+
node-version: lts/*
144+
- uses: ipfs/aegir/actions/cache-node-modules@master
145+
- run: npm run --if-present test:webkit-webworker
146+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
147+
with:
148+
flags: webkit-webworker
149+
files: .coverage/*,packages/*/.coverage/*
150+
151+
test-electron-main:
152+
needs: check
153+
runs-on: ubuntu-latest
154+
steps:
155+
- uses: actions/checkout@v3
156+
- uses: actions/setup-node@v3
157+
with:
158+
node-version: lts/*
159+
- uses: ipfs/aegir/actions/cache-node-modules@master
160+
- run: npx xvfb-maybe npm run --if-present test:electron-main
161+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
162+
with:
163+
flags: electron-main
164+
files: .coverage/*,packages/*/.coverage/*
165+
166+
test-electron-renderer:
167+
needs: check
168+
runs-on: ubuntu-latest
169+
steps:
170+
- uses: actions/checkout@v3
171+
- uses: actions/setup-node@v3
172+
with:
173+
node-version: lts/*
174+
- uses: ipfs/aegir/actions/cache-node-modules@master
175+
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
176+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
177+
with:
178+
flags: electron-renderer
179+
files: .coverage/*,packages/*/.coverage/*
180+
181+
release:
182+
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer]
183+
runs-on: ubuntu-latest
184+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
185+
permissions:
186+
id-token: write
187+
contents: write
188+
pull-requests: write
189+
steps:
190+
- uses: actions/checkout@v3
191+
with:
192+
fetch-depth: 0
193+
- uses: actions/setup-node@v3
194+
with:
195+
node-version: lts/*
196+
- uses: ipfs/aegir/actions/cache-node-modules@master
197+
- uses: ipfs/aegir/actions/docker-login@master
198+
with:
199+
docker-token: ${{ secrets.DOCKER_TOKEN }}
200+
docker-username: ${{ secrets.DOCKER_USERNAME }}
201+
- run: npm run --if-present release
202+
env:
203+
GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }}
204+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

+12-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
1-
# @libp2p/interop <!-- omit in toc -->
2-
31
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
42
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
53
[![codecov](https://img.shields.io/codecov/c/github/libp2p/interop.svg?style=flat-square)](https://codecov.io/gh/libp2p/interop)
6-
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/interop/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/interop/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
4+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/interop/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/libp2p/interop/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
75

86
> Interoperability Tests for libp2p
97
10-
## Table of contents <!-- omit in toc -->
11-
12-
- [Install](#install)
13-
- [Usage](#usage)
14-
- [Running the tests](#running-the-tests)
15-
- [License](#license)
16-
- [Contribution](#contribution)
17-
18-
## Install
19-
20-
```console
21-
$ npm i @libp2p/interop
22-
```
8+
# About
239

24-
This repository will be used for interop tests.
10+
This repository holds interop tests for testing compatibility between different libp2p implementations.
2511

26-
## Usage
27-
28-
### Running the tests
12+
## Example - How to run the tests
2913

3014
Create a js file that configures the different types of daemon:
3115

@@ -63,13 +47,19 @@ main().catch(err => {
6347

6448
For an example, see the js-libp2p interop test runner.
6549

66-
## License
50+
# Install
51+
52+
```console
53+
$ npm i @libp2p/interop
54+
```
55+
56+
# License
6757

6858
Licensed under either of
6959

7060
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
7161
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
7262

73-
## Contribution
63+
# Contribution
7464

7565
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.

package.json

+10-8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"bugs": {
1212
"url": "https://github.com/libp2p/interop/issues"
1313
},
14+
"publishConfig": {
15+
"access": "public",
16+
"provenance": true
17+
},
1418
"keywords": [
1519
"libp2p"
1620
],
17-
"engines": {
18-
"node": ">=16.0.0",
19-
"npm": ">=7.0.0"
20-
},
2121
"type": "module",
2222
"types": "./dist/src/index.d.ts",
2323
"files": [
@@ -35,12 +35,13 @@
3535
"eslintConfig": {
3636
"extends": "ipfs",
3737
"parserOptions": {
38+
"project": true,
3839
"sourceType": "module"
3940
}
4041
},
4142
"release": {
4243
"branches": [
43-
"master"
44+
"main"
4445
],
4546
"plugins": [
4647
[
@@ -130,7 +131,8 @@
130131
"dep-check": "aegir dep-check",
131132
"build": "aegir build --bundle false",
132133
"postbuild": "cp src/resources/keys/*.key dist/src/resources/keys",
133-
"release": "aegir release"
134+
"release": "aegir release",
135+
"docs": "aegir docs"
134136
},
135137
"dependencies": {
136138
"@libp2p/daemon-client": "^7.0.0",
@@ -141,8 +143,8 @@
141143
"it-all": "^3.0.1",
142144
"it-first": "^3.0.1",
143145
"it-handshake": "^4.1.2",
144-
"it-protobuf-stream": "^1.0.0",
145146
"it-pipe": "^3.0.0",
147+
"it-protobuf-stream": "^1.0.0",
146148
"it-stream-types": "^2.0.1",
147149
"multiformats": "^12.0.1",
148150
"p-defer": "^4.0.0",
@@ -153,7 +155,7 @@
153155
"uint8arrays": "^4.0.2"
154156
},
155157
"devDependencies": {
156-
"aegir": "^40.0.8",
158+
"aegir": "^41.1.11",
157159
"protons": "^7.0.2"
158160
},
159161
"peerDependencies": {

src/index.ts

+46-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
/**
2+
* @packageDocumentation
3+
*
4+
* This repository holds interop tests for testing compatibility between different libp2p implementations.
5+
*
6+
* @example How to run the tests
7+
*
8+
* Create a js file that configures the different types of daemon:
9+
*
10+
* ```js
11+
* import { interopTests } from '@libp2p/interop'
12+
* import type { Daemon, DaemonFactory } from '@libp2p/interop'
13+
*
14+
* async function createGoPeer (options: SpawnOptions): Promise<Daemon> {
15+
* // your implementation here
16+
* }
17+
*
18+
* async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
19+
* // your implementation here
20+
* }
21+
*
22+
* async function main () {
23+
* const factory: DaemonFactory = {
24+
* async spawn (options: SpawnOptions) {
25+
* if (options.type === 'go') {
26+
* return createGoPeer(options)
27+
* }
28+
*
29+
* return createJsPeer(options)
30+
* }
31+
* }
32+
*
33+
* interopTests(factory)
34+
* }
35+
*
36+
* main().catch(err => {
37+
* console.error(err)
38+
* process.exit(1)
39+
* })
40+
* ```
41+
*
42+
* For an example, see the js-libp2p interop test runner.
43+
*/
44+
145
import { connectTests } from './connect.js'
246
import { dhtTests } from './dht/index.js'
347
import { pubsubTests } from './pubsub/index.js'
@@ -6,7 +50,7 @@ import { streamTests } from './streams/index.js'
650
import type { DaemonClient } from '@libp2p/daemon-client'
751

852
export interface Daemon {
9-
stop: () => Promise<void>
53+
stop(): Promise<void>
1054
client: DaemonClient
1155
}
1256

@@ -30,7 +74,7 @@ export interface SpawnOptions {
3074
}
3175

3276
export interface DaemonFactory {
33-
spawn: (options: SpawnOptions) => Promise<Daemon>
77+
spawn(options: SpawnOptions): Promise<Daemon>
3478
}
3579

3680
export async function interopTests (factory: DaemonFactory): Promise<void> {

typedoc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"entryPoints": [
3+
"./src/index.ts"
4+
]
5+
}

0 commit comments

Comments
 (0)