|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +> This is adapted from [Vue.js's contributing guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md). |
| 4 | +
|
| 5 | +Hi! I’m really excited that you are interested in contributing to Vue-infinite-loading. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. |
| 6 | + |
| 7 | +- [Code of Conduct](https://github.com/PeachScript/vue-infinite-loading/blob/master/.github/CODE_OF_CONDUCT.md) |
| 8 | +- [Issue Reporting Guidelines](#issue-reporting-guidelines) |
| 9 | +- [Pull Request Guidelines](#pull-request-guidelines) |
| 10 | +- [Development Setup](#development-setup) |
| 11 | +- [Project Structure](#project-structure) |
| 12 | + |
| 13 | +## Issue Reporting Guidelines |
| 14 | + |
| 15 | +- The issue list of this repo is **exclusively** for bug reports and feature requests. |
| 16 | + |
| 17 | +- Try to search for your issue, it may have already been answered or even fixed in the development version. |
| 18 | + |
| 19 | +- Check if the issue is reproducible with the latest stable version of Vue-infinite-loading. If you are using a pre-release, please indicate the specific version you are using. |
| 20 | + |
| 21 | +- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable. |
| 22 | + |
| 23 | +- Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster we can investigate. |
| 24 | + |
| 25 | +- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed. |
| 26 | + |
| 27 | +- It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with [this template](https://jsfiddle.net/0uhj7epo/) that already includes the latest version of Vue-infinite-loading. |
| 28 | + |
| 29 | +- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it. |
| 30 | + |
| 31 | +## Pull Request Guidelines |
| 32 | + |
| 33 | +- Checkout a topic branch from the `master` branch, and merge back against it. |
| 34 | + |
| 35 | +- Work in the `src` folder and **DO NOT** checkin `dist` in the commits. |
| 36 | + |
| 37 | +- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging. |
| 38 | + |
| 39 | +- Make sure `npm test` passes. (see [development setup](#development-setup)) |
| 40 | + |
| 41 | +- If adding new feature: |
| 42 | + - Add accompanying test case. |
| 43 | + - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. |
| 44 | + |
| 45 | +- If fixing a bug: |
| 46 | + - If you are resolving a special issue, add `(fix #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`. |
| 47 | + - Provide detailed description of the bug in the PR. Live demo preferred. |
| 48 | + - Add appropriate test coverage if applicable. |
| 49 | + |
| 50 | +## Development Setup |
| 51 | + |
| 52 | +You will need [Node.js](http://nodejs.org) **version 6+** installed. |
| 53 | + |
| 54 | +After cloning the repo, run: |
| 55 | + |
| 56 | +``` bash |
| 57 | +$ npm install # or yarn |
| 58 | +``` |
| 59 | + |
| 60 | +### Committing Changes |
| 61 | + |
| 62 | +Commit messages should follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages will be automatically validated upon commit. |
| 63 | + |
| 64 | +### Commonly used NPM scripts |
| 65 | + |
| 66 | +``` bash |
| 67 | +# run dev-server |
| 68 | +$ npm run dev |
| 69 | + |
| 70 | +# lint code |
| 71 | +$ npm run lint |
| 72 | + |
| 73 | +# run the test suite |
| 74 | +$ npm test |
| 75 | +``` |
| 76 | + |
| 77 | +There are some other scripts available in the `scripts` section of the `package.json` file. |
| 78 | + |
| 79 | +**Please make sure to have test pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally beforehand. |
| 80 | + |
| 81 | +## Project Structure |
| 82 | + |
| 83 | +- **`dist`**: contains built file for distribution. Note this directory is only updated when a release happens; they do not reflect the latest changes in development. |
| 84 | + |
| 85 | +- **`test`**: contains unit tests. They are written with [Mocha](https://mochajs.org/) and run with [Karma](https://karma-runner.github.io/2.0/index.html). |
| 86 | + |
| 87 | +- **`src`**: contains the source code, obviously. The codebase is written in ES2015. |
| 88 | + |
| 89 | + - **`components`**: contains code for the core single-file component (`InfiniteLoading.vue`) and spinner single-file component (`Spinner.vue`). |
| 90 | + |
| 91 | + - **`styles`**: contains code for styles of different spinners, they are written with [Less](http://lesscss.org/). |
| 92 | + |
| 93 | +- **`types`**: contains TypeScript type definitions |
| 94 | + |
| 95 | +- **`example`**: contains basic example for development. |
0 commit comments