This guide provides instructions for contributing to Capacitor through issues & discussions and code.
The Capacitor repo uses GitHub issues and discussions to track bugs and feature requests, as well as to provide a place for community questions, ideas, and discussions.
- When to use issues:
- To report specific, reproducible bugs (see Creating a Code Reproduction).
- To propose detailed feature requests.
- When to use discussions:
- To ask for help.
- To ask general questions.
- To show off cool stuff.
- To propose ideas for improvement.
- If you think you found a bug, but may need help to further uncover it.
- Anything else! 🌈
When reporting bugs, we ask you to provide a minimal sample application that demonstrates the issue. Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
To create a code reproduction:
- Create a new application using
npm init @capacitor/app
(orionic start --capacitor
). - Add the minimum amount of code necessary to recreate the issue you're experiencing.
- Push the code reproduction to a public GitHub repository and include a link when you create a bug report.
- Be sure to include steps to reproduce the issue.
- Capacitor (this repo): Core Capacitor platforms, CLI, and APIs
- Capacitor Plugins: Official Capacitor plugins
- Capacitor Community: GitHub org for Capacitor Community plugins and platforms
- Capacitor Site: Capacitor website and online documentation
- Capacitor TestApp: Test app used by the core team for developing Capacitor
Before working on Capacitor, it's important to understand the philosophy behind the project to avoid investing time in things that won't fit into the goals of the project.
Please read @maxlynch's essay How Capacitor Works for a deep dive into the project and its goals.
For any large changes, make sure you've consulted with the team first. You can open a discussion to bring up your idea.
To achieve Capacitor's goal of being stable and easy to upgrade, we would like to avoid unnecessary third party libraries as much as possible. Before embarking on Capacitor contributions, make sure you aren't planning on introducing third party libraries without consulting with the team first.
On native, that means avoid adding any new Cocoapod or Gradle dependencies without explicit approval. If you just need a small bit of functionality from that library, consider adding an implementation to the codebase directly.
On web, this means do not add any third party libraries such as Firebase or Lodash. Strive for implementations that use pure Web APIs even if it means more work.
-
Fork and clone the repo.
-
Install the monorepo dependencies.
npm install
-
Install SwiftLint if you're on macOS. Contributions to iOS code will be linted in CI if you don't have macOS.
brew install swiftlint
-
Install package dependencies. Lerna can automatically install each package's dependencies.
npx lerna bootstrap
main
: Latest Capacitor development branch2.x
: Capacitor 2 (bug and security fixes only)1.x
: Capacitor 1 (not maintained)
This monorepo contains core Capacitor components. The current directory structure looks like this:
cli
: Capacitor CLI/Build scriptscore
: Capacitor Core JS libraryios
: Capacitor iOS Runtimeios-template
: Default iOS App installed by the CLIandroid
: Capacitor Android Runtimeandroid-template
: Default Android App installed by the CLI
Capacitor packages are published using Lerna with fixed versioning.
During Capacitor 3 development, the following workflow is used to create dev releases:
-
Create the next development version. The following command will:
- Create a release commit with a generated changelog
- Create a git tag
- Push to the
main
branch - Create a GitHub release
npx lerna version prerelease --force-publish
-
Wait for CI to publish the new tagged version.