Want to contribute to this repository? Please read below first:
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to this repo. Even better you can submit a Pull Request with a fix.
You can request a new feature by submitting an issue to this repo. Proposed features (with suitable design documentation and reasoning) can be crafted and submitted to this repo as a Pull Request.
If you want to help improve the docs, it’s a good idea to let others know what you’re working on to minimize duplication of effort. Comment on an issue to let others know what you’re working on, or create a new issue if your work doesn’t fit within the scope of any of the existing doc fix projects.
Before you submit your issue, search the repository. Maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
Navigate to the main Azure Repos repository page.
Click the ellipsis menu (...) near the top right (next to the Clone button).
Select Fork.
In the dialog:
develop
).Fork
.Navigate to your newly created fork. The URL will look something like https://dev.azure.com/{Your_Organization}/{Your_Project}/_git/{Your_Fork_Name} (replace placeholders with your details).
Click the Clone
button (usually near the top right).
Copy the HTTPS URL provided.
Run the following in your terminal (replace the placeholder URL with the one you copied):
# Replace the URL below with the HTTPS URL of YOUR forkgit clone https://dev.azure.com/{Your_Organization_Or_Project_For_Fork}/{Your_Project_For_Fork}/_git/{Your_Fork_Name} bridgecd bridge
Note: {Your_Organization}
, {Your_Project}
and {Your_Fork_Name}
depend on where you created your fork in Step 1.
origin
will be your default remote, pointing to your personal fork on Azure Repos.upstream
pointing back to the original worldfoodprogramme/bridge
repository you forked from.git remote add upstream https://dev.azure.com/worldfoodprogramme/Design%20System/_git/bridgegit remote -v
Search the worldfoodprogramme/bridge repository’s Pull Requests section for an active or completed PR that relates to your submission. Avoid duplicating effort.
Before starting work, ensure your local master
branch and your fork are up-to-date with the original worldfoodprogramme/bridge
repository’s develop branch.
# Checkout your local develop branchgit checkout master# Pull the latest changes from the original repository’s develop branchgit pull upstream develop# Push the updated develop branch to your fork (optional, but good practice)git push origin master
Always work and submit pull requests from a new branch created off the updated develop branch. Do not submit pull requests from the develop branch of your fork.
# Create a new branch based on the up-to-date develop branch# Replace {YOUR_BRANCH_NAME} with a descriptive name (e.g., feat/update-header)git checkout -b {YOUR_BRANCH_NAME} develop
Commit your changes using a descriptive commit message. If your changes relate to an Azure Boards work item, you can reference it (e.g., Fixes AB#123).
# Example commitgit commit -a -m "feat: Update header with newest designs, fixes AB#123"
Note: The -a
option automatically stages files that have been modified or deleted. You may need to use git add <file>
for new files first. Refer to guides on writing good commit messages and linking work items in Azure DevOps for more details.
Once ready for feedback from other contributors and maintainers, push your commits to your fork (be sure to run yarn ci-check
before pushing, to make sure your code passes linting and unit tests):
$ git push origin { YOUR_BRANCH_NAME }
worldfoodprogramme/bridge
repository in your web browser: https://dev.azure.com/worldfoodprogramme/Design%20System/_git/bridge
Repos > Pull requests
section.New pull request
button.{YOUR_BRANCH_NAME}
).worldfoodprogramme/Design System/_git/bridge
repository (usually develop
).Create pull request
.origin
again (git push origin {YOUR_BRANCH_NAME}
). The Pull Request will update automatically.Once your PR is approved and passes all required checks (like automated builds and tests defined by branch policies), a maintainer will squash and merge your commits for you.
That’s it! Thank you for your contribution to the Bridge Design System!
To ensure consistency throughout the source code, keep these rules in mind as you are working:
For a set of basic rules and guidelines for developing React components, see here.
Feel free to edit/write components in your own style but be wary that we may ask you to make changes while reviewing your pull request.
We enforce some style rules for code in this repository using eslint. You can install a linting addon to a lot of editors and IDEs that will follow our linting rules.
If you decide to not install a linter addon, or cannot, you can run yarn lint
to get a report of any style issues. Any issues not fixed will be caught during CI, and will prevent merging.
We use commit message guidelines based on the Angular Commit Conventions.
After the commit message has been submitted, it is checked by husky
and validate-commit-msg
to ensure it is syntactically correct.
If you add any features to our code, make sure to add tests so that your changes are covered. Tests are written using JEST. You can see how well your code is covered by looking at the .gh-pages/coverage/lcov-report/index.html
file after running the coverage command.
Test your changes by running our test commands:
Run linting:
yarn lint
Run unit tests:
yarn test
Run both linting and unit tests:
yarn ci-check
Watching unit tests:
yarn test --watch