Make changes to a Bonfire extension

β––

This tutorial guides you through the process of editing an existing Bonfire extension. We'll cover how to clone, enable, and contribute to an extension, ensuring you can test and implement your changes effectively.

Ideal for developers looking to modify and enhance Bonfire's functionalities.

By the end, you'll be adept at including and working with extensions in the Bonfire development environment.

Prerequisites

In Bonfire, in order to edit an existing extension and test the changes you need to set up the extension in your development environment. The process is quite straightforward:

Fork the extension

If you want to share your changes to the extension, you may want to first fork it on Github.
Use just dep-clone *dep* *repo* to clone an extension from its Git repository. Replace dep with the extension name and repo with the full URL of your fork. The cloned extension will be cloned in ./extensions:

just dep-clone-local bonfire_social https://github.com/my_username/bonfire_social

Enable the extension

After cloning, choose to use the local version by editing ./config/deps.path (create the file if it doesn’t exist).
The format to follow is the following: dep_name = "dep_path" .
To disable a local extension, comment or delete its line in .deps.path.
Use just dev to run the app with changes hot-reloading.

# ./config/deps.path
bonfire_me = "./extensions/bonfire_me"
# bonfire_boundaries = "./extensions/bonfire_boundaries" # disabled local copy

Make and test your changes

You can now make your edits to the code in ./extensions, run the app with just dev and run tests with just test-watch.

Push changes

You can push your changes remotely, use Bonfire's helpers like just contrib if you need to commit files that belong to multiple extensions or just update-dep *dep* for a specific one (e.g., just update-dep bonfire_me).

Great works πŸŽ‰πŸŽ‰πŸŽ‰

You're now equipped to contribute to Bonfire extensions, enhancing the framework's capabilities. You can do so by opening a PR on Github from your forked extension. Your contributions are vital to the Bonfire community, and we encourage you to keep exploring and improving the project.

Bonfire Networks

Star

Supported by

NLNet
Open Collective account Open Source