Skip to content

Commit

Permalink
chore: minor fixes and github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Dec 2, 2020
1 parent 4b309ad commit a674e4a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 81 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn lint
- run: yarn build
- uses: gozala/typescript-error-reporter-action@v1.0.4
- run: yarn aegir dep-check -- -i aegir
- uses: ipfs/aegir/actions/bundle-size@master
name: size
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [12, 14]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn
- run: npx nyc --reporter=lcov npm run test:node -- --bail
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn aegir test -t browser -t webworker
test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless
test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: npx xvfb-maybe yarn aegir test -t electron-main --bail
test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: npx xvfb-maybe yarn aegir test -t electron-renderer --bail
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"it-pipe": "^1.1.0",
"it-protocol-buffers": "^0.2.0",
"libp2p-crypto": "^0.18.0",
"libp2p-interfaces": "libp2p/js-libp2p-interfaces#feat/add-types",
"libp2p-interfaces": "libp2p/js-libp2p-interfaces#feat/add-types-with-post-install",
"libp2p-utils": "^0.2.2",
"mafmt": "^8.0.0",
"merge-options": "^2.0.0",
Expand All @@ -98,7 +98,7 @@
"devDependencies": {
"@nodeutils/defaults-deep": "^1.1.0",
"abortable-iterator": "^3.0.0",
"aegir": "^29.1.0",
"aegir": "^29.2.0",
"chai-bytes": "^0.1.2",
"chai-string": "^1.5.0",
"delay": "^4.3.0",
Expand Down
1 change: 0 additions & 1 deletion src/transport-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class TransportManager {
throw errCode(new Error('There is already a transport with this key'), codes.ERR_DUPLICATE_TRANSPORT)
}

// @ts-ignore
const transport = new Transport({
...transportOptions,
libp2p: this.libp2p,
Expand Down
6 changes: 2 additions & 4 deletions src/upgrader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const log = Object.assign(debug('libp2p:upgrader'), {
const errCode = require('err-code')
const Multistream = require('multistream-select')
const { Connection } = require('libp2p-interfaces/src/connection')
const ConnectionStatus = require('libp2p-interfaces/src/connection/status')
const PeerId = require('peer-id')
const { pipe } = require('it-pipe')
const mutableProxy = require('mutable-proxy')
Expand Down Expand Up @@ -223,8 +222,7 @@ class Upgrader {
let connection

if (Muxer) {
// Create the muxer
// @ts-ignore
// @ts-ignore Create the muxer
muxer = new Muxer({
// Run anytime a remote stream is created
onStream: async muxedStream => {
Expand Down Expand Up @@ -270,7 +268,7 @@ class Upgrader {
// Wait for close to finish before notifying of the closure
(async () => {
try {
if (connection.stat.status === ConnectionStatus.OPEN) {
if (connection.stat.status === 'open') {
await connection.close()
}
} catch (err) {
Expand Down
16 changes: 1 addition & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
{
"extends": "./node_modules/aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": false,
"noImplicitAny": false,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"strict": true,
"alwaysStrict": true,
"stripInternal": true
"outDir": "dist"
},
"include": [
"src"
Expand Down

0 comments on commit a674e4a

Please sign in to comment.