|
| 1 | +# Contributing to backpack.css 🎒 <!-- omit in toc --> |
| 2 | + |
| 3 | +Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. |
| 4 | + |
| 5 | +Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features. |
| 6 | + |
| 7 | +This project has a [code of conduct](CODE_OF_CONDUCT.md) that all contributors are expected to follow. |
| 8 | + |
| 9 | +## Table of contents <!-- omit in toc --> |
| 10 | + |
| 11 | +- [Issue tracker](#issue-tracker) |
| 12 | + - [Labels](#labels) |
| 13 | +- [Bug reports](#bug-reports) |
| 14 | + - [Guidelines](#guidelines) |
| 15 | + - [Example](#example) |
| 16 | +- [Feature requests](#feature-requests) |
| 17 | +- [Pull requests](#pull-requests) |
| 18 | + - [Process](#process) |
| 19 | +- [Publishing](#publishing) |
| 20 | + - [Step 3 breakdown](#step-3-breakdown) |
| 21 | +- [CSS style guide](#css-style-guide) |
| 22 | + |
| 23 | +## Issue tracker |
| 24 | + |
| 25 | +The [issue tracker](https://github.com/chris-pearce/backpack.css/issues) is the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) and [submitting pull requests](#pull-requests), however, please respect the following restrictions: |
| 26 | + |
| 27 | +- Please **do not** use the issue tracker for personal support requests. |
| 28 | +- Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others. |
| 29 | +- Please **do not** post comments consisting solely of '+1' or '👍'. Use [GitHub's 'reactions' feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead. We reserve the right to delete comments which violate this rule. |
| 30 | + |
| 31 | +### Labels |
| 32 | + |
| 33 | +The issue tracker utilises labels to help organise and identify issues. Each label should be self-explanatory, to further help each has a description. |
| 34 | + |
| 35 | +Please always attach a label(s) to your issue and you can see all of the project's labels [here](https://github.com/chris-pearce/backpack.css/labels). |
| 36 | + |
| 37 | +## Bug reports |
| 38 | + |
| 39 | +A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful, so thanks! |
| 40 | + |
| 41 | +### Guidelines |
| 42 | + |
| 43 | +1. **Use the GitHub issue search** to check if the issue has already been reported. |
| 44 | +2. **Check if the issue has been fixed** by trying to reproduce it using the latest `master` branch in the repository. |
| 45 | +3. **Isolate the problem** by creating a live example (e.g., on [Codepen](http://codepen.io)) of a [reduced test case](http://css-tricks.com/6263-reduced-test-cases/). |
| 46 | + |
| 47 | +A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. |
| 48 | + |
| 49 | +### Example |
| 50 | + |
| 51 | +> Short and descriptive example bug report title |
| 52 | +> |
| 53 | +> A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug. |
| 54 | +> |
| 55 | +> 1. This is the first step |
| 56 | +> 2. This is the second step |
| 57 | +> 3. Further steps, etc. |
| 58 | +> |
| 59 | +> `<url>` - a link to the reduced test case. |
| 60 | +> |
| 61 | +> Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits). |
| 62 | +
|
| 63 | +## Feature requests |
| 64 | + |
| 65 | +Before opening a feature request, please take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. |
| 66 | + |
| 67 | +## Pull requests |
| 68 | + |
| 69 | +Good pull requests—patches, improvements, new features—are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. |
| 70 | + |
| 71 | +**Please ask first** before embarking on any significant work, otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. And please adhere to the [CSS style guide](#css-style-guide). |
| 72 | + |
| 73 | +### Process |
| 74 | + |
| 75 | +Follow this process if you'd like your work considered for inclusion in the project: |
| 76 | + |
| 77 | +1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: |
| 78 | + |
| 79 | + ```bash |
| 80 | + # Clone your fork of the repo into the current directory |
| 81 | + git clone https://github.com/<your-username>/backpack.css.git |
| 82 | + # Navigate to the newly cloned directory |
| 83 | + cd backpack.css |
| 84 | + # Assign the original repo to a remote called 'upstream' |
| 85 | + git remote add upstream https://github.com/chris-pearce/backpack.css.git |
| 86 | + ``` |
| 87 | + |
| 88 | +2. If you cloned a while ago, get the latest changes from upstream: |
| 89 | + |
| 90 | + ```bash |
| 91 | + git checkout master |
| 92 | + git pull upstream master |
| 93 | + ``` |
| 94 | + |
| 95 | +3. Never work directly on `master`. Create a new topic branch (off the latest version of `master`) to contain your feature, change, or fix: |
| 96 | + |
| 97 | + ```bash |
| 98 | + git checkout -b <topic-branch-name> |
| 99 | + ``` |
| 100 | + |
| 101 | +4. Commit your changes in logical chunks. Please adhere to these [git commit message conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. |
| 102 | + |
| 103 | +5. Locally rebase the upstream development branch into your topic branch: |
| 104 | + |
| 105 | + ```bash |
| 106 | + git pull --rebase upstream master |
| 107 | + ``` |
| 108 | + |
| 109 | +6. Push your topic branch up to your fork: |
| 110 | + |
| 111 | + ```bash |
| 112 | + git push origin <topic-branch-name> |
| 113 | + ``` |
| 114 | + |
| 115 | +7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description. If your Pull Request corresponds to an issue then please make the title the same as the issue title and somewhere in the description, include this: _**This fixes #`<x>`**_, where `<x>` is the issue number (GitHub will offer an auto-complete menu when you type '#'). |
| 116 | + |
| 117 | +**✋ IMPORTANT:** by submitting a patch, you agree to allow the project owner to license your work under the same license that used by the project. |
| 118 | + |
| 119 | +## Publishing |
| 120 | + |
| 121 | +If you have permission to publish a new version apply the following steps, always on the `master` branch: |
| 122 | + |
| 123 | +1. Add all new changes to [`CHANGELOG.md`](CHANGELOG.md) making sure to follow the existing format. |
| 124 | +2. Update the version number in [`index.css`](src/index.css). |
| 125 | +3. Run: `npm version <update-type> --force` where `<update-type>` is one of the semantic versioning release types: **patch**, **minor**, or **major** (see the README's [Versioning](README.md#versioning) section). |
| 126 | + |
| 127 | +### Step 3 breakdown |
| 128 | + |
| 129 | +1. Run the `build` script. |
| 130 | +2. Add `CHANGELOG.md` and `index.css` that got modified in steps **1** and **2** to the version commit. |
| 131 | +3. Change the version number in [`package.json`](package.json). |
| 132 | +4. Push the new version commit and tag up to the repository. |
| 133 | +5. Publish the new version to the NPM registry. |
| 134 | +6. Clean the `lib` directory. |
| 135 | + |
| 136 | +_Each step will only run if the one before it passed._ |
| 137 | + |
| 138 | +## CSS style guide |
| 139 | + |
| 140 | +The CSS style guide is coming soon, [see](https://github.com/chris-pearce/backpack.css/issues/24). |
0 commit comments