|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thank you for considering contributing to the Symfony's Stimulus Bridge! |
| 4 | + |
| 5 | +The Symfony's Stimulus Bridge is an open source, community-driven project, and we are happy to receive contributions from the community! |
| 6 | + |
| 7 | +> [!TIP] |
| 8 | +> It's a good idea to read the [Symfony's Contribution Guide](https://symfony.com/doc/current/contributing/index.html) first, even if not all of it applies here and should be adapted to this project (e.g.: there is a single base branch, `main`). |
| 9 | +
|
| 10 | +## Reporting an issue |
| 11 | + |
| 12 | +If you either find a bug, have a feature request, or need help/have a question, please [open an issue](https://github.com/symfony/stimulus-bridge/issues/new/choose). |
| 13 | + |
| 14 | +Please provide as much information as possible, |
| 15 | +and remember to follow our [Code of Conduct](https://symfony.com/doc/current/contributing/code_of_conduct/index.html) |
| 16 | +as well, to ensure a friendly environment for all contributors. |
| 17 | + |
| 18 | +## Contributing to the code and documentation |
| 19 | + |
| 20 | +Thanks for your interest in contributing to Symfony UX! Here are some guidelines to help you get started. |
| 21 | + |
| 22 | +### Forking the repository |
| 23 | + |
| 24 | +To contribute to Symfony's Stimulus Bridge, you need to [fork the **symfony/stimulus-bridge** repository](https://github.com/symfony/stimulus-bridge/fork) on GitHub. |
| 25 | +This will give you a copy of the code under your GitHub user account, read [the documentation "How to fork a repository"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). |
| 26 | + |
| 27 | +After forking the repository, you can clone it to your local machine: |
| 28 | + |
| 29 | +```shell |
| 30 | +$ git clone [email protected]: <USERNAME >/symfony-ux.git symfony-ux |
| 31 | +$ cd symfony-ux |
| 32 | +# Add the upstream repository, to keep your fork up-to-date |
| 33 | +$ git remote add upstream [email protected]:symfony/stimulus-bridge.git |
| 34 | +``` |
| 35 | + |
| 36 | +### Setting up the development environment |
| 37 | + |
| 38 | +To set up the development environment, you need the following tools: |
| 39 | + |
| 40 | +- [Node.js](https://nodejs.org/en/download/package-manager) 18 or higher |
| 41 | + |
| 42 | +With these tools installed, you can install the project dependencies: |
| 43 | + |
| 44 | +```shell |
| 45 | +$ corepack enable |
| 46 | +$ pnpm install |
| 47 | +``` |
| 48 | + |
| 49 | +### Linking into a Symfony project |
| 50 | + |
| 51 | +To test your changes in a Symfony project, you can link the package into a Symfony project by running the following commands: |
| 52 | + |
| 53 | +```shell |
| 54 | +# Execute in the Symfony's Stimulus Bridge repository |
| 55 | +npm link |
| 56 | + |
| 57 | +# Execute in the Symfony project |
| 58 | +npm link @symfony/stimulus-bridge |
| 59 | +``` |
| 60 | + |
| 61 | +## Useful Git commands |
| 62 | + |
| 63 | +1. To keep your fork up-to-date with the upstream repository and `main` branch, you can run the following commands: |
| 64 | +```shell |
| 65 | +$ git checkout main && \ |
| 66 | + git fetch upstream && \ |
| 67 | + git rebase upstream/main && \ |
| 68 | + git push origin main |
| 69 | +``` |
| 70 | + |
| 71 | +2. To rebase your branch on top of the `main` branch, you can run the following commands: |
| 72 | +```shell |
| 73 | +$ git checkout my-feature-branch && \ |
| 74 | + git rebase upstream/main && \ |
| 75 | + git push -u origin my-feature-branch |
| 76 | +``` |
0 commit comments