Like it or loath it Magento 1.x is the world’s most popular e-commerce platform used on the web. Managing extensions in Magento can be frustrating, which is why Modman was written. Using symlinks Modman will allow you to keep all your extension’s files in the same place, and let you install or deploy files straight on the server.

I have just finished building a Grunt plugin for Magento which will automatically install any Modman extensions.

Why does the world need a Grunt plugin for Modman?

Checking in/ committing all your project’s dependencies into the project’s repository is bad practice. So we need a way of letting¬†team members know what Magento extensions are using on the project. The plugin works in a similar vein to a¬†packages.json or a bower.json file for Npm or Bower respectively.

The plugin will attempt to initialise Modman, then attempt to install all the specified Modman extensions listed in a json file stored in the project. It excepts all the options Modman does, so you can keep your extensions under Git or SVN.

Grunt Modman Example Usage

Modman.json:

[
  {
    "command":  "clone",
    "name":     "Extension One",
    "options":  "-b 'branchname'",
    "path":     "https://path/to/repo"
  },
  {
    "command":  "checkout",
    "name":     "Extension Two",
    "options":  "",
    "path":     "https://path/to/repo"
  }
]

Gruntfile.js:

grunt.initConfig({
  modmanPlugins: grunt.file.readJSON( 'modman.json' ),
  modman: {
    install: {
      plugins: '<%= modmanPlugins %>'
    }
  },
})

Then just run the following command in your terminal:

grunt modman