This is the UI project for StarTree ThirdEye.
These instructions will help you get the project up and running on your local machine for development and testing purposes.
The project uses nvm to maintain the Node version. Compatible Node version is listed in project root .nvmrc. Follow the instructions to install nvm for Linux/macOS or Windows.
Once you install nvm, go to the project directory and switch to the compatible Node version
$ nvm useThis will switch to the required Node version if already installed and make npm command available in the terminal.
If the required Node version is not installed, it will recommend the command to install it
Found '/Users/default/thirdeye/thirdeye-ui/.nvmrc' with version <14.18.1>
N/A: version "14.18.1 -> N/A" is not yet installed.
You need to run "nvm install 14.18.1" to install it before using it.Following the installation, the command above will let you switch to the required Node version.
💡
nvm use(without version number) might not work when using nvm for Windows. You may need to specify precise Node version from repository root .nvmrc.
Configure Node Package Manager (npm) for use with Artifactory
The project may depend on some packages to be installed from Artifactory and npm needs to be configured to allow access to these packages. The Artifactory repository to install packages from is configured in project root .npmrc.
To configure npm, log in to Artifactory and create an API Key. Then use the API Key to generate npm configuration from Artifactory using curl
$ curl -u<your-email>:<API-Key> http://repo.startreedata.io/artifactory/api/npm/authThis will generate an authentication token that can be used to configure npm
_auth = <authentication-token>
always-auth = true
email = <your-email>Copy the authentication token and use it in ~/.npmrc:
//repo.startreedata.io/artifactory/api/npm/startree-ui/:_auth=<authentication-token>Once you clone the repository, go to the project directory and install
$ npm installThis will install necessary dependencies for the project.
💡
In casenpmerrors out withcb() never calledmessage, remove project root /node-modules and run
$ npm cache clean --forceOnce set up, go to the project directory and run
$ npm run startThis will build and deploy the project using webpack-dev-server at http://localhost:7004.
💡
Configuration for the proxy to the/apiendpoint is located in webpack configuration underdevServer.proxyproperty. Currently, it points to the value ofTE_DEV_PROXY_SERVERenvironment variable or by defaulthttp://localhost:8080/.
StarTree ThirdEye UI is tested on latest, stable release of Chrome, Firefox, Safari and Edge.
Build and deploy the project using webpack-dev-server at http://localhost:7004
$ npm run startBuild the project and output the bundles in project root /dist
$ npm run buildThis will also analyze the bundles using Webpack Bundle Analyzer and generate bundle report in project root /webpack.
Run all tests
$ npm run testWatch files for changes and re-run tests related to changed files
$ npm run test-watchRun all tests and generate coverage report in project root /src/test/unit/coverage
$ npm run test-coverageRun all end to end tests headlessly using Cypress
$ npm run test-e2e -- --config baseUrl=<base-URL> --env username=<username>,password=<password>,clientSecret=<client-secret> --browser firefoxFollowing command line arguments are expected
- Configuration options
baseUrl: server URL to run the tests against
- Environment variables
username: username to authenticate withpassword: password to authenticate withclientSecret: client secret to authenticate with
browser: electron (default), chrome, edge or firefox (other than the default Electron browser, any other browser needs to be installed in the environment where tests are being run)
Run all end to end tests using Cypress Test Runner
$ npm run test-e2e-gui -- --config baseUrl=<base-URL> --env username=<username>,password=<password>,clientSecret=<client-secret>Following command line arguments are expected
- Configuration options
baseUrl: server URL to run the tests against
- Environment variables
username: username to authenticate withpassword: password to authenticate withclientSecret: client secret to authenticate with
Run License Header Checker across the project except for files and directories listed in project root .licenseheaderignore and check for missing copyright header
$ npm run license-header-checkRun License Header Checker across the project except for files and directories listed in project root .licenseheaderignore and insert appropriate copyright header
$ npm run license-header-fixRun ESLint across the project except for files and directories listed in project root .eslintignore and check for issues
$ npm run eslint-checkRun ESLint across the project except for files and directories listed in project root .eslintignore and fix issues
$ npm run eslint-fixRun stylelint across the project except for files and directories listed in project root .stylelintignore and check for issues
$ npm run stylelint-checkRun stylelint across the project except for files and directories listed in project root .stylelintignore and fix issues
$ npm run stylelint-fixRun Prettier across the project except for files and directories listed in project root .prettierignore and check for issues
$ npm run prettier-checkRun Prettier across the project except for files and directories listed in project root .prettierignore and fix issues
$ npm run prettier-fixRun license-header-check, eslint-check, stylelint-check and prettier-check scripts
$ npm run lint-checkRun license-header-fix, eslint-fix, stylelint-fix and prettier-fix scripts
$ npm run lint-fixRun all the scripts that will be executed as part of pull request validation for the project
$ npm run ci-check