- Debian-based Linux or macOS
- Node.js v20 (with npm v10)
- Yarn 2+ (Yarn Modern)
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.
yarn dev
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
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
Please respect Conventional Commit messages as defined by Angular in their contributing documentation.
The release process is automated, including versionning and release notes generation, using semantic-release.
- Go to Github Actions Release Workflow
- Click on "Run workflow" > "Run workflow" ("Branch: main" should be selected by default).
- This will generate a version pull request with a title looking like
ci(release): X.Y.Z
which will then be auto-merged by theMerge 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).
In short, 'feat(...):' will generated minor versions and 'fix(...):' will generate patch versions.
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!: ...'
.
- Copy the new SVG icons in
src/assets/icons
folder - Run
yarn icons
to generate React components from the SVG icons.
We
should regularly update browserlist
database:
npx browserslist@latest --update-db
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'