Skip to content

Developer Guide

Jenna Badanowski edited this page Apr 29, 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 documentation website:

    npm start
    

    Open http://localhost:3000 to view it in the browser.

    Note: If you would like to run the documentation site in development mode (with linting turned off), use npm run docs:dev.

  6. To run storybook:

    npm run storybook
    

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 (based off storybook stories)

    npm run test:visual
    

    Note: If your change have affected visual regression images or if you have added new stories, run npm run test:visual: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.

Pull Requests

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

0.x.x

  • BREAKING CHANGE::
  • 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
  • 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
  • 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

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.

Clone this wiki locally