move @waku/message-hash into @waku/core

This commit is contained in:
danisharora099 2024-01-24 18:33:35 +05:30
parent 7affbe222d
commit 5dfee9dee1
No known key found for this signature in database
GPG Key ID: FBD2BF500037F135
17 changed files with 19 additions and 344 deletions

36
package-lock.json generated
View File

@ -5521,8 +5521,16 @@
"link": true
},
"node_modules/@waku/message-hash": {
"resolved": "packages/message-hash",
"link": true
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/@waku/message-hash/-/message-hash-0.1.10.tgz",
"integrity": "sha512-STrORf0vDy5ozYo7QKF04FWlDqg0ZBNdE1kFmpi/NOeN3Wt5eEI9tzAOTBt50u3gf0t7/JLr8p5NbK19PmJlrQ==",
"dependencies": {
"@noble/hashes": "^1.3.2",
"@waku/utils": "0.0.14"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@waku/peer-exchange": {
"resolved": "packages/peer-exchange",
@ -27806,6 +27814,7 @@
"packages/message-hash": {
"name": "@waku/message-hash",
"version": "0.1.10",
"extraneous": true,
"license": "MIT OR Apache-2.0",
"dependencies": {
"@noble/hashes": "^1.3.2",
@ -31979,27 +31988,12 @@
}
},
"@waku/message-hash": {
"version": "file:packages/message-hash",
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/@waku/message-hash/-/message-hash-0.1.10.tgz",
"integrity": "sha512-STrORf0vDy5ozYo7QKF04FWlDqg0ZBNdE1kFmpi/NOeN3Wt5eEI9tzAOTBt50u3gf0t7/JLr8p5NbK19PmJlrQ==",
"requires": {
"@noble/hashes": "^1.3.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.11",
"@types/debug": "^4.1.12",
"@types/mocha": "^10.0.1",
"@waku/build-utils": "*",
"@waku/interfaces": "0.0.21",
"@waku/utils": "0.0.14",
"chai": "^4.3.10",
"cspell": "^7.3.2",
"fast-check": "^3.14.0",
"ignore-loader": "^0.1.2",
"isomorphic-fetch": "^3.0.0",
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"process": "^0.11.10",
"rollup": "^4.9.5"
"@waku/utils": "0.0.14"
}
},
"@waku/peer-exchange": {

View File

@ -28,3 +28,5 @@ export { KeepAliveManager } from "./lib/keep_alive_manager.js";
export { StreamManager } from "./lib/stream_manager.js";
export { MetadataCodec, wakuMetadata } from "./lib/metadata/index.js";
export * from "./lib/message_hash.js";

View File

@ -17,7 +17,6 @@ import type {
Unsubscribe
} from "@waku/interfaces";
import { DefaultPubsubTopic } from "@waku/interfaces";
import { messageHashStr } from "@waku/message-hash";
import { WakuMessage } from "@waku/proto";
import {
ensurePubsubTopicIsConfigured,
@ -31,6 +30,7 @@ import * as lp from "it-length-prefixed";
import { pipe } from "it-pipe";
import { BaseProtocol } from "../base_protocol.js";
import { messageHashStr } from "../message_hash.js";
import {
FilterPushRpc,

View File

@ -2,7 +2,7 @@ import type { IProtoMessage } from "@waku/interfaces";
import { bytesToHex, hexToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import { messageHash } from "./index.js";
import { messageHash } from "./message_hash.js";
// https://rfc.vac.dev/spec/14/#test-vectors
describe("RFC Test Vectors", () => {

View File

@ -1,6 +0,0 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.dev.json"
}
};

View File

@ -1,6 +0,0 @@
{
"reporterEnabled": "spec, allure-mocha",
"allureMochaReporter": {
"outputDir": "allure-results"
}
}

View File

@ -1,26 +0,0 @@
const config = {
extension: ['ts'],
spec: 'src/**/*.spec.ts',
require: ['ts-node/register', 'isomorphic-fetch'],
loader: 'ts-node/esm',
'node-option': [
'experimental-specifier-resolution=node',
'loader=ts-node/esm'
],
exit: true
};
if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Activating allure reporting");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
configFile: '.mocha.reporters.json'
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");
}
module.exports = config;

View File

@ -1,5 +0,0 @@
build
bundle
dist
node_modules
CHANGELOG.md

View File

@ -1,122 +0,0 @@
# Changelog
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.6 to 0.0.7
* devDependencies
* @waku/interfaces bumped from 0.0.13 to 0.0.14
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.7 to 0.0.8
* devDependencies
* @waku/interfaces bumped from 0.0.14 to 0.0.15
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.8 to 0.0.9
* devDependencies
* @waku/interfaces bumped from 0.0.15 to 0.0.16
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.9 to 0.0.10
* devDependencies
* @waku/interfaces bumped from 0.0.16 to 0.0.17
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.12 to 0.0.13
* devDependencies
* @waku/interfaces bumped from 0.0.19 to 0.0.20
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.13 to 0.0.14
* devDependencies
* @waku/interfaces bumped from 0.0.20 to 0.0.21
## [0.1.8](https://github.com/waku-org/js-waku/compare/message-hash-v0.1.7...message-hash-v0.1.8) (2023-10-16)
### Features
* Add Firefox and Webkit to karma ([#1598](https://github.com/waku-org/js-waku/issues/1598)) ([d9e4bcb](https://github.com/waku-org/js-waku/commit/d9e4bcbe3f7bcc092f20621bd362d76426701dab))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.11 to 0.0.12
* devDependencies
* @waku/interfaces bumped from 0.0.18 to 0.0.19
## [0.1.7](https://github.com/waku-org/js-waku/compare/message-hash-v0.1.6...message-hash-v0.1.7) (2023-09-11)
### ⚠ BREAKING CHANGES
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316))
### Features
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316)) ([50c2c25](https://github.com/waku-org/js-waku/commit/50c2c2540f3c5ff78d93f3fea646da0eee246e17))
* Implement deterministic message hash logic ([fe57461](https://github.com/waku-org/js-waku/commit/fe574613290875d1c142aa51c18641346208401d))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from 0.0.10 to 0.0.11
* devDependencies
* @waku/interfaces bumped from 0.0.17 to 0.0.18
## [0.1.2](https://github.com/waku-org/js-waku/compare/message-hash-v0.1.1...message-hash-v0.1.2) (2023-05-18)
### ⚠ BREAKING CHANGES
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316))
### Features
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316)) ([50c2c25](https://github.com/waku-org/js-waku/commit/50c2c2540f3c5ff78d93f3fea646da0eee246e17))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from * to 0.0.6
* devDependencies
* @waku/interfaces bumped from * to 0.0.13
## [0.1.1](https://github.com/waku-org/js-waku/compare/message-hash-v0.1.0...message-hash-v0.1.1) (2023-05-09)
### Features
* Implement deterministic message hash logic ([fe57461](https://github.com/waku-org/js-waku/commit/fe574613290875d1c142aa51c18641346208401d))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @waku/utils bumped from * to 0.0.5
* devDependencies
* @waku/interfaces bumped from * to 0.0.12

View File

@ -1,26 +0,0 @@
[![NPM](https://nodei.co/npm/@waku/message-hash.png)](https://npmjs.org/package/@waku/message-hash)
![GitHub Action](https://img.shields.io/github/workflow/status/waku-org/js-waku/CI)
[![Discord chat](https://img.shields.io/discord/864066763682218004.svg?logo=discord&colorB=7289DA)](https://discord.gg/Nrac59MfSX)
# @waku/message-hash
TypeScript implementation of the _Deterministic Message Hashing_ as specified in [14/WAKU2-MESSAGE](https://rfc.vac.dev/spec/14/).
See [JS-Waku README](https://github.com/waku-org/js-waku) for more information.
## Contributing
See [CONTRIBUTING.md](https://github.com/waku-org/js-waku/blob/master/CONTRIBUTING.md).
## License
Licensed and distributed under either of
- MIT license: [LICENSE-MIT](https://github.com/waku-org/js-waku/blob/master/LICENSE-MIT) or http://opensource.org/licenses/MIT
or
- Apache License, Version 2.0, ([LICENSE-APACHE-v2](https://github.com/waku-org/js-waku/blob/master/LICENSE-APACHE-v2) or http://www.apache.org/licenses/LICENSE-2.0)
at your option. These files may not be copied, modified, or distributed except according to those terms.

View File

@ -1,3 +0,0 @@
const config = require("../../karma.conf.cjs");
module.exports = config;

View File

@ -1,86 +0,0 @@
{
"name": "@waku/message-hash",
"version": "0.1.10",
"description": "TypeScript implementation of the Deterministic Message Hashing as specified in 14/WAKU2-MESSAGE",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"type": "module",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/message-hash#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",
"build:bundle": "rollup --config rollup.config.js",
"fix": "run-s fix:*",
"fix:lint": "eslint src *.js --fix",
"check": "run-s check:*",
"check:tsc": "tsc -p tsconfig.dev.json",
"check:lint": "eslint src *.js",
"check:spelling": "cspell \"{README.md,src/**/*.ts}\"",
"test": "NODE_ENV=test run-s test:*",
"test:node": "NODE_ENV=test TS_NODE_PROJECT=./tsconfig.dev.json mocha",
"test:browser": "NODE_ENV=test karma start karma.conf.cjs",
"watch:build": "tsc -p tsconfig.json -w",
"watch:test": "mocha --watch",
"prepublish": "npm run build",
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@noble/hashes": "^1.3.2",
"@waku/utils": "0.0.14"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.11",
"@types/debug": "^4.1.12",
"@types/mocha": "^10.0.1",
"@waku/build-utils": "*",
"@waku/interfaces": "0.0.21",
"chai": "^4.3.10",
"cspell": "^7.3.2",
"fast-check": "^3.14.0",
"ignore-loader": "^0.1.2",
"isomorphic-fetch": "^3.0.0",
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"process": "^0.11.10",
"rollup": "^4.9.5"
},
"files": [
"dist",
"bundle",
"src/*.ts",
"src/lib/**/*.ts",
"!**/*.spec.*",
"!**/*.json",
"CHANGELOG.md",
"LICENSE",
"README.md"
]
}

View File

@ -1,24 +0,0 @@
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import { extractExports } from "@waku/build-utils";
import * as packageJson from "./package.json" assert { type: "json" };
const input = extractExports(packageJson);
export default {
input,
output: {
dir: "bundle",
format: "esm"
},
plugins: [
commonjs(),
json(),
nodeResolve({
browser: true,
preferBuiltins: false
})
]
};

View File

@ -1,3 +0,0 @@
{
"extends": "../../tsconfig.dev"
}

View File

@ -1,10 +0,0 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "dist/",
"rootDir": "src",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"],
"exclude": ["src/**/*.spec.ts", "src/test_utils"]
}

View File

@ -1,4 +0,0 @@
{
"extends": ["../../typedoc.base.json"],
"entryPoints": ["src/index.ts"]
}