ant-design/.github/CONTRIBUTING.md

67 lines
4.5 KiB
Markdown
Raw Normal View History

2015-12-31 14:52:29 +08:00
# Contributing to Ant Design
2017-12-16 23:19:08 +08:00
[中文版](./CONTRIBUTING.zh-CN.md)
2015-12-31 14:52:29 +08:00
The following is a set of guidelines for contributing to Ant Design. Please spend several minutes in reading these guidelines before you create an issue or pull request.
2017-12-15 11:31:51 +08:00
## Code of Conduct
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
We have adopted a [Code of Conduct](../CODE_OF_CONDUCT.md) that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Open Development
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
All work on Ant Design happens directly on [GitHub](https://github.com/ant-design). Both core team members and external contributors send pull requests which go through the same review process.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Branch Organization
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
According to our [release schedule](../CHANGELOG.md#release-schedule), we'll cut a `feature` branch (e.g. `feature-3.1` for 3.1 release) from `master` every month. If you send a bugfix pull request, please do it against the `master` branch, if it's a feature pull request, please do it against the `feature` branch.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Bugs
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
We are using [GitHub Issues](https://github.com/ant-design/ant-design/issues) for bug tracing. The best way to get your bug fixed is using our [issue helper](http://new-issue.ant.design) and provide a reprduction with this [template](https://u.ant.design/codesandbox-repro).
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
Before you reporting a bug, please make sure you've searched exists issues, and read our [FAQ](https://github.com/ant-design/ant-design/wiki/FAQ).
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Proposing a Change
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
If you intend to change the public API or introduce new feature, we also recommend use our [issue helper](http://new-issue.ant.design) to create a feature request issue.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Your First Pull Request
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
Working on your first Pull Request? You can learn how from this free video series:
2016-01-17 15:02:37 +08:00
2017-12-15 11:31:51 +08:00
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/ant-design/ant-design/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) that contain bugs or small features that have a relatively limited scope. This is a great place to get started.
2016-01-17 15:02:37 +08:00
2017-12-15 11:31:51 +08:00
If you decide to fix an issue, please be sure to check the comment thread in case somebody is already 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 dont accidentally duplicate your effort.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
If somebody claims an issue but doesnt follow up for more than two weeks, its fine to take over it but you should still leave a comment.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Sending a Pull Request
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
The core team is monitoring for pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
**Before submitting a pull request**, please make sure the following is done:
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
1. Fork the repository and create your branch from [proper branch](./CONTRIBUTING.md#branch-organization).
1. Run `npm install` in the repository root.
1. If youve fixed a bug or added code that should be tested, add tests!
1. Ensure the test suite passes (npm run test). Tip: `npm test -- --watch TestName` is helpful in development.
1. Run `npm test -- -u` to update [jest snapshot](http://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest) and commit these changes as well (if has).
1. Make sure your code lints (npm run lint). Tip: Lint runs automatically when you `git commit`.
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
Sending a Pull Request to [react-component](https://github.com/react-component/):
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
Since antd's components are based on react-component, sometimes you may need to send pull request to the corresponding react-component repository. If it's a bugfix pull request, after it's merged, the core team will release a patch release for that component as soon as possible, then you only need to do is reinstalling antd in your project to get the latest patch release. If it's a feature pull request, after it's merged, the core team will release a minor release, then you need raise another pull request to [Ant Design](https://github.com/ant-design/ant-design/) to update dependencies, document and TypeScript interfaces (if needed).
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
## Development Workflow
2015-12-31 14:52:29 +08:00
2017-12-15 11:31:51 +08:00
After cloning antd, run `npm install` to fetch its dependencies. Then, you can run several commands:
2016-12-06 15:42:50 +08:00
2017-12-15 11:31:51 +08:00
1. `npm start` runs Ant Design website locally.
1. `npm run lint` checks the code style.
1. `npm test` runs the complete test suite.
1. `npm run compile` compiles TypeScript code to the `lib` and `es` directory.
1. `npm run dist` creates UMD build of antd.