Objectives

Publish module and make it community-friendly:

  • easy to install
  • easy to support

Plan

  • Start with Git
  • Download or extract your module
  • Add “Must Have” files
  • Make module installable with modman
  • Make module installable with composer
  • Publish Stable Release
  • Add module to Magento Composer Repository
  • Tweet

Download or extract your module

Download module from:

  • Web: the easiest option. Just download module zip if you have the url.
  • Magento Connect: Enter the extension key into Freegento Extension Downloader from magento connect to download the extension archive file in latest version.
  • Your project: list all the files of your module with MEFF - Magento Extension File Finder and extract those files to different folder.

Make sure you use community pool in your module. So it will be easier for others to overwrite your module classes in projects.

Start with Git

  • Go inside your module folder
  • Initialize git with git init
  • Create new repo your-company/your-module and copy link-to-your-repo

If you do it first time you probably want to Get familiar with Git

I suggest your to name your-module as ModuleNameSpace_ModuleName so when others fork your module on github module will be still recognizable.

Add “Must Have” files

Two important things here: Your extension can only be used (at least in Germany) if you add a LICENSE file and you make the usage easier for everyone if you have at least a few lines of documentations (README.md), what your extension should do, what is already implemented and who is responsible. Simon Sprankel built a sample readme to help you there. by Fabian

Make module installable with modman

modman is Module Manager. To make your module installable with modman you need to add modman file to your module root folder. You can either create it manually or better if you use modman-generator, so you won’t forget. Or you can find other modman generators.

Make module installable with composer

Composer is version management for php libraries.

Create composer.json in module root folder:

{
    "name": "your-company-name/your-module-name",
    "description": "description of your module",
    "type": "magento-module",
    "authors": [
        {
        	"name": "Your name", 
        	"email": "your@email"
        }
    ],
    "require": {
        "magento-hackathon/magento-composer-installer": "*"
    }
}

magento-hackathon/magento-composer-installer is module to enable composer to installer magento module. So it is first required package for your module.

Find example of composer.json how to install magento with modules using composer

Publish Stable Release

Uploading to github

Now it is a time to upload your files to git:

git add
git commit -m "Initial commit"
git remote add origin link-to-your-repo
git push origin master

Hooray! Now your module is published on git.

Stabilizing release

  • Go to https://github.com/your-company/your-module/releases
  • Click Draft a new release
  • Fill Tag version and Release title with version of your module. Btw, have you heard about Semantic Versioning 2.0.0? Use it as guide to choose version number for your module.
  • Fill the field Describe this release with list of features and bufixes of your module.

Add module to Packagist

Submit your module to Packagist to make it installable with one command.

Tweet

There is Magento Community, which might help you to improve your module. Tweet a link to github repo with hashtag #RealMagento and short description about your module.

Why is it easy to install?

To install or update module you need only run one command:

composer require your-company/your-module version

Why is it easy to support?

  • Anyone can fork your module and make changes there
  • Anyone can suggest pull-requests with useful changes and important bugfixes
  • Anyone can report an issue by visiting https://github.com/your-company/your-module/issues
  • Anyone can help you to solve issues

Feel informed? I hope so.

Like this article? Share it on Facebook, Twitter, or Linkedin, send a smoke signal or even try some morse code.

I will be glad to answer your questions or get some feedback from you here in comments below.