Maven builds this project automatically, however, if a manual rebuild of the UI, you may do so in the ways below.
Execute mvn clean install
from the webui directory
We use NVM to have multiple versions on node on one machine, and Lerna to handle our UI package dependencies.
- Install NVM:
brew install nvm
- From the
webui
directory:- Install Node using NVM.
nvm install
- Install UI module dependencies:
npm run bootstrap
- Install Node using NVM.
NOTE: Please ensure you are running the correct version of Node before building packages. The expected version can be found both in the package.json file and in the .nvmrc file.
This can be done in two ways:
- Let lerna build everything:
npm run build
- Build everything independently:
- common-ui:
cd webui/common-ui && npm run build
- master-ui:
cd webui/master-ui && npm run build
- worker-ui:
cd webui/worker-ui && npm run build
- common-ui:
This can be done in two ways:
- Let lerna test everything:
npm run test-ci
- Test everything independently:
- common-ui:
cd webui/common-ui && npm run test
- master-ui:
cd webui/master-ui && npm run test
- worker-ui:
cd webui/worker-ui && npm run test
- common-ui:
NOTE: test-ci
is meant to run tests once and quit (for continuous integration); test
is meant to run tests for one package and will continuously watch for changes (for active development).
This can be done in two ways:
- Let lerna generate coverage for everything:
npm run coverage-ci
- Generate coverage for everything independently:
- common-ui:
cd webui/common-ui && npm run coverage
- master-ui:
cd webui/master-ui && npm run coverage
- worker-ui:
cd webui/worker-ui && npm run coverage
- common-ui:
NOTE: coverage-ci
is meant to run tests once and quit (for continuous integration); "coverage" is meant to run tests for one package and will continuously watch for changes (for active development).
-
Follow the prerequisite instructions above.
-
Enable CORS for the alluxio RESTful api endpoints by setting
alluxio.web.cors.enabled=true
inconf/alluxio-site.properties
-
Start a development server in one of the following ways:
- For all packages:
npm run start
- For each package independently:
- common-ui:
cd webui/common-ui && npm run start
- master-ui:
cd webui/master-ui && npm run start
- worker-ui:
cd webui/worker-ui && npm run start
- common-ui:
This will open two browser windows with the common-ui at
http://localhost:3000
, the master-ui athttp://localhost:3001
, and the worker-ui athttp://localhost:3002
. Your work will be recompiled and updated as you make changes to each package. You will see compile-time errors in the terminal windows and runtime errors in the browser console. - For all packages:
-
(Optionally) Start a test watcher for each package independently (using lerna for this is possible, but you will not be able to interact with the console): 1. common-ui:
cd webui/common-ui && npm run test
1. master-ui:cd webui/master-ui && npm run test
1. worker-ui:cd webui/worker-ui && npm run test
This will continuously run your tests and will show you when tests pass or fail as you work.
-
(Optionally) Run a test coverage report in one of the following ways:
- For all packages:
npm run coverage-ci
- For each package independently:
- common-ui:
cd webui/common-ui && npm run coverage
- master-ui:
cd webui/master-ui && npm run coverage
- worker-ui:
cd webui/worker-ui && npm run coverage
- common-ui:
This will also generate a coverage report within each package:
common/coverage/lcov-report/index.html
,master/coverage/lcov-report/index.html
,worker/coverage/lcov-report/index.html
. You may also runcoverage-ci
instead ofcoverage
in this step if you would like this to execute only once. - For all packages:
This will format .tsx files based on .prettierrc.js
and return errors based on rules defined in .eslintrc.js
.
This can be done in two ways:
- Let lerna format and lint everything:
npm run format
- Build everything independently:
- common-ui:
cd webui/common-ui && npm run format
- master-ui:
cd webui/master-ui && npm run format
- worker-ui:
cd webui/worker-ui && npm run format
- common-ui:
It is sometimes necessary to bump package dependency versions for various reasons:
- Fix vulnerabilities found after an audit.
- Leverage functionality added to a dependency at a later version than the current import.
- Restructure architecture after a paradigm shift.
- Other reasons.
NOTE: Any dependencies that are shared across packages should use identical versions, otherwise lerna will complain about a dependency hoisting error. Please keep shared imported dependency versions synchronized.
Once a dependency changes, it is important to verify any functionality that could be affected by the change. This can be done via unit testing, system testing, and/or old fashioned QA testing.
In order to keep the UI consistent for production builds we shrinkwrap our dependecies using npm-shrinkwrap so that our package versions stay consistent across builds. Shrinkwrapping locks dependency versions so that updates to underlying UI libraries don't affect our build.
Once changes are tested and things work as planned, please run npm shrinkwrap && lerna exec npm shrinkwrap
to lock package dependency versions.