omni-common-ui
v0.39.0
Published
Project Omni's common UI components.
Downloads
48
Readme
Omni Common UI
Branch | Build | Coverage ------ | --- | --- master | |
Setting up the environment
Follow this steps to setup your development environment.
- Install NodeJS.
It is highly recommended to use Node Version Manager (for Mac and Linux).
A Windows version is also available. - Install Yarn running
npm install -g yarn
. - Open a terminal at the root folder of the project.
- Run
yarn
.
Committing
All commits should follow the patterns described by semantic-release.
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
Or its simpler version <type>(<scope>): <subject>
. For example, a fix commit could be:
fix(Avatar): Avoided a bug that happened on IE11.
Or adding a new feature:
feat(Avatar): Allowed passing in a default avatar to show if the user's avatar cannot be loaded.
Starting the development environment
When all your dependencies are installed, you can follow this steps to build the project on your machine for development.
- Open a terminal at the root folder of the project.
- Run
yarn start
.
Running our linting tools
- Run
yarn lint:css
to run Stylelint. - Run
yarn lint:js
to run ESLint.
Testing during development
- Open a terminal at the root folder of the project.
- Run
yarn test -- --watch
oryarn test -- --watch --silent
. - The tests will run.
- The tests will run again automatically when you change the code.
Deploying
Make sure your commits follow the Committing section. And just push/merge to the master
branch. The CI job will do the rest.
Frequent problems
yarn start
is broken :(
If you meet some error when trying to run yarn start
or yarn test
, the most common cause is that someone has added or updated some new dependency into the project.
Run yarn
to get your environment up to date.
Some tests keep failing unless I use --no-cache
If you have some tests that are always failing unless you use yarn test -- --no-cache
, that means that the Jest cache is kind of broken. To fix this quickly:
- Run
yarn test -- --showConfig
- Look for the value
cacheDirectory
- Remove that directory manually