Skip to content

Latest commit

 

History

History
92 lines (62 loc) · 4.68 KB

CONTRIBUTING.md

File metadata and controls

92 lines (62 loc) · 4.68 KB

Contributing to Capacitor

This guide provides instructions for contributing to Capacitor through issues & discussions and code.

Issues & Discussions

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:
  • 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! 🌈

Creating a Code Reproduction

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 (or ionic 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.

Developing Capacitor

Repositories

Design Philosophy

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.

Consult with the team

For any large changes, make sure you've consulted with the team first. You can open a discussion to bring up your idea.

About Third Party Libraries

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.

Local Setup

  1. Fork and clone the repo.

  2. Install the dependencies.

    npm install
  3. 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

Branches

  • main: Latest Capacitor development branch
  • 5.x: Capacitor 5
  • 4.x: Capacitor 4 (security fixes only)
  • 3.x: Capacitor 3 (not maintained)
  • 2.x: Capacitor 2 (not maintained)
  • 1.x: Capacitor 1 (not maintained)

Directory Structure

This monorepo contains core Capacitor components. The current directory structure looks like this:

  • cli: Capacitor CLI/Build scripts
  • core: Capacitor Core JS library
  • ios: Capacitor iOS Runtime
  • ios-template: Default iOS App installed by the CLI
  • android: Capacitor Android Runtime
  • android-template: Default Android App installed by the CLI