Redsign qortal-ui repo
18
README.md
@ -17,7 +17,6 @@ Installation
|
||||
Packages required:
|
||||
- Node.js
|
||||
- npm
|
||||
- yarn
|
||||
|
||||
Easiest way to install the lastest required packages on Linux is via nvm.
|
||||
|
||||
@ -28,10 +27,7 @@ Easiest way to install the lastest required packages on Linux is via nvm.
|
||||
``` source ~/.bashrc ``` (For Fedora / CentOS) <br/>
|
||||
``` nvm ls-remote ``` (Fetch list of available versions) <br/>
|
||||
``` nvm install v18.14.0 ``` (LTS: Hydrogen supported by Electron) <br/>
|
||||
``` npm --location=global install yarn@1.22.19 ``` <br/>
|
||||
``` npm --location=global install npm@9.6.4 ``` <br/>
|
||||
|
||||
On BSD do a ``` pkg_add node followed by npm install -g yarn ```
|
||||
``` npm --location=global install npm@9.6.6 ``` <br/>
|
||||
|
||||
Adding via binary package mirror will only work if you have set the package path. You can do a node or java build via ports instead by downloading ports with portsnap fetch method.
|
||||
|
||||
@ -41,29 +37,29 @@ Verify your installtion with node --version <br/>
|
||||
Clone the main UI repo
|
||||
- ``` git clone https://github.com/Qortal/qortal-ui.git ```
|
||||
|
||||
Installation and linking
|
||||
Installation
|
||||
------------------------
|
||||
In `qortal-ui/` install_link:all
|
||||
In `qortal-ui/` npm install
|
||||
|
||||
|
||||
Build UI server and files
|
||||
-------------------------
|
||||
In `qortal-ui` directory, run:
|
||||
```
|
||||
yarn run build
|
||||
npm run build
|
||||
```
|
||||
|
||||
Start UI Server ( preferred way )
|
||||
---------------
|
||||
```
|
||||
yarn run server &
|
||||
npm run server &
|
||||
```
|
||||
The "&" at the end puts the UI server in the background.
|
||||
|
||||
Run UI using electron
|
||||
---------------------
|
||||
```
|
||||
yarn run start-electron
|
||||
npm run start-electron
|
||||
```
|
||||
|
||||
Build script (unix-like systems only)
|
||||
@ -72,7 +68,7 @@ To automate the above process, run ./build.sh, optionally specifying the followi
|
||||
|
||||
`-s`: run UI server after completing the build<br />
|
||||
`-e`: run electron server after completing the build<br />
|
||||
`-f`: force relink and reinstall dependencies<br />
|
||||
`-w`: use 'npm run watch' instead of 'npm run build', to enable hot swapping<br />
|
||||
`-h`: show help<br />
|
||||
|
||||
Example command to build and run the UI server:
|
||||
|
4
build.js
@ -1,12 +1,12 @@
|
||||
const path = require('path')
|
||||
const uiCore = require('qortal-ui-core')
|
||||
const uiCore = require('./core/ui-core.js')
|
||||
|
||||
const generateBuildConfig = uiCore('generate_build_config')
|
||||
const build = uiCore('build')
|
||||
|
||||
const config = require('./config/config.js')
|
||||
|
||||
const pluginsController = require('qortal-ui-plugins')
|
||||
const pluginsController = require('./plugins/default-plugins.js')
|
||||
const buildDefalutPlugins = pluginsController('build')
|
||||
|
||||
|
||||
|
51
build.sh
@ -1,11 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
declare -a YARN_PACKAGE_DEPS=("qortal-ui-core" "qortal-ui-plugins" "qortal-ui-crypto")
|
||||
YARN_LINK_DIR="${HOME}/.config/yarn/link"
|
||||
|
||||
SHOW_HELP=0
|
||||
FORCE_LINK=0
|
||||
YARN_WATCH=0
|
||||
NPM_WATCH=0
|
||||
RUN_SERVER=0
|
||||
RUN_ELECTRON=0
|
||||
|
||||
@ -16,22 +12,17 @@ while [ -n "$*" ]; do
|
||||
SHOW_HELP=1
|
||||
;;
|
||||
|
||||
-f)
|
||||
# Force relink and reinstall dependencies
|
||||
FORCE_LINK=1
|
||||
;;
|
||||
|
||||
-w)
|
||||
# Use "yarn watch" instead of "yarn build", to enable hot swapping
|
||||
YARN_WATCH=1
|
||||
# Use "npm run watch" instead of "npm run build", to enable hot swapping
|
||||
NPM_WATCH=1
|
||||
;;
|
||||
|
||||
-s)
|
||||
-s)
|
||||
# Run server after building
|
||||
RUN_SERVER=1
|
||||
;;
|
||||
|
||||
-e)
|
||||
-e)
|
||||
# Run electron after building
|
||||
RUN_ELECTRON=1
|
||||
;;
|
||||
@ -42,34 +33,16 @@ done
|
||||
if [ "${SHOW_HELP}" -eq 1 ]; then
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo "build.sh [-h] [-f] [-s] [-e]"
|
||||
echo "build.sh [-h] [-w] [-s] [-e]"
|
||||
echo
|
||||
echo "-h: show help"
|
||||
echo "-f: force relink and reinstall dependencies"
|
||||
echo "-w: use 'yarn watch' instead of 'yarn build', to enable hot swapping"
|
||||
echo "-w: use 'npm run watch' instead of 'npm run build', to enable hot swapping"
|
||||
echo "-s: run UI server after completing the build"
|
||||
echo "-e: run electron server after completing the build"
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Checking dependencies..."
|
||||
for PACKAGE in "${YARN_PACKAGE_DEPS[@]}"; do
|
||||
if [ "${FORCE_LINK}" -eq 1 ]; then
|
||||
echo "Unlinking ${PACKAGE}..."
|
||||
yarn --cwd "${PACKAGE}" unlink "${PACKAGE}"
|
||||
yarn --cwd "${PACKAGE}" unlink
|
||||
fi
|
||||
if [ ! -d "${YARN_LINK_DIR}/${PACKAGE}" ]; then
|
||||
echo "Installing and linking ${PACKAGE}..."
|
||||
yarn --cwd "${PACKAGE}" install
|
||||
yarn --cwd "${PACKAGE}" link
|
||||
yarn link "${PACKAGE}"
|
||||
else
|
||||
echo "${PACKAGE} is already linked."
|
||||
fi
|
||||
done
|
||||
|
||||
WATCH_PID=$(cat "watch.pid" || echo "")
|
||||
if [ ! -z "${WATCH_PID}" ]; then
|
||||
echo "Stopping existing watch process..."
|
||||
@ -77,22 +50,22 @@ if [ ! -z "${WATCH_PID}" ]; then
|
||||
rm -f "watch.pid"
|
||||
fi
|
||||
|
||||
if [ "${YARN_WATCH}" -eq 1 ]; then
|
||||
if [ "${NPM_WATCH}" -eq 1 ]; then
|
||||
echo "Building qortal-ui in watch mode..."
|
||||
yarn run watch &
|
||||
npm run watch &
|
||||
echo "$!" > "watch.pid";
|
||||
else
|
||||
yarn run build
|
||||
npm run build
|
||||
fi
|
||||
|
||||
if [ "${RUN_SERVER}" -eq 1 ]; then
|
||||
echo "Running UI server..."
|
||||
trap : INT
|
||||
yarn run server
|
||||
npm run server
|
||||
elif [ "${RUN_ELECTRON}" -eq 1 ]; then
|
||||
echo "Starting electron..."
|
||||
trap : INT
|
||||
yarn run start-electron
|
||||
npm run start-electron
|
||||
fi
|
||||
|
||||
WATCH_PID=$(cat "watch.pid" || echo "")
|
||||
|
@ -7,7 +7,7 @@ const build = {
|
||||
imgDir: path.join(__dirname, '../img')
|
||||
},
|
||||
aliases: {
|
||||
'qortal-ui-crypto': path.join(__dirname, '../node_modules/qortal-ui-crypto/api.js')
|
||||
'qortal-ui-crypto': path.join(__dirname, '../crypto/api.js')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
const uiCore = require('qortal-ui-core')
|
||||
const uiCore = require('../core/ui-core.js')
|
||||
const defaultConfig = uiCore('default_config')
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 942 B |
Before Width: | Height: | Size: 731 B After Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 877 B After Width: | Height: | Size: 877 B |
Before Width: | Height: | Size: 860 B After Width: | Height: | Size: 860 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 855 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 942 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 740 B |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 716 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 948 B |
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 467 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 910 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 500 B |
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |