Organize frontend (#346)

* Remove intermediate squeak-node-frontend dir

* Create build-protos.sh

* Fix build-protos script in readme
This commit is contained in:
Jonathan Zernik 2020-10-29 23:21:38 -04:00 committed by GitHub
parent 927299cef0
commit f8cda6fef2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
173 changed files with 24 additions and 6 deletions

View file

@ -1,7 +1,14 @@
# frontend
## Build protos
- Install `protoc` and `protoc-gen-grpc-web`:
https://github.com/grpc/grpc-web#code-generator-plugin
- Run `./build-protos.sh`
## Run in dev mode
- [Build protos](#build-protos)
- Edit **config.ini** and add the following configs in the `webadmin` section
```
login_disabled=true
@ -10,14 +17,16 @@
- Start the squeak server.
- Start the frontend in dev mode with the `REACT_APP_SERVER_PORT` environment variable.
```
$ npm install
$ REACT_APP_SERVER_PORT=12994 npm start
```
## Build
- Install `protoc` and `protoc-gen-grpc-web`:
https://github.com/grpc/grpc-web#code-generator-plugin
- Run `make-build.sh`
## Build for production
- [Build protos](#build-protos)
- Make the build:
```
$ npm install
$ npm run build
```
- Copy the generated `build` folder into `squeaknode/admin/webapp/static/`.

9
frontend/build-protos.sh Executable file
View file

@ -0,0 +1,9 @@
cp -r ../proto src/
(cd src && \
protoc -I=. proto/squeak_admin.proto proto/lnd.proto \
--js_out=import_style=commonjs:. \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:.)
./pb_disable-eslint.sh src/proto/

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more