Welcome and thank you for contributing to the Intelligence Community Design System test app. This guide will take you through the technical considerations for contributing.
The Intelligence Community Design System (ICDS) has adopted the Contributor Covenant. Please familiarise yourself with our full conduct principles.
To find out more about the different types of contributions, the criteria or our roadmap, read how to contribute to the Design System and UI Kit.
You can help us speed up the development of our test app by contributing new guidance, improving existing guidance or raising bugs.
Before getting started, please check our Github issues page to check whether a similar bug or suggestion already exists. If not, create a ticket with as much information as possible. The working group will triage your ticket and get back to you. The working group meet on a fortnightly basis to review new tickets, but important bugs will be reviewed sooner.
Vite is the build tool used to bundle and serve the test app during development. It provides fast and efficient hot module replacement (HMR) to enhance the development experience.
Node 16+ is required to build and run the codebase.
If you would like to contribute code, please complete the following steps:
- Fork the test app repository and clone your forked repo onto your device.
- Make sure to add the
mi6/ic-ui-kit-test-app
repo as your upstream remote branch, by running:
git remote add upstream git@github.com:mi6/ic-ui-kit-test-app.git
- Create a new branch in your forked repo, named after the issue number of your contribution (e.g. feature/123-new-feature).
- Run the following:
NPM
npm install
npm run develop
Yarn
rm package-lock.json
yarn install
yarn run develop
-
Make your changes, keeping to the coding standards and practices.
-
Commit your changes, as per the Git commit style guide and push to your branch.
-
Submit a pull request to merge to the
develop
branch in the original repository:- Click on
Compare & pull request
. - Set the base to be the original repository's
develop
branch and the host to be yourforked branch
. - Click on
Create pull request
.
- Click on
All changes will be reviewed via a pull request. Raise the pull request to merge to the develop
branch. Provide details on what has been changed or added.
All pull requests will be reviewed by:
- Checking the change meets the guidance set out on this page.
- Checking the change meets the requirements of the ticket.
- Checking anything else deemed relevant by the reviewer.
Pull requests must have the approval of 2 reviewers before they can be merged into the develop
branch.
All changes must meet the criteria for WCAG 2.2 AA. Find out more about the importance of accessibility.
Linting tools are ran against the codebase to keep in line with our coding standards. The linting tools used are:
Resolve linting and formatting issues via npm run lint
and npm run prettier:fix
.
As a data protection measure, this repository enforces the use of GitHub user email address in your commit. Please follow these steps:
- Visit your GitHub email settings
- Optionally check the settings "Keep my email addresses private" and "Block command line pushes that expose my email"
- On this page, under Primary Email Address you'll see a user email that follows the pattern
<username>@users.noreply.github.com
. - Inside your developer environment, open a command line in the directory of the ic-ui-kit-test-app repository
- Enter the command
git config user.email <EMAIL>
where you replace<EMAIL>
with the address from step 3. This will be applied to commits made in this repository.
Please ensure that your commits are signed when contributing to the test app repository.
If you need to make changes to a commit (for example, after receiving comments on a PR), follow these steps:
-
If you're amending the most recent commit:
- Stage your changes using
git add
and include the files you want to update. - Run
git commit --amend --no-edit
to amend the most recent commit without changing the commit message. - The Commitizen prompt will still appear as if you are making a new commit. Exit the prompt (usually by pressing Ctrl+C).
- Push the changes to the remote repository using:
git push --force
.
- Stage your changes using
-
If you're amending an older commit:
-
Use
git rebase
to modify an older commit. For example, to modify commita1312407
, run:git rebase --interactive a1312407
-
In the default editor, change
pick
toedit
for the line mentioninga1312407
. -
Save the file and exit. Git will interpret and automatically execute the commands in the file, placing you in the state just after creating commit
a1312407
. -
Amend the commit by making your changes and then running:
git commit --all --amend --no-edit
-
Continue the rebase process by running:
git rebase --continue
-
Push the changes to the remote repository using:
git push --force
-
- Avoid using inline css.
Tests should be sufficient enough for the functionality changed or added.
Testing should always include accessibility testing. Please read our advice on how to test for accessibility
Tests should be added for both Cypress and React Testing Library.