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 storybookTo add a new package:
- Create a new folder in the
./packagesdirectory - Copy the contents of
./templateto your new folder - Update the
nameand yourdescriptionin thepackage.jsonfile, and the package details in yourREADME.md - Update your
./stories/index.stories.jsfile with the details for your new package / component (remove this directory if your package does not require a Storybook story) - Run
yarnin 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 testIf you need to update the Jest snapshots, run:
$ yarn test:update-snapshots