The project is developed in a monorepo, as such, it differentiates between applications and libraries.
- A Linux distro, like Fedora.
- NodeJS > v14, or newer LTS version.
- Yarn (this project uses Yarn v3)
- This project uses
rsync
in order to synchronize .css files in one of its build steps. - A back-end API to connect to. Please see instructions in assisted-test-infra.
- yalc (simulates a local package registry).
# We recommend using npm in order to get the package installed globally: npm i -g yalc
# Now, from a directory outside the project, verify the command works as expected yalc --version
- Create your own fork of this repo and
git clone
it.git clone https://github.com/<username>/assisted-installer-ui.git
- Create a
.env.local
file inapps/assisted-ui/
and add the Assisted Installer API URLAIUI_APP_API_URL=http://<host-ip>:6008
- Set up the package managers shims and install the project dependencies:
yarn install
- Build the project
yarn build:all
- Starting the project:
- Watch mode (for developing integrations, see next section for more
details)
yarn start:watch_mode
- Stand-alone mode (browse to http://localhost:5173/ using a
modern web browser after running this command).
yarn start:assisted_ui
- Watch mode (for developing integrations, see next section for more
details)
The Assisted Installer UI is consumed as a library at build-time by other applications.
The uhc-portal is one of them and is the
application you see at https://console.redhat.com/openshift.
Use this setup if you want to test the libs/ui-lib
integration with the uhc-portal. These steps
apply for libs/locales
as well.
- In one terminal run the project in watch mode.
The script builds and publishes the@openshift-assisted/ui-lib
and its workspace dependencies to the local registry everytime you'll make a change.yarn start:watch_mode
- Fork and clone the uhc-portal project
git clone https://gitlab.cee.redhat.com/<username>/uhc-portal.git
- Inside the uhc-portal run the following commands
Note:
yarn install yalc link @openshift-assisted/ui-lib yalc link @openshift-assisted/locales yalc link @openshift-assisted/types
yalc link
needs to be executed following theyarn install
command.
Be aware that this command updates the project'spackage.json
andyarn.lock
files.
DO NOT COMMIT THESE CHANGES INTO VERSION CONTROL. - Now you can follow the uhc-portal's README file in order to set up their dev-environment.
Some components of the Assisted Installer UI are integrated into the Central Infrastructure Management project (a.k.a. stolostron/console).
Follow these steps if you want to test the libs/ui-lib
integration within stolostron/console
.
- In one terminal run the project in watch mode.
yarn start:watch_mode
- Follow the stolostron/console development setup guide.
- To use the locally published
@openshift-assisted/*
packages inside thestolostron/console
run the following commands:Note:cd frontend yalc add @openshift-assisted/ui-lib yalc link @openshift-assisted/locales yalc link @openshift-assisted/types
yalc link
needs to be executed following thenpm install
command.
Be aware that this command updates the project'spackage.json
andpackage-lock.json
files.
DO NOT COMMIT THESE CHANGES INTO VERSION CONTROL.
The TypeScript types used by Assisted Installer UI are generated automatically from the assisted-service's swagger file. Use this command to update them from their master branch.
yarn workspace @openshift-assisted/types update:assisted-installer-service
This project uses Vitest for unit testing.
To run existing unit tests, call
yarn test:unit
To write a unit test, simply create/update a *.test.ts
file.