Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

fix: swap protobufjs for protons #191

Merged
merged 2 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"build": "lerna run build",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
"release": "lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo"
"release": "lerna run --concurrency 1 release -- --"
},
"dependencies": {
"lerna": "^4.0.0",
Expand Down
23 changes: 12 additions & 11 deletions packages/libp2p-connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,18 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test/*.js -f ./dist/test/**/*.js",
"test:chrome": "npm run test -- -t browser",
"test:chrome-webworker": "npm run test -- -t webworker",
"test:firefox": "npm run test -- -t browser -- --browser firefox",
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
"test:node": "npm run test -- -t node --cov",
"test:electron-main": "npm run test -- -t electron-main"
"dep-check": "aegir dep-check",
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
},
"dependencies": {
"@libp2p/interfaces": "^1.3.0",
Expand All @@ -161,7 +162,7 @@
"devDependencies": {
"@libp2p/interface-compliance-tests": "^1.1.0",
"@libp2p/peer-id-factory": "^1.0.0",
"aegir": "^36.1.3",
"aegir": "^37.0.6",
"it-pair": "^2.0.2"
}
}
9 changes: 6 additions & 3 deletions packages/libp2p-connection/test/compliance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ describe('compliance tests', () => {
const id = `${streamId++}`
const stream: Stream = {
...pair(),
close: async () => {
await stream.sink(async function * () {}())
connection.removeStream(stream.id)
close: () => {
void stream.sink(async function * () {}())
.then(() => {
connection.removeStream(stream.id)
})
.catch()
},
id,
abort: () => {},
Expand Down
4 changes: 3 additions & 1 deletion packages/libp2p-connection/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ describe('connection tests', () => {
const id = `${streamId++}`
const stream: Stream = {
...pair<Uint8Array>(),
close: async () => await stream.sink(async function * () {}()),
close: () => {
void stream.sink(async function * () {}()).catch()
},
id,
abort: () => {},
reset: () => {},
Expand Down
4 changes: 1 addition & 3 deletions packages/libp2p-connection/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020"
"outDir": "dist"
},
"include": [
"src",
Expand Down
23 changes: 12 additions & 11 deletions packages/libp2p-interface-compliance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,18 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test/*.js -f ./dist/test/**/*.js",
"test:chrome": "npm run test -- -t browser",
"test:chrome-webworker": "npm run test -- -t webworker",
"test:firefox": "npm run test -- -t browser -- --browser firefox",
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
"test:node": "npm run test -- -t node --cov",
"test:electron-main": "npm run test -- -t electron-main"
"dep-check": "aegir dep-check",
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
},
"dependencies": {
"@libp2p/crypto": "^0.22.8",
Expand All @@ -207,7 +208,7 @@
"@libp2p/pubsub": "^1.2.0",
"@multiformats/multiaddr": "^10.1.5",
"abortable-iterator": "^4.0.2",
"aegir": "^36.1.3",
"aegir": "^37.0.6",
"any-signal": "^3.0.0",
"delay": "^5.0.0",
"err-code": "^3.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { pipe } from 'it-pipe'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import all from 'it-all'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import type { TestSetup } from '../index.js'
import type { Connection } from '@libp2p/interfaces/connection'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { mockConnection } from './connection.js'
import type { Upgrader, MultiaddrConnection, UpgraderEvents } from '@libp2p/interfaces/transport'
import type { Registrar } from '@libp2p/interfaces/registrar'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { Multiaddr } from '@multiformats/multiaddr'
import delay from 'delay'
import pDefer from 'p-defer'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import pDefer from 'p-defer'
import pWaitFor from 'p-wait-for'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import pDefer from 'p-defer'
import pWaitFor from 'p-wait-for'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint max-nested-callbacks: ["error", 6] */
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import pDefer from 'p-defer'
import pWaitFor from 'p-wait-for'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint max-nested-callbacks: ["error", 6] */
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import pDefer from 'p-defer'
import pWaitFor from 'p-wait-for'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import type { TestSetup } from '../index.js'
import type { Record } from '@libp2p/interfaces/record'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { duplexPair } from 'it-pair/duplex'
import { pipe } from 'it-pipe'
import drain from 'it-drain'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { duplexPair } from 'it-pair/duplex'
import { abortableSource } from 'abortable-iterator'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import drain from 'it-drain'
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import delay from 'delay'
import type { TestSetup } from '../index.js'
import type { StreamMuxerFactory } from '@libp2p/interfaces/stream-muxer'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { duplexPair } from 'it-pair/duplex'
import { pipe } from 'it-pipe'
import pLimit from 'p-limit'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import type { TestSetup } from '../index.js'
import type { Topology } from '@libp2p/interfaces/topology'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { isValidTick } from '../utils/is-valid-tick.js'
import { mockUpgrader } from '../mocks/upgrader.js'
import { mockRegistrar } from '../mocks/registrar.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import type { TestSetup } from '../index.js'
import type { Transport } from '@libp2p/interfaces/transport'
import type { TransportTestFixtures } from './index.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint max-nested-callbacks: ["error", 8] */
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import pWaitFor from 'p-wait-for'
import { pipe } from 'it-pipe'
Expand Down
4 changes: 1 addition & 3 deletions packages/libp2p-interface-compliance-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020"
"outDir": "dist"
},
"include": [
"src",
Expand Down
9 changes: 6 additions & 3 deletions packages/libp2p-interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,19 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc"
"dep-check": "aegir dep-check",
"build": "aegir build",
"release": "aegir release"
},
"dependencies": {
"@multiformats/multiaddr": "^10.1.5",
"err-code": "^3.0.1",
"interface-datastore": "^6.1.0",
"multiformats": "^9.6.3"
},
"devDependencies": {
"aegir": "^36.1.3"
"aegir": "^37.0.6"
}
}
20 changes: 10 additions & 10 deletions packages/libp2p-interfaces/src/pubsub/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ export interface Message {
}

export interface PubSubRPCMessage {
from?: Uint8Array | null
topic?: string | null
data?: Uint8Array | null
sequenceNumber?: Uint8Array | null
signature?: Uint8Array | null
key?: Uint8Array | null
from?: Uint8Array
topic?: string
data?: Uint8Array
sequenceNumber?: Uint8Array
signature?: Uint8Array
key?: Uint8Array
}

export interface PubSubRPCSubscription {
subscribe?: boolean | null
topic?: string | null
subscribe?: boolean
topic?: string
}

export interface PubSubRPC {
subscriptions?: PubSubRPCSubscription[] | null
messages?: PubSubRPCMessage[] | null
subscriptions: PubSubRPCSubscription[]
messages: PubSubRPCMessage[]
}

export interface PeerStreams extends EventEmitter<PeerStreamEvents> {
Expand Down
4 changes: 1 addition & 3 deletions packages/libp2p-interfaces/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020"
"outDir": "dist"
},
"include": [
"src"
Expand Down
23 changes: 12 additions & 11 deletions packages/libp2p-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test/*.js -f ./dist/test/**/*.js",
"test:chrome": "npm run test -- -t browser",
"test:chrome-webworker": "npm run test -- -t webworker",
"test:firefox": "npm run test -- -t browser -- --browser firefox",
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
"test:node": "npm run test -- -t node --cov",
"test:electron-main": "npm run test -- -t electron-main"
"dep-check": "aegir dep-check",
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
},
"dependencies": {
"@libp2p/interfaces": "^1.3.0",
Expand All @@ -139,6 +140,6 @@
},
"devDependencies": {
"@types/debug": "^4.1.7",
"aegir": "^36.1.3"
"aegir": "^37.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/libp2p-logger/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { logger } from '../src/index.js'

describe('logger', () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/libp2p-logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020"
"outDir": "dist"
},
"include": [
"src",
Expand Down
Loading