Contributing to JsBridge
Contributions to JsBridge are welcome! Whether it's bug reports, feature requests, or code contributions, your help is appreciated.
Development Setup
The project is a standard Android project and can be set up easily using Android Studio.
- Fork the Repository: Start by forking the official JsBridge repository to your own GitHub account.
-
Clone the Repository: Clone your forked repository to your local machine.
git clone https://github.com/YOUR_USERNAME/JsBridge.git
-
Open in Android Studio: Open the cloned project directory in Android Studio. It will automatically sync the Gradle configuration.
Project Structure
The project is organized into two main modules:
:library
: This module contains the core source code for the JsBridge library. Any changes to the library's functionality should be made here.:example
: This module is a sample Android application that demonstrates how to use the:library
module. It's a great place to test your changes and see them in action.
When making changes to the library, you can run the example
app to verify that your changes work as expected.
Running Tests
The library includes a suite of unit tests to ensure its functionality remains stable. These tests are located in library/src/test/java/
.
You can run the tests in two ways:
- From Android Studio: Navigate to the test files in the Project explorer, right-click on a test class or method, and select "Run".
-
From the Command Line: Use the Gradle wrapper to execute the tests for the library module.
# On macOS or Linux ./gradlew :library:test # On Windows .\gradlew.bat :library:test
Before submitting a pull request, please ensure all existing tests pass.
Submitting Changes
-
Create a New Branch: Create a feature branch for your changes.
git checkout -b my-awesome-feature
-
Make Your Changes: Implement your bug fix or new feature.
-
Commit Your Work: Commit your changes with a clear and descriptive message.
git commit -m "feat: Add support for new data type"
-
Push to Your Fork: Push your branch to your forked repository.
git push origin my-awesome-feature
-
Open a Pull Request: Go to the original JsBridge repository on GitHub and open a new pull request from your feature branch. Provide a detailed description of the changes you've made.