At the moment, our IDEs of choice are JetBrains tools, i.e. WebStorm and family. If you plan to do development in some other editor (namely, VS Code, Vim, whatever), please make sure you're able to follow the code formatting etc. in the same way as everybody else.
git config --local core.autocrlf input
The LF is our line ending of choice. Be sure to set
- Go Settings… » Editor » Code Style and select
Unix and macOS (\n)
as Line separator.
Please use lts/gallium
. Install yarn
1.x for this version. Then run
yarn
to install project dependencies.
- Go Settings… » Plugins and search for Prettier plugin. Install it.
- Go Settings… » Languages & Frameworks » JavaScript » Prettier.
- Choose Prettier plugin path from the dropdown.
- Set "Run for files" to
{**/*,*}.{js,ts,jsx,tsx,json,css,scss,sass}
- Check both On Reformat Code action and On Save checkboxes.
- Go Settings… » Languages & Frameworks » TypeScript » TSLint » and select Automatic TSLint configuration.
- OpenAPI specifications
- i18n support
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ????????-????-????-????-????????????
Ask for _authToken value on #frontend channel of the project's Discord.
- Assign yourself to the task.
- Create a branch (
fr-123-some-name
) and a pull request againststaging
when complete. - See a job you can do, but no task? Let's discuss it on Discord #frontend channel.
- In commits try not to describe what have you done, but rather why have you done that and what is the outcome / improvement / fix.
- Favor readability over conciseness of code
- No dirty hacks unless absolutely necessary. Discuss them first.
- Pass pure strings only to
t()
. No variables, no constants (unless there's a good reason)
Create .env.local
(have a look at .env
file for template). Set up the following
For development purposes you should mock API responses by setting:
REACT_APP_KOKON_API_USE_MOCKS=true
yarn
yarn start
Create .env.production.local
and set values as suggested by backend team. Then:
yarn build
UI sanity tests are located in cypress/integration
directory
Build the app first and then run the tests:
yarn run cypress
Most of the selectors are text-based and are prone to failure on UI change.
If a tests fails due to change in the UI / selectors you can skip it by modifying the *.spec.js
file in cypress/integration
and adding skip
attribute to it()
.
it.skip('Failing test', () => {})
In order to run the tests locally you will need to add values for REACT_APP_GOOGLE_CLIENTID
, REACT_APP_GOOGLE_CLIENT_SECRET
and GOOGLE_REFRESH_TOKEN
in your local .env
file.
Ask for them on #frontend
in Slack or obtain them yourself