Contributing
Thank you for investing your time in contributing to our project!
Read our Code of Conduct to keep our community approachable and respectable.
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
New contributor guide
To get an overview of the project, read the README. Here are some resources to help you get started with open source contributions:
- Finding ways to contribute to open source on GitHub
- Set up Git
- GitHub flow
- Collaborating with pull requests
Getting started
You can contribute to the project in several ways:
Issues
Create a new issue
If you spot a problem, search if an issue already exists. If a related issue doesn't exist, you can open a new issue using a relevant issue form.
Solve an issue
Scan through our existing issues to find one that interests you. You can narrow down the search using labels
as filters. See How to use Labels for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
How to use Labels
Labels can help you find an issue you'd like to help with.
- The
help wanted
label is for problems or updates that anyone in the community can start working on. - The
good first issue
label is for problems or updates we think are ideal for beginners. - The
bug
label is for bugs or problems. These will usually require some knowledge of TypeScript to fix. - The
enhancement
label is for improvements of existing functionality. These will usually require some knowledge of TypeScript to implement. - The
feature
label is for feature suggestions. These will usually require some knowledge of TypeScript to implement. - The
question
label is for questions about the project. These will usually require some knowledge on how to use the project but not necessarily implementation know-how.
Make Changes
- Fork the repository so that you can make your changes without affecting the original project until you're ready to merge them.
- Install or update to Node.js to the latest LTS release or see the specified node engine version in package.json. For more information, see Development Guidelines.
- Create a working branch and start with your changes!
Commit your update
Commit the changes once you are happy with them. Don't forget to do a self-review of the PR to speed up the review process⚡.
Pull Request
When you're finished with the changes, create a pull request, also known as a PR.
- Fill the template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
- Don't forget to link PR to issue if you are solving one.
- Enable the checkbox to allow maintainer edits so the branch can be updated for a merge. Once you submit your PR, a team member will review your proposal. We may ask questions or request additional information.
- We may ask for changes to be made before a PR can be merged, either using suggested changes or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
- As you update your PR and apply changes, mark each conversation as resolved.
- If you run into any merge issues, checkout this git tutorial to help you resolve merge conflicts and other issues.
Your PR is merged
Congratulations 🎉🎉 The project team thanks you ✨.
Development Guide
Development Flow
See the steps at Pull Request for instructions on forking.
# Pre-requisites: Make sure a recent Node.js LTS version is installed
# Clone the repository and navigate to the project folder
git clone https://github.com/ahochsteger/gmail-processor.git
cd gmail-processor
# Install dependencies
npm install
# Perform changes
code .
# Run pre-commit tasks to make sure the code is in an acceptable state to be commited
# (clean, build, run tests, update docs, do some sanity checks, ...)
npm run pre-commit
The recommended IDE for this project is Visual Studio Code, but any other IDEs with support for TypeScript and NPM will do. Make sure to configure the IDE to respect the Code Style settings.
Testing
Please add/update the tests for any change to keep the codebase in a well-tested state. For every source file *.ts
the corresponding test file is named *.spec.ts
and they are implemented using Jest as the testing framework.
Remote services are mocked (see MockFactory.ts) to simplify local testing in isolation.
After the changes and tests are done run the pre-commit
script that validates the changes and updates all generated artifacts (like documentation, examples, JSON schema files, ...) and include all updated files in your commit.
Code Style
We use Prettier to automatically format our code and ensure a consistent style. It is recommended to configure your IDE to format the code (e.g. on saving) using Prettier.
Development Resources
A list of tools, libraries and frameworks that are used for development:
- NPM - Node Package Manager: For package management and building
- Clasp: For deploying the library and examples to Google Apps Script
- TypeScript: The language used for developing the library
- Jest: For test automation
- webpack: For packaging the library
- semantic-release: For release automation and publishing
- For a complete list have a look at the dependencies in
package.json
Helpful resources about development for Google Apps Script:
- https://github.com/labnol/apps-script-starter
- https://github.com/labnol/google-apps-script-awesome-list
- https://blog.gsmart.in/es6-and-npm-modules-in-google-apps-script/
- https://github.com/gsmart-in/AppsCurryStep1
- https://developers.google.com/apps-script/guides/typescript
- https://github.com/google/clasp/blob/master/docs/typescript.md
- https://github.com/grant/ts2gas
- https://blog.filippo.io/gmail-bot-with-apps-script-and-typescript/