Contribution guide
We are happy that you are interested in contributing to our project. This guide will help you to get started with the development of our project. We are always looking for new contributors and are happy to help you with any questions you might have. If you have any questions or need help please feel free to reach out!
Dev environment
We deploy and also develop using docker container. We have a docker compose file that can be used to start a local development environment. To prevent long startup times and unnecessary rebuilds we do not build the packages inside the dev containers. Instead we build the packages on the host machine and live mount the code into the containers. This allows for fast rebuilds and hot reloading of the code.
For this to work tho you need to build the packages on your host machine. This can be done by running the following command:
pnpm install
pnpm --filter packages build
docker compose -f docker/docker-compose.dev.yml build
docker compose -f docker/docker-compose.dev.yml up
This will start all apps (email, next, socket, images) in watch mode and live mount the repo into the containers. The watch mode does not apply to packages located in the packages
folder. If you make changes to a package you will need to run the build command again (or in watch mode if you apply changes often). This can be done on your host machine and applies to all containers as the code is live mounted.
# Run build command (in watch mode)
pnpm --filter snips build --watch
If you change dependencies you will need to rebuild the containers. This can be done by running the following command:
docker compose -f docker/docker-compose.dev.yml up --build
Formatting
We use a number of eslint and prettier rules to ensure a consistent code style. Please run the following commands before submitting a pull request:
pnpm -r lint
This runs eslint and prettier on all packages. You may also run the commands in a specific package:
cd packages/auth
pnpm eslint .
Submitting changes
Please create a new branch for your changes, and submit a pull request to the main branch. We will review your changes and provide feedback.
Testing
Where possible we try to provide tests for our code. We use vitest as our testing framework. Tests mostly exist for unit tests and api endpoints. Frontend code is currently not tested if you are interested and have some strong opinions on how to test frontend code please let us know.
To run the tests locally you can use the following commands:
# Run all tests
pnpm test
# Run tests for a specific package
cd packages/auth
pnpm test