diff --git a/.github/workflows/add-action-project.yml b/.github/workflows/add-action-project.yml index 5ecdd10d8b..3557a9e9ce 100644 --- a/.github/workflows/add-action-project.yml +++ b/.github/workflows/add-action-project.yml @@ -1,4 +1,4 @@ -name: Add new issues to js-waku project board +name: Add new issues to waku-js project board on: issues: @@ -10,6 +10,6 @@ jobs: steps: - uses: alex-page/github-project-automation-plus@v0.6.0 with: - project: js-waku + project: waku-js column: New repo-token: ${{ secrets.GH_ACTION_PROJECT_MGMT }} diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 050a87edb6..e0b98c2542 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -15,7 +15,7 @@ jobs: - name: Set git author identity run: | - git config user.name "GitHub Action On js-waku Repo" + git config user.name "GitHub Action On waku-js Repo" git config user.email "franck+ghpages@status.im" - name: Install NodeJS @@ -29,10 +29,10 @@ jobs: path: ~/.npm key: node-v1-${{ hashFiles('**/package-lock.json') }} - - name: "[js-waku] install using npm ci" + - name: "[waku-js] install using npm ci" uses: bahmutov/npm-install@v1 - - name: "[js-waku] build" + - name: "[waku-js] build" run: npm run build - name: install using npm i diff --git a/.github/workflows/examples-ci.yml b/.github/workflows/examples-ci.yml index ac2a7c72cd..3d602669ae 100644 --- a/.github/workflows/examples-ci.yml +++ b/.github/workflows/examples-ci.yml @@ -30,10 +30,10 @@ jobs: path: ~/.npm key: examples-node-v1-${{ hashFiles('**/package-lock.json') }} - - name: "[js-waku] install using npm ci" + - name: "[waku-js] install using npm ci" uses: bahmutov/npm-install@v1 - - name: "[js-waku] build" + - name: "[waku-js] build" run: npm run build - name: ${{ matrix.example }} install using npm i diff --git a/CHANGELOG.md b/CHANGELOG.md index a72b41ec97..ec9afefa73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.0] - 2021-05-13 + ### Added - Add usage section to the README. - -## [1.0.0] - 2021-05-11 - -### Added - Support of [Waku v2 Relay](https://rfc.vac.dev/spec/11/). - Support of [Waku v2 Store](https://rfc.vac.dev/spec/13/). - [Node Chat App example](./examples/cli-chat). - [ReactJS Chat App example](./examples/web-chat). - [Typedoc Documentation](https://status-im.github.io/js-waku/docs). -[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD -[1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/f46ce77f57c08866873b5c80acd052e0ddba8bc9..v1.0.0 +[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/f46ce77f57c08866873b5c80acd052e0ddba8bc9..v0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c9612ad08..6ba69f00cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,10 @@ Contributors are welcomed! -We try to keep a number of [`good first issue`](https://github.com/status-im/js-waku/labels/good%20first%20issue) for new contributors. -If you feel confident, you can also check out the [`help wanted`](https://github.com/status-im/js-waku/labels/help%20wanted) issues. +We try to keep a number of [`good first issue`](https://github.com/status-im/waku-js/labels/good%20first%20issue) for new contributors. +If you feel confident, you can also check out the [`help wanted`](https://github.com/status-im/waku-js/labels/help%20wanted) issues. -To have an idea of the work in the pipeline, feel free to view the [js-waku project board](https://github.com/status-im/js-waku/projects/1). +To have an idea of the work in the pipeline, feel free to view the [waku-js project board](https://github.com/status-im/waku-js/projects/1). This project board is to prioritize the work of core contributors so do not be deterred by issues in the `Icebox` or bottom of the `Backlog`. Do note that we have a [CI](./.github/workflows/ci.yml) powered by GitHub Action. @@ -25,7 +25,7 @@ To build and test this repository, you need: To ensure interoperability with [nim-waku](https://github.com/status-im/nim-waku/), some tests are run against a nim-waku node. This is why `nim-waku` is present as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), which itself contain several submodules. -At this stage, it is not possible to exclude nim-waku tests, hence `git submodule update --init --recursive` is run before testing (see [`pretest` script](https://github.com/status-im/js-waku/blob/main/package.json)). +At this stage, it is not possible to exclude nim-waku tests, hence `git submodule update --init --recursive` is run before testing (see [`pretest` script](https://github.com/status-im/waku-js/blob/main/package.json)). To build nim-waku, you also need [Rust](https://www.rust-lang.org/tools/install). diff --git a/README.md b/README.md index ee6b9458e0..6f8c4424e1 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ A JavaScript implementation of the [Waku v2 protocol](https://rfc.vac.dev/spec/1 ## Usage -Install `web3-waku` package: +Install `waku-js` package: ```shell -npm install web3-waku +npm install waku-js ``` Start a waku node: ```javascript -import { Waku } from 'web3-waku'; +import { Waku } from 'waku-js'; const waku = await Waku.create(); ``` @@ -47,7 +47,7 @@ waku.relay.addObserver((msg) => { Send a message on the waku relay network: ```javascript -import { WakuMessage } from 'web3-waku'; +import { WakuMessage } from 'waku-js'; const msg = WakuMessage.fromUtf8String("Here is a message!", "waku/2/my-cool-app/proto") await waku.relay.send(msg); @@ -76,7 +76,7 @@ waku.store.queryHistory(storePeerId, ["waku/2/my-cool-app/proto"], ``` Find more [examples](#examples) below -or checkout the latest `main` branch documentation at [https://status-im.github.io/js-waku/docs/](https://status-im.github.io/js-waku/docs/). +or checkout the latest `main` branch documentation at [https://status-im.github.io/waku-js/docs/](https://status-im.github.io/waku-js/docs/). Docs can also be generated locally using: @@ -87,7 +87,7 @@ npm run doc ## Waku Protocol Support -You can track progress on the [project board](https://github.com/status-im/js-waku/projects/1). +You can track progress on the [project board](https://github.com/status-im/waku-js/projects/1). - ✔: Supported - 🚧: Implementation in progress @@ -111,28 +111,28 @@ You can track progress on the [project board](https://github.com/status-im/js-wa ## Bugs, Questions & Features -If you encounter any bug or would like to propose new features, feel free to [open an issue](https://github.com/status-im/js-waku/issues/new/). +If you encounter any bug or would like to propose new features, feel free to [open an issue](https://github.com/status-im/waku-js/issues/new/). -For support, questions & more general topics, please join the discussion on the [Vac forum](https://forum.vac.dev/tag/js-waku) (use _\#js-waku_ tag). +For support, questions & more general topics, please join the discussion on the [Vac forum](https://forum.vac.dev/tag/waku-js) (use _\#js-waku_ tag). ## Examples ## Web Chat App (ReactJS) A ReactJS chat app is provided as a showcase of the library used in the browser. -A deployed version is available at https://status-im.github.io/js-waku/ +A deployed version is available at https://status-im.github.io/waku-js/ -Find the code in the [examples folder](https://github.com/status-im/js-waku/tree/main/examples/web-chat). +Find the code in the [examples folder](https://github.com/status-im/waku-js/tree/main/examples/web-chat). To run a development version locally, do: ```shell -git clone https://github.com/status-im/js-waku/ ; cd js-waku -npm install # Install dependencies for js-waku -npm run build # Build js-waku +git clone https://github.com/status-im/waku-js/ ; cd waku-js +npm install # Install dependencies for waku-js +npm run build # Build waku-js cd examples/web-chat npm install # Install dependencies for the web app -npm run start # Start development server to serve the web app on http://localhost:3000/js-waku +npm run start # Start development server to serve the web app on http://localhost:3000/waku-js ``` Use `/help` to see the available commands. @@ -142,7 +142,7 @@ Use `/help` to see the available commands. A node chat app is provided as a working example of the library. It is interoperable with the [nim-waku chat app example](https://github.com/status-im/nim-waku/blob/master/examples/v2/chat2.nim). -Find the code in the [examples folder](https://github.com/status-im/js-waku/tree/main/examples/cli-chat). +Find the code in the [examples folder](https://github.com/status-im/waku-js/tree/main/examples/cli-chat). To run the chat app, first ensure you have [Node.js](https://nodejs.org/en/) v14 or above: @@ -153,9 +153,9 @@ node --version Then, install and run: ```shell -git clone https://github.com/status-im/js-waku/ ; cd js-waku -npm install # Install dependencies for js-waku -npm run build # Build js-waku +git clone https://github.com/status-im/waku-js/ ; cd waku-js +npm install # Install dependencies for waku-js +npm run build # Build waku-js cd examples/cli-chat npm install # Install dependencies for the cli app npm run start -- --staticNode /ip4/134.209.139.210/tcp/30303/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ diff --git a/examples/cli-chat/README.md b/examples/cli-chat/README.md index 14a50e890a..af3671430f 100644 --- a/examples/cli-chat/README.md +++ b/examples/cli-chat/README.md @@ -1,3 +1,3 @@ -# A NodeJS CLI Chat App powered by js-waku +# A NodeJS CLI Chat App powered by waku-js -See js-waku [README](../../README.md#cli-chat-app-nodejs) for details. +See waku-js [README](../../README.md#cli-chat-app-nodejs) for details. diff --git a/examples/cli-chat/package-lock.json b/examples/cli-chat/package-lock.json index 21040d61ad..e9d945ef23 100644 --- a/examples/cli-chat/package-lock.json +++ b/examples/cli-chat/package-lock.json @@ -1,17 +1,17 @@ { - "name": "js-waku-cli-chat", - "version": "1.0.0", + "name": "waku-js-cli-chat", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "js-waku-cli-chat", - "version": "1.0.0", + "name": "waku-js-cli-chat", + "version": "0.1.0", "license": "MIT OR Apache-2.0", "dependencies": { "libp2p-tcp": "^0.15.4", "prompt-sync": "^4.2.0", - "web3-waku": "../../build/main" + "waku-js": "../../build/main" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", @@ -7509,7 +7509,7 @@ "integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==", "dev": true }, - "node_modules/web3-waku": { + "node_modules/waku-js": { "resolved": "../../build/main", "link": true }, @@ -13563,7 +13563,7 @@ "integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==", "dev": true }, - "web3-waku": { + "waku-js": { "version": "file:../../build/main" }, "which": { diff --git a/examples/cli-chat/package.json b/examples/cli-chat/package.json index ae76a8881a..2119f51d6a 100644 --- a/examples/cli-chat/package.json +++ b/examples/cli-chat/package.json @@ -1,9 +1,9 @@ { - "name": "js-waku-cli-chat", - "version": "1.0.0", - "description": "A NodeJS CLI Chat App powered by js-waku", + "name": "waku-js-cli-chat", + "version": "0.1.0", + "description": "A NodeJS CLI Chat App powered by waku-js", "main": "./index.ts", - "repository": "https://github.com/status-im/js-waku", + "repository": "https://github.com/status-im/waku-js", "license": "MIT OR Apache-2.0", "keywords": [ "waku", @@ -33,7 +33,7 @@ "dependencies": { "libp2p-tcp": "^0.15.4", "prompt-sync": "^4.2.0", - "web3-waku": "../../build/main" + "waku-js": "../../build/main" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", diff --git a/examples/cli-chat/src/chat.spec.ts b/examples/cli-chat/src/chat.spec.ts index ebc4491778..da45574dca 100644 --- a/examples/cli-chat/src/chat.spec.ts +++ b/examples/cli-chat/src/chat.spec.ts @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { ChatMessage } from 'web3-waku'; +import { ChatMessage } from 'waku-js'; import { formatMessage } from './chat'; diff --git a/examples/cli-chat/src/chat.ts b/examples/cli-chat/src/chat.ts index 54a9f0abc4..7f9215700b 100644 --- a/examples/cli-chat/src/chat.ts +++ b/examples/cli-chat/src/chat.ts @@ -3,7 +3,7 @@ import util from 'util'; import TCP from 'libp2p-tcp'; import { multiaddr, Multiaddr } from 'multiaddr'; -import { ChatMessage, StoreCodec, Waku, WakuMessage } from 'web3-waku'; +import { ChatMessage, StoreCodec, Waku, WakuMessage } from 'waku-js'; const ChatContentTopic = 'dingpu'; @@ -25,7 +25,7 @@ export default async function startChat(): Promise { output: process.stdout, }); - let nick = 'js-waku'; + let nick = 'waku-js'; try { const question = util.promisify(rl.question).bind(rl); // Looks like wrong type definition of promisify is picked. diff --git a/examples/web-chat/README.md b/examples/web-chat/README.md index b1d1a966d2..e0002bb506 100644 --- a/examples/web-chat/README.md +++ b/examples/web-chat/README.md @@ -1,3 +1,3 @@ -# A React Web Chat App powered by js-waku +# A React Web Chat App powered by waku-js -See js-waku [README](../../README.md#web-chat-app-reactjs) for details. +See waku-js [README](../../README.md#web-chat-app-reactjs) for details. diff --git a/examples/web-chat/package-lock.json b/examples/web-chat/package-lock.json index dc8a02bdbb..babdc594c0 100644 --- a/examples/web-chat/package-lock.json +++ b/examples/web-chat/package-lock.json @@ -11,8 +11,8 @@ "react": "^16.14.0", "react-dom": "^16.14.0", "server-name-generator": "^1.0.5", - "web-vitals": "^1.1.1", - "web3-waku": "../../build/main" + "waku-js": "../../build/main", + "web-vitals": "^1.1.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.11.10", @@ -22885,6 +22885,10 @@ "node": ">=10" } }, + "node_modules/waku-js": { + "resolved": "../../build/main", + "link": true + }, "node_modules/walker": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", @@ -23226,10 +23230,6 @@ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz", "integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ==" }, - "node_modules/web3-waku": { - "resolved": "../../build/main", - "link": true - }, "node_modules/webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", @@ -43270,6 +43270,9 @@ "xml-name-validator": "^3.0.0" } }, + "waku-js": { + "version": "file:../../build/main" + }, "walker": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", @@ -43568,9 +43571,6 @@ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz", "integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ==" }, - "web3-waku": { - "version": "file:../../build/main" - }, "webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", diff --git a/examples/web-chat/package.json b/examples/web-chat/package.json index 63ff09d5fa..95283d8e74 100644 --- a/examples/web-chat/package.json +++ b/examples/web-chat/package.json @@ -2,14 +2,14 @@ "name": "web-chat", "version": "0.1.0", "private": true, - "homepage": "/js-waku", + "homepage": "/waku-js", "dependencies": { "@livechat/ui-kit": "*", "react": "^16.14.0", "react-dom": "^16.14.0", "server-name-generator": "^1.0.5", - "web-vitals": "^1.1.1", - "web3-waku": "../../build/main" + "waku-js": "../../build/main", + "web-vitals": "^1.1.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.11.10", @@ -38,8 +38,8 @@ "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../../.cspell.json", "fix:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" --write", "fix:lint": "eslint src --ext .ts --ext .tsx --fix", - "js-waku:build": "cd ../; npm run build", - "predeploy": "run-s js-waku:build build", + "waku-js:build": "cd ../; npm run build", + "predeploy": "run-s waku-js:build build", "deploy": "gh-pages -d build" }, "eslintConfig": { diff --git a/examples/web-chat/public/index.html b/examples/web-chat/public/index.html index a620c9fec6..82c8e1bf6e 100644 --- a/examples/web-chat/public/index.html +++ b/examples/web-chat/public/index.html @@ -7,7 +7,7 @@