2021-06-23 15:54:13 +02:00
# Contributing to WorkAdventure
2021-12-18 22:32:15 +01:00
Are you looking to help on WorkAdventure? Awesome, feel welcome and read the following sections in order to know how to
2021-06-23 15:54:13 +02:00
ask questions and how to work on something.
## Contributions we are seeking
We love to receive contributions from our community — you!
2021-12-18 22:32:15 +01:00
There are many ways to contribute, from writing tutorials or blog posts, improving the documentation,
2021-06-23 15:54:13 +02:00
submitting bug reports and feature requests or writing code which can be incorporated into WorkAdventure itself.
2021-12-09 18:08:04 +01:00
## Contributing external resources
You can share your work on maps / articles / videos related to WorkAdventure on our [awesome-workadventure ](https://github.com/workadventure/awesome-workadventure ) list.
2021-12-09 10:57:27 +01:00
## Developer documentation
2021-12-18 22:32:15 +01:00
Documentation targeted at developers can be found in the [`/docs/dev` ](docs/dev/ )
2021-12-09 10:57:27 +01:00
2021-06-23 15:54:13 +02:00
## Using the issue tracker
First things first: **Do NOT report security vulnerabilities in public issues!** .
Please read the [security guide ](SECURITY.md ) to learn who to do a security disclosure to the WorkAdventure core team.
You can use [GitHub issue tracker ](https://github.com/thecodingmachine/workadventure/issues ) to:
- File bug reports
- Ask for feature requests
2022-02-28 17:04:48 +01:00
If you have more general questions, a good place to ask is [our Discord server ](https://discord.gg/G6Xh9ZM9aR ).
2021-06-23 15:54:13 +02:00
Finally, you can come and talk to the WorkAdventure core team... on WorkAdventure, of course! [Our offices are here ](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village ).
## Pull requests
2021-12-18 22:32:15 +01:00
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope
2021-06-23 15:54:13 +02:00
and avoid containing unrelated commits.
2021-12-18 22:32:15 +01:00
Please ask first before embarking on any significant pull request (e.g. implementing features, refactoring code),
otherwise you risk spending a lot of time working on something that the project's developers might not want to merge
2021-06-23 15:54:13 +02:00
into the project.
2022-02-28 17:04:48 +01:00
You can ask us on [Discord ](https://discord.gg/G6Xh9ZM9aR ) or in the [GitHub issues ](https://github.com/thecodingmachine/workadventure/issues ).
2021-06-23 15:54:13 +02:00
### Linting your code
Before committing, be sure to install the "Prettier" precommit hook that will reformat your code to our coding style.
In order to enable the "Prettier" precommit hook, at the root of the project, run:
```console
2021-07-02 14:40:18 +02:00
$ yarn install
2021-06-23 15:54:13 +02:00
$ yarn run prepare
```
2021-12-18 22:32:15 +01:00
If you don't have the precommit hook installed (or if you committed code before installing the precommit hook), you will need
2021-06-23 17:13:16 +02:00
to run code linting manually:
```console
$ docker-compose exec front yarn run pretty
$ docker-compose exec pusher yarn run pretty
$ docker-compose exec back yarn run pretty
```
2021-06-23 15:54:13 +02:00
### Providing tests
WorkAdventure is based on a video game engine (Phaser), and video games are not the easiest programs to unit test.
2022-02-18 16:11:26 +01:00
Nevertheless, if your code can be unit tested, please provide a unit test (we use Jasmine), or an end-to-end test (we use Playwright).
2021-06-23 15:54:13 +02:00
If you are providing a new feature, you should setup a test map in the `maps/tests` directory. The test map should contain
2021-12-03 09:28:30 +01:00
some description text describing how to test the feature.
2021-06-23 15:54:13 +02:00
2021-12-18 22:32:15 +01:00
* if the features is meant to be manually tested, you should modify the `maps/tests/index.html` file to add a reference
2021-12-03 09:28:30 +01:00
to your newly created test map
2022-02-18 16:11:26 +01:00
* if the features can be automatically tested, please provide an end-to-end test
2021-12-03 09:28:30 +01:00
2022-02-18 16:11:26 +01:00
#### Running end-to-end tests
2021-12-03 09:28:30 +01:00
End-to-end tests are available in the "/tests" directory.
2022-02-18 16:11:26 +01:00
More information on running end-to-end tests can be found in the [`/tests/README` ](/tests/README.md ).
2021-12-18 22:32:15 +01:00
### A bad wording or a missing language
If you notice a translation error or missing language you can help us by following the [how to translate ](docs/dev/how-to-translate.md ) documentation.