|
| 1 | +# React Input Trigger Contributing Guide |
| 2 | + |
| 3 | +Before submitting your contribution, please take a moment and read through the following guidelines. |
| 4 | + |
| 5 | +- [Pull Request Guidelines](#pull-request-guidelines) |
| 6 | +- [Development Setup](#development-setup) |
| 7 | +- [Project Structure](#project-structure) |
| 8 | + |
| 9 | +## Pull Request Guidelines |
| 10 | + |
| 11 | +- All development would require you to just edit the contents of `src`. Please do not modify the contents of `/build`, or `/docs` directly. `/build` will always be generated by the maintainers before publishing to npm, and `/docs` is generated automatically on publish from `/src/docs`. |
| 12 | + |
| 13 | +- A preferred convention for branch names is `<task-type>/<description>`. For example: |
| 14 | + - `bugfix/missing-props` |
| 15 | + - `feature/handle-refs` |
| 16 | + |
| 17 | +- As for commit guidelines on your branch, do not fret! 🙂 The commits will be squash merged by the maintainers before merging to `master`. |
| 18 | + |
| 19 | +- Make sure `npm run lint` passes. This command runs [eslint](https://eslint.org/) to enforce the code-style conventions. |
| 20 | + |
| 21 | +- Make sure `npm run test` passes. This will check if the package can be built correctly without build errors. |
| 22 | + |
| 23 | +- If there are any changes to the dependencies, please make sure to use `npm` rather than `yarn` and that your changes are reflected in both the `package.json` and `package-lock.json` files. |
| 24 | + |
| 25 | +- If adding a new feature: |
| 26 | + - Describe your use-case / need for the feature, so that we can understand the scenario better. |
| 27 | + - Preferably raise a suggestion issue, so that we can have a discussion before you start working on the PR. 👩💻 |
| 28 | + |
| 29 | +- If fixing a bug: |
| 30 | + - Reference any open/closed github issues related to this bug. |
| 31 | + - Provide detailed description of the bug in the PR. Live demo preferred. 🚀 |
| 32 | + |
| 33 | +## Development Setup |
| 34 | + |
| 35 | +You will need [Node.js](http://nodejs.org) **version 6+** |
| 36 | + |
| 37 | +After cloning the repo, run: |
| 38 | + |
| 39 | +``` bash |
| 40 | +$ npm install |
| 41 | +``` |
| 42 | + |
| 43 | +**Note: If you're using `yarn`, just make sure you aren't committing the yarn lockfile.** |
| 44 | + |
| 45 | +### Committing Changes |
| 46 | + |
| 47 | +There is a `pre-commit` hook that runs the linter to check for code style. Please make sure that any issues that come up during this linter check are fixed when raising the Pull Request. |
| 48 | + |
| 49 | +### Commonly used NPM scripts |
| 50 | + |
| 51 | +``` bash |
| 52 | +# Runs the example project in `/src/docs`, using webpack-dev-server. |
| 53 | +# Use this demo sandbox to test your changes. It has HMR out of the box! |
| 54 | +$ npm start |
| 55 | + |
| 56 | +# Check for linting issues. |
| 57 | +# This command will also auto-fix some common issues. |
| 58 | +$ npm run lint |
| 59 | + |
| 60 | +# Tests if the package can be built correctly without errors. |
| 61 | +$ npm test |
| 62 | +``` |
| 63 | + |
| 64 | +## Project Structure |
| 65 | + |
| 66 | +- **src** |
| 67 | + - **index.js**: This is the main `<InputTrigger />` component source. |
| 68 | + - **docs**: This is the code pertaining to the demo project. |
| 69 | + |
| 70 | +- **build** |
| 71 | + |
| 72 | + This contains the production builds of the component. **Do not edit this directly** |
| 73 | + |
| 74 | +- **docs** |
| 75 | + |
| 76 | + This is the production example for the component. **Do not edit this directly** |
| 77 | + |
| 78 | +## Credits |
| 79 | + |
| 80 | +This file has been adapted from the awesome folks at Vuejs: [VueJS's Contributing Guidelines](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md). |
0 commit comments