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

Commit

Permalink
feat: update package names (#133)
Browse files Browse the repository at this point in the history
Publish typescript packages under the `@libp2p` org on npm
  • Loading branch information
achingbrain authored Jan 4, 2022
1 parent d9c2077 commit 337adc9
Show file tree
Hide file tree
Showing 72 changed files with 145 additions and 145 deletions.
2 changes: 1 addition & 1 deletion packages/libp2p-connection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm i libp2p-connection
```

```javascript
import { Connection } from 'libp2p-connection'
import { Connection } from '@libp2p/connection'

const connection = new Connection({ ... })
const stream = connection.newStream([ '/my-protocol/v1.0.0' ])
Expand Down
10 changes: 5 additions & 5 deletions packages/libp2p-connection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libp2p-connection",
"version": "0.3.1",
"name": "@libp2p/connection",
"version": "0.1.0",
"description": "JS Libp2p connections",
"type": "module",
"files": [
Expand Down Expand Up @@ -43,13 +43,13 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-connection#readme",
"dependencies": {
"@libp2p/interfaces": "^0.1.0",
"err-code": "^3.0.1",
"libp2p-interfaces": "^3.1.1",
"multiaddr": "^10.0.1"
},
"devDependencies": {
"aegir": "^36.0.0",
"libp2p-peer-id-factory": "^0.2.1"
"@libp2p/peer-id-factory": "^0.1.0",
"aegir": "^36.0.0"
},
"exports": {
".": {
Expand Down
8 changes: 4 additions & 4 deletions packages/libp2p-connection/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Multiaddr } from 'multiaddr'
import errCode from 'err-code'
import { OPEN, CLOSING, CLOSED } from 'libp2p-interfaces/connection/status'
import type { MuxedStream } from 'libp2p-interfaces/stream-muxer'
import type { ConnectionStat, StreamData } from 'libp2p-interfaces/connection'
import type { PeerId } from 'libp2p-interfaces/peer-id'
import { OPEN, CLOSING, CLOSED } from '@libp2p/interfaces/connection/status'
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer'
import type { ConnectionStat, StreamData } from '@libp2p/interfaces/connection'
import type { PeerId } from '@libp2p/interfaces/peer-id'

const connectionSymbol = Symbol.for('@libp2p/interface-connection/connection')

Expand Down
4 changes: 2 additions & 2 deletions packages/libp2p-connection/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Connection } from '../src/index.js'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
// @ts-expect-error no types
import pair from 'it-pair'
import { Multiaddr } from 'multiaddr'
import type { MuxedStream } from 'libp2p-interfaces/stream-muxer'
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer'

const peers = [{
id: 'QmNMMAqSxPetRS1cVMmutW5BCN1qQQyEr4u98kUvZjcfEw',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libp2p-interfaces-compliance-tests",
"version": "3.1.1",
"name": "@libp2p/interface-compliance-tests",
"version": "0.1.0",
"description": "Compliance tests for JS libp2p interfaces",
"type": "module",
"files": [
Expand Down Expand Up @@ -41,6 +41,12 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces-compliance-tests#readme",
"dependencies": {
"@libp2p/connection": "^0.1.0",
"@libp2p/interfaces": "^0.1.0",
"@libp2p/peer-id": "^0.1.0",
"@libp2p/peer-id-factory": "^0.1.0",
"@libp2p/pubsub": "^0.1.0",
"@libp2p/topology": "^0.1.0",
"abort-controller": "^3.0.0",
"abortable-iterator": "^3.0.0",
"aegir": "^36.0.0",
Expand All @@ -50,13 +56,7 @@
"it-goodbye": "^3.0.0",
"it-pair": "^1.0.0",
"it-pipe": "^1.1.0",
"libp2p-connection": "^0.3.1",
"libp2p-crypto": "^0.21.0",
"libp2p-interfaces": "^3.1.1",
"libp2p-peer-id": "^0.2.0",
"libp2p-peer-id-factory": "^0.2.1",
"libp2p-pubsub": "^0.9.1",
"libp2p-topology": "^0.3.1",
"multiaddr": "^10.0.0",
"multiformats": "^9.4.10",
"p-defer": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import type { TestSetup } from '../index.js'
import type { Connection } from 'libp2p-interfaces/connection'
import type { Connection } from '@libp2p/interfaces/connection'

export default (test: TestSetup<Connection>) => {
describe('connection', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import connectionSuite from './connection.js'
import type { TestSetup } from '../index.js'
import type { Connection } from 'libp2p-interfaces/connection'
import type { Connection } from '@libp2p/interfaces/connection'

export default (test: TestSetup<Connection>) => {
connectionSuite(test)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { expect } from 'aegir/utils/chai.js'
// @ts-expect-error no types
import duplexPair from 'it-pair/duplex.js'
import { pipe } from 'it-pipe'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import { collect } from 'streaming-iterables'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import peers from '../utils/peers.js'
import { UnexpectedPeerError } from 'libp2p-interfaces/crypto/errors'
import { UnexpectedPeerError } from '@libp2p/interfaces/crypto/errors'
import type { TestSetup } from '../index.js'
import type { Crypto } from 'libp2p-interfaces/crypto'
import type { PeerId } from 'libp2p-interfaces/peer-id'
import type { Crypto } from '@libp2p/interfaces/crypto'
import type { PeerId } from '@libp2p/interfaces/peer-id'

export default (common: TestSetup<Crypto>) => {
describe('interface-crypto compliance tests', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Multiaddr } from 'multiaddr'
import delay from 'delay'
import pDefer from 'p-defer'
import type { TestSetup } from '../index.js'
import type { PeerDiscovery } from 'libp2p-interfaces/peer-discovery'
import type { Startable } from 'libp2p-interfaces'
import type { PeerDiscovery } from '@libp2p/interfaces/peer-discovery'
import type { Startable } from '@libp2p/interfaces'

export default (common: TestSetup<PeerDiscovery & Startable>) => {
describe('interface-peer-discovery compliance tests', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import pDefer from 'p-defer'
import pWaitFor from 'p-wait-for'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { TestSetup } from '../index.js'
import type { PubSub, Message } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub, Message } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

const topic = 'foo'
const data = uint8ArrayFromString('bar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { expectSet } from './utils.js'
import type { TestSetup } from '../index.js'
import type { PubSub, Message } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub, Message } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

export default (common: TestSetup<PubSub & Startable>) => {
describe('pubsub connection handlers', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { TestSetup } from '../index.js'
import type { PubSub, PubsubOptions } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub, PubsubOptions } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

const topic = 'foo'
const data = uint8ArrayFromString('bar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import connectionHandlersTest from './connection-handlers.js'
import twoNodesTest from './two-nodes.js'
import multipleNodesTest from './multiple-nodes.js'
import type { TestSetup } from '../index.js'
import type { PubSub } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

export default (common: TestSetup<PubSub & Startable>) => {
describe('interface-pubsub compliance tests', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import * as utils from 'libp2p-pubsub/utils'
import { PeerStreams } from 'libp2p-pubsub/peer-streams'
import * as utils from '@libp2p/pubsub/utils'
import { PeerStreams } from '@libp2p/pubsub/peer-streams'
import type { TestSetup } from '../index.js'
import type { PubSub } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

const topic = 'foo'
const data = uint8ArrayFromString('bar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { expectSet } from './utils.js'
import type { TestSetup } from '../index.js'
import type { PubSub, Message } from 'libp2p-interfaces/pubsub'
import type { Startable } from 'libp2p-interfaces'
import type { PubSub, Message } from '@libp2p/interfaces/pubsub'
import type { Startable } from '@libp2p/interfaces'

export default (common: TestSetup<PubSub & Startable>) => {
describe('pubsub with multiple nodes', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import pWaitFor from 'p-wait-for'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { TestSetup } from '../index.js'
import type { PubSub, Message } from 'libp2p-interfaces/pubsub'
import type { PubSub, Message } from '@libp2p/interfaces/pubsub'
import {
first,
expectSet
} from './utils.js'
import type { Startable } from 'libp2p-interfaces'
import type { Startable } from '@libp2p/interfaces'

const topic = 'foo'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'aegir/utils/chai.js'
import type { TestSetup } from '../index.js'
import type { Record } from 'libp2p-interfaces/record'
import type { Record } from '@libp2p/interfaces/record'

export default (test: TestSetup<Record>) => {
describe('record', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pipe } from 'it-pipe'
import { collect, map, consume } from 'streaming-iterables'
import defer from 'p-defer'
import type { TestSetup } from '../index.js'
import type { Muxer, MuxerOptions, MuxedStream } from 'libp2p-interfaces/stream-muxer'
import type { Muxer, MuxerOptions, MuxedStream } from '@libp2p/interfaces/stream-muxer'
import { isValidTick } from '../transport/utils/index.js'

function close (stream: MuxedStream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { source, duplex } from 'abortable-iterator'
import AbortController from 'abort-controller'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { TestSetup } from '../index.js'
import type { Muxer, MuxerOptions } from 'libp2p-interfaces/stream-muxer'
import type { Connection } from 'libp2p-interfaces/connection'
import type { Muxer, MuxerOptions } from '@libp2p/interfaces/stream-muxer'
import type { Connection } from '@libp2p/interfaces/connection'

async function pause (ms: number) {
return await new Promise(resolve => setTimeout(resolve, ms))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import closeTest from './close-test.js'
import stressTest from './stress-test.js'
import megaStressTest from './mega-stress-test.js'
import type { TestSetup } from '../index.js'
import type { Muxer } from 'libp2p-interfaces/stream-muxer'
import type { Muxer } from '@libp2p/interfaces/stream-muxer'

export default (common: TestSetup<Muxer>) => {
describe('interface-stream-muxer', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import spawn from './spawner'
import type { TestSetup } from '../index.js'
import type { Muxer, MuxerOptions } from 'libp2p-interfaces/stream-muxer'
import type { Muxer, MuxerOptions } from '@libp2p/interfaces/stream-muxer'

export default (common: TestSetup<Muxer, MuxerOptions>) => {
const createMuxer = async (opts?: MuxerOptions) => await common.setup(opts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import pair from 'it-pair/duplex.js'
import { pipe } from 'it-pipe'
import pLimit from 'p-limit'
import { collect, consume } from 'streaming-iterables'
import type { Muxer, MuxerOptions } from 'libp2p-interfaces/stream-muxer'
import type { Muxer, MuxerOptions } from '@libp2p/interfaces/stream-muxer'

export default async (createMuxer: (options?: MuxerOptions) => Promise<Muxer>, nStreams: number, nMsg: number, limit?: number) => {
const [dialerSocket, listenerSocket] = pair()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import spawn from './spawner'
import type { TestSetup } from '../index.js'
import type { Muxer, MuxerOptions } from 'libp2p-interfaces/stream-muxer'
import type { Muxer, MuxerOptions } from '@libp2p/interfaces/stream-muxer'

export default (common: TestSetup<Muxer, MuxerOptions>) => {
const createMuxer = async (opts?: MuxerOptions) => await common.setup(opts)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import peers from '../utils/peers.js'
import type { TestSetup } from '../index.js'
import type { MulticodecTopology } from 'libp2p-interfaces/topology'
import type { PeerId } from 'libp2p-interfaces/peer-id'
import type { MulticodecTopology } from '@libp2p/interfaces/topology'
import type { PeerId } from '@libp2p/interfaces/peer-id'

export default (test: TestSetup<MulticodecTopology>) => {
describe('multicodec topology', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import peers from '../utils/peers.js'
import type { TestSetup } from '../index.js'
import type { Topology } from 'libp2p-interfaces/topology'
import type { PeerId } from 'libp2p-interfaces/peer-id'
import type { Topology } from '@libp2p/interfaces/topology'
import type { PeerId } from '@libp2p/interfaces/peer-id'

export default (test: TestSetup<Topology>) => {
describe('topology', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import goodbye from 'it-goodbye'
import { collect } from 'streaming-iterables'
import { pipe } from 'it-pipe'
import AbortController from 'abort-controller'
import { AbortError } from 'libp2p-interfaces/errors'
import { AbortError } from '@libp2p/interfaces/errors'
import sinon from 'sinon'
import type { TestSetup } from '../index.js'
import type { Transport, Listener } from 'libp2p-interfaces/transport'
import type { Transport, Listener } from '@libp2p/interfaces/transport'
import type { TransportTestFixtures, SetupArgs, Connector } from './index.js'
import type { Multiaddr } from 'multiaddr'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'aegir/utils/chai.js'
import { mockUpgrader } from './utils/index.js'
import type { TestSetup } from '../index.js'
import type { Transport } from 'libp2p-interfaces/transport'
import type { Transport } from '@libp2p/interfaces/transport'
import type { TransportTestFixtures, SetupArgs } from './index.js'
import type { Multiaddr } from 'multiaddr'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dial from './dial-test.js'
import listen from './listen-test.js'
import filter from './filter-test.js'
import type { TestSetup } from '../index.js'
import type { Transport, Upgrader } from 'libp2p-interfaces/transport'
import type { Transport, Upgrader } from '@libp2p/interfaces/transport'
import type { Multiaddr } from 'multiaddr'

export interface Connector {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { isValidTick, mockUpgrader } from './utils/index.js'
import defer from 'p-defer'
import type { TestSetup } from '../index.js'
import type { Transport } from 'libp2p-interfaces/transport'
import type { Transport } from '@libp2p/interfaces/transport'
import type { TransportTestFixtures, SetupArgs } from './index.js'
import type { Multiaddr } from 'multiaddr'
import type { Connection } from 'libp2p-interfaces/connection'
import type { Connection } from '@libp2p/interfaces/connection'

export default (common: TestSetup<TransportTestFixtures, SetupArgs>) => {
describe('listen', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'aegir/utils/chai.js'
import type { Upgrader, MultiaddrConnection } from 'libp2p-interfaces/transport'
import type { Connection, StreamData } from 'libp2p-interfaces/connection'
import type { MuxedStream } from 'libp2p-interfaces/stream-muxer'
import type { Upgrader, MultiaddrConnection } from '@libp2p/interfaces/transport'
import type { Connection, StreamData } from '@libp2p/interfaces/connection'
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer'
// @ts-expect-error no types
import pair from 'it-pair'
import { PeerId } from 'libp2p-peer-id'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import { PeerId } from '@libp2p/peer-id'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
/**
* A tick is considered valid if it happened between now
* and `ms` milliseconds ago
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import tests from '../../src/connection/index.js'
import { Connection } from 'libp2p-connection'
import { Connection } from '@libp2p/connection'
import peers from '../../src/utils/peers.js'
import * as PeerIdFactory from 'libp2p-peer-id-factory'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import { Multiaddr } from 'multiaddr'
// @ts-expect-error no types
import pair from 'it-pair'
import type { MuxedStream } from 'libp2p-interfaces/stream-muxer'
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer'

describe('compliance tests', () => {
tests({
Expand Down
Loading

0 comments on commit 337adc9

Please sign in to comment.