Skip to content

Commit

Permalink
deps(dev): bump aegir from 38.1.8 to 40.0.0 (#104)
Browse files Browse the repository at this point in the history
Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 40.0.0.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v38.1.8...v40.0.0)

---
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>
  • Loading branch information
dependabot[bot] and achingbrain authored Sep 18, 2023
1 parent 654a2db commit 0342dd9
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
node_modules
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
"peer",
"pubsub"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
Expand Down Expand Up @@ -159,7 +155,7 @@
"@libp2p/interface-address-manager": "^3.0.0",
"@libp2p/interface-peer-discovery-compliance-tests": "^2.0.0",
"@libp2p/peer-id-factory": "^2.0.0",
"aegir": "^38.1.8",
"aegir": "^40.0.0",
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"protons": "^7.0.2",
Expand Down
25 changes: 10 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { logger } from '@libp2p/logger'
import { symbol } from '@libp2p/interface-peer-discovery'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import type { Startable } from '@libp2p/interfaces/startable'
import { logger } from '@libp2p/logger'
import { peerIdFromKeys } from '@libp2p/peer-id'
import { multiaddr } from '@multiformats/multiaddr'
import { Peer as PBPeer } from './peer.js'
import { peerIdFromKeys } from '@libp2p/peer-id'
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { Message, PubSub } from '@libp2p/interface-pubsub'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import { symbol } from '@libp2p/interface-peer-discovery'
import type { AddressManager } from '@libp2p/interface-address-manager'
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { Message, PubSub } from '@libp2p/interface-pubsub'
import type { Startable } from '@libp2p/interfaces/startable'

const log = logger('libp2p:discovery:pubsub')
export const TOPIC = '_peer-discovery._p2p._pubsub'
Expand Down Expand Up @@ -41,6 +41,9 @@ export interface PubSubPeerDiscoveryComponents {
* A Peer Discovery Service that leverages libp2p Pubsub to find peers.
*/
export class PubSubPeerDiscovery extends EventEmitter<PeerDiscoveryEvents> implements PeerDiscovery, Startable {
public readonly [symbol] = true
public readonly [Symbol.toStringTag] = '@libp2p/pubsub-peer-discovery'

private readonly interval: number
private readonly listenOnly: boolean
private readonly topics: string[]
Expand Down Expand Up @@ -70,14 +73,6 @@ export class PubSubPeerDiscovery extends EventEmitter<PeerDiscoveryEvents> imple
this._onMessage = this._onMessage.bind(this)
}

get [symbol] (): true {
return true
}

get [Symbol.toStringTag] (): '@libp2p/pubsub-peer-discovery' {
return '@libp2p/pubsub-peer-discovery'
}

isStarted (): boolean {
return this.intervalId != null
}
Expand Down
10 changes: 5 additions & 5 deletions test/compliance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-env mocha */

import tests from '@libp2p/interface-peer-discovery-compliance-tests'
import { pubsubPeerDiscovery, TOPIC } from '../src/index.js'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { stubInterface } from 'ts-sinon'
import type { PubSub } from '@libp2p/interface-pubsub'
import { CustomEvent } from '@libp2p/interfaces/events'
import type { AddressManager } from '@libp2p/interface-address-manager'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { multiaddr } from '@multiformats/multiaddr'
import { stubInterface } from 'ts-sinon'
import { pubsubPeerDiscovery, TOPIC } from '../src/index.js'
import { Peer as PBPeer } from '../src/peer.js'
import type { AddressManager } from '@libp2p/interface-address-manager'
import type { PubSub } from '@libp2p/interface-pubsub'

describe('compliance tests', () => {
let intervalId: ReturnType<typeof setInterval>
Expand Down
20 changes: 10 additions & 10 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* eslint-env mocha */

import { CustomEvent } from '@libp2p/interfaces/events'
import { start, stop } from '@libp2p/interfaces/startable'
import { peerIdFromKeys } from '@libp2p/peer-id'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { multiaddr } from '@multiformats/multiaddr'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import defer from 'p-defer'
import pWaitFor from 'p-wait-for'
import { multiaddr } from '@multiformats/multiaddr'
import { pubsubPeerDiscovery, PubSubPeerDiscoveryComponents, TOPIC } from '../src/index.js'
import sinon from 'sinon'
import { type StubbedInstance, stubInterface } from 'ts-sinon'
import { pubsubPeerDiscovery, type PubSubPeerDiscoveryComponents, TOPIC } from '../src/index.js'
import * as PB from '../src/peer.js'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { StubbedInstance, stubInterface } from 'ts-sinon'
import type { PubSub } from '@libp2p/interface-pubsub'
import { peerIdFromKeys } from '@libp2p/peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import { CustomEvent } from '@libp2p/interfaces/events'
import type { AddressManager } from '@libp2p/interface-address-manager'
import { start, stop } from '@libp2p/interfaces/startable'
import type { PeerDiscovery } from '@libp2p/interface-peer-discovery'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { PubSub } from '@libp2p/interface-pubsub'

const listeningMultiaddr = multiaddr('/ip4/127.0.0.1/tcp/9000/ws')

Expand Down
5 changes: 5 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": [
"./src/index.ts"
]
}

0 comments on commit 0342dd9

Please sign in to comment.