Contributing
December 12, 2025 · View on GitHub
This guide provides instructions for contributing to this Capacitor plugins.
Developing
Local Setup
-
Fork and clone the repo.
-
Install the dependencies.
bun install -
Install SwiftLint if you're on macOS.
brew install swiftlint
Scripts
bun run build
Build the plugin web assets and generate plugin API documentation using @capacitor/docgen.
It will compile the TypeScript code from /packages/<package>/src/ into ESM JavaScript in /packages/<package>/dist/esm/.
These files are used in apps with bundlers when your plugin is imported.
Then, Rollup will bundle the code into a single file at /packages/<package>/dist/plugin.js.
This file is used in apps without bundlers by including it as a script in index.html.
bun run verify
Build and validate the web and native projects.
This is useful to run in CI to verify that the plugin builds for all platforms.
bun run lint / bun run fmt
Check formatting and code quality, autoformat/autofix if possible.
This template is integrated with ESLint, Prettier, and SwiftLint. We want to have a consistent style and structure for easier cooperation.
Upstream Sync
This repository is a fork of cap-go/capacitor-firebase and automatically syncs changes from the upstream repository.
Automated Sync Process
A GitHub Action runs every Monday at 9 AM UTC to:
- Check for new changes in the upstream repository
- Create a pull request with the changes
- Run all tests (Android, iOS, Web, and lint)
- Auto-merge if all tests pass
You can also manually trigger a sync:
- Go to Actions → Sync from Upstream → Run workflow
Handling Sync Conflicts
If the automated sync encounters merge conflicts:
- An issue will be created automatically
- Manual resolution is required
- Follow the instructions in the created issue
Publishing
These packages are published individually via GitHub Actions:
-
Version Bump: When code changes are merged to
main, thebump_version.ymlworkflow:- Detects which packages changed
- Updates documentation
- Creates version tags (format:
package-name/vX.Y.Z)
-
Build & Publish: When tags are pushed, the
build.ymlworkflow:- Builds the specific package
- Generates AI changelog
- Publishes to npm with provenance
- Creates GitHub release
Note: The
filesarray in/packages/<package>/package.jsonspecifies which files get published. If you rename files/directories or add files elsewhere, you may need to update it.