From 6ed728947ef4d30754f61234ba07994a1f0b0e9d Mon Sep 17 00:00:00 2001 From: achingbrain Date: Thu, 24 Aug 2023 09:28:39 +0100 Subject: [PATCH] chore: update deps --- packages/interop/package.json | 28 +++++++++---------- packages/interop/test/dht.spec.ts | 6 ++-- .../test/fixtures/create-helia.browser.ts | 2 +- .../interop/test/fixtures/create-peer-ids.ts | 2 +- packages/interop/test/fixtures/key-types.ts | 2 +- packages/interop/test/pubsub.spec.ts | 2 +- packages/ipns/package.json | 13 ++++----- packages/ipns/src/index.ts | 6 ++-- packages/ipns/src/routing/dht.ts | 2 +- packages/ipns/src/routing/index.ts | 2 +- packages/ipns/src/routing/local-store.ts | 2 +- packages/ipns/src/routing/pubsub.ts | 6 ++-- .../src/utils/resolve-dns-link.browser.ts | 2 +- packages/ipns/src/utils/resolve-dns-link.ts | 2 +- 14 files changed, 36 insertions(+), 41 deletions(-) diff --git a/packages/interop/package.json b/packages/interop/package.json index 663eeb4..5f762e0 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -48,24 +48,22 @@ "test:electron-main": "aegir test -t electron-main" }, "devDependencies": { - "@chainsafe/libp2p-gossipsub": "^8.0.0", - "@chainsafe/libp2p-noise": "^12.0.1", - "@chainsafe/libp2p-yamux": "^4.0.2", - "@helia/interface": "^1.0.0", + "@chainsafe/libp2p-gossipsub": "^10.1.0", + "@chainsafe/libp2p-noise": "^13.0.0", + "@chainsafe/libp2p-yamux": "^5.0.0", + "@helia/interface": "^2.0.0", "@helia/ipns": "^1.0.0", - "@libp2p/interface-libp2p": "^3.2.0", - "@libp2p/interface-peer-id": "^2.0.1", - "@libp2p/interface-pubsub": "^4.0.1", - "@libp2p/kad-dht": "^9.3.4", - "@libp2p/peer-id": "^2.0.1", - "@libp2p/peer-id-factory": "^2.0.1", - "@libp2p/tcp": "^7.0.1", - "@libp2p/websockets": "^6.0.1", + "@libp2p/interface": "^0.1.2", + "@libp2p/kad-dht": "^10.0.4", + "@libp2p/peer-id": "^3.0.2", + "@libp2p/peer-id-factory": "^3.0.3", + "@libp2p/tcp": "^8.0.4", + "@libp2p/websockets": "^7.0.4", "aegir": "^40.0.8", "blockstore-core": "^4.0.1", "datastore-core": "^9.0.3", - "go-ipfs": "^0.20.0", - "helia": "^1.0.0", + "go-ipfs": "^0.22.0", + "helia": "^2.0.1", "ipfsd-ctl": "^13.0.0", "ipns": "^6.0.0", "it-all": "^3.0.2", @@ -74,7 +72,7 @@ "kubo-rpc-client": "^3.0.0", "libp2p": "^0.46.6", "merge-options": "^3.0.4", - "multiformats": "^11.0.1", + "multiformats": "^12.0.1", "uint8arrays": "^4.0.3", "wherearewe": "^2.0.1" }, diff --git a/packages/interop/test/dht.spec.ts b/packages/interop/test/dht.spec.ts index 5dbff01..6c07ea3 100644 --- a/packages/interop/test/dht.spec.ts +++ b/packages/interop/test/dht.spec.ts @@ -2,7 +2,7 @@ import { ipns } from '@helia/ipns' import { dht } from '@helia/ipns/routing' -import { type KadDHT, kadDHT } from '@libp2p/kad-dht' +import { kadDHT, type DualKadDHT } from '@libp2p/kad-dht' import { createEd25519PeerId, createRSAPeerId, createSecp256k1PeerId } from '@libp2p/peer-id-factory' import { expect } from 'aegir/chai' import { ipnsSelector } from 'ipns/selector' @@ -23,13 +23,13 @@ import { keyTypes } from './fixtures/key-types.js' import { waitFor } from './fixtures/wait-for.js' import type { Helia } from '@helia/interface' import type { IPNS } from '@helia/ipns' -import type { Libp2p } from '@libp2p/interface-libp2p' +import type { Libp2p } from '@libp2p/interface' import type { Controller } from 'ipfsd-ctl' import type { PeerId } from 'kubo-rpc-client/dist/src/types.js' keyTypes.forEach(type => { describe(`dht routing with ${type} keys`, () => { - let helia: Helia> + let helia: Helia> let kubo: Controller let name: IPNS diff --git a/packages/interop/test/fixtures/create-helia.browser.ts b/packages/interop/test/fixtures/create-helia.browser.ts index f24c351..a958301 100644 --- a/packages/interop/test/fixtures/create-helia.browser.ts +++ b/packages/interop/test/fixtures/create-helia.browser.ts @@ -7,7 +7,7 @@ import { MemoryDatastore } from 'datastore-core' import { createHelia } from 'helia' import { createLibp2p, type Libp2pOptions } from 'libp2p' import type { Helia } from '@helia/interface' -import type { Libp2p } from '@libp2p/interface-libp2p' +import type { Libp2p } from '@libp2p/interface' export async function createHeliaNode (config: Libp2pOptions = {}): Promise>> { const blockstore = new MemoryBlockstore() diff --git a/packages/interop/test/fixtures/create-peer-ids.ts b/packages/interop/test/fixtures/create-peer-ids.ts index 36403d8..01faee2 100644 --- a/packages/interop/test/fixtures/create-peer-ids.ts +++ b/packages/interop/test/fixtures/create-peer-ids.ts @@ -3,7 +3,7 @@ import map from 'it-map' import { sha256 } from 'multiformats/hashes/sha2' import { compare as uint8ArrayCompare } from 'uint8arrays/compare' import { xor as uint8ArrayXor } from 'uint8arrays/xor' -import type { PeerId } from '@libp2p/interface-peer-id' +import type { PeerId } from '@libp2p/interface/peer-id' /** * Sort peers by distance to the KadID of the passed buffer diff --git a/packages/interop/test/fixtures/key-types.ts b/packages/interop/test/fixtures/key-types.ts index 78b60e3..4cd7991 100644 --- a/packages/interop/test/fixtures/key-types.ts +++ b/packages/interop/test/fixtures/key-types.ts @@ -1,4 +1,4 @@ -import type { PeerIdType } from '@libp2p/interface-peer-id' +import type { PeerIdType } from '@libp2p/interface/peer-id' export const keyTypes: PeerIdType[] = [ 'Ed25519', diff --git a/packages/interop/test/pubsub.spec.ts b/packages/interop/test/pubsub.spec.ts index 9180d35..f9826d1 100644 --- a/packages/interop/test/pubsub.spec.ts +++ b/packages/interop/test/pubsub.spec.ts @@ -23,7 +23,7 @@ import { keyTypes } from './fixtures/key-types.js' import { waitFor } from './fixtures/wait-for.js' import type { Helia } from '@helia/interface' import type { IPNS } from '@helia/ipns' -import type { PubSub } from '@libp2p/interface-pubsub' +import type { PubSub } from '@libp2p/interface/pubsub' import type { Controller } from 'ipfsd-ctl' import type { Libp2p } from 'libp2p' diff --git a/packages/ipns/package.json b/packages/ipns/package.json index af4d12d..92b880f 100644 --- a/packages/ipns/package.json +++ b/packages/ipns/package.json @@ -155,24 +155,21 @@ "release": "aegir release" }, "dependencies": { - "@libp2p/interface-content-routing": "^2.1.0", - "@libp2p/interface-peer-id": "^2.0.1", - "@libp2p/interface-pubsub": "^4.0.1", - "@libp2p/interfaces": "^3.3.1", - "@libp2p/logger": "^2.0.6", - "@libp2p/peer-id": "^2.0.1", + "@libp2p/interface": "^0.1.2", + "@libp2p/logger": "^3.0.2", + "@libp2p/peer-id": "^3.0.2", "@libp2p/record": "^3.0.0", "hashlru": "^2.3.0", "interface-datastore": "^8.0.0", "ipns": "^6.0.0", "is-ipfs": "^8.0.1", - "multiformats": "^11.0.1", + "multiformats": "^12.0.1", "p-queue": "^7.3.0", "progress-events": "^1.0.0", "uint8arrays": "^4.0.3" }, "devDependencies": { - "@libp2p/peer-id-factory": "^2.0.1", + "@libp2p/peer-id-factory": "^3.0.3", "aegir": "^40.0.8", "datastore-core": "^9.0.3", "sinon": "^15.0.1", diff --git a/packages/ipns/src/index.ts b/packages/ipns/src/index.ts index 1686b19..b4c3022 100644 --- a/packages/ipns/src/index.ts +++ b/packages/ipns/src/index.ts @@ -62,8 +62,8 @@ * ``` */ -import { isPeerId, type PeerId } from '@libp2p/interface-peer-id' -import { CodeError } from '@libp2p/interfaces/errors' +import { isPeerId, type PeerId } from '@libp2p/interface/peer-id' +import { CodeError } from '@libp2p/interface/errors' import { logger } from '@libp2p/logger' import { peerIdFromString } from '@libp2p/peer-id' import { create, marshal, peerIdToRoutingKey, unmarshal } from 'ipns' @@ -76,7 +76,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { localStore, type LocalStore } from './routing/local-store.js' import { resolveDnslink } from './utils/resolve-dns-link.js' import type { IPNSRouting, IPNSRoutingEvents } from './routing/index.js' -import type { AbortOptions } from '@libp2p/interfaces' +import type { AbortOptions } from '@libp2p/interface' import type { Datastore } from 'interface-datastore' import type { IPNSEntry } from 'ipns' import type { ProgressEvent, ProgressOptions } from 'progress-events' diff --git a/packages/ipns/src/routing/dht.ts b/packages/ipns/src/routing/dht.ts index 2b970cb..ea13b79 100644 --- a/packages/ipns/src/routing/dht.ts +++ b/packages/ipns/src/routing/dht.ts @@ -1,7 +1,7 @@ import { CustomProgressEvent, type ProgressEvent } from 'progress-events' import type { GetOptions, PutOptions } from './index.js' import type { IPNSRouting } from '../index.js' -import type { ContentRouting } from '@libp2p/interface-content-routing' +import type { ContentRouting } from '@libp2p/interface/content-routing' export interface DHTRoutingComponents { libp2p: { diff --git a/packages/ipns/src/routing/index.ts b/packages/ipns/src/routing/index.ts index bc0659b..d7021d5 100644 --- a/packages/ipns/src/routing/index.ts +++ b/packages/ipns/src/routing/index.ts @@ -1,7 +1,7 @@ import type { DHTProgressEvents } from './dht.js' import type { DatastoreProgressEvents } from './local-store.js' import type { PubSubProgressEvents } from './pubsub.js' -import type { AbortOptions } from '@libp2p/interfaces' +import type { AbortOptions } from '@libp2p/interface' import type { ProgressOptions } from 'progress-events' export interface PutOptions extends AbortOptions, ProgressOptions { diff --git a/packages/ipns/src/routing/local-store.ts b/packages/ipns/src/routing/local-store.ts index eef3f41..9b80a46 100644 --- a/packages/ipns/src/routing/local-store.ts +++ b/packages/ipns/src/routing/local-store.ts @@ -3,7 +3,7 @@ import { type Datastore, Key } from 'interface-datastore' import { CustomProgressEvent, type ProgressEvent } from 'progress-events' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import type { GetOptions, IPNSRouting, PutOptions } from '../routing' -import type { AbortOptions } from '@libp2p/interfaces' +import type { AbortOptions } from '@libp2p/interface' function dhtRoutingKey (key: Uint8Array): Key { return new Key('/dht/record/' + uint8ArrayToString(key, 'base32'), false) diff --git a/packages/ipns/src/routing/pubsub.ts b/packages/ipns/src/routing/pubsub.ts index 83a57e4..9b08141 100644 --- a/packages/ipns/src/routing/pubsub.ts +++ b/packages/ipns/src/routing/pubsub.ts @@ -1,4 +1,4 @@ -import { CodeError } from '@libp2p/interfaces/errors' +import { CodeError } from '@libp2p/interface/errors' import { logger } from '@libp2p/logger' import { peerIdToRoutingKey } from 'ipns' import { ipnsSelector } from 'ipns/selector' @@ -9,8 +9,8 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { localStore, type LocalStore } from './local-store.js' import type { GetOptions, IPNSRouting, PutOptions } from './index.js' -import type { PeerId } from '@libp2p/interface-peer-id' -import type { Message, PublishResult, PubSub } from '@libp2p/interface-pubsub' +import type { PeerId } from '@libp2p/interface/peer-id' +import type { Message, PublishResult, PubSub } from '@libp2p/interface/pubsub' import type { Datastore } from 'interface-datastore' const log = logger('helia:ipns:routing:pubsub') diff --git a/packages/ipns/src/utils/resolve-dns-link.browser.ts b/packages/ipns/src/utils/resolve-dns-link.browser.ts index 4035ca6..3a6d707 100644 --- a/packages/ipns/src/utils/resolve-dns-link.browser.ts +++ b/packages/ipns/src/utils/resolve-dns-link.browser.ts @@ -2,7 +2,7 @@ import PQueue from 'p-queue' import { TLRU } from './tlru.js' -import type { AbortOptions } from '@libp2p/interfaces' +import type { AbortOptions } from '@libp2p/interface' // Avoid sending multiple queries for the same hostname by caching results const cache = new TLRU<{ Path: string, Message: string }>(1000) diff --git a/packages/ipns/src/utils/resolve-dns-link.ts b/packages/ipns/src/utils/resolve-dns-link.ts index d77cf2d..1975cf9 100644 --- a/packages/ipns/src/utils/resolve-dns-link.ts +++ b/packages/ipns/src/utils/resolve-dns-link.ts @@ -1,7 +1,7 @@ import dns from 'dns' import { promisify } from 'util' import * as isIPFS from 'is-ipfs' -import type { AbortOptions } from '@libp2p/interfaces' +import type { AbortOptions } from '@libp2p/interface' const MAX_RECURSIVE_DEPTH = 32