As of Monday 7th December this package has been deprecated and will no longer be maintained. If you wish to view or use current versions of these components, they are available on the Data Hub Storybook site and FE repository.
Collection of React Components used by the Data Hub platform.
This component library makes heavy use of the govuk-react project.
create-react-app demo-app
yarn add data-hub-components react react-dom
import { ActivityFeed } from 'data-hub-components'
const activities = []
<ActivityFeed activities={activities} />
Install dependencies
Recommended Node.js version: 10.18.0
Recommended Yarn version: 1.16.0
nvm use # 10.18 from .nvmrc will be used
npm i -g yarn@1.16.0
yarn
Start Storybook
yarn start
Run tests
yarn test
Optionally, you can execute the CircleCI tests locally:
curl -fLSs https://circle.ci/cli | bash # Install CircleCI CLI
circleci local execute --job build
Update Jest snapshots
yarn test:update
Create a release
This project is using Semantic Release.
When committing please always use the following pattern for you messages (scope, body and footer are optional):
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
Commit message types (tags) | Release type | Example |
---|---|---|
feat: A new feature | Minor release (0.1.0) | feat: Add "Investment project" activity card |
fix: A bug fix | Patch release (0.0.1) | fix: Remove default activity card |
refactor: A code change that neither fixes a bug nor adds a feature | Patch release (0.0.1) | refactor: Add missing props validation to ActivityFeed |
perf: A code change that improves performance | Patch release (0.0.1) | perf: Improve rendering speed of ActivityFeed |
docs: Documentation only changes | None | docs(README): Add testing instructions |
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | None | style: Use tabs instead of spaces |
test: Adding missing or correcting existing tests | None | test: Add integration tests to ActivityFeedCard |
build Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) | None | build: Update webpack config |
ci Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) | None | ci: Update CircleCI config |
chore: Changes to the build process or auxiliary tools and libraries such as documentation generation | None | chore: Update CircleCI config |
To create a major/breaking (1.0.0) release, please add BREAKING CHANGE
to the commit message body with some explanation, example message:
fix: Remove ActivityFeedApp component
BREAKING CHANGE: This components is no longer used so we removed it.
Optionally add more info in the second line of your message.
To ease the process, commitizen was added to the project to help creating properly formatted commit messages.
Command git cz
supports the same arguments as git commit
and should be used as its replacement, example:
git add .
git cz
- Create a new branch based on
master
. - Commit code to the newly created branch following conventions specified by
semantic-release
above. - Create a PR to the
master
branch. - Wait for PR to pass tests and get the required number of approvals.
- Once there are no outstanding comments the PR is merged.
- Once again tests are being run on
master
branch. - If tests pass, a NPM release is created using version number determined by commit messages.
- The Git repo is tagged using the same version.
- Storybook is built and published to the
gh-pages
branch which will be available on GitHub Pages. - A GitHub release is created using the commit messages as the changelog.
- A new comment is added to the previously merged PR with information about the release.
- A tag
released
is added to the PR.
react-markdown
is required only temporary to resolve dependency issue with @govuk-react/paragraph, see issue on the govuk-react project.