Code Monkey home page Code Monkey logo

grunt-firefox-package's Introduction

grunt-firefox-package

Generate a package.zip and mini manifest for your app.

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-firefox-package --save-dev

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

grunt.loadNpmTasks('grunt-firefox-package');

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

grunt.initConfig({
  firefoxPackage: {...},
});

The 'firefoxPackage' task

Overview

To distribute a Firefox OS 'packaged' app outside of the Firefox store, you need two things:

  • A package.zip that contains your app source code and manifest.
  • A mini-manifest.webapp file that tells the system where package.zip can be downloaded, and also some basic info like the app's name.

Making the mini manifest is finicky, because it requires information to be duplicated from the main manifest, and installation will fail if those duplicated values don't match exactly (1).

Furthermore, it requires some additional information (such as the package file size) that mean it's not a simple copy/paste job. This task attempts to automate the process.

This task is intended to interoperate with grunt-firefox-manifest, such that you can use firefox-manifest to build your main manifest from your package.json, then use firefox-package to build the final distributable using the generated manifest.

Options

source

Type: String Default value: undefined
Example: 'dist'

Directory containing your built application source code and manifest.webapp.

outputPackage

Type: String Default value: undefined
Example: 'dist/packaged/package.zip'

Where to place the output package file in your project tree.

outputMiniManifest

Type: String Default value: undefined
Example: 'dist/packaged/mini-manifest.webapp'

Where to place the output mini manifest in your project tree.

packageUrl

Type: String Default value: undefined
Example: 'https://example.com/package.zip'

Location from which you plan to distribute your package.zip file.

Usage Examples

We have a build task that compiles and minifies our CSS and JS into a directory called dist. We want to include the contents of dist in the package, and create the zip and manifest in packaged.

grunt.registerTask('build', [
  ...
  'firefoxPackage:dist'
]);
grunt.initConfig({
  firefoxPackage: {
    dist: {
      options: {
        source: 'dist',
        outputPackage: 'packaged/package.zip',
        outputMiniManifest: 'packaged/mini-manifest.webapp',
        packageUrl: 'https://example.com/package.zip',
      }
    }
  }
});

Contributing

Pull requests/issues are welcome.

Release History

0.1.0

  • Initial release.

0.2.0

  • Rename task firefox_package->firefoxPackage.

0.3.0

  • Remove default 'options'; now all are required.
  • Fix misc issues in readme.

grunt-firefox-package's People

Contributors

danhawkes avatar

Watchers

 avatar  avatar

Forkers

gruntjs-updater

grunt-firefox-package's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.