Thank you so much for contributing to @govtechsg/sgds-react. Please read this guideline before starting your development works.
To contribute, please start off at the Issue section of our github repository.
- Checkout our Issue section to search for similar bugs/issues/feature request that you encounter. Someone else might have already raised a similar issue.
- If your issue is not found, open an issue !
- Follow the instructions of the issue request form and answer them
- 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.
- An SGDS admin will pick up on the discussion and notify you if the proposal is accepted
- Once accepted, you can fork the repository and start working away !
- Raise a PR, tagging the issue number, and request a review from one of our admins.
- git clone this repository
- run
npm run install
- To start storybook, hit
npm run storybook
on terminal
-
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 filee.g. > Accordion -> index.ts
-
Any helper functions that is not to be exported as part of library can go under
utils
folder
- Unit test should be written in
tests
folder at root - It is compulsory to write unit test for changes made or new components build
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"
This is a commitizen friendly repo. Adhere to the commit conventions of cz.
Library publication is performed in workflow by github actions. When ready for publishing, perform the following steps
- run
npm version <major|minor|path>
or for alpha releasesnpm version <version-name>
**version number should observe SEMVER **this step will auto-generate a git tag on your local git push
the changes
- 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 - Push the changes
- run
git tag
to check the newly generated git tag on local npm push origin <newly-created-tag>
** this triggers gh action workflow to publish the library to npm
- Manually create a release on github
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