Move web-chat to examples folder

This commit is contained in:
Franck Royer 2021-05-05 14:57:46 +10:00
parent a43e9987ff
commit 316edff778
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
31 changed files with 17 additions and 104 deletions

View File

@ -37,14 +37,14 @@ jobs:
- name: install using npm i
run: npm install
working-directory: web-chat
working-directory: examples/web-chat
- name: build web app
run: npm run build
working-directory: web-chat
working-directory: examples/web-chat
- name: Deploy web chat app on gh pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web-chat/build
publish_dir: ./examples/web-chat/build

View File

@ -12,7 +12,7 @@ jobs:
examples_build_and_test:
strategy:
matrix:
example: [ cli-chat ]
example: [ cli-chat, web-chat ]
runs-on: ubuntu-latest
steps:

View File

@ -1,42 +0,0 @@
name: Webchat CI
on:
push:
branches:
- 'main'
- 'staging'
- 'trying'
pull_request:
jobs:
web_chat_build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: node-v1-${{ hashFiles('**/package-lock.json') }}
- name: "[js-waku] install using npm ci"
uses: bahmutov/npm-install@v1
- name: "[js-waku] build"
run: npm run build
- name: install using npm i
run: npm install
working-directory: web-chat
- name: test
run: npm run test
working-directory: web-chat

View File

@ -46,7 +46,7 @@ To run a development version locally, do:
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
cd web-chat
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
```

View File

@ -1,7 +1,7 @@
status = [
"build_and_test (14, ubuntu-latest)",
"build_and_test (14, macos-latest)",
"web_chat_build_and_test",
"examples_build_and_test (web-chat)",
"examples_build_and_test (cli-chat)"
]
block_labels = ["work-in-progress"]

View File

@ -46,6 +46,7 @@
"prettierignore",
"protobuf",
"protoc",
"reactjs",
"rlnrelay",
"sandboxed",
"secio",

View File

@ -0,0 +1,3 @@
# A React Web Chat App powered by js-waku
See js-waku [README](../../README.md#web-chat-app-reactjs) for details.

View File

@ -11,7 +11,7 @@
"react": "^16.14.0",
"react-dom": "^16.14.0",
"server-name-generator": "^1.0.5",
"waku": "../build/main/lib",
"waku": "../../build/main/lib",
"web-vitals": "^1.1.1"
},
"devDependencies": {
@ -30,10 +30,7 @@
"typescript": "^4.2.4"
}
},
"../build/main/chat": {
"extraneous": true
},
"../build/main/lib": {},
"../../build/main/lib": {},
"node_modules/@babel/code-frame": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
@ -9864,7 +9861,7 @@
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
"integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=",
"deprecated": "core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3."
"deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js."
},
"node_modules/fbjs/node_modules/promise": {
"version": "7.3.1",
@ -22886,7 +22883,7 @@
}
},
"node_modules/waku": {
"resolved": "../build/main/lib",
"resolved": "../../build/main/lib",
"link": true
},
"node_modules/walker": {
@ -43271,7 +43268,7 @@
}
},
"waku": {
"version": "file:../build/main/lib"
"version": "file:../../build/main/lib"
},
"walker": {
"version": "1.0.7",

View File

@ -8,7 +8,7 @@
"react": "^16.14.0",
"react-dom": "^16.14.0",
"server-name-generator": "^1.0.5",
"waku": "../build/main/lib",
"waku": "../../build/main/lib",
"web-vitals": "^1.1.1"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
import { multiaddr } from 'multiaddr';
import PeerId from 'peer-id';
import Waku from '../../build/main/lib/waku';
import Waku from 'waku/waku';
function help(): string[] {
return [

View File

@ -1,46 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).