|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +# Contributing to Boa |
| 6 | + |
| 7 | +Boa welcomes contribution from everyone. Here are the guidelines if you are |
| 8 | +thinking of helping out: |
| 9 | + |
| 10 | +## Contributions |
| 11 | + |
| 12 | +Contributions to Boa or its dependencies should be made in the form of GitHub |
| 13 | +pull requests. Each pull request will be reviewed by a core contributor |
| 14 | +(someone with permission to land patches) and either landed in the main tree or |
| 15 | +given feedback for changes that would be required. All contributions should |
| 16 | +follow this format. |
| 17 | + |
| 18 | +Should you wish to work on an issue, please claim it first by commenting on |
| 19 | +the GitHub issue that you want to work on it. This is to prevent duplicated |
| 20 | +efforts from contributors on the same issue. |
| 21 | + |
| 22 | +Head over to [issues][issues] and check for "good first issue" labels to find |
| 23 | +good tasks to start with. If you come across words or jargon that do not make |
| 24 | +sense, please ask! |
| 25 | + |
| 26 | +If you don't already have Rust installed [_rustup_][rustup] is the recommended |
| 27 | +tool to use. It will install Rust and allow you to switch between _nightly_, |
| 28 | +_stable_ and _beta_. You can also install additional components. In Linux, you |
| 29 | +can run: |
| 30 | + |
| 31 | +```shell |
| 32 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 33 | +``` |
| 34 | + |
| 35 | +Then simply clone this project and `cargo build`. |
| 36 | + |
| 37 | +## Running the compiler |
| 38 | + |
| 39 | +You can execute a Boa console by running `cargo run`, and you can compile a list |
| 40 | +of JavaScript files by running `cargo run -- file1.js file2.js` and so on. |
| 41 | + |
| 42 | +## Building the docs |
| 43 | + |
| 44 | +To build the development documentation, run: |
| 45 | + |
| 46 | +```shell |
| 47 | +cargo doc --all-features --document-private-items --workspace |
| 48 | +``` |
| 49 | + |
| 50 | +This will also document all the dependencies on the workspace, which could be |
| 51 | +heavier in size. To only generate documentation for the workspace members, just |
| 52 | +add the `--no-deps` flag: |
| 53 | + |
| 54 | +```shell |
| 55 | +cargo doc --all-features --document-private-items --workspace --no-deps |
| 56 | +``` |
| 57 | + |
| 58 | +## Debugging |
| 59 | + |
| 60 | +Knowing how to debug the interpreter should help you resolve problems quite quickly. |
| 61 | +See [Debugging](/docs/category/debugging). |
| 62 | + |
| 63 | +## IDE Setup |
| 64 | + |
| 65 | +You can work on Boa with any text editor capable of editing Rust and Javascript code. |
| 66 | +An easy way of getting started is to use [Visual Studio Code](https://code.visualstudio.com/) |
| 67 | +with the [Rust Analyzer][rust-analyzer_vscode] extension. |
| 68 | + |
| 69 | +## AI |
| 70 | + |
| 71 | +We are usually not against using AI tools. However, their |
| 72 | +general availability makes it much easier to fill our review capacity with |
| 73 | +low-effort contributions. Therefore, every contributor must adhere to the following |
| 74 | +rules: |
| 75 | +- No spamming PRs. This includes the use of AI agents to open multiple PRs in |
| 76 | + succession. |
| 77 | +- No PRs with massive line changes (5k+) without prior discussion and acknowledgement. |
| 78 | +- All PR authors must be able to explain what their contribution does in detail. |
| 79 | + |
| 80 | +The maintainers reserve the right to closing any PRs that do not follow these rules, |
| 81 | +and recurrent offenses will result in a global ban from contributing to all |
| 82 | +Boa-related projects. |
| 83 | + |
| 84 | +## Communication |
| 85 | + |
| 86 | +Most of our communication happens in Matrix, feel free to ask questions in our |
| 87 | +[Boa space][matrix]. |
| 88 | + |
| 89 | +[issues]: https://github.com/boa-dev/boa/issues |
| 90 | +[rustup]: https://rustup.rs/ |
| 91 | +[rust-analyzer_vscode]: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer |
| 92 | +[matrix]: https://matrix.to/#/#boa:matrix.org |
0 commit comments