Skip to content

Latest commit

 

History

History
164 lines (125 loc) · 7.5 KB

CONTRIBUTING.md

File metadata and controls

164 lines (125 loc) · 7.5 KB

Contributing

We'd love for you to contribute to our source code and to make Webex Components even better than it is today! If you would like to contribute to this repository by adding features, enhancements or bug fixes, you must follow our process:

  1. Create an issue to propose your solution before you get coding
  2. Let core members know about your proposal by posting a message in the contributor's Webex space
  3. A core member will review your proposal and if necessary may suggest to have a meeting to better understand your approach
  4. If your proposal is approved you should start coding at this point
  5. We recommend opening a draft PR to receive feedback before finalizing your solution
    • When opening a draft PR, specify with PR comments where in the code you would like to get feedback
  6. Before opening a PR ensure all PR guidelines are followed
  7. Let core members know about your PR by posting a message in the contributor's Webex space
  8. Core members will review the pull request and provide feedback when necessary
    • If a PR is too large, you may be asked to break it down into multiple smaller-scoped PRs
  9. Once the PR is approved by a core member, it will be merged
  10. Celebrate! Your code is released 🎈🎉🍻

Table of Contents

Development Setup

Getting Started

To get started developing for contributions, follow these steps:

  1. Fork the component repository

    1. Click on the Fork button on the top-right corner
    2. Wait for Github to finish forking the repository
    3. Head over to your newly created repository fork
  2. Clone your repository fork locally

    git clone [email protected]:{your username}/components.git
  3. Install all project and peer dependencies

    cd components
    npx npm-install-peers
  4. Open the code with your favorite editor. You're ready! 👍🏼

Pull Request Guidelines

Pull requests must include code documentation, tests, follow code style and commits format.

Documentation

All methods, functions and object structures should be documented following JSDoc style comments.

Testing

We take testing very seriously, all code changes must include unit, integration and end-to-end tests.

  • Unit: Tests at the file level with mocked external requests
  • Integration: Tests at the application level with mocked I/O requests
  • End-to-end: Tests the application in a system

Code Style

Code style is enforced by linters. Use npm run linter to verify that your code is beautiful, too!

We highly discourage disabling eslint rules. Unless there is an exceptional use case, we may request additional changes to your PR.

Git Commit

As part of the build process, commits are run through conventional changelog to generate the changelog. Please adhere to the following guidelines when formatting your commit messages as the commit message will become part of the changelog word by word.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

The header is mandatory and the scope of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

Revert

If the commit reverts a previous commit, it should begin with revert:, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

You may use Git to revert changes:

git revert <commit hash>

Type

Must be one of the following:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Scope

The scope should indicate what is being changed. Generally, these should match name of the file where the change occurs. For example, WebexAvatar, PeopleJsonAdapter, etc. Other than those, for tooling changes, use the name of the tool where changes occur.

Following these guidelines will help you separate your changes into commits that reflect discrete, incremental changes.

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

You can think as the subject as a command that you give to Git as to how execute your changes. Each change will add up to create the current state of the code base. For instance (commits ordered from newest to oldest):

fix(operators): add divide as named export
feat(operators): add multiply method
refactor(math): rename math module to operators

Body

Just as in the subject the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking changes and is also the place to reference GitHub issues that this commit closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.

Release Process

There is a list of commit types provided here. However, not all commits trigger our release process. We are using semantic-release to fully automate the version management and package publishing. By default semantic-release uses the Angular Commit Message Conventions and triggers release and publishing based on the following rules:

Commit Release type
Commit with type BREAKING CHANGE Major release
Commit with type feat Minor release
Commit with type fix Patch release
Commit with type perf Patch release