4.4 KiB
How to Contribute
Thanks in advance for contributing to MapillaryJS. Please follow the conventions below when submitting an issue or pull request.
Code of Conduct
Facebook has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.
Contribution Prerequisites
Sending a Pull Request
We will review your pull request and either merge it, request changes to it, or close it with an explanation. We’ll do our best to provide updates and feedback throughout the process.
Before submitting a pull request, please make sure the following is done:
- Fork the repository and create your branch from
main. - Follow the development workflow to setup your environment.
- If you’ve fixed a bug or added code that should be tested, add tests!
- Ensure the test suite passes (
yarn test) and that your code lints (yarn lint). - If you haven’t already, complete the CLA.
Contributor License Agreement (CLA)
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you’ve done this for another Facebook open source project, you’re good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
Development Workflow
After cloning MapillaryJS, run yarn install to fetch its dependencies.
If you want to use data from the Mapillary platform during development, first you need an account. Then you need to register an application to get a client access token.
Setup your MapillaryJS development environment with the following command:
MAPILLARY_ACCESS_TOKEN="<YOUR_CLIENT_ACCESS_TOKEN>" yarn setup
Then, you can run several commands:
yarn lintchecks the code style.yarn testruns the complete test suite.yarn test-watchruns an interactive test watcher.yarn buildcreates adistfolder with the package.yarn startstarts a development server and rebuilds on source file changes.yarn clearremoves the build output.
We recommend running yarn test to make sure you don’t introduce any regressions as you work on your change.
The easiest way to try your changes is to run yarn start and open the debug page at http://localhost:8000.
However it can be handy to try your build of MapillaryJS in a real project. First, run yarn build. This will produce pre-built bundles in the dist folder.
If you want to try your changes in your existing project, you may use yarn link or copy the dist folder into your app and use them instead of the stable version.
Documentation Workflow
See the documentation README.
Develop with Docker
- Install Docker.
- Clone the repository.
- Build the mapillary-js image:
docker build -t mapillary-js .
- Create a mapillary-js container and run it interactively:
docker run -v "$(pwd)":/source/mapillary-js -p 8000:8000 --name mapillary-js-container -it mapillary-js
Commit Conventions
We use the standardized commit messages according to Conventional Commits with the additional types in the Angular convention.
Version Control Conventions
We use rebase merging (as opposed to basic merging) to merge branches.
License
By contributing to MapillaryJS, you agree that your contributions will be licensed under its MIT license.