|
1 |
| -# Git Workflow |
| 1 | +# Submitting Issues |
| 2 | +## Bug Reports |
2 | 3 |
|
3 |
| -This project is a monorepo that uses lerna to link dependencies. |
| 4 | +A bug is a _demonstrable problem_ that is caused by the code in the repository. |
| 5 | +Good bug reports are extremely helpful - thank you! |
4 | 6 |
|
5 |
| -https://github.com/lerna/lerna |
| 7 | +Guidelines for bug reports: |
6 | 8 |
|
7 |
| -This mono repo should contain the commits from all of the packages. |
| 9 | +1. **Use the GitHub issue search** — Check if the issue has already been |
| 10 | + reported. If it already exists, consider leaving a comment with any extra clarifying |
| 11 | + details about your situation that might help us narrow in on the nature of the problem. |
8 | 12 |
|
9 |
| -Each package has it's own repo. |
| 13 | +2. **Check if the issue has already been fixed** — In the event that you are don't |
| 14 | + have the latest, try to reproduce it using the latest changes in the `master` branch. |
10 | 15 |
|
11 |
| -## Packages |
| 16 | +3. **Submit a clear and detailed issue** — Please try to be as detailed as possible |
| 17 | + in your report. Please include the following: |
| 18 | + - Your environment, OS and/or browsers facing the issue |
| 19 | + - Steps to reproduce the issue |
| 20 | + - Specific errors thrown, stack trace etc. |
| 21 | + - The behaviour you expect vs what it's doing |
12 | 22 |
|
13 |
| -Each package is in the packages directory. |
14 | 23 |
|
15 |
| -Code changes that touch multiple modules should be done on the bitcore repo. |
16 |
| -This way one branch can update multiple modules. |
| 24 | +## Feature Requests |
17 | 25 |
|
18 |
| -Lengthy developments on a single package should be done on that package's repo. |
19 |
| -Once the package is at a good point, it should be merged into the monorepo |
| 26 | +Feature requests are welcome. But take a moment to find out whether your idea |
| 27 | +fits with the scope and aims of the project. It's up to *you* to make a strong |
| 28 | +case to convince the project's developers of the merits of this feature. Please |
| 29 | +provide as much detail and context as possible. |
20 | 30 |
|
21 |
| -## Updating Packages From Their Own Repo |
22 | 31 |
|
23 |
| -The monorepo packages can be updated via git subtrees, then submitted to the bitcore repo as a MR |
| 32 | +# Contributing Code |
24 | 33 |
|
25 |
| -Example: |
| 34 | +Good pull requests - patches, improvements, new features - are a fantastic |
| 35 | +help. They should remain focused in scope and avoid containing unrelated |
| 36 | +commits. |
26 | 37 |
|
27 |
| -```sh |
28 |
| -git co -b feature/bitcore-node-update |
29 |
| -git subtree pull --prefix=packages/bitcore-node git@github.com:bitpay/bitcore-node.git branchToPull |
30 |
| -git push -u origin feature/bitcore-node-update |
31 |
| -# Create MR from origin:feature/bitcore-node-update to upstream:bitcore |
32 |
| -``` |
| 38 | +Please adhere to the coding conventions used throughout this monorepo (indentation, |
| 39 | +accurate comments, etc.) and any other requirements (such as test coverage). |
33 | 40 |
|
34 |
| -## Updating Repos from Bitcore Package |
| 41 | +Follow this process: |
35 | 42 |
|
36 |
| -Changes to the mono repo can be pushed to the package repo. |
| 43 | +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, |
| 44 | + and configure the remotes: |
37 | 45 |
|
38 |
| -```sh |
39 |
| -git subtree push --prefix=packages/bitcore-node git@github.com:micahriggan/bitcore-node.git branchToPush |
40 |
| -``` |
| 46 | + ```bash |
| 47 | + # Clone your fork of the repo into the current directory |
| 48 | + git clone https://github.com/<your-username>/bitcore |
| 49 | + # Navigate to the newly cloned directory |
| 50 | + cd bitcore |
| 51 | + # Assign the original repo to a remote called "upstream" |
| 52 | + git remote add upstream https://github.com/bitpay/bitcore |
| 53 | + ``` |
41 | 54 |
|
42 |
| -## Adding New Packages from Existing Repos |
| 55 | +2. If you cloned a while ago, get the latest changes from upstream: |
43 | 56 |
|
44 |
| -Packages can be added via Lerna or via git subtrees. |
| 57 | + ```bash |
| 58 | + git checkout master |
| 59 | + git pull upstream master |
| 60 | + ``` |
45 | 61 |
|
46 |
| -```sh |
47 |
| -lerna import ~/somedir/path-to-bitcore-repo --flatten |
48 |
| -# OR |
49 |
| -git subtree add --prefix=packages/bitcore-repo-to-add git@github.com:bitpay/bitcore-repo-to-add.git branchToAdd |
50 |
| -``` |
| 62 | +3. Create a new feature branch (off the `master` branch) to |
| 63 | + contain your feature, change, or fix: |
51 | 64 |
|
52 |
| -This will merge all of the commits into the bitcore history |
| 65 | + ```bash |
| 66 | + git checkout -b <feature-branch-name> |
| 67 | + ``` |
53 | 68 |
|
54 |
| -## Dev Dependencies |
| 69 | +4. Write code and commit your changes in logical chunks. |
55 | 70 |
|
56 |
| -Dev dependencies that are used on multiple packages can be hoisted to the top-level |
| 71 | +5. Locally merge (or rebase) the upstream `master` branch into your feature branch: |
| 72 | + |
| 73 | + ```bash |
| 74 | + git pull [--rebase] upstream master |
| 75 | + ``` |
| 76 | + |
| 77 | +6. Push your feature branch up to your fork: |
| 78 | + |
| 79 | + ```bash |
| 80 | + git push origin <feature-branch-name> |
| 81 | + ``` |
| 82 | + |
| 83 | +7. [Open a Merge Request](https://help.github.com/articles/using-pull-requests/) |
| 84 | + with a clear title and description from your fork to the base repository (bitpay/bitcore - master). |
57 | 85 |
|
58 |
| -Linters, formatters, and other standards can be defined top-level for the monorepo |
59 | 86 |
|
60 |
| -This allows reuse of eslint/tslint/prettier standards for all projects. |
|
0 commit comments