yarn add @ons/design-system-react@git+https://github.com/ONSdigital/design-system-react#v0.0.3
If you work across multiple Node.js projects there's a good chance they require different Node.js and npm versions.
To enable this we use nvm (Node Version Manager) to switch between versions easily.
- install nvm
- Run nvm install in the project directory (this will use .nvmrc)
yarn
yarn start
Once the server has started, navigate to http://localhost:3010
The port can be overridden if desired:
export TEST_PORT=5000; yarn start
This project uses jest and supports its command line options.
yarn test [jest-args]
Tests can be filtered using the testNamePattern
jest argument.
To run tests associated with a specific component:
yarn test --testNamePattern="<Highlight/>"
The build command builds the stylesheets and components needed to preview the examples contained in this repository. In addition a .json file is generated to facilitate the generation of API reference documentation.
The output of this command goes into the ./dist
directory.
yarn build
It is also possible to build a static preview of the examples which can be deployed alongside PRs to preview component examples more easily.
yarn build-static-preview
Again the output goes into the ./dist
directory except this time it includes static
.html
files.
-
Ensure that you are on the latest commit of the
main
branch:git checkout main git pull
-
Remove any existing
create/release
branch:git branch -D create/release
-
Create a new
create/release
branch:git checkout -b create/release
-
Bump the version number of the package in
package.json
. -
Commit this change; eg "Bump version to v1.2.3".
-
Push this to the repository:
git push --set-upstream origin create/release
-
The action of pushing this branch will trigger the creation of a new release. It may take a moment for the PR to appear in GitHub as the package is being built.
-
A release entry and tag is automatically created upon approving and merging the PR.