feat!: rename package from @waku/create to @waku/sdk (#1386)

* feat!(@waku/sdk): rename package from @waku/create to @waku/sdk

* feat: proxy @waku/core and @waku/utils through @waku/sdk

* address comments

* update package-lock

* Update .size-limit.cjs

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* integrate to release please

---------

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
Co-authored-by: Sasha <oleksandr@status.im>
This commit is contained in:
Danish Arora 2023-06-05 17:10:13 +05:30 committed by GitHub
parent 259b39f207
commit 951ebdac9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 209 additions and 107 deletions

View File

@ -8,6 +8,5 @@
"packages/core": "0.0.19",
"packages/dns-discovery": "0.0.13",
"packages/message-encryption": "0.0.17",
"packages/create": "0.0.15",
"packages/relay": "0.0.2"
}

View File

@ -5,12 +5,11 @@ module.exports = [
import: "{ WakuNode }",
},
{
name: "Waku default setup",
path: ["packages/create/bundle/index.js", "packages/core/bundle/index.js"],
name: "Waku Simple Light Node",
path: ["packages/sdk/bundle/index.js", "packages/core/bundle/index.js"],
import: {
"packages/create/bundle/index.js": "{ createLightNode }",
"packages/core/bundle/index.js":
"{ waitForRemotePeer, createEncoder, createDecoder }",
"packages/sdk/bundle/index.js":
"{ createLightNode, waitForRemotePeer, createEncoder, createDecoder, bytesToUtf8, utf8ToBytes, Decoder, Encoder, DecodedMessage, WakuNode }",
},
},
{

246
package-lock.json generated
View File

@ -16,7 +16,7 @@
"packages/peer-exchange",
"packages/dns-discovery",
"packages/message-encryption",
"packages/create",
"packages/sdk",
"packages/tests",
"packages/build-utils"
],
@ -7201,10 +7201,6 @@
"resolved": "packages/core",
"link": true
},
"node_modules/@waku/create": {
"resolved": "packages/create",
"link": true
},
"node_modules/@waku/dns-discovery": {
"resolved": "packages/dns-discovery",
"link": true
@ -7237,6 +7233,10 @@
"resolved": "packages/relay",
"link": true
},
"node_modules/@waku/sdk": {
"resolved": "packages/sdk",
"link": true
},
"node_modules/@waku/tests": {
"resolved": "packages/tests",
"link": true
@ -30979,6 +30979,7 @@
"packages/create": {
"name": "@waku/create",
"version": "0.0.15",
"extraneous": true,
"license": "MIT OR Apache-2.0",
"dependencies": {
"@chainsafe/libp2p-noise": "^11.0.0",
@ -31028,22 +31029,6 @@
"node": ">=16"
}
},
"packages/create/node_modules/@libp2p/interface-dht": {
"version": "2.0.1",
"dev": true,
"license": "Apache-2.0 OR MIT",
"dependencies": {
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"multiformats": "^11.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"packages/dns-discovery": {
"name": "@waku/dns-discovery",
"version": "0.0.13",
@ -31431,6 +31416,90 @@
"node": ">=16"
}
},
"packages/sdk": {
"name": "@waku/sdk",
"version": "0.0.16",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@chainsafe/libp2p-noise": "^11.0.0",
"@libp2p/mplex": "^7.1.1",
"@libp2p/websockets": "^5.0.3",
"@waku/core": "0.0.19",
"@waku/dns-discovery": "0.0.13",
"@waku/relay": "0.0.2",
"@waku/utils": "*",
"libp2p": "^0.42.2"
},
"devDependencies": {
"@libp2p/interface-address-manager": "^2.0.4",
"@libp2p/interface-connection": "^3.0.8",
"@libp2p/interface-connection-manager": "^1.3.7",
"@libp2p/interface-content-routing": "^2.1.1",
"@libp2p/interface-dht": "^2.0.1",
"@libp2p/interface-libp2p": "^1.1.2",
"@libp2p/interface-metrics": "^4.0.7",
"@libp2p/interface-peer-discovery": "^1.0.5",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-peer-routing": "^1.0.8",
"@libp2p/interface-peer-store": "^1.2.8",
"@libp2p/interface-pubsub": "^3.0.6",
"@libp2p/interface-registrar": "^2.0.8",
"@libp2p/interface-transport": "^2.1.1",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/build-utils": "*",
"@waku/interfaces": "0.0.14",
"cspell": "^6.31.1",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^5.0.4",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"interface-datastore": "^7.0.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"rollup": "^3.21.3",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=16"
}
},
"packages/sdk/node_modules/@libp2p/interface-dht": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@libp2p/interface-dht/-/interface-dht-2.0.3.tgz",
"integrity": "sha512-JAKbHvw3egaSeB7CHOf6PF/dLNim4kzAiXX+0IEz2lln8L32/Xf1T7KNOF/RSbSYqO9b7Xxc/b2fuSfyaMwwMQ==",
"dev": true,
"dependencies": {
"@libp2p/interface-peer-discovery": "^2.0.0",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"multiformats": "^11.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"packages/sdk/node_modules/@libp2p/interface-dht/node_modules/@libp2p/interface-peer-discovery": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-2.0.0.tgz",
"integrity": "sha512-Mien5t3Tc+ntP5p50acKUYJN90ouMnq1lOTQDKQNvGcXoajG8A1AEYLocnzVia/MXiexuj6S/Q28WBBacoOlBg==",
"dev": true,
"dependencies": {
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"packages/tests": {
"name": "@waku/tests",
"version": "0.0.1",
@ -31459,10 +31528,10 @@
"@types/tail": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/create": "*",
"@waku/dns-discovery": "*",
"@waku/message-encryption": "*",
"@waku/peer-exchange": "*",
"@waku/sdk": "*",
"chai": "^4.3.7",
"cspell": "^6.31.1",
"debug": "^4.3.4",
@ -36935,64 +37004,6 @@
}
}
},
"@waku/create": {
"version": "file:packages/create",
"requires": {
"@chainsafe/libp2p-noise": "^11.0.0",
"@libp2p/interface-address-manager": "^2.0.4",
"@libp2p/interface-connection": "^3.0.8",
"@libp2p/interface-connection-manager": "^1.3.7",
"@libp2p/interface-content-routing": "^2.1.1",
"@libp2p/interface-dht": "^2.0.1",
"@libp2p/interface-libp2p": "^1.1.2",
"@libp2p/interface-metrics": "^4.0.7",
"@libp2p/interface-peer-discovery": "^1.0.5",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-peer-routing": "^1.0.8",
"@libp2p/interface-peer-store": "^1.2.8",
"@libp2p/interface-pubsub": "^3.0.6",
"@libp2p/interface-registrar": "^2.0.8",
"@libp2p/interface-transport": "^2.1.1",
"@libp2p/mplex": "^7.1.1",
"@libp2p/websockets": "^5.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/build-utils": "*",
"@waku/core": "0.0.19",
"@waku/dns-discovery": "0.0.13",
"@waku/interfaces": "0.0.14",
"@waku/relay": "0.0.2",
"cspell": "^6.31.1",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^5.0.4",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"interface-datastore": "^7.0.4",
"libp2p": "^0.42.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"rollup": "^3.21.3",
"typescript": "^5.0.4"
},
"dependencies": {
"@libp2p/interface-dht": {
"version": "2.0.1",
"dev": true,
"requires": {
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"multiformats": "^11.0.0"
}
}
}
},
"@waku/dns-discovery": {
"version": "file:packages/dns-discovery",
"requires": {
@ -37314,6 +37325,79 @@
"typescript": "^5.0.4"
}
},
"@waku/sdk": {
"version": "file:packages/sdk",
"requires": {
"@chainsafe/libp2p-noise": "^11.0.0",
"@libp2p/interface-address-manager": "^2.0.4",
"@libp2p/interface-connection": "^3.0.8",
"@libp2p/interface-connection-manager": "^1.3.7",
"@libp2p/interface-content-routing": "^2.1.1",
"@libp2p/interface-dht": "^2.0.1",
"@libp2p/interface-libp2p": "^1.1.2",
"@libp2p/interface-metrics": "^4.0.7",
"@libp2p/interface-peer-discovery": "^1.0.5",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-peer-routing": "^1.0.8",
"@libp2p/interface-peer-store": "^1.2.8",
"@libp2p/interface-pubsub": "^3.0.6",
"@libp2p/interface-registrar": "^2.0.8",
"@libp2p/interface-transport": "^2.1.1",
"@libp2p/mplex": "^7.1.1",
"@libp2p/websockets": "^5.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/build-utils": "*",
"@waku/core": "0.0.19",
"@waku/dns-discovery": "0.0.13",
"@waku/interfaces": "0.0.14",
"@waku/relay": "0.0.2",
"@waku/utils": "*",
"cspell": "^6.31.1",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^5.0.4",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"interface-datastore": "^7.0.4",
"libp2p": "^0.42.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"rollup": "^3.21.3",
"typescript": "^5.0.4"
},
"dependencies": {
"@libp2p/interface-dht": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@libp2p/interface-dht/-/interface-dht-2.0.3.tgz",
"integrity": "sha512-JAKbHvw3egaSeB7CHOf6PF/dLNim4kzAiXX+0IEz2lln8L32/Xf1T7KNOF/RSbSYqO9b7Xxc/b2fuSfyaMwwMQ==",
"dev": true,
"requires": {
"@libp2p/interface-peer-discovery": "^2.0.0",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"multiformats": "^11.0.0"
},
"dependencies": {
"@libp2p/interface-peer-discovery": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-2.0.0.tgz",
"integrity": "sha512-Mien5t3Tc+ntP5p50acKUYJN90ouMnq1lOTQDKQNvGcXoajG8A1AEYLocnzVia/MXiexuj6S/Q28WBBacoOlBg==",
"dev": true,
"requires": {
"@libp2p/interface-peer-info": "^1.0.0",
"@libp2p/interfaces": "^3.0.0"
}
}
}
}
}
},
"@waku/tests": {
"version": "file:packages/tests",
"requires": {
@ -37329,12 +37413,12 @@
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/core": "*",
"@waku/create": "*",
"@waku/dns-discovery": "*",
"@waku/enr": "*",
"@waku/interfaces": "*",
"@waku/message-encryption": "*",
"@waku/peer-exchange": "*",
"@waku/sdk": "*",
"@waku/utils": "*",
"app-root-path": "^3.1.0",
"chai": "^4.3.7",

View File

@ -13,7 +13,7 @@
"packages/peer-exchange",
"packages/dns-discovery",
"packages/message-encryption",
"packages/create",
"packages/sdk",
"packages/tests",
"packages/build-utils"
],

View File

@ -10,7 +10,7 @@ const log = debug("waku:wait-for-remote-peer");
* Wait for a remote peer to be ready given the passed protocols.
* Must be used after attempting to connect to nodes, using
* {@link @waku/core.WakuNode.dial} or a bootstrap method with
* {@link @waku/create.createLightNode}.
* {@link @waku/sdk.createLightNode}.
*
* If the passed protocols is a GossipSub protocol, then it resolves only once
* a peer is in a mesh, to help ensure that other peers will send and receive

View File

@ -1,7 +1,7 @@
{
"name": "@waku/create",
"version": "0.0.15",
"description": "Easily create a Waku node",
"name": "@waku/sdk",
"version": "0.0.16",
"description": "A unified SDK for easy creation and management of js-waku nodes.",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"exports": {
@ -12,7 +12,7 @@
},
"type": "module",
"author": "Waku Team",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/create#readme",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/sdk#readme",
"repository": {
"type": "git",
"url": "https://github.com/waku-org/js-waku.git"
@ -51,6 +51,7 @@
"@chainsafe/libp2p-noise": "^11.0.0",
"@libp2p/mplex": "^7.1.1",
"@libp2p/websockets": "^5.0.3",
"@waku/utils": "*",
"@waku/relay": "0.0.2",
"@waku/core": "0.0.19",
"@waku/dns-discovery": "0.0.13",

17
packages/sdk/src/index.ts Normal file
View File

@ -0,0 +1,17 @@
export {
waitForRemotePeer,
createEncoder,
createDecoder,
WakuNode,
} from "@waku/core";
export {
DecodedMessage,
Decoder,
Encoder,
} from "@waku/core/lib/message/version_0";
export { utf8ToBytes, bytesToUtf8 } from "@waku/utils/bytes";
export * from "./create.js";
export * as waku from "@waku/core";
export * as utils from "@waku/utils";

View File

@ -72,7 +72,7 @@
"@types/tail": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.59.8",
"@waku/create": "*",
"@waku/sdk": "*",
"@waku/dns-discovery": "*",
"@waku/message-encryption": "*",
"@waku/peer-exchange": "*",

View File

@ -3,13 +3,13 @@ import tests from "@libp2p/interface-peer-discovery-compliance-tests";
import { Peer } from "@libp2p/interface-peer-store";
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
import { PersistentPeerStore } from "@libp2p/peer-store";
import { createLightNode } from "@waku/create";
import {
DnsNodeDiscovery,
enrTree,
PeerDiscoveryDns,
wakuDnsDiscovery,
} from "@waku/dns-discovery";
import { createLightNode } from "@waku/sdk";
import { expect } from "chai";
import { MemoryDatastore } from "datastore-core";

View File

@ -1,8 +1,8 @@
import { waitForRemotePeer } from "@waku/core";
import { createRelayNode } from "@waku/create";
import { EnrDecoder } from "@waku/enr";
import type { RelayNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createRelayNode } from "@waku/sdk";
import { expect } from "chai";
import { makeLogFileName, NOISE_KEY_1 } from "../src/index.js";

View File

@ -4,7 +4,6 @@ import {
DecodedMessage,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode } from "@waku/create";
import { IFilterV2, IFilterV2Subscription, Protocols } from "@waku/interfaces";
import type { LightNode } from "@waku/interfaces";
import {
@ -18,6 +17,7 @@ import {
createDecoder as symDecoder,
createEncoder as symEncoder,
} from "@waku/message-encryption/symmetric";
import { createLightNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -5,9 +5,9 @@ import {
DefaultPubSubTopic,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode } from "@waku/create";
import type { IFilter, LightNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -5,13 +5,13 @@ import {
DefaultPubSubTopic,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode } from "@waku/create";
import type {
IFilterV2,
IFilterV2Subscription,
LightNode,
} from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -1,7 +1,7 @@
import { createEncoder, waitForRemotePeer } from "@waku/core";
import { createLightNode } from "@waku/create";
import { LightNode, SendError } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -4,7 +4,6 @@ import {
Fleet,
getPredefinedBootstrapNodes,
} from "@waku/core/lib/predefined_bootstrap_nodes";
import { createLightNode, Libp2pComponents } from "@waku/create";
import type { LightNode, PeerInfo } from "@waku/interfaces";
import {
PeerExchangeCodec,
@ -12,6 +11,7 @@ import {
WakuPeerExchange,
wakuPeerExchangeDiscovery,
} from "@waku/peer-exchange";
import { createLightNode, Libp2pComponents } from "@waku/sdk";
import { expect } from "chai";
import { delay } from "../src/delay.js";

View File

@ -6,7 +6,6 @@ import {
DefaultPubSubTopic,
waitForRemotePeer,
} from "@waku/core";
import { createRelayNode } from "@waku/create";
import { RelayNode, SendError } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
@ -20,6 +19,7 @@ import {
createEncoder as createSymEncoder,
generateSymmetricKey,
} from "@waku/message-encryption/symmetric";
import { createRelayNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -6,7 +6,6 @@ import {
PageDirection,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode } from "@waku/create";
import type { IMessage, LightNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
@ -20,6 +19,7 @@ import {
createEncoder as createSymEncoder,
generateSymmetricKey,
} from "@waku/message-encryption/symmetric";
import { createLightNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import debug from "debug";

View File

@ -4,9 +4,9 @@ import {
DefaultPubSubTopic,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode } from "@waku/create";
import type { IFilter, IFilterV2, LightNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { toAsyncIterator } from "@waku/utils";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";

View File

@ -1,7 +1,7 @@
import { waitForRemotePeer } from "@waku/core";
import { createLightNode, createRelayNode } from "@waku/create";
import type { LightNode, RelayNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createLightNode, createRelayNode } from "@waku/sdk";
import { expect } from "chai";
import { delay, makeLogFileName, NOISE_KEY_1 } from "../src/index.js";

View File

@ -5,7 +5,6 @@ import {
DefaultUserAgent,
waitForRemotePeer,
} from "@waku/core";
import { createLightNode, createRelayNode } from "@waku/create";
import type { LightNode, RelayNode, Waku } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
@ -13,6 +12,7 @@ import {
createEncoder,
generateSymmetricKey,
} from "@waku/message-encryption/symmetric";
import { createLightNode, createRelayNode } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";

View File

@ -15,7 +15,9 @@
"packages/core": {},
"packages/dns-discovery": {},
"packages/message-encryption": {},
"packages/create": {},
"packages/sdk": {
"release-as": "0.0.16"
},
"packages/relay": {}
}
}