Extensions and themes that are published on the Marketplace must follow a few
simple rules to allow them to hook into a Bolt installation. Information about
the package needs to be provided in JSON format in the root of a project.

To be hosted on the Bolt Marketplace your project will need to be stored in a
VCS repository and publicly readable. If you want to install your own extensions
from somewhere other than the official Bolt marketplace then see the advanced
documentation page.

Once you've run the above commands, Composer will create a new directory with
the bare extension. You should then open the project in your editor and you will
need to make a few changes, giving your new extension the correct configuration
and namespaces. There are two files you need to edit immediately, composer.json,
and src/ExtensionNameExtension.php.

Change the namespace at the top of src/ExtensionNameExtension.php to your
own.

Rename the class ExtensionNameExtension to match the name of your
extension plus the "Extension" suffix, e.g. KoalaCatcherExtension

In order to make the extension installable via Composer, you will first need to
define the location of the extension's git repository at the top of the
"repositories" section of your local Bolt site's extensions/composer.json
file, e.g.

Note that the most important part above is the value give to the "url": key,
this value is the path to your extension's local git repository, and can be
either the full path (recommended) or a path relative to the location of the
extensions/ directory.

Note: Placing the "myextension-git-repo"
section at the top will give it priority over a matching package name on the
Bolt Marketplace.

Next you will need to update the "minimum-stability" value in your local Bolt
site's extensions/composer.json file, e.g.

"minimum-stability": "dev",

Note: This setting should also be changed in
your app/config/config.yml file as it will be overwritten the next
time you load the Extensions page in the Bolt back-end.

This will allow you to install the current development version of your new
extension.

As the extension is in a local git repository, the version may be inferred by
the branch or tag that is currently checked out. Otherwise, the version should
be explicitly defined in the extension's composer.json file, e.g.

"version": "x.y.z",

If Composer cannot resolved the version by these means, it will assumed the
version to be dev-master.

Finally you can add your extension to the "require" section on your local
Bolt site's extensions/composer.json file, e.g.

"require": {
"myname/myextension": "dev-master@dev"
},
}

Once this is done, you can now either run composer update inside the
extensions/ directory of your local Bolt site, or by pressing the
"Run all Updates" button on the Extensions page in the Bolt back-end.