Skip to content

Latest commit

 

History

History
146 lines (104 loc) · 4.4 KB

CONTRIBUTING.md

File metadata and controls

146 lines (104 loc) · 4.4 KB

Contributing

Getting Started: Backend & Frontend

Requirements

First Setup

git clone https://github.com/MTES-MCT/monitor-ui.git
cd monitor-ui
yarn
yarn postinstall # Optional: automatically run each time Yarn cache is cleared

Note

You may have to manually run yarn postinstall to update post-install scripts when Yarn cache already exists.

Local Development

yarn dev

Run E2E tests

You must have the Storybook running locally to run the E2E tests (yarn dev). You can then run the E2E tests with:

yarn test:e2e:open

Run Release E2E tests

In order to test that the final package is working as expected when imported in another project, you can run the release E2E tests:

yarn test:e2e:release:setup # Build, install the package and start the sample React with Vite project
yarn test:e2e:release # In another tab/terminal

Conventions

Please respect Conventional Commit messages as defined by Angular in their contributing documentation.

Release

The release process is automated, including versionning and release notes generation, using semantic-release.

  1. Go to Github Actions Release Workflow
  2. Click on "Run workflow" > "Run workflow" ("Branch: main" should be selected by default).
  3. This will generate a version pull request with a title looking like ci(release): X.Y.Z which will then be auto-merged by the Merge Release Pull Request workflow.

Important

DO NOT merge other pull requests:

  • while the Release workflow is running
  • or while the release pull request is still open (waiting to be auto-merged).

Versionning

In short, 'feat(...):' will generated minor versions and 'fix(...):' will generate patch versions.

Breaking changes

If you have to release a BREAKING CHANGE, you should look at the official documentation and you may look at this pull request as an example.

In the case of a BREAKING CHANGE, it's strongly advised to add an exclamation point before the colon in the commit message, i.e.:

git commit -m 'feat(fields)!: this prop has been removed'
git commit -m 'feat!: all theses component props are now strings instead of numbers'

And DON'T FORGET the BREAKING CHANGE: ... in the commit message body.

Warning

When using an exclamation point, your bash can interpret it as a history expansion character.
To avoid that, you can:

  • either escape it with a backslash: git commit -m "feat\!:..." when using double quotes
  • or simply use single quotes: git commit -m 'feat!: ...'.

Maintenance

Updating icons

  1. Copy the new SVG icons in src/assets/icons folder
  2. Run
yarn icons

to generate React components from the SVG icons.

Updating caniuse browserlist

We should regularly update browserlist database:

npx browserslist@latest --update-db

Notes

We added @babel/runtime in package.json dependencies to fix this error:

@rsuite/icons tried to access @babel/runtime, but it isn't declared in its dependencies;
this makes the require call ambiguous and unsound.

We added prop-types in package.json dependencies to fix this error:

ModuleNotFoundError: Module not found: Error:
Can't resolve 'prop-types' in '.../monitor-ui/.yarn/__virtual__/.../@rsuite/icons/lib'