grunt-hub-json-creator

0.0.8 • Public • Published

grunt-hub-json-creator

Grunt plugin to create JSON file to be used in HUB.

This JSON will consist of following:

  • Menuitems to be used for creating left navigation into HUB. It will also have data related to category-component relationship.
  • jsDependencies to be included in HUB component page to include necessary functionality to run that component.
  • isJqueryPartialsAvailable flag to notify HUB for Jquery partials availability for current library.

Getting Started

From the same directory as your project's Gruntfile and package.json, install this plugin with the following command

npm install grunt-hub-json-creator --save-dev

Once that's done, add this line to your project's Gruntfile

grunt.loadNpmTasks('grunt-hub-json-creator');

Config

Inside your Gruntfile.js file, add a section named hubjson. Here's a simple example

hubjson: {
    target: {
        options: {
            libraryName: 'reference-library',
            partialsFolderPath: 'dist/partials/toolkit',
            partialsFileExt: 'html',
            catCompSeparator: '.',
            dest: 'dist/reference-library',
            jsDependencies: ['reference-library.min.js', 'demoControllers.js'],
            isJqueryPartialsAvailable: true,
            allowedCategories: ['array of category names'],
            allowedComponents: ['array of components name']
        }
    }
}

Options

libraryName

[default] 'Package name from package.json'

Name of the library.

partialsFolderPath

[default] 'dist/partials'

Path to folder from where it will search for partial files.

partialsFileExt

[default] 'html'

Extension of partial folder.

catCompSeparator

[default] '.'

Separator used to separate category and component name in filename.

dest

[default] 'dist/libraryNameFromPackageJson'

Destination folder path.

jsDependencies

[default] []

List of files to be included as dependency for this library.

isJqueryPartialsAvailable

[default] true

Flag to notify HUB that jquery partials are available for this library or not.

allowedCategories

[default] []

list of categories which will be included in json file to be used by HUB.

allowedComponents

[default] []

list of components which will be included in json file to be used by HUB.

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-hub-json-creator

Weekly Downloads

6

Version

0.0.8

License

none

Last publish

Collaborators

  • hs018c