Skip to content

Generate jQuery plugin manifest automatically from package.json values

License

Notifications You must be signed in to change notification settings

RafterOne/grunt-jquerymanifest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-jquerymanifest

Requires Grunt 0.4.0 or newer

Generate jQuery plugin manifest automatically from package.json values

Getting Started

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, install this plugin with this command:

npm install grunt-jquerymanifest --save-dev

Usage

Below is an example gruntfile configuration:

grunt.initConfig({
    jquerymanifest: {
        options: {
            source: grunt.file.readJSON('package.json'),
            overrides: {
                name: "myPlugin",
                title: "jquery.myPlugin",
                author: {
                    name: "Andrew Duthie",
                    email: "[email protected]",
                    url: "http://www.andrewduthie.com"
                },
                homepage: "http://github.com/aduth/grunt-jquerymanifest",
                demo: "http://github.com/aduth/grunt-jquerymanifest"
            }
        }
    }
});

grunt.loadNpmTasks('grunt-jquerymanifest');

grunt.registerTask('default', ['jquerymanifest']);

Automatic Mappings

The following manifest properties are automatically mapped from package.json:

  • title - Uses package.json name
  • author - Generates proper jQuery people object with package.json name as name
  • licenses - Generates proper jQuery licenses array with single entry using package.json license as type, and links to http://opensource.org/licenses/<licensename> (always check to ensure link is valid with license name)
  • dependencies - Returns object with jQuery ("*" version) as sole dependency

Options

  • source - This will typically be your package.json file. Specify either with a string (i.e. "package.json") or the object itself (i.e. grunt.file.readJSON('package.json'))
  • overrides - An object containing custom values which will override any inferred value. For example, you might want to specify a homepage or demo URL here, since these are usually not defined as package.json properties

License

Copyright (c) 2013 Andrew Duthie

Released under the MIT License (see LICENSE.txt)

About

Generate jQuery plugin manifest automatically from package.json values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%