|
| 1 | +# Contributing to feed-reader |
| 2 | + |
| 3 | +While `feed-reader` is just a simple library with personal purpose, I'm happy if it can be useful for you too. |
| 4 | + |
| 5 | +Anyway, I hope it always gets better, so pull requests are welcome, though larger proposals should be discussed first. |
| 6 | + |
| 7 | +As an OSS, it should follow the Unix philosophy: "do one thing and do it well". |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +- Ensure you have `node` and `npm` installed. |
| 12 | +- After cloning the repository, run `npm install` in the root of the repository. |
| 13 | +- Run `npm test` to ensure that everything works correctly in your environment. |
| 14 | + |
| 15 | +If it works well, you can start modifying your fork. |
| 16 | + |
| 17 | +In this process, you can use [`node eval.js` command](https://github.com/ndaidong/feed-reader#quick-evaluation) to evaluate your changes. |
| 18 | + |
| 19 | + |
| 20 | +## Third-party libraries |
| 21 | + |
| 22 | +Please avoid using libaries other than those available in the standard library, unless necessary. |
| 23 | + |
| 24 | +This library needs to be simple and flexible to run on multiple platforms such as Deno, Bun, or even browser. |
| 25 | + |
| 26 | + |
| 27 | +## Coding convention |
| 28 | + |
| 29 | +Please follow [standardjs](https://standardjs.com/) style guide. |
| 30 | + |
| 31 | +Make sure your code lints before opening a pull request. |
| 32 | + |
| 33 | + |
| 34 | +```bash |
| 35 | +cd feed-reader |
| 36 | + |
| 37 | +# check coding convention issue |
| 38 | +npm run lint |
| 39 | + |
| 40 | +# auto fix coding convention issue |
| 41 | +npm run lint:fix |
| 42 | +``` |
| 43 | + |
| 44 | +*When you run `npm test`, the linting process will be triggered at first.* |
| 45 | + |
| 46 | + |
| 47 | +## Testing |
| 48 | + |
| 49 | +Be sure to run the unit test suite before opening a pull request. An example test run is shown below. |
| 50 | + |
| 51 | +```bash |
| 52 | +cd feed-reader |
| 53 | +npm test |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +If test coverage decreased, please check test scripts and try to improve this number. |
| 59 | + |
| 60 | + |
| 61 | +## Documentation |
| 62 | + |
| 63 | +If you've changed APIs, please update README and [the examples](https://github.com/ndaidong/feed-reader/tree/main/examples). |
| 64 | + |
| 65 | + |
| 66 | +## Clean commit histories |
| 67 | + |
| 68 | +When you open a pull request, please ensure the commit history is clean. |
| 69 | +Squash the commits into logical blocks, perhaps a single commit if that makes sense. |
| 70 | + |
| 71 | +What you want to avoid is commits such as "WIP" and "fix test" in the history. |
| 72 | +This is so we keep history on master clean and straightforward. |
| 73 | + |
| 74 | +For people new to git, please refer the following guides: |
| 75 | + |
| 76 | +- [Writing good commit messages](https://github.com/erlang/otp/wiki/writing-good-commit-messages) |
| 77 | +- [Commit Message Guidelines](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53) |
| 78 | + |
| 79 | + |
| 80 | +## License |
| 81 | + |
| 82 | +By contributing to `feed-reader`, you agree that your contributions will be licensed under its [MIT license](https://github.com/ndaidong/feed-reader/blob/main/LICENSE). |
| 83 | + |
| 84 | +--- |
0 commit comments