Please read and follow our Code of Conduct.
Every feature or bug fix should have an associated GitHub issue. This should be created prior to beginning development and, ideally, should be tagged as "accepted" before any actual work is begun.
A feature story should be written in the behavior-driven development (BDD) process.
For bugs, the issue should clearly specify the Steps to reproduce with the Actual behavior. Please be clear about the expected behavior and provide details like device, browser, screenshots or video of the issue.
This project uses eslint:recommended
to review your code style. No errors should be displayed in the terminal.
To check run:
$ npm run lint
Mocha is used for writing unit test. Please ensure all code has proper unit test before submission.
To check run:
$ npm run test
We use Storybook for documentation.
When adding a new feature please review the documentation to ensure the new feature is properly documented as a story.
Bugfix's should review the stories related to ensure everything is correct and up to date.
While in development run:
$ npm run storybook
To generate the docs for a Pull Request (PR):
$ npm run build-storybook
The Feature Branch Workflow is a Gitflow branching strategy that assumes a central repository and main represents the official project history. Instead of committing directly on the main branch, developers should create a new branch every time they start work on a new feature or bug fix.
Branches should have a consistent naming convention. Feature branches can start with feature/*
and bug fix branches should start with bugfix/*
. Before a branch is merged to main, it needs to be approved.
Main -----O-----O-------------O-------------O----------------
| | |
| | |
| | |
| | |
Feature 1 ...........+--O-----O----+.............|.................
| |
| |
| |
| |
Feature 2 ........................+---O-----O---+.................
We use https://www.conventionalcommits.org/en/v1.0.0/ for commit messages.
Once a pull request receives the required approvals, it will be merged to the main branch.
All pull requests must be merged using Squash and merge strategy.
When using Squash and merge strategy, a new squash commit that contains all the changes from the pull request is created by the GitHub. This commit is going to get merged into the main branch.
IMPORTANT
The PR title should follow the conventional commit format with the github issue number. This is important because it will be added to the changelog if it is a feat:
or fix:
comment. Below are some examples.
fix: Fix text color in the search bar (#4)
docs: Improve installation documentation (#15)
style: Fix indentation and typos in the files (#16)
refactor: Use another logo (#23)
test: Add tests for a feature (#42)
chore: Add new action Github job (#69)
feat: Updated Mettle-tool-tip component with auto placement (#696)
We use https://semver.org/ for versioning mettle.
In order to create a release with a specified version add this description to your PR merge.
Release-As: 2.0.0
In the event that please-release
is not functioning, the following procedure will
generate the release notes
Before running the release command, find the tagged release version with the following command
$ npm run release -- --dry-run
Create the branch in the following format release-v*
e.g. release-v1.10.3
Final step is to run the release and push to main.
$ npm run release
Be sure to also push the follow tags but do not run
npm publish
If the version that is desired is not being generated, you can set it like so:
$ npm run release -- --release-as major|minor|patch
# Or
$ npm run release -- --release-as 1.13.3
Please review all feedback on a PR. This is required for a merge.
- Nodejs (LTS)
- npm (LTS)
Node installation can be found at the following location: https://nodejs.org/en/download/ . When you install Nodejs
, npm
is also installed.
Now that you have reviewed the contribution guide you are ready to contribute.
- Be sure to fork the repository.
- Clone your forked repository.
- run
$ npm install
from the root directory.
This will install all dependencies needed to run and maintain the project.
Now that the setup is done
- Create your branch from main.
- Develop!
Happy Contributing!