Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Latest commit

 

History

History
146 lines (108 loc) · 6.97 KB

README.md

File metadata and controls

146 lines (108 loc) · 6.97 KB

Data Hub Components

NPM Version NPM Downloads

Build Status LGTM Alerts LGTM Grade Coverage


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.

Usage

create-react-app demo-app
yarn add data-hub-components react react-dom
import { ActivityFeed } from 'data-hub-components'

const activities = []
<ActivityFeed activities={activities} />

Development

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

Release process

  1. Create a new branch based on master.
  2. Commit code to the newly created branch following conventions specified by semantic-release above.
  3. Create a PR to the master branch.
  4. Wait for PR to pass tests and get the required number of approvals.
  5. Once there are no outstanding comments the PR is merged.
  6. Once again tests are being run on master branch.
  7. If tests pass, a NPM release is created using version number determined by commit messages.
  8. The Git repo is tagged using the same version.
  9. Storybook is built and published to the gh-pages branch which will be available on GitHub Pages.
  10. A GitHub release is created using the commit messages as the changelog.
  11. A new comment is added to the previously merged PR with information about the release.
  12. A tag released is added to the PR.

Notes