Skip to content

Commit 8c541aa

Browse files
committed
docs: clarify contribution page. Link from readme.
Closes filestack#101
1 parent 266d180 commit 8c541aa

File tree

2 files changed

+150
-101
lines changed

2 files changed

+150
-101
lines changed

CONTRIBUTING.md

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,120 @@ First of all, thank you so much for being interested in contributing to filestac
77
- Creating new examples
88

99
## Issues
10+
1011
Feel free to open new issues or participating in the discussion of the existing ones on
1112
[this repository](https://github.com/filestack/filestack-react/issues), but before doing so, please make sure that the issue is not duplicated and/or the discussion is related to the topic of the issue.
1213

1314
## Pull requests
15+
1416
Code contributions are welcome following a process which guarantees the long-term maintainability of the project.
1517
You can contribute either with bugfixes or new features. Before submitting a new feature, we highly encourage you to first open a new issue describing its motivation and details and discuss it with one of the project mantainers. This will ensure that the feature fits well in the project.
1618

1719
### Step 1: Open a new issue (if not opened yet)
20+
1821
Before starting to code, it is desirable to first open an issue describing the bug or the new feature. Please be sure the issue is not duplicated.
1922

2023
### Step 2: Fork the repository
24+
2125
Fork the project https://github.com/filestack/filestack-react into your account. Then, check out your copy of the project locally.
26+
27+
### Step 3: Create a new feature branch `contrib/issue-[number]`
28+
29+
Put your code in a new feature branch. The name of the new branch should start with `contrib/issue-`. This convention will help us to keep track of future changes from pull requests.
30+
2231
```
23-
git clone [email protected]:user/react-filestack.git
24-
cd react-filestack
25-
git remote add upstream https://github.com/filestack/filestack-react.git
32+
git checkout -b contrib/issue-[number] tags/[tag-name]
2633
```
2734

28-
### Step 3: Create a new feature branch `contrib/issue-number`
29-
Put your code in a new feature branch. The name of the new branch should start with `contrib/`. This convention will help us to keep track of future changes from pull requests.
35+
Note that `tags/[tag-name]` would correspond with one of the existing tags in the project. List all the tags with `git tag`, or look on the project home page. For example, suppose that the latest version of the project is `v1.2.3` (note the 'v' is part of the tag name), and you want to fix a new bug that you discovered in this version. If the new reported issue has an id of #186, then you would create your feature branch in this way:
36+
3037
```
31-
git checkout -b contrib/issue-number tags/tag-number
38+
git checkout -b contrib/issue-186 tags/v1.2.3
3239
```
33-
Note that tags/tag-number would correspond with any of the tags (for example 1.0.X). For example, suppose that the latest version of the project is v1.0.0 and you want to fix a new bug that you discovered in this version. If the new reported issue has an id, say, #186, then you would create your feature branch in this way:
40+
41+
### Step 4: Create your feature or bugfix
42+
43+
The whole component is located inside src/ReactFilestack.jsx.
44+
45+
#### Install dependencies
46+
3447
```
35-
git checkout -b contrib/issue-186 tags/1.0.X
48+
npm install
3649
```
3750

38-
### Step 4: Committing your changes
39-
First of all, make sure that git is configured with your complete name and email address. It is desirable to use the same email of your Github account, this will help to identify the contributions:
51+
#### Re-build after making changes
52+
4053
```
41-
git config --global user.name "Your Name"
42-
git config --global user.email "[email protected]"
54+
npm run build
4355
```
44-
Write a good commit message. It should describe the changes you made and its motivation. Be sure to reference the issue you are working in the commit that finishes your contribution using one the [keywords to close issues in Github](https://help.github.com/articles/closing-issues-via-commit-messages/).
45-
If your commit message is too long, try to summarize the changes in the header of the message, like this:
56+
57+
#### Run unit tests
58+
59+
Verify that your changes are actually working by adding the required unit tests. It is desirable to include unit tests covering all new features you implement. Also, if you find a bug which is not currently detected by the unit tests you might consider to implement a new one or modify the current implementation. After this, you can verify that everything works fine after your changes with:
60+
4661
```
47-
fix #xx : summarize your commit in one line
62+
npm test
63+
```
64+
65+
#### Lint the code
4866

49-
If needed, explain more in detail the changes introduced in your
50-
commit and the motivation. You could introduce some background
51-
about the issue you worked in.
67+
Ensure that your code meets the project's style, enforced by eslint.
5268

53-
This message can contain several paragraphs and be as long as
54-
you need, but try to do a good indentation: the columns should
55-
be shorter than 72 characters and with a proper word-wrap.
56-
The command `git log` will print this complete text in a nice
57-
way if you format it properly.
5869
```
59-
The header and the body of the commit message must be separated by a line in blank. The header is the message shown when running the command `git shortlog`.
70+
npm run lint
71+
```
72+
73+
#### Link to an existing project (optional)
74+
75+
You may want to test how the filestack-react works with an existing project, or a new demo project. Use [NPM link](https://docs.npmjs.com/cli/link) to tell your existing project to use your local development version of filestack-react instead of the one from NPM.
6076

61-
#### Test your code
62-
Verify that your changes are actually working by adding the required unit tests. It is desirable to include unit test covering all new features you implement. Also, if you find a bug which is not currently detected by the unit tests you might consider to implement a new one or modify the current implementation. After this, you can verify that everything works fine after your changes with:
77+
In the filestack-react development folder:
6378

6479
```
65-
nosetests
80+
npm link
6681
```
6782

68-
### Step 5: Push your changes
83+
If your existing/demo project is already using filestack-react from NPM, uninstall it.
84+
85+
```
86+
npm uninstall filestack-react
87+
```
88+
89+
Then link to the local version of filestack-react. In your existing/demo folder:
90+
91+
```
92+
npm link ../somepath/to/filestack-react
93+
```
94+
95+
### Step 5: Committing your changes
96+
97+
#### Git congif
98+
99+
Make sure your git client is configured with your complete name and email address. It is desirable to use the same email of your Github account, this will help to identify the contributions:
100+
101+
```
102+
git config --global user.name "Your Name"
103+
git config --global user.email "[email protected]"
104+
```
105+
106+
#### Commit message
107+
108+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en/v1.0.0/) to ensure consistent commit messages and changelog formatting. Be sure to reference the issue you are working on in the commit that finishes your contribution using one the [keywords to close issues in Github](https://help.github.com/articles/closing-issues-via-commit-messages/).
109+
110+
### Step 6: Push your changes
69111

70112
Push your changes to your forked project with:
113+
71114
```
72115
git push origin contrib/issue-186
73116
```
74117

75-
### Step 6: Create and submit a pull request
76-
Go to your forked project on GitHub, select your feature branch and click the “Compare, review, create a pull request button”.
118+
### Step 7: Create and submit a pull request
77119

120+
Go to your forked project on GitHub, select your feature branch and click the “Compare, review, create a pull request button”.
78121

79122
### License Agreement
123+
80124
By contributing your code, you agree to license your contribution under the terms of the [Apache 2.0 license](https://raw.githubusercontent.com/citiususc/hipster/4ca93e681ad7335acbd0bea9e49fe678d56f3519/LICENSE).
81125

82126
Also, remember to add this header to each new file that you’ve created:

0 commit comments

Comments
 (0)