mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-04 06:43:12 +00:00
chore!: upgrade libp2p, nodejs and typescript (#2401)
* remove react native package * upgrade nodejs * upgrade libp2p * upgrade typescript, use 22 node * up lock * fix node compatibility * upgrade playwright * upgrade proto * update tests
This commit is contained in:
parent
fecc026dd7
commit
fcc6496fef
@ -21,5 +21,4 @@ packages/enr/
|
|||||||
packages/interfaces/
|
packages/interfaces/
|
||||||
packages/message-encryption/
|
packages/message-encryption/
|
||||||
packages/core/
|
packages/core/
|
||||||
packages/react-native-polyfills/
|
|
||||||
packages/build-utils/
|
packages/build-utils/
|
||||||
|
|||||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -15,7 +15,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
@ -57,7 +57,7 @@ jobs:
|
|||||||
browser:
|
browser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: mcr.microsoft.com/playwright:v1.52.0-jammy
|
image: mcr.microsoft.com/playwright:v1.53.1-jammy
|
||||||
env:
|
env:
|
||||||
HOME: "/root"
|
HOME: "/root"
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
2
.github/workflows/fleet-checker.yml
vendored
2
.github/workflows/fleet-checker.yml
vendored
@ -2,7 +2,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre-release:
|
pre-release:
|
||||||
|
|||||||
4
.github/workflows/playwright.yml
vendored
4
.github/workflows/playwright.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
EXAMPLE_TEMPLATE: "web-chat"
|
EXAMPLE_TEMPLATE: "web-chat"
|
||||||
EXAMPLE_NAME: "example"
|
EXAMPLE_NAME: "example"
|
||||||
EXAMPLE_PORT: "8080"
|
EXAMPLE_PORT: "8080"
|
||||||
@ -20,7 +20,7 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: mcr.microsoft.com/playwright:v1.52.0-jammy
|
image: mcr.microsoft.com/playwright:v1.53.1-jammy
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
|
|||||||
2
.github/workflows/pre-release.yml
vendored
2
.github/workflows/pre-release.yml
vendored
@ -2,7 +2,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre-release:
|
pre-release:
|
||||||
|
|||||||
2
.github/workflows/test-node.yml
vendored
2
.github/workflows/test-node.yml
vendored
@ -24,7 +24,7 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
# Ensure test type conditions remain consistent.
|
# Ensure test type conditions remain consistent.
|
||||||
WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }}
|
WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }}
|
||||||
DEBUG: ${{ inputs.debug }}
|
DEBUG: ${{ inputs.debug }}
|
||||||
|
|||||||
2
.github/workflows/test-reliability.yml
vendored
2
.github/workflows/test-reliability.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
- "chore/longevity-tests"
|
- "chore/longevity-tests"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_JS: "20"
|
NODE_JS: "22"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
node:
|
node:
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
"packages/relay": "0.0.18",
|
"packages/relay": "0.0.18",
|
||||||
"packages/sdk": "0.0.31",
|
"packages/sdk": "0.0.31",
|
||||||
"packages/discovery": "0.0.8",
|
"packages/discovery": "0.0.8",
|
||||||
"packages/react-native-polyfills": "0.0.1",
|
|
||||||
"packages/sds": "0.0.3",
|
"packages/sds": "0.0.3",
|
||||||
"packages/rln": "0.1.5"
|
"packages/rln": "0.1.5"
|
||||||
}
|
}
|
||||||
|
|||||||
17577
package-lock.json
generated
17577
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -18,8 +18,7 @@
|
|||||||
"packages/reliability-tests",
|
"packages/reliability-tests",
|
||||||
"packages/headless-tests",
|
"packages/headless-tests",
|
||||||
"packages/browser-tests",
|
"packages/browser-tests",
|
||||||
"packages/build-utils",
|
"packages/build-utils"
|
||||||
"packages/react-native-polyfills"
|
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
@ -64,10 +63,10 @@
|
|||||||
"lint-staged": "^15.4.3",
|
"lint-staged": "^15.4.3",
|
||||||
"playwright": "^1.40.1",
|
"playwright": "^1.40.1",
|
||||||
"size-limit": "^11.0.1",
|
"size-limit": "^11.0.1",
|
||||||
"ts-loader": "^9.5.1",
|
"ts-loader": "9.5.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "10.9.2",
|
||||||
"typedoc": "^0.25.9",
|
"typedoc": "0.28.5",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "5.8.3",
|
||||||
"wscat": "^6.0.1"
|
"wscat": "^6.0.1"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
"dotenv-flow": "^0.4.0",
|
"dotenv-flow": "^0.4.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"serve": "^14.2.3",
|
"serve": "^14.2.3",
|
||||||
"typescript": "^5.3.0",
|
"typescript": "5.8.3",
|
||||||
"webpack-cli": "^6.0.1"
|
"webpack-cli": "^6.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -61,12 +61,12 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@waku/enr": "^0.0.29",
|
"@waku/enr": "^0.0.29",
|
||||||
"@waku/interfaces": "0.0.30",
|
"@waku/interfaces": "0.0.30",
|
||||||
"@libp2p/ping": "2.0.1",
|
"@libp2p/ping": "2.0.35",
|
||||||
"@waku/proto": "0.0.10",
|
"@waku/proto": "0.0.10",
|
||||||
"@waku/utils": "0.0.23",
|
"@waku/utils": "0.0.23",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
@ -78,8 +78,8 @@
|
|||||||
"uuid": "^9.0.0"
|
"uuid": "^9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libp2p/peer-id": "^5.0.1",
|
"@libp2p/peer-id": "5.1.7",
|
||||||
"@libp2p/interface": "^2.1.3",
|
"@libp2p/interface": "2.10.4",
|
||||||
"@multiformats/multiaddr": "^12.0.0",
|
"@multiformats/multiaddr": "^12.0.0",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
@ -102,7 +102,7 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@multiformats/multiaddr": "^12.0.0",
|
"@multiformats/multiaddr": "^12.0.0",
|
||||||
"libp2p": "2.1.8"
|
"libp2p": "2.8.11"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@multiformats/multiaddr": {
|
"@multiformats/multiaddr": {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
"test:browser": "NODE_ENV=test karma start karma.conf.cjs"
|
"test:browser": "NODE_ENV=test karma start karma.conf.cjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@waku/core": "0.0.35",
|
"@waku/core": "0.0.35",
|
||||||
@ -62,8 +62,8 @@
|
|||||||
"uint8arrays": "^5.0.1"
|
"uint8arrays": "^5.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libp2p/interface": "^2.1.3",
|
"@libp2p/interface": "2.10.4",
|
||||||
"@libp2p/peer-id": "5.0.1",
|
"@libp2p/peer-id": "5.1.7",
|
||||||
"@multiformats/multiaddr": "^12.3.0",
|
"@multiformats/multiaddr": "^12.3.0",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import type { DnsClient } from "@waku/interfaces";
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import { DnsNodeDiscovery } from "./dns.js";
|
import { DnsNodeDiscovery } from "./dns.js";
|
||||||
import testData from "./testdata.json" assert { type: "json" };
|
import testData from "./testdata.json" with { type: "json" };
|
||||||
|
|
||||||
import { enrTree } from "./index.js";
|
import { enrTree } from "./index.js";
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import { ENRTree } from "./enrtree.js";
|
import { ENRTree } from "./enrtree.js";
|
||||||
import testData from "./testdata.json" assert { type: "json" };
|
import testData from "./testdata.json" with { type: "json" };
|
||||||
|
|
||||||
const dns = testData.dns;
|
const dns = testData.dns;
|
||||||
|
|
||||||
|
|||||||
@ -48,12 +48,12 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersproject/rlp": "^5.7.0",
|
"@ethersproject/rlp": "^5.7.0",
|
||||||
"@libp2p/crypto": "^5.0.1",
|
"@libp2p/crypto": "5.1.6",
|
||||||
"@libp2p/peer-id": "^5.0.1",
|
"@libp2p/peer-id": "5.1.7",
|
||||||
"@multiformats/multiaddr": "^12.0.0",
|
"@multiformats/multiaddr": "^12.0.0",
|
||||||
"@noble/secp256k1": "^1.7.1",
|
"@noble/secp256k1": "^1.7.1",
|
||||||
"@waku/utils": "0.0.23",
|
"@waku/utils": "0.0.23",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
"@babel/preset-typescript": "^7.23.3",
|
"@babel/preset-typescript": "^7.23.3",
|
||||||
"babel-loader": "^9.1.3",
|
"babel-loader": "^9.1.3",
|
||||||
"filter-obj": "^2.0.2",
|
"filter-obj": "^2.0.2",
|
||||||
|
"it-first": "^3.0.9",
|
||||||
"node-polyfill-webpack-plugin": "^2.0.1",
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
||||||
"serve": "^14.1.2",
|
"serve": "^14.1.2",
|
||||||
"webpack": "^5.99.5",
|
"webpack": "^5.99.5",
|
||||||
|
|||||||
@ -44,14 +44,14 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@chainsafe/libp2p-gossipsub": "^14.1.0",
|
"@chainsafe/libp2p-gossipsub": "14.1.1",
|
||||||
"@multiformats/multiaddr": "^12.0.0",
|
"@multiformats/multiaddr": "^12.0.0",
|
||||||
"cspell": "^8.6.1",
|
"cspell": "^8.6.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"libp2p": "2.1.8"
|
"libp2p": "2.8.11"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@ -69,7 +69,7 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"crypto": false
|
"crypto": false
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protons-runtime": "^5.4.0"
|
"protons-runtime": "^5.4.0"
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
||||||
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface FilterRequest {
|
export interface FilterRequest {
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, enumeration, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, enumeration, MaxLengthError, message } from 'protons-runtime'
|
||||||
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface FilterSubscribeRequest {
|
export interface FilterSubscribeRequest {
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, message } from 'protons-runtime'
|
||||||
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface PushRequest {
|
export interface PushRequest {
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, message } from 'protons-runtime'
|
||||||
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface RateLimitProof {
|
export interface RateLimitProof {
|
||||||
|
|||||||
@ -3,8 +3,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface WakuMetadataRequest {
|
export interface WakuMetadataRequest {
|
||||||
|
|||||||
@ -3,8 +3,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface PeerInfo {
|
export interface PeerInfo {
|
||||||
|
|||||||
@ -3,8 +3,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface HistoryEntry {
|
export interface HistoryEntry {
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'
|
||||||
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface WakuMessageKeyValue {
|
export interface WakuMessageKeyValue {
|
||||||
|
|||||||
@ -3,8 +3,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-namespace */
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
/* eslint-disable import/consistent-type-specifier-style */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, message } from 'protons-runtime'
|
import { decodeMessage, encodeMessage, message } from 'protons-runtime'
|
||||||
|
import type { Codec, DecodeOptions } from 'protons-runtime'
|
||||||
import type { Uint8ArrayList } from 'uint8arraylist'
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
||||||
|
|
||||||
export interface TopicOnlyMessage {
|
export interface TopicOnlyMessage {
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: "./tsconfig.dev.json"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## 0.0.1 (2024-04-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Add react-native polyfills ([#1915](https://github.com/waku-org/js-waku/issues/1915)) ([9be942f](https://github.com/waku-org/js-waku/commit/9be942fc23e1e6c1ed5775e44e0d77ec7627b38c))
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@waku/react-native-polyfills",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"description": "Set of polyfills for Waku for React Native environment",
|
|
||||||
"module": "./dist/index.js",
|
|
||||||
"exports": {
|
|
||||||
".": "./dist/index.js",
|
|
||||||
"./metro": "./dist/metro.js"
|
|
||||||
},
|
|
||||||
"type": "module",
|
|
||||||
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/react-native-polyfills#readme",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/waku-org/js-waku.git"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/waku-org/js-waku/issues"
|
|
||||||
},
|
|
||||||
"license": "MIT OR Apache-2.0",
|
|
||||||
"keywords": [
|
|
||||||
"waku",
|
|
||||||
"decentralised",
|
|
||||||
"communication",
|
|
||||||
"web3",
|
|
||||||
"ethereum",
|
|
||||||
"dapps"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"build": "run-s build:**",
|
|
||||||
"build:esm": "tsc",
|
|
||||||
"check": "run-s check:*",
|
|
||||||
"check:tsc": "tsc -p tsconfig.dev.json",
|
|
||||||
"check:spelling": "cspell \"{README.md,src/**/*.ts}\"",
|
|
||||||
"prepublish": "npm run build"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=20"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"event-target-polyfill": "^0.0.4",
|
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
|
||||||
"text-encoding-polyfill": "^0.6.7"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"expo": "~51.0.14"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"expo": "~51.0.14",
|
|
||||||
"react-native": "0.73.6"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist",
|
|
||||||
"bundle",
|
|
||||||
"src/**/*.ts",
|
|
||||||
"!**/*.json",
|
|
||||||
"CHANGELOG.md",
|
|
||||||
"LICENSE",
|
|
||||||
"README.md"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
import "event-target-polyfill";
|
|
||||||
import "text-encoding-polyfill";
|
|
||||||
import "react-native-url-polyfill/auto";
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
import path, { dirname } from "path";
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
|
|
||||||
import type { MetroConfig } from "expo/metro-config";
|
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
type Writeable<T> = { -readonly [P in keyof T]: Writeable<T[P]> };
|
|
||||||
|
|
||||||
export function setupWakuMetroConfig(config: Writeable<MetroConfig>): void {
|
|
||||||
config.resolver.unstable_enablePackageExports = true;
|
|
||||||
config.resolver.extraNodeModules = {
|
|
||||||
url: path.resolve(__dirname, "node_modules", "react-native-url-polyfill")
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.dev"
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "dist/",
|
|
||||||
"rootDir": "src",
|
|
||||||
"tsBuildInfoFile": "dist/.tsbuildinfo"
|
|
||||||
},
|
|
||||||
"include": ["src"],
|
|
||||||
"exclude": ["src/**/*.spec.ts", "src/test_utils"]
|
|
||||||
}
|
|
||||||
@ -46,10 +46,10 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chainsafe/libp2p-gossipsub": "^14.1.0",
|
"@chainsafe/libp2p-gossipsub": "14.1.1",
|
||||||
"@noble/hashes": "^1.3.2",
|
"@noble/hashes": "^1.3.2",
|
||||||
"@waku/core": "0.0.35",
|
"@waku/core": "0.0.35",
|
||||||
"@waku/sdk": "0.0.31",
|
"@waku/sdk": "0.0.31",
|
||||||
@ -69,7 +69,7 @@
|
|||||||
"rollup": "^4.12.0"
|
"rollup": "^4.12.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@chainsafe/libp2p-gossipsub": "^14.1.0"
|
"@chainsafe/libp2p-gossipsub": "14.1.1"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@chainsafe/libp2p-gossipsub": {
|
"@chainsafe/libp2p-gossipsub": {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -45,11 +45,11 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@libp2p/interface-compliance-tests": "^6.0.1",
|
"@libp2p/interface-compliance-tests": "6.4.12",
|
||||||
"@libp2p/peer-id": "^5.0.1",
|
"@libp2p/peer-id": "5.1.7",
|
||||||
"@waku/core": "*",
|
"@waku/core": "*",
|
||||||
"@waku/enr": "*",
|
"@waku/enr": "*",
|
||||||
"@waku/interfaces": "*",
|
"@waku/interfaces": "*",
|
||||||
@ -66,8 +66,8 @@
|
|||||||
"tail": "^2.2.6"
|
"tail": "^2.2.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libp2p/bootstrap": "^11.0.1",
|
"@libp2p/bootstrap": "11.0.42",
|
||||||
"@libp2p/crypto": "^5.0.1",
|
"@libp2p/crypto": "5.1.6",
|
||||||
"@types/chai": "^4.3.11",
|
"@types/chai": "^4.3.11",
|
||||||
"@types/dockerode": "^3.3.19",
|
"@types/dockerode": "^3.3.19",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.6",
|
||||||
@ -81,10 +81,10 @@
|
|||||||
"allure-mocha": "^2.9.2",
|
"allure-mocha": "^2.9.2",
|
||||||
"chai": "^4.3.10",
|
"chai": "^4.3.10",
|
||||||
"cspell": "^8.6.1",
|
"cspell": "^8.6.1",
|
||||||
"datastore-core": "^10.0.2",
|
"datastore-core": "10.0.4",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"interface-datastore": "^8.2.10",
|
"interface-datastore": "8.3.2",
|
||||||
"libp2p": "2.1.8",
|
"libp2p": "2.8.11",
|
||||||
"mocha": "^10.3.0",
|
"mocha": "^10.3.0",
|
||||||
"mocha-multi-reporters": "^1.5.1",
|
"mocha-multi-reporters": "^1.5.1",
|
||||||
"npm-run-all": "^4.1.5"
|
"npm-run-all": "^4.1.5"
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
import copy from "rollup-plugin-copy";
|
import copy from "rollup-plugin-copy";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -57,25 +57,25 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chainsafe/libp2p-noise": "16.0.0",
|
"@chainsafe/libp2p-noise": "16.1.3",
|
||||||
"@libp2p/bootstrap": "^11.0.1",
|
"@libp2p/bootstrap": "11.0.42",
|
||||||
"@libp2p/identify": "^3.0.1",
|
"@libp2p/identify": "3.0.36",
|
||||||
"@libp2p/mplex": "^11.0.1",
|
"@libp2p/mplex": "11.0.42",
|
||||||
"@libp2p/ping": "2.0.1",
|
"@libp2p/ping": "2.0.35",
|
||||||
"@libp2p/websockets": "^9.0.1",
|
"@libp2p/websockets": "9.2.16",
|
||||||
"@noble/hashes": "^1.3.3",
|
"@noble/hashes": "^1.3.3",
|
||||||
"@waku/core": "0.0.35",
|
"@waku/core": "0.0.35",
|
||||||
"@waku/discovery": "0.0.8",
|
"@waku/discovery": "0.0.8",
|
||||||
"@waku/interfaces": "0.0.30",
|
"@waku/interfaces": "0.0.30",
|
||||||
"@waku/proto": "^0.0.10",
|
"@waku/proto": "^0.0.10",
|
||||||
"@waku/utils": "0.0.23",
|
"@waku/utils": "0.0.23",
|
||||||
"libp2p": "2.1.8"
|
"libp2p": "2.8.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libp2p/interface": "^2.1.3",
|
"@libp2p/interface": "2.10.4",
|
||||||
"@types/chai": "^4.3.11",
|
"@types/chai": "^4.3.11",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
@ -85,14 +85,14 @@
|
|||||||
"@waku/build-utils": "*",
|
"@waku/build-utils": "*",
|
||||||
"chai": "^5.1.1",
|
"chai": "^5.1.1",
|
||||||
"cspell": "^8.6.1",
|
"cspell": "^8.6.1",
|
||||||
"interface-datastore": "^8.2.10",
|
"interface-datastore": "8.3.2",
|
||||||
"mocha": "^10.7.3",
|
"mocha": "^10.7.3",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"rollup": "^4.12.0",
|
"rollup": "^4.12.0",
|
||||||
"sinon": "^19.0.2"
|
"sinon": "^19.0.2"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@chainsafe/libp2p-noise": "16.0.0"
|
"@chainsafe/libp2p-noise": "16.1.3"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|||||||
import replace from "@rollup/plugin-replace";
|
import replace from "@rollup/plugin-replace";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -56,10 +56,10 @@
|
|||||||
"test:node": "NODE_ENV=test TS_NODE_PROJECT=./tsconfig.dev.json mocha"
|
"test:node": "NODE_ENV=test TS_NODE_PROJECT=./tsconfig.dev.json mocha"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@libp2p/interface": "2.7.0",
|
"@libp2p/interface": "2.10.4",
|
||||||
"@noble/hashes": "^1.7.1",
|
"@noble/hashes": "^1.7.1",
|
||||||
"@waku/proto": "^0.0.10",
|
"@waku/proto": "^0.0.10",
|
||||||
"@waku/utils": "^0.0.23",
|
"@waku/utils": "^0.0.23",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import testVectors from "./nim_hash_test_vectors.json" assert { type: "json" };
|
import testVectors from "./nim_hash_test_vectors.json" with { type: "json" };
|
||||||
import { hashN } from "./nim_hashn.mjs";
|
import { hashN } from "./nim_hashn.mjs";
|
||||||
|
|
||||||
describe("hashN", () => {
|
describe("hashN", () => {
|
||||||
|
|||||||
@ -47,11 +47,11 @@
|
|||||||
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@libp2p/interface-compliance-tests": "^6.0.1",
|
"@libp2p/interface-compliance-tests": "6.4.12",
|
||||||
"@libp2p/peer-id": "^5.0.1",
|
"@libp2p/peer-id": "5.1.7",
|
||||||
"@waku/core": "*",
|
"@waku/core": "*",
|
||||||
"@waku/enr": "*",
|
"@waku/enr": "*",
|
||||||
"@waku/interfaces": "*",
|
"@waku/interfaces": "*",
|
||||||
@ -69,8 +69,8 @@
|
|||||||
"tail": "^2.2.6"
|
"tail": "^2.2.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libp2p/bootstrap": "^11.0.1",
|
"@libp2p/bootstrap": "11.0.42",
|
||||||
"@libp2p/crypto": "^5.0.1",
|
"@libp2p/crypto": "5.1.6",
|
||||||
"@types/chai": "^4.3.11",
|
"@types/chai": "^4.3.11",
|
||||||
"@types/dockerode": "^3.3.19",
|
"@types/dockerode": "^3.3.19",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.6",
|
||||||
@ -84,10 +84,10 @@
|
|||||||
"allure-mocha": "^2.9.2",
|
"allure-mocha": "^2.9.2",
|
||||||
"chai": "^4.3.10",
|
"chai": "^4.3.10",
|
||||||
"cspell": "^8.6.1",
|
"cspell": "^8.6.1",
|
||||||
"datastore-core": "^10.0.2",
|
"datastore-core": "10.0.4",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"interface-datastore": "^8.2.10",
|
"interface-datastore": "8.3.2",
|
||||||
"libp2p": "2.1.8",
|
"libp2p": "2.8.11",
|
||||||
"mocha": "^10.3.0",
|
"mocha": "^10.3.0",
|
||||||
"mocha-multi-reporters": "^1.5.1",
|
"mocha-multi-reporters": "^1.5.1",
|
||||||
"npm-run-all": "^4.1.5"
|
"npm-run-all": "^4.1.5"
|
||||||
|
|||||||
@ -28,22 +28,33 @@ describe("Connection state", function () {
|
|||||||
let nwaku1PeerId: Multiaddr;
|
let nwaku1PeerId: Multiaddr;
|
||||||
let nwaku2PeerId: Multiaddr;
|
let nwaku2PeerId: Multiaddr;
|
||||||
|
|
||||||
|
let navigatorMock: any;
|
||||||
|
let originalNavigator: any;
|
||||||
|
|
||||||
beforeEachCustom(this, async () => {
|
beforeEachCustom(this, async () => {
|
||||||
try {
|
waku = await createLightNode({ networkConfig: DefaultTestShardInfo });
|
||||||
waku = await createLightNode({ networkConfig: DefaultTestShardInfo });
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
nwaku1 = new ServiceNode(makeLogFileName(this.ctx) + "1");
|
nwaku1 = new ServiceNode(makeLogFileName(this.ctx) + "1");
|
||||||
nwaku2 = new ServiceNode(makeLogFileName(this.ctx) + "2");
|
nwaku2 = new ServiceNode(makeLogFileName(this.ctx) + "2");
|
||||||
await nwaku1.start({ filter: true });
|
await nwaku1.start({ filter: true });
|
||||||
await nwaku2.start({ filter: true });
|
await nwaku2.start({ filter: true });
|
||||||
nwaku1PeerId = await nwaku1.getMultiaddrWithId();
|
nwaku1PeerId = await nwaku1.getMultiaddrWithId();
|
||||||
nwaku2PeerId = await nwaku2.getMultiaddrWithId();
|
nwaku2PeerId = await nwaku2.getMultiaddrWithId();
|
||||||
|
|
||||||
|
navigatorMock = { onLine: true };
|
||||||
|
Object.defineProperty(globalThis, "navigator", {
|
||||||
|
value: navigatorMock,
|
||||||
|
configurable: true,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEachCustom(this, async () => {
|
afterEachCustom(this, async () => {
|
||||||
await tearDownNodes([nwaku1, nwaku2], waku);
|
await tearDownNodes([nwaku1, nwaku2], waku);
|
||||||
|
Object.defineProperty(globalThis, "navigator", {
|
||||||
|
value: originalNavigator,
|
||||||
|
configurable: true,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should emit `waku:online` event only when first peer is connected", async function () {
|
it("should emit `waku:online` event only when first peer is connected", async function () {
|
||||||
|
|||||||
@ -158,10 +158,19 @@ describe("Events", function () {
|
|||||||
|
|
||||||
describe(EConnectionStateEvents.CONNECTION_STATUS, function () {
|
describe(EConnectionStateEvents.CONNECTION_STATUS, function () {
|
||||||
let navigatorMock: any;
|
let navigatorMock: any;
|
||||||
|
let originalNavigator: any;
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
originalNavigator = global.navigator;
|
||||||
|
});
|
||||||
|
|
||||||
this.beforeEach(() => {
|
this.beforeEach(() => {
|
||||||
navigatorMock = { onLine: true };
|
navigatorMock = { onLine: true };
|
||||||
globalThis.navigator = navigatorMock;
|
Object.defineProperty(globalThis, "navigator", {
|
||||||
|
value: navigatorMock,
|
||||||
|
configurable: true,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
|
|
||||||
const eventEmmitter = new TypedEventEmitter();
|
const eventEmmitter = new TypedEventEmitter();
|
||||||
globalThis.addEventListener =
|
globalThis.addEventListener =
|
||||||
@ -173,8 +182,11 @@ describe("Events", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.afterEach(() => {
|
this.afterEach(() => {
|
||||||
// @ts-expect-error: resetting set value
|
Object.defineProperty(globalThis, "navigator", {
|
||||||
globalThis.navigator = undefined;
|
value: originalNavigator,
|
||||||
|
configurable: true,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
// @ts-expect-error: resetting set value
|
// @ts-expect-error: resetting set value
|
||||||
globalThis.addEventListener = undefined;
|
globalThis.addEventListener = undefined;
|
||||||
// @ts-expect-error: resetting set value
|
// @ts-expect-error: resetting set value
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
"test:node": "NODE_ENV=test TS_NODE_PROJECT=./tsconfig.dev.json mocha"
|
"test:node": "NODE_ENV=test TS_NODE_PROJECT=./tsconfig.dev.json mocha"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/hashes": "^1.3.2",
|
"@noble/hashes": "^1.3.2",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import json from "@rollup/plugin-json";
|
|||||||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { extractExports } from "@waku/build-utils";
|
import { extractExports } from "@waku/build-utils";
|
||||||
|
|
||||||
import * as packageJson from "./package.json" assert { type: "json" };
|
import * as packageJson from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
const input = extractExports(packageJson);
|
const input = extractExports(packageJson);
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export const pubsubTopicsToShardInfo = (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const clusterId = clusterIds.values().next().value;
|
const clusterId = clusterIds.values().next().value!;
|
||||||
const shards = Array.from(shardInfoSet).map((info) =>
|
const shards = Array.from(shardInfoSet).map((info) =>
|
||||||
parseInt(info.split(":")[1])
|
parseInt(info.split(":")[1])
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
"packages/sdk": {},
|
"packages/sdk": {},
|
||||||
"packages/relay": {},
|
"packages/relay": {},
|
||||||
"packages/discovery": {},
|
"packages/discovery": {},
|
||||||
"packages/react-native-polyfills": {},
|
|
||||||
"packages/sds": {},
|
"packages/sds": {},
|
||||||
"packages/rln": {}
|
"packages/rln": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"target": "ES2022",
|
"target": "ES2023",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
@ -38,7 +38,7 @@
|
|||||||
// "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
|
// "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
|
||||||
// "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
|
// "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
|
||||||
|
|
||||||
"lib": ["es2022", "dom"],
|
"lib": ["es2023", "dom"],
|
||||||
"types": ["node", "mocha"],
|
"types": ["node", "mocha"],
|
||||||
"typeRoots": ["node_modules/@types"]
|
"typeRoots": ["node_modules/@types"]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user