grunt-jse

0.2.1 • Public • Published

grunt-jse

Generator for JSE

Currently, it can generate the module class file, the test spec for jasmine and the import for the test

Getting Started

This plugin requires Grunt ~0.4.1

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-jse --save-dev

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

grunt.loadNpmTasks('grunt-jse');

The "jse" task

Overview

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

grunt.initConfig({
  jse: {
    options: {
			srcDir: 'Web Content/maf/jse',
			specDir: 'test/spec'
    },
    default: {}
  },
})

Options

options.srcDir

Type: String Default value: 'src'

A string value that is used as a base path for the src directory of the JSE modules.

options.specDir

Type: String Default value: 'test/spec'

A string value that is used as a base path for the jasmine spec directory of the JSE modules.

Usage Examples

Default Options

In this exemple, we generate files for the class named Awesome.Module

  1. Add this configuration in your Gruntfile.js (inside the grunt.initConfig block)
grunt.initConfig({
  jse: {
    options: {
			srcDir: 'Web Content/maf/jse',
			specDir: 'test/spec'
    },
    default: {}
  },
})
  1. Type in the following command
grunt jse --class=Awesome.Module

Command line options

All those options are boolean, you should use --singleton=true instead of --singleton as long as there is a bug with the nopt module version (< 0.2) in grunt.

Generate a singleton module

grunt jse --class=Awesome.Module --singleton=true

Skip the module file (only generate test files)

grunt jse --class=Awesome.Module --skip-src=true

Skip the test files (only generate the class file)

grunt jse --class=Awesome.Module --skip-test=true

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-jse

Weekly Downloads

1

Version

0.2.1

License

none

Last publish

Collaborators

  • ymainier