Skip to content

Latest commit

 

History

History
190 lines (135 loc) · 13.2 KB

CONTRIBUTING.md

File metadata and controls

190 lines (135 loc) · 13.2 KB

Contributing to Clay

Want to contribute to Clay? There are a few things you need to know before you start sending your pull requests or opening issues.

Here's a set of guidelines to contribute to Clay and its packages. Use your common sense, and feel free to propose changes to this document in a pull request.

Table of Contents

What Should I Know Before I Get Started?

Clay and Packages

The Clay repository follows the monorepo approach; the pillars of Clay, all the major components, are in this one repository.

  • clay-css - Provides the colors and structure for Clay. It contains the CSS and example HTML markup for each component.
  • clay-components - The components that follow clay-css markup and Lexicon use cases. They are developed on Metal.js with Soy (Closure templates). Note that Clay components will be rewritten in React in version 3.0.
  • clayui.com - Contains the source code and documentation for clayui.com.

How Can I Contribute?

Reporting Bugs

This section shows you how to submit an error report to Clay. Follow these guidelines so maintainers can clearly understand your report, reproduce the behavior, and find related reports.

Before Submitting a Bug Report

  • Check existing issues to see if the problem has already been reported. If it has and the issue is still open, add a comment to the existing issue instead of opening a new one.

How Do I Submit a Good Bug Report?

Bugs are tracked as Github issues. Create an issue, and provide the information listed below so the maintainers can reproduce the problem:

  • Use a clear and descriptive title for the issue that identifies the problem.
  • Describe the exact steps to reproduce the problem in as much detail as possible.
  • Describe the behavior you observed after following the steps, and explain the problem with that behavior.
  • Explain the desired behavior you expected and why.
  • Include screenshots and animated GIFs if necessary.
  • If the problem is related to performance or memory, include a CPU profile capture with your report.
  • If the problem only occurs in a specific browser, specify the name and version of the browser.

Provide more context by answering this question:

  • Can you reliably reproduce the issue? If not, provide details about how frequently the problem occurs and under which conditions it normally happens.

Your First Pull Request

If you want to contribute to this project but you don't know where to begin, issues with the "good first issue" label are a great place to start.

If you decide to fix an issue, please check the comment thread first to make sure that no one else is working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don’t duplicate your effort.

Proposing a Change

This section shows you how to propose a public API change, make non-trivial changes to the implementation, or propose something new. Follow these guidelines so maintainers can clearly understand your suggestion and your point of view.

Before Submitting a Suggestion for Improvement

  • Check existing suggestions to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.

How Do I Submit a Suggestion for Improvement?

Suggestions for enhancement or API changes are tracked as Github issues. Create an issue in this repository and provide the following information:

  • Use a clear and descriptive title for the issue that states your suggestion.
  • Provide a step-by-step description of the suggested enhancement in as much detail as possible.
  • Describe the current behavior, and explain the behavior you want to see instead and why.
  • Provide details of the impact your change will make and how you will use it.
  • Provide the pros and cons of your change.
  • Provide at least one alternative for your change.

Sending a Pull Request

This section shows you how to send a pull request. The main staff are always monitoring pull requests, so rest assured that they will review yours. Follow these guidelines so the maintainers can complete a thorough review of your request.

Since Travis is failing on executing a11y tests due to out of date suid you need to execute npm run pa11y locally before sending any PR to verify we're following accessibility standards.

Before Sending a Pull Request

  • Fork the repository and create your branch from develop.
  • Run yarn at the root of the repository to install the project dependencies.
  • Run yarn lerna to install the dependencies of each package and link them together.
  • Run yarn build to build all packages.
  • If you’ve fixed a bug or added code that should be tested, add tests!
  • Run yarn test to ensure the test suite passes.
  • If you have modified a Soy file, make sure the related tests passed by running yarn testSoy.
  • Run yarn format to format your code with Prettier.
  • Run yarn lint to make sure your code lints.
  • Run yarn mcritic to follow the rules of Soy.

Style Guides

Git Commit Messages

This section shows you how to write commit messages in Clay. Follow these guidelines to help us maintain order and make it easier to locate your changes.

Before You Make a Commit Message

  • Make sure that the problem or change you are making doesn't already exists.
  • Start the commit message with the word Fixes, and always follow it with a reference to the issue:
    • Fixes #0 - bla bla
    • Fixes #0, #1 - bla bla

JavaScript Style Guide

All JavaScript must adhere to the Liferay JavaScript style guide.

CSS Guidelines

See guidelines for contribution with CSS.

Documentation Style Guide

  • Use JSDOC for documentation in your JavaScript code.

Example

/**
 * Data to add to the element.
 * @default undefined
 * @instance
 * @memberof ClayActionsDropdown
 * @type {?object}
 */
data: Config.object()

Additional Notes

Issue Labels

This section lists the labels we use to help us organize and track the issues.

Labels are organized by categories, such as the component the problem affects, the resolution, the status...

You may want to use Github search to find groups of issues you are interested in. For example, you may be interested in open bug issues in Clay components. Use this to create more focused queries.

Categorization

Category Description
Component Specifies the component the problem affects (e.g Clay Components, Charts...)
Type Specifies the type of issue (e.g Bug...)
Status Group of labels that reflect the progress of the issue
Resolution Group of labels reflecting the resolution of the issue
Browser Identifies the specific browser the issue affects, if applicable

Labels

Label liferay/clay Category Description
RFC search None A proposal for changes or a request for new features (similar to the RFCs that are used in React.js, Ember.js, Gatsby.js, and Rust)
Infrastructure search Component Monorepo infrastructure, build, process automation...
Clay Components search Component Clay components (e.g ClayCard, ClayLabel...)
Clay Charts search Component Components of Charts in Soy or React
Generator Clay search Component Our Clay Component Generator
Clay CSS search Component Clay CSS
Documentation search Component Documentation in general, in clayui.com or elsewhere...
Accessibility search Component Accessibility issues
Clay site search Component Website infrastructure or other things outside documentation that relate to the site
IE search Browser Occurs exclusively in IE browser
Chrome search Browser Occurs exclusively in Chrome browser
Safari search Browser Occurs exclusively in Safari browser
Firefox search Browser Occurs exclusively in Firefox browser
Breaking Change search Type Caused a breaking change in API or a change in behavior
Bug search Type Problems with Component behavior
Epic search Type Opened as an Epic (a collection of many related things to be done)
Discussion search Type A discussion of some change or a request for information
Enhancement search Type A suggestion for improvements or refinement of code
Feature Request search Type A suggestion for new features
Regression search Type Regressions
Blocked search Status Blocked by other tasks
Help Wanted search Status Requires help
Next Release search Status Will be available in the next release
Duplicate search Resolution Duplicates an existing issue
Wontfix search Resolution Will no longer be worked on