diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 3f3fe3e0e8..b8806f547f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `@multiformats/multiaddr` as peer dependency. +### Changed + +- `waitForRemotePeer` can now be directly imported from `@waku/core`. + ## @waku/core [0.0.6](https://github.com/waku-org/js-waku/compare/@waku/core@0.0.5...@waku/core@0.0.6) (2022-11-18) ### Added diff --git a/packages/core/package.json b/packages/core/package.json index 43d058a372..5c83f5f243 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,10 +13,6 @@ "types": "./dist/lib/predefined_bootstrap_nodes.d.ts", "import": "./dist/lib/predefined_bootstrap_nodes.js" }, - "./lib/wait_for_remote_peer": { - "types": "./dist/lib/wait_for_remote_peer.d.ts", - "import": "./dist/lib/wait_for_remote_peer.js" - }, "./lib/waku_message/version_0": { "types": "./dist/lib/waku_message/version_0.d.ts", "import": "./dist/lib/waku_message/version_0.js" diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index fd47526e18..1a9240bbe7 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -1,12 +1,11 @@ -import { nodeResolve } from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import json from "@rollup/plugin-json"; +import { nodeResolve } from "@rollup/plugin-node-resolve"; export default { input: { index: "dist/index.js", "lib/predefined_bootstrap_nodes": "dist/lib/predefined_bootstrap_nodes.js", - "lib/wait_for_remote_peer": "dist/lib/wait_for_remote_peer.js", "lib/waku_message/version_0": "dist/lib/waku_message/version_0.js", "lib/waku_message/topic_only_message": "dist/lib/waku_message/topic_only_message.js", diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index be64f04783..8fc48aaa5e 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -33,3 +33,5 @@ export { StoreCodec, createCursor, } from "./lib/waku_store/index.js"; + +export { waitForRemotePeer } from "./lib/wait_for_remote_peer.js"; diff --git a/packages/tests/tests/enr.node.spec.ts b/packages/tests/tests/enr.node.spec.ts index 3e85ce269c..517007d44b 100644 --- a/packages/tests/tests/enr.node.spec.ts +++ b/packages/tests/tests/enr.node.spec.ts @@ -1,4 +1,4 @@ -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { waitForRemotePeer } from "@waku/core"; import { createPrivacyNode } from "@waku/create"; import { ENR } from "@waku/enr"; import type { WakuPrivacy } from "@waku/interfaces"; diff --git a/packages/tests/tests/ephemeral.node.spec.ts b/packages/tests/tests/ephemeral.node.spec.ts index 73f631ba55..755820017f 100644 --- a/packages/tests/tests/ephemeral.node.spec.ts +++ b/packages/tests/tests/ephemeral.node.spec.ts @@ -1,8 +1,13 @@ import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { createDecoder, createEncoder, DecodedMessage } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { + createDecoder, + createEncoder, + DecodedMessage, + waitForRemotePeer, +} from "@waku/core"; import { createLightNode } from "@waku/create"; -import { Protocols, WakuLight } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; +import type { WakuLight } from "@waku/interfaces"; import { createDecoder as eciesDecoder, createEncoder as eciesEncoder, diff --git a/packages/tests/tests/filter.node.spec.ts b/packages/tests/tests/filter.node.spec.ts index f1d456c906..0b97563264 100644 --- a/packages/tests/tests/filter.node.spec.ts +++ b/packages/tests/tests/filter.node.spec.ts @@ -1,6 +1,5 @@ import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { createDecoder, createEncoder } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core"; import { createLightNode } from "@waku/create"; import type { DecodedMessage, WakuLight } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; diff --git a/packages/tests/tests/light_push.node.spec.ts b/packages/tests/tests/light_push.node.spec.ts index d61f2cb63f..2a4f11c81a 100644 --- a/packages/tests/tests/light_push.node.spec.ts +++ b/packages/tests/tests/light_push.node.spec.ts @@ -1,6 +1,5 @@ import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { createEncoder } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { createEncoder, waitForRemotePeer } from "@waku/core"; import { createLightNode } from "@waku/create"; import type { WakuLight } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; diff --git a/packages/tests/tests/relay.node.spec.ts b/packages/tests/tests/relay.node.spec.ts index 519c539f35..764813dceb 100644 --- a/packages/tests/tests/relay.node.spec.ts +++ b/packages/tests/tests/relay.node.spec.ts @@ -1,8 +1,12 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { DefaultPubSubTopic } from "@waku/core"; -import { createDecoder, createEncoder, DecodedMessage } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { + createDecoder, + createEncoder, + DecodedMessage, + DefaultPubSubTopic, + waitForRemotePeer, +} from "@waku/core"; import { createPrivacyNode } from "@waku/create"; import type { WakuPrivacy } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; diff --git a/packages/tests/tests/store.node.spec.ts b/packages/tests/tests/store.node.spec.ts index 9907d35b4c..5a3ef35735 100644 --- a/packages/tests/tests/store.node.spec.ts +++ b/packages/tests/tests/store.node.spec.ts @@ -1,9 +1,13 @@ import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { createCursor, PageDirection } from "@waku/core"; -import { createDecoder, createEncoder } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { + createCursor, + createDecoder, + createEncoder, + PageDirection, + waitForRemotePeer, +} from "@waku/core"; import { createLightNode } from "@waku/create"; -import { DecodedMessage, Message, WakuLight } from "@waku/interfaces"; +import type { DecodedMessage, Message, WakuLight } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; import { createDecoder as createEciesDecoder, diff --git a/packages/tests/tests/wait_for_remote_peer.node.spec.ts b/packages/tests/tests/wait_for_remote_peer.node.spec.ts index 8adf521525..0fa96d6fff 100644 --- a/packages/tests/tests/wait_for_remote_peer.node.spec.ts +++ b/packages/tests/tests/wait_for_remote_peer.node.spec.ts @@ -1,4 +1,4 @@ -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { waitForRemotePeer } from "@waku/core"; import { createLightNode, createPrivacyNode } from "@waku/create"; import type { WakuLight, WakuPrivacy } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; diff --git a/packages/tests/tests/waku.node.spec.ts b/packages/tests/tests/waku.node.spec.ts index 37e4e080c5..5391297c15 100644 --- a/packages/tests/tests/waku.node.spec.ts +++ b/packages/tests/tests/waku.node.spec.ts @@ -1,8 +1,7 @@ import { bootstrap } from "@libp2p/bootstrap"; import type { PeerId } from "@libp2p/interface-peer-id"; import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { DefaultUserAgent } from "@waku/core"; -import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { DefaultUserAgent, waitForRemotePeer } from "@waku/core"; import { createLightNode, createPrivacyNode } from "@waku/create"; import type { DecodedMessage,