Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 3.43 KB

CONTRIBUTING.md

File metadata and controls

84 lines (59 loc) · 3.43 KB

Contributing Guide

Commitizen friendly

Thank you so much for contributing to @govtechsg/sgds-react. Please read this guideline before starting your development works.

Contributing workflow

To contribute, please start off at the Issue section of our github repository.

  1. Checkout our Issue section to search for similar bugs/issues/feature request that you encounter. Someone else might have already raised a similar issue.
  2. If your issue is not found, open an issue !
  3. Follow the instructions of the issue request form and answer them
  4. Describe your bug / new feature request as detailed as possible. For new feature request, let us know your motivation behind your proposal and how you intend to build the feature. For bug fixes, let us know how you intend to fix the bug.
  5. An SGDS admin will pick up on the discussion and notify you if the proposal is accepted
  6. Once accepted, you can fork the repository and start working away !
  7. Raise a PR, tagging the issue number, and request a review from one of our admins.

Writing

Setup

  1. git clone this repository
  2. run npm run install
  3. To start storybook, hit npm run storybook on terminal

File Structure

  1. When generating new Components, create a new folder with Component name and include index.ts file as entry point. This helps to ensure rollup exports of individual components are properly configured with the appropriate name and file

    e.g. > Accordion -> index.ts

  2. Any helper functions that is not to be exported as part of library can go under utils folder

Test

  1. Unit test should be written in tests folder at root
  2. It is compulsory to write unit test for changes made or new components build

Storybook documentation

ArgsTable

To show props for components and subcomponents in Storybook's ArgsTable, it requires that the component be exported via named exports. Its displayName must be the reflect the same name as the named exports as well

For example, in src code

export const TableHeader = ... 

TableHeader.displayName = "TableHeader"

Commit standard

This is a commitizen friendly repo. Adhere to the commit conventions of cz.

Publishing (for admin only)

Library publication is performed in workflow by github actions. When ready for publishing, perform the following steps

Bump version
  1. run npm version <major|minor|path> or for alpha releases npm version <version-name> **version number should observe SEMVER **this step will auto-generate a git tag on your local
  2. git push the changes
Generate Changelog
  1. run npm run changelog to update CHANGELOG.md file (ensure that you have set up cz-cli globally) **cz changelog --incremental updates based on your local git tags, but do not overwrite existing file
  2. Push the changes
Push git tag
  1. run git tag to check the newly generated git tag on local
  2. npm push origin <newly-created-tag> ** this triggers gh action workflow to publish the library to npm
Create a release
  1. Manually create a release on github

Skipping a build on aws code build

For case when a feature is not released but built, skip the amplify build to prevent documentation update. Add [skip-cd] to commit message to prevent amplify from building