Merge pull request #1 from waku-org/setup

This commit is contained in:
fryorcraken.eth 2022-08-08 13:24:10 +10:00 committed by GitHub
commit 06f6c6f250
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 71383 additions and 180544 deletions

129
.cspell.json Normal file
View File

@ -0,0 +1,129 @@
{
"version": "0.1",
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json",
"language": "en",
"words": [
"backoff",
"backoffs",
"bitjson",
"bitauth",
"bufbuild",
"chainsafe",
"cimg",
"ciphertext",
"circleci",
"codecov",
"commitlint",
"dependabot",
"dingpu",
"Dlazy",
"dnsaddr",
"Dout",
"Dscore",
"ecies",
"editorconfig",
"enr",
"enrs",
"enrtree",
"ephem",
"esnext",
"ethersproject",
"execa",
"exponentiate",
"fanout",
"floodsub",
"fontsource",
"globby",
"gossipsub",
"huilong",
"iasked",
"ihave",
"ihaves",
"ineed",
"ipfs",
"iwant",
"jdev",
"jswaku",
"keccak",
"lastpub",
"libauth",
"libp",
"lightpush",
"livechat",
"mkdir",
"multiaddr",
"multiaddresses",
"multiaddrs",
"multicodec",
"multicodecs",
"multiformats",
"mplex",
"multihashes",
"muxed",
"muxer",
"muxers",
"mvps",
"nodekey",
"nwaku",
"opendns",
"peerhave",
"portfinder",
"prettierignore",
"proto",
"protobuf",
"protoc",
"reactjs",
"recid",
"rlnrelay",
"roadmap",
"sandboxed",
"scanf",
"secio",
"seckey",
"secp",
"sscanf",
"staticnode",
"statusim",
"submodule",
"submodules",
"supercrypto",
"transpiled",
"typedoc",
"unencrypted",
"unmarshal",
"unmount",
"unmounts",
"untracked",
"upgrader",
"vacp",
"varint",
"waku",
"wakuconnect",
"wakuv",
"wakunode",
"webfonts",
"websockets",
"wifi",
"xsalsa20",
"Alives"
],
"flagWords": [],
"ignorePaths": [
"package.json",
"package-lock.json",
"yarn.lock",
"tsconfig.json",
"node_modules/**",
"build",
"gen",
"proto",
"*.spec.ts"
],
"patterns": [
{
"name": "import",
"pattern": "/import .*/"
}
],
"ignoreRegExpList": ["import"]
}

62
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,62 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "eth-pm"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]
- package-ecosystem: "npm"
directory: "eth-pm-wallet-encryption"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]
- package-ecosystem: "npm"
directory: "relay-angular-chat"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]
- package-ecosystem: "npm"
directory: "relay-reactjs-chat"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]
- package-ecosystem: "npm"
directory: "store-reactjs-chat"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]
- package-ecosystem: "npm"
directory: "web-chat"
schedule:
interval: "daily"
reviewers: [ "fryorcraken" ]
ignore:
- dependency-name: "*"
update-types:
[ "version-update:semver-patch", "version-update:semver-minor" ]

49
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: CI
on:
push:
branches:
- "master"
pull_request:
jobs:
examples_build_and_test:
strategy:
fail-fast: false
matrix:
example:
[
eth-pm-wallet-encryption,
eth-pm,
relay-angular-chat,
relay-reactjs-chat,
store-reactjs-chat,
web-chat
]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: "16"
cache: "pnpm"
cache-dependency-path: "*/pnpm-lock.yaml"
- name: install
run: pnpm install --frozen-lockfile
working-directory: ${{ matrix.example }}
- name: build
run: pnpm run build
working-directory: ${{ matrix.example }}
- name: test
run: pnpm --if-present test
working-directory: ${{ matrix.example }}

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
dist
node_modules

View File

@ -1,6 +1,6 @@
## Examples
Here is the list of the code examples and the features they demonstrate:
Here is the list of the examples using [`js-waku`](https://www.npmjs.com/package/js-waku) and the features they demonstrate:
- [Web Chat App](web-chat): Group chat, React/TypeScript, Relay, Store.
- [Ethereum Private Message Web App](eth-pm): Private Messaging, React/TypeScript, Light Push, Signature with Web3, Asymmetric Encryption.

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
"private": true,
"homepage": "/examples/eth-pm-wallet-encryption",
"dependencies": {
"@ethersproject/providers": "^5.6.8",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.16.2",
@ -18,7 +19,8 @@
"js-waku": "^0.24.0",
"protobufjs": "^6.11.2",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react-dom": "^18.1.0",
"uint8arrays": "^3.1.0"
},
"scripts": {
"start": "cra-webpack-rewired start",
@ -29,7 +31,7 @@
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts --ext .tsx",
"test:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" --list-different",
"test:spelling": "cspell \"{README.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../../.cspell.json",
"test:spelling": "cspell \"{README.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"
},

File diff suppressed because it is too large Load Diff

37114
eth-pm/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,21 +4,17 @@
"private": true,
"homepage": "/examples/eth-pm",
"dependencies": {
"@ethersproject/providers": "^5.6.8",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^14.0.4",
"@types/jest": "^27.4.0",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3",
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.4",
"fontsource-roboto": "^4.0.0",
"js-waku": "^0.24.0",
"protobufjs": "^6.11.2",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react": "^17.0.2",
"react-dom": "^17.0.2",
"uint8arrays": "^3.1.0"
},
"scripts": {
"start": "cra-webpack-rewired start",
@ -29,7 +25,7 @@
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts --ext .tsx",
"test:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" --list-different",
"test:spelling": "cspell \"{README.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../../.cspell.json",
"test:spelling": "cspell \"{README.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"
},
@ -55,7 +51,10 @@
},
"devDependencies": {
"@ethersproject/shims": "^5.5.0",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.19",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"cra-webpack-rewired": "^1.0.1",

12991
eth-pm/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ export interface KeyPair {
}
/**
* Generate new encryption keypair.
* Generate new encryption key pair.
*/
export async function generateEncryptionKeyPair(): Promise<KeyPair> {
const privateKey = generatePrivateKey();

View File

@ -2,7 +2,7 @@ import { KeyPair } from "../crypto";
import { utils } from "js-waku";
/**
* Save keypair to storage, encrypted with password
* Save key pair to storage, encrypted with password
*/
export async function saveKeyPairToStorage(
EncryptionKeyPair: KeyPair,
@ -20,7 +20,7 @@ export async function saveKeyPairToStorage(
}
/**
* Load keypair from storage, decrypted using password
* Load key pair from storage, decrypted using password
*/
export async function loadKeyPairFromStorage(
password: string

1
relay-angular-chat/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.angular/cache

View File

@ -61,7 +61,7 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",

View File

@ -7,8 +7,9 @@
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test-ci": "ng test --watch=false"
"test": "is-ci-cli test:ci test:local",
"test:local": "ng test",
"test:ci": "ng test --watch=false --browsers=ChromeHeadless"
},
"private": true,
"dependencies": {
@ -35,6 +36,9 @@
"@types/bl": "^5.0.2",
"@types/jasmine": "~4.0.3",
"@types/node": "^17.0.21",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"is-ci-cli": "^2.2.0",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,9 @@
]
},
"devDependencies": {
"cra-webpack-rewired": "^1.0.1"
"cra-webpack-rewired": "^1.0.1",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"typescript": "^4.7.4"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,9 @@
]
},
"devDependencies": {
"cra-webpack-rewired": "^1.0.1"
"@testing-library/dom": "^8.16.1",
"cra-webpack-rewired": "^1.0.1",
"process": "^0.11.10",
"typescript": "^4.7.4"
}
}

File diff suppressed because it is too large Load Diff

14
web-chat/.pnpmfile.cjs Normal file
View File

@ -0,0 +1,14 @@
function readPackage(pkg) {
// Freeze webpack transient dependency
if (pkg.dependencies.webpack) {
pkg.dependencies.webpack = '5.65.0';
}
return pkg
}
module.exports = {
hooks: {
readPackage
}
}

41808
web-chat/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,20 +10,22 @@
"http-browserify": "^1.7.0",
"https-browserify": "^1.0.0",
"js-waku": "^0.24.0",
"libp2p-interfaces": "^4.0.6",
"long": "^5.2.0",
"multiaddr": "^10.0.1",
"peer-id": "^0.16.0",
"process": "^0.11.10",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"protobufjs": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"server-name-generator": "^1.0.5",
"stream-browserify": "^3.0.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^14.1.1",
"@types/jest": "^27.5.0",
"@types/node": "^17.0.32",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.3",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"assert": "^2.0.0",
"cra-webpack-rewired": "^1.0.1",
"cspell": "^6.0.0",
@ -42,7 +44,7 @@
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts --ext .tsx",
"test:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" \"./config/*.js\" --list-different",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../../.cspell.json",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../.cspell.json",
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" \"./config/*.js\" --write",
"fix:lint": "eslint src --ext .ts --ext .tsx --fix",
"proto": "run-s proto:*",

12913
web-chat/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff