|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +Thank you for reading this, we always welcome help make this project even better! Without the help from our contributors this project would not be possible. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | +Please read and follow our [Code of Conduct][coc]. |
| 7 | + |
| 8 | +## Setup |
| 9 | + |
| 10 | +Run `npm install` to install dependencies. |
| 11 | + |
| 12 | +Run `npm run build:lib` to build. |
| 13 | + |
| 14 | +Run `npm run start:example-app` to start the example app. |
| 15 | + |
| 16 | +### Testing |
| 17 | + |
| 18 | +Run `npm install` to install dependencies. |
| 19 | + |
| 20 | +Run `npm run build:lib` to build. |
| 21 | + |
| 22 | +Run `npm run test:ci:local` to test the same way the build validation will test. |
| 23 | + |
| 24 | +## Submission Guidelines |
| 25 | + |
| 26 | +### Submitting a feature request |
| 27 | + |
| 28 | +You can open an issue and request a new feature. Please add some information on what you would like, how it should work. Small features can be added directly as a Pull Request without opening an issue first. |
| 29 | + |
| 30 | +### Submitting a bug report |
| 31 | + |
| 32 | +Search through other issues to see if there is already a previous issue for the bug. Provide a small reproduction using a StackBlitz project or a GitHub repo. |
| 33 | + |
| 34 | +### Submitting a Pull Request |
| 35 | + |
| 36 | +- Please test your code by running the tests. |
| 37 | +- Rebase your branch against the current master. We might ask you to rebase again once your branch is out of date. |
| 38 | +- If you add new functionality please also add tests to validate this. |
| 39 | +- Reference issues as a PR comment. |
| 40 | +- Follow our code guidelines. |
| 41 | + |
| 42 | +## Commit Message Guidelines |
| 43 | + |
| 44 | +We have very precise rules over how our git commit messages can be formatted. This leads to **more |
| 45 | +readable messages** that are easy to follow when looking through the **project history**. But also, |
| 46 | +we use the git commit messages to **generate the Angular Tree Component change log**. |
| 47 | + |
| 48 | +### Commit Message Format |
| 49 | + |
| 50 | +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special |
| 51 | +format that includes a **type**, a **scope**, and a **subject**: |
| 52 | + |
| 53 | +``` |
| 54 | +<type>(<scope>): <subject> |
| 55 | +<BLANK LINE> |
| 56 | +<body> |
| 57 | +<BLANK LINE> |
| 58 | +<footer> |
| 59 | +``` |
| 60 | + |
| 61 | +The **header** is mandatory and the **scope** of the header is optional. |
| 62 | + |
| 63 | +Any line of the commit message cannot be longer 100 characters! This allows the message to be easier |
| 64 | +to read on GitHub as well as in various git tools. |
| 65 | + |
| 66 | +The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any. |
| 67 | + |
| 68 | +Samples: (even more [samples](https://github.com/CirclonGroup/angular-tree-component/commits/master)) |
| 69 | + |
| 70 | +``` |
| 71 | +docs(changelog): update changelog to beta.5 |
| 72 | +``` |
| 73 | + |
| 74 | +``` |
| 75 | +fix(release): need to depend on latest rxjs and zone.js |
| 76 | +
|
| 77 | +The version in our package.json gets copied to the one we publish, and users need the latest of these. |
| 78 | +``` |
| 79 | + |
| 80 | +### Revert |
| 81 | + |
| 82 | +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. |
| 83 | + |
| 84 | +### Type |
| 85 | + |
| 86 | +Must be one of the following: |
| 87 | + |
| 88 | +- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| 89 | +- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| 90 | +- **docs**: Documentation only changes |
| 91 | +- **feat**: A new feature |
| 92 | +- **fix**: A bug fix |
| 93 | +- **perf**: A code change that improves performance |
| 94 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 95 | +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| 96 | +- **test**: Adding missing tests or correcting existing tests |
| 97 | + |
| 98 | +### Scope |
| 99 | + |
| 100 | +The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages). |
| 101 | + |
| 102 | +The following is the list of supported scopes: |
| 103 | + |
| 104 | +- **component** |
| 105 | +- **directive** |
| 106 | +- **model** |
| 107 | +- **mobx** |
| 108 | + |
| 109 | +### Subject |
| 110 | + |
| 111 | +The subject contains a succinct description of the change: |
| 112 | + |
| 113 | +- use the imperative, present tense: "change" not "changed" nor "changes" |
| 114 | +- don't capitalize the first letter |
| 115 | +- no dot (.) at the end |
| 116 | + |
| 117 | +### Body |
| 118 | + |
| 119 | +Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". |
| 120 | +The body should include the motivation for the change and contrast this with previous behavior. |
| 121 | + |
| 122 | +### Footer |
| 123 | + |
| 124 | +The footer should contain any information about **Breaking Changes** and is also the place to |
| 125 | +reference GitHub issues that this commit **Closes**. |
| 126 | + |
| 127 | +**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. |
| 128 | + |
| 129 | +Example: |
| 130 | + |
| 131 | +``` |
| 132 | +feat(scope): commit message |
| 133 | +
|
| 134 | +BREAKING CHANGES: |
| 135 | +
|
| 136 | +Describe breaking changes here |
| 137 | +
|
| 138 | +BEFORE: |
| 139 | +
|
| 140 | +Previous code example here |
| 141 | +
|
| 142 | +AFTER: |
| 143 | +
|
| 144 | +New code example here |
| 145 | +``` |
| 146 | + |
| 147 | +[coc]: https://github.com/CirclonGroup/angular-tree-component/blob/master/CODE_OF_CONDUCT.md |
0 commit comments