Skip to content

Developer Guide

Jenna Badanowski edited this page May 5, 2020 · 32 revisions

Getting Started

  1. Fork the repository

  2. Clone the forked repository to your local machine

    git clone https://github.com/{your_username}/fundamental-react.git
    
  3. Navigate to the directory

    cd fundamental-react
    
  4. Install dependencies

    npm install
    
  5. To run storybook:

    npm start
    

Testing

See Testing wiki page for more details on adding to these tests.

  1. Unit tests

    npm run test
    

    Note: If your changes have affected any snapshots, run npm run test -- -u

  2. coverage

    npm run test:coverage
    
  3. visual regression testing and jest snapshot testing (based off storybook stories)

    npm run test:storybook
    

    Note: If your changes have affected visual regression images or if you have added new stories, run npm run test:storybook:update

Linting

Linting is achieved using ESLint and StyleLint.

npm run lint

This command can be run manually at any time and will be run as part of a pre-commit hook.

Documentation

Documentation is created using @storybook/addon-docs.

See Documentation wiki page for more details on adding to the documentation.

Pull Requests

When authoring a change, create a pull request with the title beginning with one of the prefixes listed below:

0.x.x

  • feat: new features in the distribution package code
    • will increment the PATCH version number ([MAJOR].[MINOR].[PATCH])
    • will show up in the Features section in the release notes
  • fix: bug fixes in the distribution package code
    • will increment the PATCH version number ([MAJOR].[MINOR].[PATCH])
    • will show up in the Bug Fixes section in the release notes
  • docs: any changes to the documentation pages/content (fixes or features)
    • will increment the PATCH version number ([MAJOR].[MINOR].[PATCH])
    • will show up in the Documentation section in the release notes
  • chore: infrastructure/internal changes that don’t affect the distribution package code or the documentation pages/content
    • will increment the PATCH version number ([MAJOR].[MINOR].[PATCH])
    • will NOT show up in the release notes

BREAKING CHANGE: any change that meets the breaking criteria outlined in the README

  • will increment the MINOR version number ([MAJOR].[MINOR].[PATCH])
  • will show up in the Breaking Changes section in the release notes Use one of the standard pr titles, but in the description include: BREAKING CHANGE: whatever the breaking change is

When merging a pull request, make sure the title of the merge commit starts with one of those prefixes. This is used by standard-version to increment the package version and update the CHANGELOG.md file and is also used to generate release notes when publishing releases.