Skip to content

Commit

Permalink
fix: reference files directly to avoid npm install failures (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun authored Aug 21, 2019
1 parent 299cfef commit b3deb35
Show file tree
Hide file tree
Showing 41 changed files with 49 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PeerBook = require('peer-book')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const path = require('path')
const Switch = require('libp2p-switch')
const Switch = require('./src/switch')
const WebSockets = require('libp2p-websockets')

const Node = require('./test/utils/bundle-nodejs.js')
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@
"hashlru": "^2.3.0",
"interface-connection": "~0.3.3",
"latency-monitor": "~0.2.1",
"libp2p-circuit": "./src/circuit",
"libp2p-connection-manager": "./src/connection-manager",
"libp2p-crypto": "~0.16.1",
"libp2p-identify": "./src/identify",
"libp2p-ping": "./src/ping",
"libp2p-pnet": "./src/pnet",
"libp2p-switch": "./src/switch",
"libp2p-websockets": "^0.12.2",
"mafmt": "^6.0.7",
"moving-average": "^1.0.0",
Expand Down
5 changes: 0 additions & 5 deletions src/circuit/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/connection-manager/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/identify/package.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const nextTick = require('async/nextTick')

const PeerBook = require('peer-book')
const PeerInfo = require('peer-info')
const Switch = require('libp2p-switch')
const Ping = require('libp2p-ping')
const Switch = require('./switch')
const Ping = require('./ping')
const WebSockets = require('libp2p-websockets')
const ConnectionManager = require('libp2p-connection-manager')
const ConnectionManager = require('./connection-manager')

const { emitFirst } = require('./util')
const peerRouting = require('./peer-routing')
Expand Down
5 changes: 0 additions & 5 deletions src/ping/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/pnet/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/switch/connection/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict'

const FSM = require('fsm-event')
const Circuit = require('libp2p-circuit')
const Circuit = require('../../circuit')
const multistream = require('multistream-select')
const withIs = require('class-is')
const BaseConnection = require('./base')
const parallel = require('async/parallel')
const nextTick = require('async/nextTick')
const identify = require('libp2p-identify')
const identify = require('../../identify')
const errCode = require('err-code')
const { msHandle, msSelect, identifyDialer } = require('../utils')

Expand Down
4 changes: 2 additions & 2 deletions src/switch/connection/manager.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict'

const identify = require('libp2p-identify')
const identify = require('../../identify')
const multistream = require('multistream-select')
const debug = require('debug')
const log = debug('libp2p:switch:conn-manager')
const once = require('once')
const ConnectionFSM = require('../connection')
const { msHandle, msSelect, identifyDialer } = require('../utils')

const Circuit = require('libp2p-circuit')
const Circuit = require('../../circuit')

const plaintext = require('../plaintext')

Expand Down
2 changes: 1 addition & 1 deletion src/switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const EventEmitter = require('events').EventEmitter
const each = require('async/each')
const eachSeries = require('async/eachSeries')
const series = require('async/series')
const Circuit = require('libp2p-circuit')
const Circuit = require('../circuit')
const TransportManager = require('./transport')
const ConnectionManager = require('./connection/manager')
const { getPeerInfo } = require('../get-peer-info')
Expand Down
5 changes: 0 additions & 5 deletions src/switch/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/switch/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Identify = require('libp2p-identify')
const Identify = require('../identify')

/**
* For a given multistream, registers to handle the given connection
Expand Down
2 changes: 1 addition & 1 deletion test/circuit-relay.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sinon = require('sinon')
const waterfall = require('async/waterfall')
const series = require('async/series')
const parallel = require('async/parallel')
const Circuit = require('libp2p-circuit')
const Circuit = require('../src/circuit')
const multiaddr = require('multiaddr')

const createNode = require('./utils/create-node')
Expand Down
2 changes: 1 addition & 1 deletion test/connection-manager/utils/create-libp2p-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const waterfall = require('async/waterfall')
const PeerInfo = require('peer-info')
const PeerId = require('peer-id')

const ConnManager = require('libp2p-connection-manager')
const ConnManager = require('../../../src/connection-manager')

class Node extends libp2p {
constructor (peerInfo) {
Expand Down
2 changes: 1 addition & 1 deletion test/identify/basic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const identify = require('libp2p-identify')
const identify = require('../../src/identify')

describe('basic', () => {
it('multicodec', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/identify/dialer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const PeerInfo = require('peer-info')
const lp = require('pull-length-prefixed')
const multiaddr = require('multiaddr')

const msg = require('libp2p-identify').message
const identify = require('libp2p-identify')
const identify = require('../../src/identify')
const msg = identify.message

describe('identify.dialer', () => {
let original
Expand Down
4 changes: 2 additions & 2 deletions test/identify/listener.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const PeerInfo = require('peer-info')
const lp = require('pull-length-prefixed')
const multiaddr = require('multiaddr')

const msg = require('libp2p-identify').message
const identify = require('libp2p-identify')
const identify = require('../../src/identify')
const msg = identify.message

describe('identify.listener', () => {
let info
Expand Down
4 changes: 2 additions & 2 deletions test/ping/test-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ chai.use(dirtyChai)
const PeerInfo = require('peer-info')
const PeerBook = require('peer-book')

const Swarm = require('libp2p-switch')
const Swarm = require('../../src/switch')
const TCP = require('libp2p-tcp')
const series = require('async/series')
const parallel = require('async/parallel')

const Ping = require('libp2p-ping')
const Ping = require('../../src/ping')

describe('libp2p ping', () => {
let swarmA
Expand Down
2 changes: 1 addition & 1 deletion test/pnet/pnet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Connection = require('interface-connection').Connection
const pair = require('pull-pair/duplex')
const pull = require('pull-stream')

const Protector = require('libp2p-pnet')
const Protector = require('../../src/pnet')
const Errors = Protector.errors
const generate = Protector.generate

Expand Down
2 changes: 1 addition & 1 deletion test/promisify.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const createNode = promisify(require('./utils/create-node'))
const { createPeerInfo } = require('./utils/create-node')
const Node = require('./utils/bundle-nodejs')
const pull = require('pull-stream')
const Ping = require('libp2p-ping')
const Ping = require('../src/ping')

/**
* As libp2p is currently promisified, when extending libp2p,
Expand Down
6 changes: 3 additions & 3 deletions test/switch/connection.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const secio = require('libp2p-secio')
const pull = require('pull-stream')
const multiplex = require('pull-mplex')
const spdy = require('libp2p-spdy')
const Protector = require('libp2p-pnet')
const Protector = require('../../src/pnet')
const generatePSK = Protector.generate

const psk = Buffer.alloc(95)
generatePSK(psk)

const ConnectionFSM = require('libp2p-switch/connection')
const Switch = require('libp2p-switch')
const ConnectionFSM = require('../../src/switch/connection')
const Switch = require('../../src/switch')
const createInfos = require('./utils').createInfos

describe('ConnectionFSM', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/switch/constructor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('create Switch instance', () => {
it('throws on missing peerInfo', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/switch/dial-fsm.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const TCP = require('libp2p-tcp')
const secio = require('libp2p-secio')
const multiplex = require('pull-mplex')
const pull = require('pull-stream')
const identify = require('libp2p-identify')
const identify = require('../../src/identify')

const utils = require('./utils')
const createInfos = utils.createInfos
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('dialFSM', () => {
let switchA
Expand Down
2 changes: 1 addition & 1 deletion test/switch/dialSelf.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Duplex = require('pull-pair/duplex')

const utils = require('./utils')
const createInfos = utils.createInfos
const Swarm = require('libp2p-switch')
const Swarm = require('../../src/switch')

class MockTransport extends EventEmitter {
constructor () {
Expand Down
8 changes: 4 additions & 4 deletions test/switch/dialer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ chai.use(dirtyChai)
const sinon = require('sinon')

const PeerBook = require('peer-book')
const Queue = require('libp2p-switch/dialer/queue')
const QueueManager = require('libp2p-switch/dialer/queueManager')
const Switch = require('libp2p-switch')
const { PRIORITY_HIGH, PRIORITY_LOW } = require('libp2p-switch/constants')
const Queue = require('../../src/switch/dialer/queue')
const QueueManager = require('../../src/switch/dialer/queueManager')
const Switch = require('../../src/switch')
const { PRIORITY_HIGH, PRIORITY_LOW } = require('../../src/switch/constants')

const utils = require('./utils')
const createInfos = utils.createInfos
Expand Down
4 changes: 2 additions & 2 deletions test/switch/identify.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const pull = require('pull-stream')
const secio = require('libp2p-secio')
const PeerInfo = require('peer-info')
const PeerBook = require('peer-book')
const identify = require('libp2p-identify')
const identify = require('../../src/identify')
const lp = require('pull-length-prefixed')
const sinon = require('sinon')

const utils = require('./utils')
const createInfos = utils.createInfos
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Identify', () => {
let switchA
Expand Down
2 changes: 1 addition & 1 deletion test/switch/limit-dialer.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const multiaddr = require('multiaddr')
const pull = require('pull-stream')
const nextTick = require('async/nextTick')

const LimitDialer = require('libp2p-switch/limit-dialer')
const LimitDialer = require('../../src/switch/limit-dialer')
const utils = require('./utils')

describe('LimitDialer', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/switch/pnet.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const multiplex = require('pull-mplex')
const pull = require('pull-stream')
const PeerBook = require('peer-book')
const secio = require('libp2p-secio')
const Protector = require('libp2p-pnet')
const Protector = require('../../src/pnet')

const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

const generatePSK = Protector.generate

Expand Down
2 changes: 1 addition & 1 deletion test/switch/secio.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const PeerBook = require('peer-book')
const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('SECIO', () => {
let switchA
Expand Down
2 changes: 1 addition & 1 deletion test/switch/stats.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PeerBook = require('peer-book')
const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Stats', () => {
const setup = (cb) => {
Expand Down
2 changes: 1 addition & 1 deletion test/switch/stream-muxers.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Stream Multiplexing', () => {
[
Expand Down
2 changes: 1 addition & 1 deletion test/switch/swarm-muxing+webrtc-star.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PeerBook = require('peer-book')
const tryEcho = require('./utils').tryEcho
const sinon = require('sinon')

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Switch (webrtc-star)', () => {
let switch1
Expand Down
2 changes: 1 addition & 1 deletion test/switch/swarm-muxing+websockets.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const spdy = require('libp2p-spdy')
const PeerBook = require('peer-book')
const tryEcho = require('./utils').tryEcho

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Switch (WebSockets)', () => {
[
Expand Down
2 changes: 1 addition & 1 deletion test/switch/swarm-muxing.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const PeerBook = require('peer-book')
const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Switch (everything all together)', () => {
[pMplex, spdy, mplex].forEach(muxer => {
Expand Down
2 changes: 1 addition & 1 deletion test/switch/swarm-no-muxing.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PeerBook = require('peer-book')
const utils = require('./utils')
const createInfos = utils.createInfos
const tryEcho = utils.tryEcho
const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Switch (no Stream Multiplexing)', () => {
let switchA
Expand Down
2 changes: 1 addition & 1 deletion test/switch/switch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('Switch', () => {
describe('.availableTransports', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/switch/t-webrtc-star.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const pull = require('pull-stream')
const PeerBook = require('peer-book')
const tryEcho = require('./utils').tryEcho

const Switch = require('libp2p-switch')
const Switch = require('../../src/switch')

describe('transport - webrtc-star', () => {
let switch1
Expand Down
2 changes: 1 addition & 1 deletion test/switch/transport-manager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Multiaddr = require('multiaddr')
const PeerInfo = require('peer-info')
const sinon = require('sinon')

const TransportManager = require('libp2p-switch/transport')
const TransportManager = require('../../src/switch/transport')

describe('Transport Manager', () => {
afterEach(() => {
Expand Down
Loading

0 comments on commit b3deb35

Please sign in to comment.