We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.
We are particularly looking for help with our open issues. We appreciate all forms of contribution - not just code - that can include documentation, clarifications, typo corrections and much more.
Please familiarise yourself with our:
- Code of conduct
- Coding Standards
- Contributing guidelines (you are here)
- Guide to Code Reviews
- GPG Signing Guide
- Primary README
- Recommended Tools
- Troubleshooting
NB there is further documentation colocated with relevant code. The above list is an index of the top-level documentation of our repo.
Before starting a pull request, firstly search through existing issues. Please also ensure to branch from latest, we only review PRs that are as small as they can be; which we do to maximise productivity.
If the work you want to carry out is not captured in an issue, please open one. Otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
There are issue templates available for bug fix and feature requests, so you know what details to include.
If you never created a pull request before, here is a great tutorial on how to send a PR.
Fork the project, clone your fork, configure the remotes and install the dependencies:
-
Clone your fork of the repo into the current directory
git clone https://github.com/<YOUR ACCOUNT>/simorgh.git
-
Navigate to the newly cloned directory
cd simorgh
-
Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/bbc/simorgh
-
Use recommended version of node for the project, listed in
.nvmrc
nvm use
Install Yarn
The Simorgh project uses Yarn for package management. To install Yarn, run this command:
npm install --global yarn
Install the project dependencies with Yarn
yarn install
If it has been a while since you've cloned the repo, pull from the latest
branch
git checkout latest
git pull upstream latest
We recommend you have a valid GPG key set up in GitHub. All commits should be GPG signed We have a very small guide for setting up GPG signing on macOS. Without the GPG signing, we cannot guarantee that your work will be merged.
Create a new topic branch (off the main project latest
branch) that will contain your feature, change, or fix:
git checkout -b <topic-branch-name>
When committing, please use these commit guidelines:
If you have a breaking change in a commit, prefix the commit message with BREAKING CHANGE:
All pull requests need to have linting, unit tests and integration tests passing. For new features, you should add appropriate tests in your PR.
Instructions for how to run tests are here in the Readme.
We use React Testing Library for writing our React component and custom hook unit tests. An introduction to using React Testing Library can be found here.
We have a lot of sample data feeds. These are categorised in directories under this primary directory. Finding useful examples within these folder can be done by searching for the asset (page type) and block types (e.g. paragraph, media etc.) you're looking for.
Pick a JSON file under data/news/articles/[id].json
, and:
- add an example of your block somewhere in the
content.model.blocks
array. - add your new component to the
blockTypes
array.
Run yarn dev
and you should see your component at your article of choice, eg http://localhost:7080/news/articles/c0000000001o
There is a guide for BBC staff which documents the manual process that should be followed before merging a PR. Please note: The guide links through to our CI endpoints and therefore is hosted in a private repository.
The .env
file should not be commited as it is often overwritten by the values in envConfig/
at build time. There is a postshrinkwrap
command which runs after an yarn install
so should be run during setup of the application.
If the .env
file is appearing in your git status
it means it is now longer being assumed as unchanged, to fix this run:
git update-index --assume-unchanged .env