diff --git a/.travis.yml b/.travis.yml index bb818d0..727be57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,43 @@ -# Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -sudo: false language: node_js +cache: npm -matrix: +stages: + - check + - test + - cov + +node_js: + - '10' + +os: + - linux + - osx + - windows + +script: npx nyc -s npm run test:node -- --bail +after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov + +jobs: include: - - node_js: 8 - env: CXX=g++-4.8 + - stage: check + script: + - npx aegir commitlint --travis + - npx aegir dep-check + - npm run lint + + - stage: test + name: chrome + addons: + chrome: stable + script: + - npx aegir test -t browser -t webworker -script: - - npm run test + - stage: test + name: firefox + addons: + firefox: latest + script: + - npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start +notifications: + email: false diff --git a/README.md b/README.md index aeca7c0..c069576 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ # libp2p-connection-manager -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) -[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) -[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) -[![](https://coveralls.io/repos/github/libp2p/js-libp2p-connection-manager/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-connection-manager?branch=master) -[![](https://travis-ci.org/libp2p/js-libp2p-connection-manager.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-connection-manager) -[![](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) -![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square) -![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square) +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai) +[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) +[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) +[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-connection-manager/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-connection-manager?branch=master) +[![Travis CI](https://travis-ci.org/libp2p/js-libp2p-connection-manager.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-connection-manager) +[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-connection-manager.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-connection-manager) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +[![](https://img.shields.io/badge/pm-waffle-yellow.svg?style=flat-square)](https://waffle.io/libp2p/js-libp2p-connection-manager) > JavaScript connection manager for libp2p diff --git a/package.json b/package.json index 49e7276..6e5b5db 100644 --- a/package.json +++ b/package.json @@ -26,27 +26,28 @@ "test" ], "devDependencies": { - "aegir": "^13.0.7", - "async": "^2.6.0", - "chai": "^4.1.2", + "aegir": "^18.2.1", + "async": "^2.6.2", + "chai": "^4.2.0", "dirty-chai": "^2.0.1", - "ipfs-repo": "^0.19.0", - "libp2p": "^0.20.2", - "libp2p-multiplex": "^0.5.1", - "libp2p-secio": "^0.10.0", - "libp2p-tcp": "^0.12.0", - "lodash": "^4.17.10", - "multihashing-async": "^0.4.8", + "ipfs-repo": "~0.26.3", + "libp2p": "~0.24.4", + "libp2p-multiplex": "~0.5.1", + "libp2p-secio": "~0.11.1", + "libp2p-tcp": "~0.13.0", + "lodash": "^4.17.11", + "multihashing-async": "~0.5.2", "ncp": "^2.0.0", - "os": "^0.1.1", - "peer-id": "^0.10.7", - "peer-info": "^0.14.1", - "rimraf": "^2.6.2", - "uuid": "^3.2.1" + "os": "~0.1.1", + "peer-id": "~0.12.2", + "peer-info": "~0.15.1", + "rimraf": "^2.6.3", + "uuid": "^3.3.2" }, "dependencies": { - "debug": "^3.1.0", - "latency-monitor": "^0.2.1" + "debug": "^4.1.1", + "latency-monitor": "~0.2.1", + "peer-book": "~0.9.1" }, "contributors": [ "David Dias ", diff --git a/test/utils/create-libp2p-node.js b/test/utils/create-libp2p-node.js index 0bdb515..b70064b 100644 --- a/test/utils/create-libp2p-node.js +++ b/test/utils/create-libp2p-node.js @@ -14,13 +14,18 @@ class Node extends libp2p { const modules = { transport: [new TCP()], - connection: { - muxer: Multiplex, - crypto: SECIO - } + streamMuxer: [ + Multiplex + ], + connEncryption: [ + SECIO + ] } - super(modules, peerInfo, null, options.DHT || {}) + super({ + modules, + peerInfo + }) } } @@ -28,7 +33,7 @@ function createLibp2pNode (options, callback) { let node waterfall([ - (cb) => PeerId.create({bits: 1024}, cb), + (cb) => PeerId.create({ bits: 1024 }, cb), (id, cb) => PeerInfo.create(id, cb), (peerInfo, cb) => { peerInfo.multiaddrs.add('/ip4/127.0.0.1/tcp/0')