Thank you for investing your time in contributing to our project!
This project adheres to the Github Contributor Code of Conduct.
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
Use the table of contents icon on the top left corner of this document to get to a specific section of this guide quickly.
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
To navigate our codebase with confidence, see the introduction to working in the docs repository 🎊. For more information on how we write our markdown files, see the GitHub Markdown reference.
Check to see what types of contributions we accept before making changes. Some of them don't even require writing a single line of code ✨.
If you spot a problem with the docs, search if an issue already exists. If a related issue doesn't exist, you can open a new issue using the issue form.
Scan through our existing issues to find one that interests you. You can narrow down the search using labels
as filters. See Labels for more information. If you find an issue to work on, you are welcome to open a PR with a fix.
-
Install and Configure an instance of MagicMirror for testing. It is very helpful to read and understand Module Development in Magic Mirror.
-
Fork the repository
-
Using GitHub Desktop:
- Getting started with GitHub Desktop will guide you through setting up Desktop.
- Once Desktop is set up, you can use it to fork the repo!
-
Using the command line:
- Fork the repo 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 v18.
-
Clone your forked repository. In order to test locally, clone your repository into the
modules
folder of the MagicMirror repository. -
Create a working branch and start with your changes!
Commit the changes once you are happy with them. Don't forget to run the linting and test commands:
# Run ESLint on Javascript files
npm run lint:js
# Run Prettier on all files
npm run lint:prettier
# run everything above - *** Recommended before commit ***
npm run lint
# Run all tests (unit, prettier, and js)
npm run test
# Run unit tests
npm run test:unit
# Check for prettier syntax violations (does not fix)
npm run test:prettier
# Check for ESLint JS syntax violations (does not fix)
npm run test:js
This module is written and tested using Typescript and SCSS, however, to be used by MagicMirror, rollup
must execute and create the necessary Javascript and CSS files for the module and the node_helper
.
This is all encapsulated in the build command:
# build module JS files from typescript
npm run build
You can use npm run dev
to build with inline source maps, and npm run watch
to build (and rebuild) on changes.
When you're finished with the changes, create a pull request, also known as a PR.
- 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 Docs 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.
Congratulations 🎉🎉 We thank you for your contribution.
Once your PR is merged, your updates are available in MagicMirror by pulling the latest code from the main
branch in this repository into your Magic Mirror modules
folder and running npm install