mirror of https://github.com/status-im/js-waku.git
chore!: add exports map to @waku/utils (#1201)
* add exports map * merge: master * export subdir with default export path * import according to the export path
This commit is contained in:
parent
8c4dfe566c
commit
a30b2bd747
|
@ -5,7 +5,7 @@ import {
|
||||||
getPeersForProtocol,
|
getPeersForProtocol,
|
||||||
selectConnection,
|
selectConnection,
|
||||||
selectPeerForProtocol,
|
selectPeerForProtocol,
|
||||||
} from "@waku/utils";
|
} from "@waku/utils/libp2p";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class with predefined helpers, to be used as a base to implement Waku
|
* A class with predefined helpers, to be used as a base to implement Waku
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
ProtocolCreateOptions,
|
ProtocolCreateOptions,
|
||||||
} from "@waku/interfaces";
|
} from "@waku/interfaces";
|
||||||
import { proto_store as proto } from "@waku/proto";
|
import { proto_store as proto } from "@waku/proto";
|
||||||
import { concat, utf8ToBytes } from "@waku/utils";
|
import { concat, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
import all from "it-all";
|
import all from "it-all";
|
||||||
import * as lp from "it-length-prefixed";
|
import * as lp from "it-length-prefixed";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { bytesToUtf8 } from "@waku/utils";
|
import { bytesToUtf8 } from "@waku/utils/bytes";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
import { Endpoint, query, toEndpoint } from "dns-query";
|
import { Endpoint, query, toEndpoint } from "dns-query";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ENR } from "@waku/enr";
|
import { ENR } from "@waku/enr";
|
||||||
import { keccak256, verifySignature } from "@waku/enr";
|
import { keccak256, verifySignature } from "@waku/enr";
|
||||||
import { utf8ToBytes } from "@waku/utils";
|
import { utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import base32 from "hi-base32";
|
import base32 from "hi-base32";
|
||||||
import { fromString } from "uint8arrays/from-string";
|
import { fromString } from "uint8arrays/from-string";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PeerId } from "@libp2p/interface-peer-id";
|
import { PeerId } from "@libp2p/interface-peer-id";
|
||||||
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
||||||
import { utf8ToBytes } from "@waku/utils";
|
import { utf8ToBytes } from "@waku/utils/bytes";
|
||||||
|
|
||||||
import { compressPublicKey } from "./crypto.js";
|
import { compressPublicKey } from "./crypto.js";
|
||||||
import { ENR } from "./enr.js";
|
import { ENR } from "./enr.js";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import { concat } from "@waku/utils";
|
import { concat } from "@waku/utils/bytes";
|
||||||
import sha3 from "js-sha3";
|
import sha3 from "js-sha3";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as RLP from "@ethersproject/rlp";
|
import * as RLP from "@ethersproject/rlp";
|
||||||
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
||||||
import { bytesToHex, bytesToUtf8, hexToBytes } from "@waku/utils";
|
import { bytesToHex, bytesToUtf8, hexToBytes } from "@waku/utils/bytes";
|
||||||
import { log } from "debug";
|
import { log } from "debug";
|
||||||
import { fromString } from "uint8arrays/from-string";
|
import { fromString } from "uint8arrays/from-string";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as RLP from "@ethersproject/rlp";
|
import * as RLP from "@ethersproject/rlp";
|
||||||
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
||||||
import { hexToBytes, utf8ToBytes } from "@waku/utils";
|
import { hexToBytes, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { toString } from "uint8arrays/to-string";
|
import { toString } from "uint8arrays/to-string";
|
||||||
|
|
||||||
import { ERR_NO_SIGNATURE, MAX_RECORD_SIZE } from "./constants.js";
|
import { ERR_NO_SIGNATURE, MAX_RECORD_SIZE } from "./constants.js";
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||||
import { multiaddr } from "@multiformats/multiaddr";
|
import { multiaddr } from "@multiformats/multiaddr";
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import type { Waku2 } from "@waku/interfaces";
|
import type { Waku2 } from "@waku/interfaces";
|
||||||
import { bytesToHex, hexToBytes, utf8ToBytes } from "@waku/utils";
|
import { bytesToHex, hexToBytes, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { assert, expect } from "chai";
|
import { assert, expect } from "chai";
|
||||||
import { equals } from "uint8arrays/equals";
|
import { equals } from "uint8arrays/equals";
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
convertToString,
|
convertToString,
|
||||||
} from "@multiformats/multiaddr/convert";
|
} from "@multiformats/multiaddr/convert";
|
||||||
import type { ENRKey, ENRValue, SequenceNumber, Waku2 } from "@waku/interfaces";
|
import type { ENRKey, ENRValue, SequenceNumber, Waku2 } from "@waku/interfaces";
|
||||||
import { bytesToUtf8 } from "@waku/utils";
|
import { bytesToUtf8 } from "@waku/utils/bytes";
|
||||||
|
|
||||||
import { ERR_INVALID_ID } from "./constants.js";
|
import { ERR_INVALID_ID } from "./constants.js";
|
||||||
import { decodeMultiaddrs, encodeMultiaddrs } from "./multiaddrs_codec.js";
|
import { decodeMultiaddrs, encodeMultiaddrs } from "./multiaddrs_codec.js";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import type { NodeId } from "@waku/interfaces";
|
import type { NodeId } from "@waku/interfaces";
|
||||||
import { bytesToHex } from "@waku/utils";
|
import { bytesToHex } from "@waku/utils/bytes";
|
||||||
|
|
||||||
import { keccak256 } from "./crypto.js";
|
import { keccak256 } from "./crypto.js";
|
||||||
export async function sign(
|
export async function sign(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import { concat, hexToBytes } from "@waku/utils";
|
import { concat, hexToBytes } from "@waku/utils/bytes";
|
||||||
|
|
||||||
import { getSubtle, randomBytes, sha256 } from "./index.js";
|
import { getSubtle, randomBytes, sha256 } from "./index.js";
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import nodeCrypto from "crypto";
|
import nodeCrypto from "crypto";
|
||||||
|
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import { concat } from "@waku/utils";
|
import { concat } from "@waku/utils/bytes";
|
||||||
import sha3 from "js-sha3";
|
import sha3 from "js-sha3";
|
||||||
|
|
||||||
import { Asymmetric, Symmetric } from "../constants.js";
|
import { Asymmetric, Symmetric } from "../constants.js";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as secp from "@noble/secp256k1";
|
import * as secp from "@noble/secp256k1";
|
||||||
import { concat, hexToBytes } from "@waku/utils";
|
import { concat, hexToBytes } from "@waku/utils/bytes";
|
||||||
|
|
||||||
import { Symmetric } from "./constants.js";
|
import { Symmetric } from "./constants.js";
|
||||||
import * as ecies from "./crypto/ecies.js";
|
import * as ecies from "./crypto/ecies.js";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import type { PeerId } from "@libp2p/interface-peer-id";
|
||||||
import { peerIdFromString } from "@libp2p/peer-id";
|
import { peerIdFromString } from "@libp2p/peer-id";
|
||||||
import { Multiaddr, multiaddr } from "@multiformats/multiaddr";
|
import { Multiaddr, multiaddr } from "@multiformats/multiaddr";
|
||||||
import { DefaultPubSubTopic } from "@waku/core";
|
import { DefaultPubSubTopic } from "@waku/core";
|
||||||
import { bytesToHex, hexToBytes } from "@waku/utils";
|
import { bytesToHex, hexToBytes } from "@waku/utils/bytes";
|
||||||
import appRoot from "app-root-path";
|
import appRoot from "app-root-path";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
import portfinder from "portfinder";
|
import portfinder from "portfinder";
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
createDecoder as symDecoder,
|
createDecoder as symDecoder,
|
||||||
createEncoder as symEncoder,
|
createEncoder as symEncoder,
|
||||||
} from "@waku/message-encryption/symmetric";
|
} from "@waku/message-encryption/symmetric";
|
||||||
import { bytesToUtf8, utf8ToBytes } from "@waku/utils";
|
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
import { createLightNode } from "@waku/create";
|
import { createLightNode } from "@waku/create";
|
||||||
import type { LightNode } from "@waku/interfaces";
|
import type { LightNode } from "@waku/interfaces";
|
||||||
import { Protocols } from "@waku/interfaces";
|
import { Protocols } from "@waku/interfaces";
|
||||||
import { bytesToUtf8, utf8ToBytes } from "@waku/utils";
|
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { createEncoder, waitForRemotePeer } from "@waku/core";
|
||||||
import { createLightNode } from "@waku/create";
|
import { createLightNode } from "@waku/create";
|
||||||
import type { LightNode } from "@waku/interfaces";
|
import type { LightNode } from "@waku/interfaces";
|
||||||
import { Protocols } from "@waku/interfaces";
|
import { Protocols } from "@waku/interfaces";
|
||||||
import { utf8ToBytes } from "@waku/utils";
|
import { utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
createEncoder as createSymEncoder,
|
createEncoder as createSymEncoder,
|
||||||
generateSymmetricKey,
|
generateSymmetricKey,
|
||||||
} from "@waku/message-encryption/symmetric";
|
} from "@waku/message-encryption/symmetric";
|
||||||
import { bytesToUtf8, utf8ToBytes } from "@waku/utils";
|
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
createEncoder as createSymEncoder,
|
createEncoder as createSymEncoder,
|
||||||
generateSymmetricKey,
|
generateSymmetricKey,
|
||||||
} from "@waku/message-encryption/symmetric";
|
} from "@waku/message-encryption/symmetric";
|
||||||
import { bytesToUtf8, utf8ToBytes } from "@waku/utils";
|
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
createEncoder,
|
createEncoder,
|
||||||
generateSymmetricKey,
|
generateSymmetricKey,
|
||||||
} from "@waku/message-encryption/symmetric";
|
} from "@waku/message-encryption/symmetric";
|
||||||
import { bytesToUtf8, utf8ToBytes } from "@waku/utils";
|
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -8,6 +8,14 @@
|
||||||
".": {
|
".": {
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/index.js"
|
"import": "./dist/index.js"
|
||||||
|
},
|
||||||
|
"./libp2p": {
|
||||||
|
"types": "./dist/libp2p/index.d.ts",
|
||||||
|
"import": "./dist/libp2p/index.js"
|
||||||
|
},
|
||||||
|
"./bytes": {
|
||||||
|
"types": "./dist/bytes/index.d.ts",
|
||||||
|
"import": "./dist/bytes/index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
export * from "./bytes/index.js";
|
|
||||||
export * from "./libp2p/index.js";
|
|
||||||
export * from "./common/index.js";
|
export * from "./common/index.js";
|
||||||
|
|
Loading…
Reference in New Issue