npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-joomla-packager

v0.1.0-b10

Published

Tasks for copying extension files from a Joomla installation and repackaging them as an installable package.

Downloads

13

Readme

grunt-joomla-packager

Tasks for copying extension files from a Joomla installation and repackaging them as an installable package.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-joomla-packager --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-joomla-packager');

The "joomla_packager" task

Overview

In your project's Gruntfile, add a section named joomla_packager to the data object passed into grunt.initConfig().

grunt.initConfig({
  joomla_packager: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
        options: {
            // Target-specific file lists and/or options go here.
        }
    }
  }
});

Options

options.name

Required Type: String Default value: null

The base name of the extension to be packaged. Omit any obligatory prefix. For example, to package a component called com_mycompoment, just use mycomponent.

options.type

Required Type: String Default value: null

The extension type. Should be one of: component, files, language, library, module, plugin, or template. The package type extension is not currently supported.

options.group

Required if type is plugin Type: String Default value: null

The plugin group. Joomla's built-in groups are authentication, captcha, content, editors, editors-xtd, extension, finder, quickicon, search, system, twofactorauth, and user but this list is also extensible.

options.client

Type: String Default value: 'site'

The client application in which the extension is installed. Can be either site or administrator. Only applies to the language, module, and template types.

options.packageName

Type: String Default value: null

The name of a directory that will be created (inside of options.dest) for this package. There's really no need to set this as the value will either be take from the name value in the manifest file or generated based on the type, group (plugins only), and name options.

options.packagePrefix

type: Object default value:

{
    'component': 'com',
    'plugin':    'plg',
    'files':     'files',
    'library':   'lib',
    'package':   'pkg',
    'module':    'mod',
    'template':  'tpl',
    'language':  'lan'
}

This is a mapping of extension type to naming prefix. This prefix will only be used in cases when the name of the package directory needs to be generated. This should be a rare case.

options.joomla

Type: String Default value: '.'

The path to your Joomla installation's root directory. Files will be copied from locations inside this directory (in most cases).

options.dest

Type: String Default value: './dest'

The location where files should be copied to. A directory will be created in this location for each and every extension being packed. If you are packaging a component called mycomponent, a folder com_mycomponent will be created here and files will be copied into it.

options.administrator

Type: String Default value: options.joomla + '/administrator'

The location of the Joomla administrator directory. No need to change this unless using a custom defines.php file.

options.libraries

Type: String Default value: options.joomla + '/libraries'

The location of the libraries directory. No need to change this unless using a custom defines.php file.

options.plugins

Type: String Default value: options.joomla + '/plugins'

The location of the plugins directory. No need to change this unless using a custom defines.php file.

options.templates

Type: String Default value: options.joomla + '/templates'

The location of the templates directory. No need to change this unless using a custom defines.php file.

options.manifests

Type: String Default value: options.administrator + '/manifests'

The location of the manifests directory. No need to change this unless using a custom defines.php file.

options.adminTemplates

Type: String Default value: options.administrator + '/templates'

The location of the administrator templates directory. No need to change this unless using a custom defines.php file in the administrator app.

Usage Examples

Component Packaging

In this example, com_content is being copied from a Joomla directory and packaged.

grunt.initConfig({
  joomla_packager: {
    com_content: {
        options: {
          'name': 'content',
          'type': 'component',
          'joomla': '/path/to/joomla',
          'dest': '/path/to/packages'            
        }
    }
  }
});

Fun Fact: This configuration actually fails because the manifest file for this component has a mistake in it. You can make it work by using --force.

Global Options

It's highly likely that you'll be copying from the same joomla directory and to the same destination for more than one package. Then you can do this:

grunt.initConfig({
  joomla_packager: {
    options: {
      'joomla': '/path/to/joomla',
      'dest': '/path/to/packages'
    },
    com_content: {
        options: {
          'name': 'content',
          'type': 'component'
        }
    },
    com_categories: {
        options: {
          'name': 'categories',
          'type': 'component'
        }
    }
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2015-10-05   v0.1.0b10 Minor changes to readme and package.json.
  • 2015-10-05   v0.1.0b9   Accept any tag name inside of <files> and <media>.
  • 2015-10-01   v0.1.0b8   Better package naming. Properly locate libraries based on the library name in the manifest file.
  • 2015-10-01   v0.1.0b7   Bugfix: various fixes for the 'files' extension type.
  • 2015-10-01   v0.1.0b6   Bugfix: create directories for each package.
  • 2015-10-01   v0.1.0b5   Bugfix: more logging problems.
  • 2015-10-01   v0.1.0b4   Bugfix: logging problems.
  • 2015-09-30   v0.1.0b3   Add a 'client' option (instead of repurposing 'group').
  • 2015-09-29   v0.1.0b2   Bugfix: default manifest path was wrong.
  • 2015-09-28   v0.1.0b1   First beta. Probably works...