From bd1d288ff0c8fdcbc578736b3baa45d7f14e735a Mon Sep 17 00:00:00 2001 From: t <28008958+taeh98@users.noreply.github.com> Date: Sat, 7 Oct 2023 02:13:49 +0100 Subject: [PATCH] chore: made CONTRIBUTING.md --- CONTRIBUTING.md | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 45 +++------------ 2 files changed, 154 insertions(+), 37 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ba250f0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,146 @@ +# ๐Ÿ’– Contributing to [React Native Dropdown Picker](https://github.com/hossein-zare/react-native-dropdown-picker) + +Thank you for considering contributing to this library! This guide will walk you +through how to do so successfully ๐Ÿ˜ƒ + +## ๐Ÿค” Overview + +### ๐ŸŒ General guidance + +You should +read [GitHub's general guidance on contributing to projects](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) +and [guidance on collaborating with pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests). + +### ๐Ÿ“„ Documentation + +Good and thorough documentation is important to enabling people to use a +library. Therefore, it would be greatly appreciated if +you [contributed to this library's documentation](https://github.com/hossein-zare/react-native-dropdown-picker-website). + +### ๐Ÿงช Experimenting + +To easily and quickly test changes before needing to add them to version +control or submit them for acceptance into this library, you can +use [patch-package](https://www.npmjs.com/package/patch-package). It will let +you edit this library in your own project's npm dependencies to see which +changes work. + +## ๐Ÿ› ๏ธ How to contribute changes + +### โœ… Sensibility + +Read [this library's docs](https://hossein-zare.github.io/react-native-dropdown-picker-website/docs) +and +search [its GitHub issues](https://github.com/hossein-zare/react-native-dropdown-picker/issues) +to ensure your intended changes make sense. + +### ๐Ÿšฉ Make an issue + +Before submitting any changes, document them +in [an issue](https://github.com/hossein-zare/react-native-dropdown-picker/issues/new/choose). +For example, this might be a feature request issue for the feature you will +create or a bug report for the bug you will fix. If the issue already exists, +e.g. a bug report for the same bug you'll fix or a feature request for the same +feature you're building, skip this step. Don't make a duplicate issue. + +### ๐Ÿด Forking + +To start work on your changes to be +submitted, [fork and clone](https://docs.github.com/en/get-started/quickstart/fork-a-repo) +this library. You should +then [create a new branch](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging) +on your fork dedicated to the changes you're making. You should +read [GitHub's docs about branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches). +Make sure you use a separate branch (โ‡’ PR) for each atomic change (e.g. adding +one feature or fixing one bug) you are making. If you want to make multiple, do +so in separate branches, and submit them in separate PRs. Otherwise, your PRs +will bloat, and it will be hard to review, manage, and keep track of them. + +### ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ’ป Make changes + +Make the changes you require to this library in your fork. Test them +with `npm pack`. It will let you build this library as if for release on npm +locally, so you can include it as a dependency in another npm package to test +it. +Read [this article](https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e) +for more information on how to use `npm pack` to test your changed version of +this library locally. + +Once you have ensured your changes work as +required, [commit your changes](https://git-scm.com/docs/git-commit) +and [push them to your fork](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository). +Then ensure that your changes pass +our [continuous integration (CI) workflow](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration). +They will show up to you +as [status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks). +To do this, you may need +to [fix ESLint issues](https://eslint.org/docs/latest/use/command-line-interface#--fix) +and [reformat your code with Prettier](https://prettier.io/docs/en/cli#--write). + +Use the script `update_reformat.sh` to automatically update this library's +dependencies and reformat its code. This will help you pass our CI checks. + +Whenever applicable, add or update automated tests to check your changes work +and that they will continue to do so in the future. You +should [squash the commits you made](https://www.geeksforgeeks.org/git-squash/) +containing your changes into one single commit that conforms +to [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary). + +Ensure your changes are up-to-date with those in the `dev-5.x` (default) branch. +This will mean your commit will come immediately after the last one in +the `dev-5.x` (default) branch if you +run [git log](https://git-scm.com/docs/git-log). +Read [GitHub's guidance on keeping your pull request in sync with the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch). +Doing this will prevent merge conflicts that will stop your changes being able +to be merged. + +Once you've done all this, you're ready to submit a Pull Request (PR). + +### ๐Ÿš€ Make a Pull Request + +To submit your changes for review and to have them added to this library, you +must make +a [pull request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). +You will be ready to do so after following the instructions in the "Make +changes" section. + +You can make a PR into this +library [here](https://github.com/hossein-zare/react-native-dropdown-picker/compare). +Ensure +you [link the issue you made earlier (and any others that are relevant) to your PR](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar). + +PRs should be made against and merged into +the [`dev-5.x`](https://github.com/hossein-zare/react-native-dropdown-picker) +branch, which is set as the `default` branch on GitHub. + +You can also make +a [draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/) +before the changes are completely finished as per the "Make changes" section. +This might be useful if you need feedback on your changes early on and before +finalizing for merging. + +Once you have made a PR, you will then get feedback from the maintainers of the +repo. This will help ensure your changes are ready to be merged. + +If required, make a separate +PR [in the docs](https://github.com/hossein-zare/react-native-dropdown-picker-website) +if your changes make its contents incorrect or if information regarding your +changes is missing from them altogether. + +## ๐Ÿ Release process + +Releases are currently made from +the [`5.x`](https://github.com/hossein-zare/react-native-dropdown-picker/tree/5.x) +branch. To make a new release, follow these steps: + +1. Verify the development branch has all the changes desired in the release and + works well +2. Make and merge a final PR into the development branch that increments the + version number in `package.json` +3. Make and merge a PR from the development branch to the release branch +4. Using the GitHub web UI, draft a new release using the tag name `vx.x.x` + (replace the `x` values as appropriate). Use the release branch as the + target, with the release name being `vx.x.x` (again, with appropriate + numbers in place of `x`) +5. Verify in the GitHub Actions panel for the repository that `npm publish` + succeeded diff --git a/README.md b/README.md index 91b0a73..4ac7c93 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![GitHub repo](https://img.shields.io/badge/GitHub_repo-grey?logo=github)](https://github.com/hossein-zare/react-native-dropdown-picker) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fhossein-zare%2Freact-native-dropdown-picker%2Fbadge%3Fref%3Ddev-5.x&style=flat)](https://actions-badge.atrox.dev/hossein-zare/react-native-dropdown-picker/goto?ref=dev-5.x) +[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/CONTRIBUTING.md) [![react-native-dropdown-picker is released under the MIT license.](https://img.shields.io/github/license/hossein-zare/react-native-dropdown-picker)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/LICENSE) [![Current npm package version.](https://img.shields.io/npm/v/react-native-dropdown-picker?color=brightgreen&label=npm%20package)](https://www.npmjs.org/package/react-native-dropdown-picker) [![Weekly npm downloads](https://img.shields.io/npm/dw/react-native-dropdown-picker)](https://www.npmjs.org/package/react-native-dropdown-picker) @@ -90,43 +91,13 @@ at: [https://hossein-zare.github.io/react-native-dropdown-picker-website](https: The docs can be edited at: [https://github.com/hossein-zare/react-native-dropdown-picker-website](https://github.com/hossein-zare/react-native-dropdown-picker-website) -## Merge and Release Process +## ๐Ÿ˜• Support and issues -### Branches in use +If you have questions or need help, you +can [ask a question on Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-dropdown-picker) +or [make a GitHub issue](https://github.com/hossein-zare/react-native-dropdown-picker/issues/new/choose). +You can also make a GitHub issue to report a bug or make a feature request. -#### Development +## ๐Ÿš€๏ธ Contributing -PRs should be made against and merged into -the [`dev-5.x`](https://github.com/hossein-zare/react-native-dropdown-picker) -branch, which is set as the `default` branch on GitHub. - -#### Release - -Releases are currently made from -the [`5.x`](https://github.com/hossein-zare/react-native-dropdown-picker/tree/5.x) -branch. - -### Release Process - -To make a new release, follow these steps: - -* Verify the development branch has all the changes desired in the release and - works well -* You can test changes to this library and experiment easily - with [patch-package](https://www.npmjs.com/package/patch-package) -* Once you have made changes, and after finalizing them, use `npm pack` - to [test your new, changed version of this library locally and check it works correctly](https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e) -* Make and merge a final PR into the development branch that increments the - version number in `package.json` -* Make and merge a PR from the development branch to the release branch -* Using the GitHub web UI, draft a new release using the tag name `vx.x.x` - (replace the `x` values as appropriate). Use the release branch as the - target, with the release name being `vx.x.x` (again, with appropriate - numbers in place of `x`) -* Verify in the GitHub Actions panel for the repository that `npm publish` - succeeded - -[//]: # (TODO: make templates for pull requests and issues, and CONTRIBUTING.md - include check people read docs and past issues before submitting new issues - ensure PRs tested with npm pack: https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e -) +See [CONTRIBUTING.md](https://github.com/hossein-zare/react-native-dropdown-picker/blob/dev-5.x/CONTRIBUTING.md).