Skip to content

Commit 149c19a

Browse files
committed
chore: minor fixes and github ci
1 parent 4b309ad commit 149c19a

File tree

6 files changed

+72
-81
lines changed

6 files changed

+72
-81
lines changed

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: yarn
16+
- run: yarn lint
17+
- run: yarn build
18+
- uses: gozala/[email protected]
19+
- run: yarn aegir dep-check -- -i aegir
20+
- uses: ipfs/aegir/actions/bundle-size@master
21+
name: size
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
test-node:
25+
needs: check
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
matrix:
29+
os: [ubuntu-latest, macos-latest]
30+
node: [12, 14]
31+
fail-fast: true
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v1
35+
with:
36+
node-version: ${{ matrix.node }}
37+
- run: yarn
38+
- run: npx nyc --reporter=lcov npm run test:node -- --bail
39+
- uses: codecov/codecov-action@v1
40+
test-chrome:
41+
needs: check
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- run: yarn
46+
- run: yarn aegir test -t browser -t webworker
47+
test-firefox:
48+
needs: check
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- run: yarn
53+
- run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless
54+
test-electron-main:
55+
needs: check
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v2
59+
- run: yarn
60+
- run: npx xvfb-maybe yarn aegir test -t electron-main --bail
61+
test-electron-renderer:
62+
needs: check
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v2
66+
- run: yarn
67+
- run: npx xvfb-maybe yarn aegir test -t electron-renderer --bail

.travis.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"it-pipe": "^1.1.0",
7272
"it-protocol-buffers": "^0.2.0",
7373
"libp2p-crypto": "^0.18.0",
74-
"libp2p-interfaces": "libp2p/js-libp2p-interfaces#feat/add-types",
74+
"libp2p-interfaces": "libp2p/js-libp2p-interfaces#feat/add-types-with-post-install",
7575
"libp2p-utils": "^0.2.2",
7676
"mafmt": "^8.0.0",
7777
"merge-options": "^2.0.0",
@@ -98,7 +98,7 @@
9898
"devDependencies": {
9999
"@nodeutils/defaults-deep": "^1.1.0",
100100
"abortable-iterator": "^3.0.0",
101-
"aegir": "^29.1.0",
101+
"aegir": "^29.2.0",
102102
"chai-bytes": "^0.1.2",
103103
"chai-string": "^1.5.0",
104104
"delay": "^4.3.0",

src/transport-manager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class TransportManager {
5454
throw errCode(new Error('There is already a transport with this key'), codes.ERR_DUPLICATE_TRANSPORT)
5555
}
5656

57-
// @ts-ignore
5857
const transport = new Transport({
5958
...transportOptions,
6059
libp2p: this.libp2p,

src/upgrader.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const log = Object.assign(debug('libp2p:upgrader'), {
77
const errCode = require('err-code')
88
const Multistream = require('multistream-select')
99
const { Connection } = require('libp2p-interfaces/src/connection')
10-
const ConnectionStatus = require('libp2p-interfaces/src/connection/status')
1110
const PeerId = require('peer-id')
1211
const { pipe } = require('it-pipe')
1312
const mutableProxy = require('mutable-proxy')
@@ -223,8 +222,7 @@ class Upgrader {
223222
let connection
224223

225224
if (Muxer) {
226-
// Create the muxer
227-
// @ts-ignore
225+
// @ts-ignore Create the muxer
228226
muxer = new Muxer({
229227
// Run anytime a remote stream is created
230228
onStream: async muxedStream => {
@@ -270,7 +268,7 @@ class Upgrader {
270268
// Wait for close to finish before notifying of the closure
271269
(async () => {
272270
try {
273-
if (connection.stat.status === ConnectionStatus.OPEN) {
271+
if (connection.stat.status === 'open') {
274272
await connection.close()
275273
}
276274
} catch (err) {

tsconfig.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
{
22
"extends": "./node_modules/aegir/src/config/tsconfig.aegir.json",
33
"compilerOptions": {
4-
"outDir": "dist",
5-
"forceConsistentCasingInFileNames": true,
6-
"noImplicitReturns": false,
7-
"noImplicitAny": false,
8-
"noImplicitThis": true,
9-
"noFallthroughCasesInSwitch": true,
10-
"noUnusedLocals": true,
11-
"noUnusedParameters": false,
12-
"strictFunctionTypes": true,
13-
"strictNullChecks": true,
14-
"strictPropertyInitialization": true,
15-
"strictBindCallApply": true,
16-
"strict": true,
17-
"alwaysStrict": true,
18-
"stripInternal": true
4+
"outDir": "dist"
195
},
206
"include": [
217
"src"

0 commit comments

Comments
 (0)