|
| 1 | +# # Node.js `api-docs-tooling` Contributing Guide |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Node.js `api-docs-tooling` project! We welcome contributions from everyone, and we appreciate your help in making this project better. |
| 4 | + |
| 5 | +## Getting started |
| 6 | + |
| 7 | +The steps below will give you a general idea of how to prepare your local environment for the Node.js Website and general steps |
| 8 | +for getting things done and landing your contribution. |
| 9 | + |
| 10 | +1. Click the fork button in the top right to clone the [Node.js `api-docs-tooling` Repository](https://github.com/nodejs/api-docs-tooling/fork) |
| 11 | + |
| 12 | +2. Clone your fork using SSH, GitHub CLI, or HTTPS. |
| 13 | + |
| 14 | + ```bash |
| 15 | + git clone [email protected]: <YOUR_GITHUB_USERNAME >/api-docs-tooling.git # SSH |
| 16 | + git clone https://github.com/<YOUR_GITHUB_USERNAME>/api-docs-tooling.git # HTTPS |
| 17 | + gh repo clone <YOUR_GITHUB_USERNAME>/api-docs-tooling # GitHub CLI |
| 18 | + ``` |
| 19 | + |
| 20 | +3. Change into the `api-docs-tooling` directory. |
| 21 | + |
| 22 | + ```bash |
| 23 | + cd api-docs-tooling |
| 24 | + ``` |
| 25 | + |
| 26 | +4. Create a remote to keep your fork and local clone up-to-date. |
| 27 | + |
| 28 | + ```bash |
| 29 | + git remote add upstream [email protected]:nodejs/api-docs-tooling # SSH |
| 30 | + git remote add upstream https://github.com/nodejs/api-docs-tooling # HTTPS |
| 31 | + gh repo sync nodejs/api-docs-tooling # GitHub CLI |
| 32 | + ``` |
| 33 | + |
| 34 | +5. Create a new branch for your work. |
| 35 | + |
| 36 | + ```bash |
| 37 | + git checkout -b <name-of-your-branch> |
| 38 | + ``` |
| 39 | + |
| 40 | +6. Run the following to install the dependencies. |
| 41 | + |
| 42 | + ```bash |
| 43 | + npm install |
| 44 | + ``` |
| 45 | + |
| 46 | +7. Perform your changes. |
| 47 | + |
| 48 | +8. Perform a merge to sync your current branch with the upstream branch. |
| 49 | + |
| 50 | + ```bash |
| 51 | + git fetch upstream |
| 52 | + git merge upstream/main |
| 53 | + ``` |
| 54 | + |
| 55 | +9. Run `node --run format` and `node --run lint` to confirm that linting and formatting are passing. |
| 56 | + |
| 57 | + ```bash |
| 58 | + node --run format |
| 59 | + node --run lint |
| 60 | + ``` |
| 61 | + |
| 62 | +10. Once you're happy with your changes, add and commit them to your branch, then push the branch to your fork. |
| 63 | + |
| 64 | + ```bash |
| 65 | + cd ~/api-docs-tooling |
| 66 | + git add . |
| 67 | + git commit -m "describe your changes" |
| 68 | + git push -u origin name-of-your-branch |
| 69 | + ``` |
| 70 | + |
| 71 | +> [!IMPORTANT]\ |
| 72 | +> Before committing and opening a Pull Request, please go first through our [Commit](#commit-guidelines); |
| 73 | + |
| 74 | +11. Create a Pull Request. |
| 75 | + |
| 76 | +## Commit Guidelines |
| 77 | + |
| 78 | +This project follows the [Conventional Commits][] specification. |
| 79 | + |
| 80 | +### Commit Message Guidelines |
| 81 | + |
| 82 | +- Commit messages must include a "type" as described on Conventional Commits |
| 83 | +- Commit messages **must** start with a capital letter |
| 84 | +- Commit messages **must not** end with a period `.` |
| 85 | + |
| 86 | +### Pre-commit Hooks |
| 87 | + |
| 88 | +This project uses [Husky][] for Git pre-commit hooks. |
| 89 | +It's lint and format stages your code before committing. |
| 90 | +You can disable the pre-commit hooks by using the `--no-verify` flag. |
| 91 | +
|
| 92 | +```bash |
| 93 | +git commit -m "describe your changes" --no-verify |
| 94 | +``` |
| 95 | +
|
| 96 | +## Developer's Certificate of Origin 1.1 |
| 97 | + |
| 98 | +``` |
| 99 | +By contributing to this project, I certify that: |
| 100 | +
|
| 101 | +- (a) The contribution was created in whole or in part by me and I have the right to |
| 102 | + submit it under the open source license indicated in the file; or |
| 103 | +- (b) The contribution is based upon previous work that, to the best of my knowledge, |
| 104 | + is covered under an appropriate open source license and I have the right under that |
| 105 | + license to submit that work with modifications, whether created in whole or in part |
| 106 | + by me, under the same open source license (unless I am permitted to submit under a |
| 107 | + different license), as indicated in the file; or |
| 108 | +- (c) The contribution was provided directly to me by some other person who certified |
| 109 | + (a), (b) or (c) and I have not modified it. |
| 110 | +- (d) I understand and agree that this project and the contribution are public and that |
| 111 | + a record of the contribution (including all personal information I submit with it, |
| 112 | + including my sign-off) is maintained indefinitely and may be redistributed consistent |
| 113 | + with this project or the open source license(s) involved. |
| 114 | +``` |
| 115 | + |
| 116 | +[Conventional Commits]: https://www.conventionalcommits.org/ |
| 117 | +[Commit Signing]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
| 118 | +[Husky]: https://typicode.github.io/husky/ |
0 commit comments