A library of libraries and React components for building visuals at The Times and The Sunday Times
This is a monorepo containing all the charts, libraries and configuration for building out charts and visuals for The Times and The Sunday Times.
- Clone this repo
- Install dependencies
$ yarn
- Run the storybook
$ yarn storybook
To add a new package:
- Create a new folder in the
./packages
directory - Copy the contents of
./template
to your new folder - Update the
name
and yourdescription
in thepackage.json
file, and the package details in yourREADME.md
- Update your
./stories/index.stories.js
file with the details for your new package / component (remove this directory if your package does not require a Storybook story) - Run
yarn
in the project root (top level of the repository)
Often you may wish to depend on another package in the repo (e.g.
@times-visuals/styles
). To do this, manually add it to the package.json
of
your new component, and run yarn
from the project root to link everything
together.
For those components with test suites, you can run them using:
$ yarn test
If you need to update the Jest snapshots, run:
$ yarn test:update-snapshots