@team-florence/nightingale
v0.0.3
Published
The 'nightingale' component library for @team-florence
Downloads
3
Readme
Nightingale Design System
Follow the documentation below to get Nightingale up and running locally for development.
Getting Started
- Clone the repo:
git clone [email protected]:team-florence/nightingale.git
- Install dependencies:
yarn install
- We use husky & lint-staged to run Prettier, ESLint and TSC prior to commiting. Github actions has also been configured to run all of these tools in CI.
- Run storybook to preview all of the components available:
yarn storybook:flex
to run with the Flex 'theme' appliedyarn storybook:academy
to run with the Academy 'theme' applied
Contributing
Creating a new component
- Read the documentation on Notion for best practices to follow: Building Nightingale components
- Create a new folder in
src/components
with the name of your component - Create a new file in the folder called
index.tsx
-> this is your component - Export your component inside
./src/index.ts
- Make sure the component has a Storybook story and unit test written with
@testing-library/react
Testing Locally
It is highly advisable to run your branch of Nightingale locally in your consuming application to ensure that any changes/new components work as expected prior to opening a PR. To do this, you will need to use yalc.
- Install
yalc
globally on your machine with:yarn global add yalc
- In the root of the Nightingale repo, run
yalc publish
in a terminal - In your consuming application directory (Flex or Academy), run
yalc add nightingale
in a terminal - This tells Flex or Academy to use the local version of Nightingale instead of the published version on Github
- Run your consuming application locally and test your changes
Useful Commands
yarn test
- Runs all unit tests with Jest
yarn test:watch
- Runs a single unit test with Jest in watch mode. This will hot-reload and re-run the test automatically as you make changes to the component or test file. This is useful when you're writing a new test, or working on fixing a failing test
yarn test:coverage
- Generates and automatically opens a test coverage report in your browser
yarn typescript
- Runs the Typescript compiler to check for any type errors
yarn prettier
- Runs Prettier to check for any formatting errors
yarn lint
- Runs ESLint to check for any linting errors