Redsign qortal-ui repo
18
README.md
@ -17,7 +17,6 @@ Installation
|
|||||||
Packages required:
|
Packages required:
|
||||||
- Node.js
|
- Node.js
|
||||||
- npm
|
- npm
|
||||||
- yarn
|
|
||||||
|
|
||||||
Easiest way to install the lastest required packages on Linux is via nvm.
|
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/>
|
``` source ~/.bashrc ``` (For Fedora / CentOS) <br/>
|
||||||
``` nvm ls-remote ``` (Fetch list of available versions) <br/>
|
``` nvm ls-remote ``` (Fetch list of available versions) <br/>
|
||||||
``` nvm install v18.14.0 ``` (LTS: Hydrogen supported by Electron) <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.6 ``` <br/>
|
||||||
``` npm --location=global install npm@9.6.4 ``` <br/>
|
|
||||||
|
|
||||||
On BSD do a ``` pkg_add node followed by npm install -g yarn ```
|
|
||||||
|
|
||||||
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.
|
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
|
Clone the main UI repo
|
||||||
- ``` git clone https://github.com/Qortal/qortal-ui.git ```
|
- ``` 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
|
Build UI server and files
|
||||||
-------------------------
|
-------------------------
|
||||||
In `qortal-ui` directory, run:
|
In `qortal-ui` directory, run:
|
||||||
```
|
```
|
||||||
yarn run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Start UI Server ( preferred way )
|
Start UI Server ( preferred way )
|
||||||
---------------
|
---------------
|
||||||
```
|
```
|
||||||
yarn run server &
|
npm run server &
|
||||||
```
|
```
|
||||||
The "&" at the end puts the UI server in the background.
|
The "&" at the end puts the UI server in the background.
|
||||||
|
|
||||||
Run UI using electron
|
Run UI using electron
|
||||||
---------------------
|
---------------------
|
||||||
```
|
```
|
||||||
yarn run start-electron
|
npm run start-electron
|
||||||
```
|
```
|
||||||
|
|
||||||
Build script (unix-like systems only)
|
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 />
|
`-s`: run UI server after completing the build<br />
|
||||||
`-e`: run electron 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 />
|
`-h`: show help<br />
|
||||||
|
|
||||||
Example command to build and run the UI server:
|
Example command to build and run the UI server:
|
||||||
|
4
build.js
@ -1,12 +1,12 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const uiCore = require('qortal-ui-core')
|
const uiCore = require('./core/ui-core.js')
|
||||||
|
|
||||||
const generateBuildConfig = uiCore('generate_build_config')
|
const generateBuildConfig = uiCore('generate_build_config')
|
||||||
const build = uiCore('build')
|
const build = uiCore('build')
|
||||||
|
|
||||||
const config = require('./config/config.js')
|
const config = require('./config/config.js')
|
||||||
|
|
||||||
const pluginsController = require('qortal-ui-plugins')
|
const pluginsController = require('./plugins/default-plugins.js')
|
||||||
const buildDefalutPlugins = pluginsController('build')
|
const buildDefalutPlugins = pluginsController('build')
|
||||||
|
|
||||||
|
|
||||||
|
47
build.sh
@ -1,11 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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
|
SHOW_HELP=0
|
||||||
FORCE_LINK=0
|
NPM_WATCH=0
|
||||||
YARN_WATCH=0
|
|
||||||
RUN_SERVER=0
|
RUN_SERVER=0
|
||||||
RUN_ELECTRON=0
|
RUN_ELECTRON=0
|
||||||
|
|
||||||
@ -16,14 +12,9 @@ while [ -n "$*" ]; do
|
|||||||
SHOW_HELP=1
|
SHOW_HELP=1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-f)
|
|
||||||
# Force relink and reinstall dependencies
|
|
||||||
FORCE_LINK=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
-w)
|
-w)
|
||||||
# Use "yarn watch" instead of "yarn build", to enable hot swapping
|
# Use "npm run watch" instead of "npm run build", to enable hot swapping
|
||||||
YARN_WATCH=1
|
NPM_WATCH=1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-s)
|
-s)
|
||||||
@ -42,34 +33,16 @@ done
|
|||||||
if [ "${SHOW_HELP}" -eq 1 ]; then
|
if [ "${SHOW_HELP}" -eq 1 ]; then
|
||||||
echo
|
echo
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo "build.sh [-h] [-f] [-s] [-e]"
|
echo "build.sh [-h] [-w] [-s] [-e]"
|
||||||
echo
|
echo
|
||||||
echo "-h: show help"
|
echo "-h: show help"
|
||||||
echo "-f: force relink and reinstall dependencies"
|
echo "-w: use 'npm run watch' instead of 'npm run build', to enable hot swapping"
|
||||||
echo "-w: use 'yarn watch' instead of 'yarn build', to enable hot swapping"
|
|
||||||
echo "-s: run UI server after completing the build"
|
echo "-s: run UI server after completing the build"
|
||||||
echo "-e: run electron server after completing the build"
|
echo "-e: run electron server after completing the build"
|
||||||
echo
|
echo
|
||||||
exit
|
exit
|
||||||
fi
|
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 "")
|
WATCH_PID=$(cat "watch.pid" || echo "")
|
||||||
if [ ! -z "${WATCH_PID}" ]; then
|
if [ ! -z "${WATCH_PID}" ]; then
|
||||||
echo "Stopping existing watch process..."
|
echo "Stopping existing watch process..."
|
||||||
@ -77,22 +50,22 @@ if [ ! -z "${WATCH_PID}" ]; then
|
|||||||
rm -f "watch.pid"
|
rm -f "watch.pid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${YARN_WATCH}" -eq 1 ]; then
|
if [ "${NPM_WATCH}" -eq 1 ]; then
|
||||||
echo "Building qortal-ui in watch mode..."
|
echo "Building qortal-ui in watch mode..."
|
||||||
yarn run watch &
|
npm run watch &
|
||||||
echo "$!" > "watch.pid";
|
echo "$!" > "watch.pid";
|
||||||
else
|
else
|
||||||
yarn run build
|
npm run build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${RUN_SERVER}" -eq 1 ]; then
|
if [ "${RUN_SERVER}" -eq 1 ]; then
|
||||||
echo "Running UI server..."
|
echo "Running UI server..."
|
||||||
trap : INT
|
trap : INT
|
||||||
yarn run server
|
npm run server
|
||||||
elif [ "${RUN_ELECTRON}" -eq 1 ]; then
|
elif [ "${RUN_ELECTRON}" -eq 1 ]; then
|
||||||
echo "Starting electron..."
|
echo "Starting electron..."
|
||||||
trap : INT
|
trap : INT
|
||||||
yarn run start-electron
|
npm run start-electron
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WATCH_PID=$(cat "watch.pid" || echo "")
|
WATCH_PID=$(cat "watch.pid" || echo "")
|
||||||
|
@ -7,7 +7,7 @@ const build = {
|
|||||||
imgDir: path.join(__dirname, '../img')
|
imgDir: path.join(__dirname, '../img')
|
||||||
},
|
},
|
||||||
aliases: {
|
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')
|
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 |