<commit_before>/*global module:false*/

module.exports = function(grunt) {
    'use strict';

    var sh = require('shelljs');

    grunt.loadNpmTasks('grunt-conventional-changelog');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-ngdocs');

    /*
        Project configuration
        According to https://github.com/gruntjs/grunt-contrib-jshint/pull/24#issuecomment-14976842
        jshint options could not be merged with .jshintrc
        so we need to use

        options: grunt.util._.merge({}, grunt.file.readJSON('.jshintrc')),

        to merge the required options

    */
    grunt.initConfig({
        docsSever: {
            port      : 9001,
        },
        clean: {
            docs: {
                src: ['docs']
            }
        },
        jshint: {
            server: {
                /*
                   TODO add option "devel: true" for production linting

                   This option defines globals that are usually used for
                   logging poor-man's debugging: console, alert, etc.
                   It is usually a good idea to not ship them in production because,
                   for example, console.log breaks in legacy versions of Internet Explorer.

                   http://www.jshint.com/docs/options/#devel
                 */
                options: grunt.util._.merge(
                    grunt.file.readJSON('.jshintrc'),
                    {
                        ignores: [
                            'lib/client/system/libs/*',
                            'lib/client/system/modules/*',
                            'lib/websocket/transports/engineio/*',
                            'test/helpers/connect.js',
                            'test/fixtures/**'
                        ]
                    }
                ),
                files: {
                    src: [
                        'Gruntfile.js',
                        'test/**/*.js',
                        'lib/**/*.js',
                        'lib/websocket/transports/engineio/index.js'
                    ]
                }
            },
            client: {
                options: grunt.util._.merge(
                    grunt.file.readJSON('.jshintrc'),
                    {
                        browser: true,
                        node   : false,
                        ignores: [
                            'lib/client/system/libs/*',
                            'lib/client/system/index.js'
                        ]
                    }
                ),
                files: {
                    src: [
                        'lib/client/system/**/*.js'
                    ]
                }
            },
            test: {
                options: {
                    ignores: ['test/fixtures']
                },
                files: {
                    src: [
                        'test/unit/**/*.js'
                    ]
                }
            }
        },
        ngdocs: {
            options: {
                title: 'SocketStream',
                scripts: [
                    'angular.js',
                ],
                styles: [
                    'src/docs/site/css/main.css'
                ],
                // navTemplate: 'src/docs/site/header.html',
                startPage: 'tutorials',
                titleLink: '#/tutorials',
                discussions: {
                    shortName: 'socketstream',
                    url: 'http://romanminkin.github.io/socketstream/docs/',
                    dev: true
                },
                html5Mode: false,
                bestMatch: true
            },
            tutorials: {
                src: ['src/docs/tutorials/**/*.ngdoc'],
                title: 'Tutorials'
            },
            api: {
                src: ['lib/**/*.js'],
                title: 'API Documentation'
            },
            demos: {
                src: ['src/docs/demos/**/*.ngdoc'],
                title: 'Demos'
            },
        },
        concurrent: {
            options: {
                logConcurrentOutput: true
            },
            docsSite: ['delta:docs', 'connect:docsSite']
        },
        delta: {
            docs: {
                options: {
                    interrupt: true,
                    atBegin: true
                },
                files: [
                    'lib/**',
                    'src/**'
                ],
                tasks: ['clean', 'ngdocs']
            }
        },
        connect: {
            options: {
            },
            docsSite: {
                options: {
                    port     : '<%= docsSever.port %>',
                    keepalive: true,
                    base     : 'docs',
                }
            }
        },
        mochaTest: {
            src: [
                'test/unit/**/*.test.js',
            ],
            options: {
                reporter: 'spec'
            }
        },
        shell: {
            //We use %version% and evluate it at run-time, because <%= pkg.version %>
            //is only evaluated once
            'release-prepare': [
                'grunt before-test',
                'grunt test',
                'grunt build:docs',
                'grunt isClean:master',
                'grunt version',    //remove "-SNAPSHOT" from the project's version in package.json
                'grunt changelog'
            ],
            'release-complete': [
                'git commit CHANGELOG.md package.json -m "chore(release): v%version%"',
                'git tag %version%'
            ],
            'release-start': [
                'grunt version:patch:"SNAPSHOT"',
                'git commit package.json -m "chore(release): Starting v%version%"'
            ],
            'update-gh-pages': [
                'git checkout gh-pages',
                'git merge master',
                'git checkout master'
            ]
        },
        changelog: {
            options: {
                dest: 'CHANGELOG.md',
                templateFile: 'src/docs/changelog.tpl.md',
                github: 'socketstream/socketstream'
            }
        },
    });

    // Rename our watch task to 'delta', then make actual 'watch'
    grunt.renameTask('watch', 'delta');

    /**
     * Sets version in 'package.json' in http://semver.org friendly mode
     *
     * @param {String} type   Could be 'major', 'minor' or 'patch'
     * @param {String} suffix Suffic string, example: 'alpha', 'pre-alpha', 'beta'
     */
    function setVersion(type, suffix) {
        var file = 'package.json',
            VERSION_REGEX = /([\'|\"]version[\'|\"][ ]*:[ ]*[\'|\"])([\d|.]*)(-\w+)*([\'|\"])/,
            contents = grunt.file.read(file),
            version;
        contents = contents.replace(VERSION_REGEX, function(match, left, center) {
            version = center;
            if (type) {
                version = require('semver').inc(version, type);
            }
            //semver.inc strips our suffix if it existed
            if (suffix) {
                version += '-' + suffix;
            }
            return left + version + '"';
        });
        grunt.log.ok('Version set to ' + version.cyan);
        grunt.file.write(file, contents);
        return version;
    }

    /**
     * Task for setting project version according to http://semver.org
     * @usage
     *     grunt version:type:suffix
     *
     *     // suppose current version in package.json is "0.3.10"
     *
     *     grunt version:patch // will set version to "0.3.11"
     *     grunt version:patch // one more call will increas version to "0.3.12"
     *
     *     grunt version:minor:"alpha" // this one will set up version to "0.4.0-alpha"
     *
     *     grunt version" // this clean up current vesion to valid according to http://semver.org,
     *                    // so "0.3.10-SNAPSHOT" will become "0.3.10"
     */
    grunt.registerTask('version', 'Set version. If no arguments, it just takes off suffix', function() {
        setVersion(this.args[0], this.args[1]);
    });

    grunt.registerTask('enforce', 'Install commit message enforce script if it doesn\'t exist', function() {
        if (!grunt.file.exists('.git/hooks/commit-msg')) {
            grunt.file.copy('misc/validate-commit-msg.js', '.git/hooks/commit-msg');
            require('fs').chmodSync('.git/hooks/commit-msg', '0755');
        }
    });

    /**
     * Check is master(default) or specified branch is clean for commit
     *
     *  grunt:isClean // checks 'master' branch
     *  grunt:isClean:test // checks 'test' branch
     *
     * @param {String} Branch name to check
     */
    grunt.registerTask('isClean', 'Install commit message enforce script if it doesn\'t exist', function() {
        var result,
            branch = this.args[0] ? this.args[0] : 'master';

        result = sh.exec('git symbolic-ref HEAD', {silent: true});
        if (result.output.trim() !== 'refs/heads/' + branch) {
            throw new Error('Not on master branch, aborting! Current branch is \'' + result.output.trim() + '\'');
        }

        result = sh.exec('git status --porcelain', {silent: true});
        if (result.output.trim() !== '') {
            grunt.log.error(result.output.trim());
            throw new Error('Working copy is dirty, aborting!');
        }
    });

    grunt.registerMultiTask('shell', 'run shell commands', function() {
        var self = this;

        self.data.forEach(function(cmd) {
            cmd = cmd.replace('%version%', grunt.file.readJSON('package.json').version);
            grunt.log.ok(cmd);

            var result = sh.exec(cmd, { silent: true });

            if (result.code !== 0) {
                grunt.fatal(result.output);
            }
        });
    });

    grunt.registerTask('default', 'Default task which runs all the required subtasks', ['before-test', 'test']);
    grunt.registerTask('before-test', ['enforce'/*, 'jshint'*/]); // 'jshint' should be uncommented after we linted all the source code
    grunt.registerTask('test', 'Test everything', ['mochaTest']);
    grunt.registerTask('build:docs', 'Build documentation', ['clean:docs', 'ngdocs']);
    grunt.registerTask('watch:docs', 'Watching for changes and re-building docs', ['concurrent:docsSite']);
    grunt.registerTask('update:docs', 'Update gh-page branch by mergin from master', ['shell:update-gh-pages']);

    grunt.registerTask('release:start', 'Increase patch version by 1 and add suffix "SNAPSHOT" as "major.minor.(patch+1)-SNAPSHOT" and commit package.json', ['shell:release-start']);
    grunt.registerTask('release:prepare', 'Run all the tests, generates CHANGELOG.md since laste release and and clean up version to just "major.minor.patch"', ['shell:release-prepare']);
    grunt.registerTask('release:complete', 'Complete the release and ', ['shell:release-complete', 'shell:update-gh-pages']);
}<commit_msg>feat(Gruntfile): Add task `grunt release:push`<commit_after>/*global module:false*/

module.exports = function(grunt) {
    'use strict';

    var sh = require('shelljs');

    grunt.loadNpmTasks('grunt-conventional-changelog');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-ngdocs');

    /*
        Project configuration
        According to https://github.com/gruntjs/grunt-contrib-jshint/pull/24#issuecomment-14976842
        jshint options could not be merged with .jshintrc
        so we need to use

        options: grunt.util._.merge({}, grunt.file.readJSON('.jshintrc')),

        to merge the required options

    */
    grunt.initConfig({
        docsSever: {
            port      : 9001,
        },
        clean: {
            docs: {
                src: ['docs']
            }
        },
        jshint: {
            server: {
                /*
                   TODO add option "devel: true" for production linting

                   This option defines globals that are usually used for
                   logging poor-man's debugging: console, alert, etc.
                   It is usually a good idea to not ship them in production because,
                   for example, console.log breaks in legacy versions of Internet Explorer.

                   http://www.jshint.com/docs/options/#devel
                 */
                options: grunt.util._.merge(
                    grunt.file.readJSON('.jshintrc'),
                    {
                        ignores: [
                            'lib/client/system/libs/*',
                            'lib/client/system/modules/*',
                            'lib/websocket/transports/engineio/*',
                            'test/helpers/connect.js',
                            'test/fixtures/**'
                        ]
                    }
                ),
                files: {
                    src: [
                        'Gruntfile.js',
                        'test/**/*.js',
                        'lib/**/*.js',
                        'lib/websocket/transports/engineio/index.js'
                    ]
                }
            },
            client: {
                options: grunt.util._.merge(
                    grunt.file.readJSON('.jshintrc'),
                    {
                        browser: true,
                        node   : false,
                        ignores: [
                            'lib/client/system/libs/*',
                            'lib/client/system/index.js'
                        ]
                    }
                ),
                files: {
                    src: [
                        'lib/client/system/**/*.js'
                    ]
                }
            },
            test: {
                options: {
                    ignores: ['test/fixtures']
                },
                files: {
                    src: [
                        'test/unit/**/*.js'
                    ]
                }
            }
        },
        ngdocs: {
            options: {
                title: 'SocketStream',
                scripts: [
                    'angular.js',
                ],
                styles: [
                    'src/docs/site/css/main.css'
                ],
                // navTemplate: 'src/docs/site/header.html',
                startPage: 'tutorials',
                titleLink: '#/tutorials',
                discussions: {
                    shortName: 'socketstream',
                    url: 'http://romanminkin.github.io/socketstream/docs/',
                    dev: true
                },
                html5Mode: false,
                bestMatch: true
            },
            tutorials: {
                src: ['src/docs/tutorials/**/*.ngdoc'],
                title: 'Tutorials'
            },
            api: {
                src: ['lib/**/*.js'],
                title: 'API Documentation'
            },
            demos: {
                src: ['src/docs/demos/**/*.ngdoc'],
                title: 'Demos'
            },
        },
        concurrent: {
            options: {
                logConcurrentOutput: true
            },
            docsSite: ['delta:docs', 'connect:docsSite']
        },
        delta: {
            docs: {
                options: {
                    interrupt: true,
                    atBegin: true
                },
                files: [
                    'lib/**',
                    'src/**'
                ],
                tasks: ['clean', 'ngdocs']
            }
        },
        connect: {
            options: {
            },
            docsSite: {
                options: {
                    port     : '<%= docsSever.port %>',
                    keepalive: true,
                    base     : 'docs',
                }
            }
        },
        mochaTest: {
            src: [
                'test/unit/**/*.test.js',
            ],
            options: {
                reporter: 'spec'
            }
        },
        shell: {
            //We use %version% and evluate it at run-time, because <%= pkg.version %>
            //is only evaluated once
            'release-prepare': [
                'grunt before-test',
                'grunt test',
                'grunt build:docs',
                'grunt isClean:master',
                'grunt version',    //remove "-SNAPSHOT" from the project's version in package.json
                'grunt changelog'
            ],
            'release-complete': [
                'git commit CHANGELOG.md package.json -m "chore(release): v%version%"',
                'git tag %version%'
            ],
            'release-start': [
                'grunt version:patch:"SNAPSHOT"',
                'git commit package.json -m "chore(release): Starting v%version%"'
            ],
            'release-push': [
                'git push origin master',
                'git push origin gh-pages',
                'git push --tags',
            ],
            'update-gh-pages': [
                'git checkout gh-pages',
                'git merge master',
                'git checkout master'
            ]
        },
        changelog: {
            options: {
                dest: 'CHANGELOG.md',
                templateFile: 'src/docs/changelog.tpl.md',
                github: 'socketstream/socketstream'
            }
        },
    });

    // Rename our watch task to 'delta', then make actual 'watch'
    grunt.renameTask('watch', 'delta');

    /**
     * Sets version in 'package.json' in http://semver.org friendly mode
     *
     * @param {String} type   Could be 'major', 'minor' or 'patch'
     * @param {String} suffix Suffic string, example: 'alpha', 'pre-alpha', 'beta'
     */
    function setVersion(type, suffix) {
        var file = 'package.json',
            VERSION_REGEX = /([\'|\"]version[\'|\"][ ]*:[ ]*[\'|\"])([\d|.]*)(-\w+)*([\'|\"])/,
            contents = grunt.file.read(file),
            version;
        contents = contents.replace(VERSION_REGEX, function(match, left, center) {
            version = center;
            if (type) {
                version = require('semver').inc(version, type);
            }
            //semver.inc strips our suffix if it existed
            if (suffix) {
                version += '-' + suffix;
            }
            return left + version + '"';
        });
        grunt.log.ok('Version set to ' + version.cyan);
        grunt.file.write(file, contents);
        return version;
    }

    /**
     * Task for setting project version according to http://semver.org
     * @usage
     *     grunt version:type:suffix
     *
     *     // suppose current version in package.json is "0.3.10"
     *
     *     grunt version:patch // will set version to "0.3.11"
     *     grunt version:patch // one more call will increas version to "0.3.12"
     *
     *     grunt version:minor:"alpha" // this one will set up version to "0.4.0-alpha"
     *
     *     grunt version" // this clean up current vesion to valid according to http://semver.org,
     *                    // so "0.3.10-SNAPSHOT" will become "0.3.10"
     */
    grunt.registerTask('version', 'Set version. If no arguments, it just takes off suffix', function() {
        setVersion(this.args[0], this.args[1]);
    });

    grunt.registerTask('enforce', 'Install commit message enforce script if it doesn\'t exist', function() {
        if (!grunt.file.exists('.git/hooks/commit-msg')) {
            grunt.file.copy('misc/validate-commit-msg.js', '.git/hooks/commit-msg');
            require('fs').chmodSync('.git/hooks/commit-msg', '0755');
        }
    });

    /**
     * Check is master(default) or specified branch is clean for commit
     *
     *  grunt:isClean // checks 'master' branch
     *  grunt:isClean:test // checks 'test' branch
     *
     * @param {String} Branch name to check
     */
    grunt.registerTask('isClean', 'Install commit message enforce script if it doesn\'t exist', function() {
        var result,
            branch = this.args[0] ? this.args[0] : 'master';

        result = sh.exec('git symbolic-ref HEAD', {silent: true});
        if (result.output.trim() !== 'refs/heads/' + branch) {
            throw new Error('Not on master branch, aborting! Current branch is \'' + result.output.trim() + '\'');
        }

        result = sh.exec('git status --porcelain', {silent: true});
        if (result.output.trim() !== '') {
            grunt.log.error(result.output.trim());
            throw new Error('Working copy is dirty, aborting!');
        }
    });

    grunt.registerMultiTask('shell', 'run shell commands', function() {
        var self = this;

        self.data.forEach(function(cmd) {
            cmd = cmd.replace('%version%', grunt.file.readJSON('package.json').version);
            grunt.log.ok(cmd);

            var result = sh.exec(cmd, { silent: true });

            if (result.code !== 0) {
                grunt.fatal(result.output);
            }
        });
    });

    grunt.registerTask('default', 'Default task which runs all the required subtasks', ['before-test', 'test']);
    grunt.registerTask('before-test', ['enforce'/*, 'jshint'*/]); // 'jshint' should be uncommented after we linted all the source code
    grunt.registerTask('test', 'Test everything', ['mochaTest']);
    grunt.registerTask('build:docs', 'Build documentation', ['clean:docs', 'ngdocs']);
    grunt.registerTask('watch:docs', 'Watching for changes and re-building docs', ['concurrent:docsSite']);
    grunt.registerTask('update:docs', 'Update gh-page branch by mergin from master', ['shell:update-gh-pages']);

    grunt.registerTask('release:start', 'Increase patch version by 1 and add suffix "SNAPSHOT" as "major.minor.(patch+1)-SNAPSHOT" and commit package.json', ['shell:release-start']);
    grunt.registerTask('release:prepare', 'Run all the tests, generates CHANGELOG.md since laste release and and clean up version to just "major.minor.patch"', ['shell:release-prepare']);
    grunt.registerTask('release:complete', 'Complete the release and ', ['shell:release-complete', 'shell:update-gh-pages']);
    grunt.registerTask('release:push', 'Push to origin tags, master and gh-pages branches', ['shell:release-push']);
}<|endoftext|>


<commit_before>var path = require('path');

module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jsdoc: {
      dist: {
        src: [
            'app/**/*.js'
        ],
        dest: 'doc'
      }
    },
    jade: {
      compile: {
        options: {
          pretty: false,
          data: {
            debug: false,
          }
        },
        files: [
          {
            expand: true,
            cwd: 'ui/',
            src: "**/*.jade",
            dest: "ui/",
            ext: ".html",
          }
        ]
      }
    },
    requirejs: {
      "openbiz-ui-css":{
        options:{
          cssIn: "ui/vendor/openbiz/openbiz.css",
          out: "ui/vendor/openbiz/openbiz.min.css",
          preserveLicenseComments:false,
          baseUrl: "./ui",
          useStrict: true,
        }
      },
      "openbiz-ui": {
        options: {
          preserveLicenseComments:false,
          baseUrl: "./ui",
          useStrict: true,
          name: "main",
          out: "ui/main.min.js",
          paths:{
            'bootstrap' : 'vendor/bootstrap/js/bootstrap.min',
            'underscore': 'vendor/underscore/underscore-min',
            'jquery'  : 'vendor/jquery/jquery-1.10.2.min',
            'jquery.mmenu' : 'vendor/plugins/mmenu/jquery.mmenu',
            'jquery.ui' : 'vendor/jquery-ui/jquery.ui.min',
	         'jqueryform' 	: 'vendor/jquery-form/jquery.form.min',
	         'modernizr' : 'vendor/modernizr/modernizr',
            'chart'   : 'vendor/plugins/chart/chart',
            'EasyPieChart'  : 'vendor/plugins/chart/ori/easypiechart.min',
            'throbber'  : 'vendor/throbber/throbber',
            'hammer'  : 'vendor/hammer/hammer',
            'form'    : 'vendor/plugins/form/form',
            'datetime'  : 'vendor/plugins/datetime/datetime',
            'holder'  : 'vendor/plugins/holder/holder',
            'cookie'  : 'vendor/plugins/cookie/jquery.cookie',
            'openbiz' : 'openbiz',
            'backbone'  : 'vendor/backbone/backbone-min',
            'backgrid'  : 'vendor/backgrid/backgrid',
            'backgrid-paginator': 'vendor/backgrid/extensions/paginator/backgrid-paginator',
            'backgrid-filter' : 'vendor/backgrid/extensions/filter/backgrid-filter',
            'backbone-pageable' : 'vendor/backbone-pageable/backbone-pageable.min',
            'i18n'    : 'vendor/require/plugins/i18n',
            'text'    : 'vendor/require/plugins/text',
            'respond' : 'vendor/bootstrap/libs/respond.js/1.3.0/respond.min',
            'html5shiv' : 'vendor/bootstrap/libs/html5shiv/3.7.0/html5shiv',
            'openbiz.custom' : 'vendor/openbiz/openbiz.custom',
            'parsley'   : 'vendor/openbiz/openbiz.parsley',
            'bootbox'   : 'vendor/bootbox/bootbox.min',
            'bootstrap-paginator' : 'vendor/paginator/bootstrap-paginator.min',
          },
          shim:{
            'backbone':{
              deps: [ 'underscore',
                  'jquery.ui'],
              exports: 'Backbone'
            },
            "backbone-paginator":{
              deps: [ 'backbone'],
            },

            "backgrid":{
              exports: "Backgrid",
               deps: [ 'underscore','jquery','backbone' ]
            },
            "backgrid-paginator":{
               deps: [ 'backgrid' ]
            },
            "backgrid-filter":{
              deps: [ 'backgrid'],
            },

            'underscore':{
              exports: '_'
            },
            'jquery.validate':{
              deps: ['jquery']
            },
            'jquery.validate-addon':{
              deps: ['jquery.validate']
            },
            'chart':{
              deps: ['EasyPieChart']
            },
            'bootstrap':{
              deps: ["jquery"],
              exports: ['jQuery']
            },
            'throbber':{
              exports: 'Throbber'
            },
            'openbiz':{
              deps: [ 'underscore','jquery','backbone','openbiz.custom' ]
            },
            'jquery.ui':{
              deps: [ "jquery","holder","throbber","jquery.mmenu","bootbox",
                  "modernizr","form",'parsley',"chart","EasyPieChart","datetime","cookie"]
            },
            'openbiz.custom':{
              deps: [ "jquery.ui","bootstrap-paginator"]
            }
          }
        }
      }
    },
    clean: {
      html: {
        src: [
          'ui/**/*.html'
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-jsdoc');
  grunt.loadNpmTasks('grunt-contrib-jade');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-requirejs');

  grunt.registerTask('default', ['build']);
  grunt.registerTask('build', ['requirejs','jade','jsdoc']);
};
<commit_msg>update gruntfile<commit_after>var path = require('path');

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		jsdoc: {
			dist: {
				src: [
					'app/**/*.js'
				],
				dest: 'doc'
			}
		},
		jade: {
			compile: {
				options: {
					pretty: false,
					data: {
						debug: false
					}
				},
				files: [
					{
						expand: true,
						cwd: 'ui/',
						src: "**/*.jade",
						dest: "ui/",
						ext: ".html"
					}
				]
			}
		},
		requirejs: {
			"openbiz-ui-css":{
				options:{
					cssIn: "ui/vendor/openbiz/openbiz.css",
					out: "ui/vendor/openbiz/openbiz.min.css",
					preserveLicenseComments:false,
					baseUrl: "./ui",
					useStrict: true
				}
			},
			"openbiz-ui": {
				options: {
					preserveLicenseComments:false,
					baseUrl: "./ui",
					useStrict: true,
					name: "main",
					out: "ui/main.min.js",
					paths:{
						'bootstrap' : 'vendor/bootstrap/js/bootstrap.min',
						'underscore': 'vendor/underscore/underscore-min',
						'jquery'  : 'vendor/jquery/jquery-1.10.2.min',
						'jquery.mmenu' : 'vendor/plugins/mmenu/jquery.mmenu',
						'jquery.ui' : 'vendor/jquery-ui/jquery.ui.min',
						'jqueryform' 	: 'vendor/jquery-form/jquery.form.min',
						'modernizr' : 'vendor/modernizr/modernizr',
						'chart'   : 'vendor/plugins/chart/chart',
						'EasyPieChart'  : 'vendor/plugins/chart/ori/easypiechart.min',
						'throbber'  : 'vendor/throbber/throbber',
						'hammer'  : 'vendor/hammer/hammer',
						'form'    : 'vendor/plugins/form/form',
						'datetime'  : 'vendor/plugins/datetime/datetime',
						'holder'  : 'vendor/plugins/holder/holder',
						'cookie'  : 'vendor/plugins/cookie/jquery.cookie',
						'openbiz' : 'openbiz',
						'backbone'  : 'vendor/backbone/backbone-min',
						'backgrid'  : 'vendor/backgrid/backgrid',
						'backgrid-paginator': 'vendor/backgrid/extensions/paginator/backgrid-paginator',
						'backgrid-filter' : 'vendor/backgrid/extensions/filter/backgrid-filter',
						'backbone-pageable' : 'vendor/backbone-pageable/backbone-pageable.min',
						'i18n'    : 'vendor/require/plugins/i18n',
						'text'    : 'vendor/require/plugins/text',
						'respond' : 'vendor/bootstrap/libs/respond.js/1.3.0/respond.min',
						'html5shiv' : 'vendor/bootstrap/libs/html5shiv/3.7.0/html5shiv',
						'openbiz.custom' : 'vendor/openbiz/openbiz.custom',
						'parsley'   : 'vendor/openbiz/openbiz.parsley',
						'bootbox'   : 'vendor/bootbox/bootbox.min',
						'bootstrap-paginator' : 'vendor/paginator/bootstrap-paginator.min'
					},
					shim:{
						'backbone':{
							deps: [ 'underscore',
								'jquery.ui'],
							exports: 'Backbone'
						},
						"backbone-paginator":{
							deps: [ 'backbone']
						},

						"backgrid":{
							exports: "Backgrid",
							deps: [ 'underscore','jquery','backbone' ]
						},
						"backgrid-paginator":{
							deps: [ 'backgrid' ]
						},
						"backgrid-filter":{
							deps: [ 'backgrid']
						},

						'underscore':{
							exports: '_'
						},
						'jquery.validate':{
							deps: ['jquery']
						},
						'jquery.validate-addon':{
							deps: ['jquery.validate']
						},
						'chart':{
							deps: ['EasyPieChart']
						},
						'bootstrap':{
							deps: ["jquery"],
							exports: ['jQuery']
						},
						'throbber':{
							exports: 'Throbber'
						},
						'openbiz':{
							deps: [ 'underscore','jquery','backbone','openbiz.custom' ]
						},
						'jquery.ui':{
							deps: [ "jquery","holder","throbber","jquery.mmenu","bootbox",
								"modernizr","form",'parsley',"chart","EasyPieChart","datetime","cookie"]
						},
						'openbiz.custom':{
							deps: [ "jquery.ui","bootstrap-paginator"]
						}
					}
				}
			}
		},
		clean: {
			html: {
				src: [
					'ui/**/*.html'
				]
			}
		}
	});

	grunt.loadNpmTasks('grunt-jsdoc');
	grunt.loadNpmTasks('grunt-contrib-jade');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-requirejs');

	grunt.registerTask('default', ['build']);
	grunt.registerTask('build', ['requirejs','jade','jsdoc']);
};
<|endoftext|>


<commit_before>import redent from 'redent';
import stripAnsi from 'strip-ansi';
import trimNewlines from 'trim-newlines';

import generateTable from '../generateTable';
import pad from '../helpers/pad';
import getCommandArgumentsAsString from '../../cli/commands/getCommandArgumentsAsString';
import getDefaultOptions from '../../cli/commands/getDefaultOptions';
import onProperty from '../../helpers/onProperty';
import isCommandGroup from '../../cli/commands/helpers/isCommandGroup';
import isCommand from '../../cli/commands/helpers/isCommand';
import getInfoObject from '../../validation/helpers/getInfoObject';
import objectToArray from '../../helpers/objectToArray';

import createStatefulAnchor from './helpers/createStatefulAnchor';

// Table with default options
const header = {
    name: {
        name: 'Name',
    },
    description: {
        name: 'Description',
        renderer: (input) => stripAnsi(input),
    },
    required: {
        name: 'Required',
        renderer: (input) => {
            if (input === true) {
                return 'Yes';
            }
            return 'No';
        },
    },
};

const settings = {
    groupTitleWrapper: (groupName, level) => `${pad(level + 3, '#')} ${
        groupName.charAt(0).toUpperCase() + groupName.slice(1)}`,
};

export default function commandsToMarkdown(
    name,
    config = {},
    commands,
    settingsLink,
    mode,
    hideCommands = [],
    cli = 'roc'
) {
    let rows = [];
    const allSettingGroups = config.settings ?
        Object.keys(config.settings).sort() :
        [];

    const printGroup = (group) => {
        const groupName = settingsLink ?
            `[${group}](${settingsLink}#${group})` :
            group;

        return `* ${groupName}`;
    };

    rows.push(`# Commands for \`${name}\``, '');

    if (commands) {
        rows.push('## General Information');
        rows.push('All commands can be called with some additional options illustrated in the table below.', '');

        rows.push(generateTable([{
            name: 'General options',
            level: 0,
            objects: getDefaultOptions('name'),
        }], header, settings));

        rows.push('## Commands');

        const { tableOfContent, content } =
            build(cli, commands, allSettingGroups, printGroup, hideCommands, createStatefulAnchor(mode));

        rows = rows.concat(tableOfContent, '', content, '');
    } else {
        rows.push('__No commands available.__', '');
    }

    return rows.join('\n');
}

function build(cli, commands, allSettingGroups, printGroup, hideCommands, statefulAnchor, parents = [], level = 0) {
    let tableOfContent = [];
    let content = [];

    Object.keys(commands)
        .filter((element) => hideCommands.indexOf(element) === -1)
        .filter((potentialGroup) => isCommand(commands)(potentialGroup))
        .sort()
        .forEach((command) => {
            const spacing = '  '.repeat(level === 0 ? 0 : level + 1);
            tableOfContent.push(`${spacing}* ${statefulAnchor(command)}`);
            content.push(buildCommand(
                cli,
                command,
                commands[command],
                allSettingGroups,
                printGroup,
                parents,
                level
            ).join('\n'));
        });

    Object.keys(commands)
        .filter((element) => hideCommands.indexOf(element) === -1)
        .filter(isCommandGroup(commands))
        .sort()
        .forEach((group) => {
            const spacing = '  '.repeat(level);
            content.push(buildGroup(
                cli,
                group,
                commands[group],
                allSettingGroups,
                printGroup,
                parents,
                level
            ).join('\n'));
            tableOfContent.push(`${spacing}* [${group}](#${group.replace(':', '')})`);
            const { tableOfContent: newTableOfContent, content: newContent } = build(
                    cli,
                    commands[group],
                    allSettingGroups,
                    printGroup,
                    hideCommands,
                    statefulAnchor,
                    parents.concat(group),
                    level + 1
                );
            content = content.concat(newContent);
            tableOfContent = tableOfContent.concat(newTableOfContent);
        });

    return {
        tableOfContent,
        content,
    };
}

function buildGroup(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
    const rows = [];
    rows.push(`##${'#'.repeat(level)} ${command}`);
    if (commandData.__meta && commandData.__meta.name) {
        rows.push(`__${commandData.__meta.name}__`);
        rows.push('');
    }

    rows.push(`\`\`\`\n${cli} ${parents.concat(command).join(' ')} <command>\n\`\`\``);
    if (commandData.__meta) {
        // If we have a markdown property we will use that over description
        if (commandData.__meta.markdown) {
            rows.push(redent(trimNewlines(commandData.__meta.markdown)), '');
        } else if (commandData.__meta.description) {
            rows.push(commandData.__meta.description, '');
        }
    }
    rows.push('');
    return rows;
}

function buildCommand(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
    let rows = [];

    rows.push(`##${'#'.repeat(level)} ${command}`);

    if (commandData.description) {
        rows.push(`__${commandData.description}__`);
    }

    rows.push('');

    rows.push(`\`\`\`\n${cli} ${parents.concat(command).join(' ')}${getCommandArgumentsAsString(commandData)}\n\`\`\``);

    // If we have a markdown property we will use that over help
    if (commandData.markdown) {
        rows.push(redent(trimNewlines(commandData.markdown)));
    } else if (commandData.help) {
        rows.push(redent(trimNewlines(commandData.help)));
    }

    // Create table will Arguments + Command Options
    let body = [];

    // Generate the arguments
    if (commandData.arguments) {
        const objects = objectToArray(commandData.arguments).map((argument) => {
            const infoObject = getInfoObject(argument.validator);
            return {
                name: argument.name,
                description: argument.description || '',
                type: infoObject.type,
                required: infoObject.required,
                canBeEmpty: infoObject.canBeEmpty,
                default: argument.default !== undefined && JSON.stringify(argument.default),
            };
        });

        if (objects.length > 0) {
            body = body.concat({
                name: 'Arguments',
                level,
                objects,
            });
        }
    }

    // Generate the options
    if (commandData.options) {
        const objects = objectToArray(commandData.options).sort(onProperty('name')).map((option) => {
            const infoObject = getInfoObject(option.validator);
            return {
                name: option.alias ? `-${option.alias}, --${option.name}` : `--${option.name}`,
                description: option.description || '',
                type: infoObject.type,
                required: infoObject.required,
                canBeEmpty: infoObject.canBeEmpty,
                default: option.default !== undefined && JSON.stringify(option.default),
            };
        });

        if (objects.length > 0) {
            body = body.concat({
                name: 'Command options',
                level,
                objects,
            });
        }
    }

    const newHeader = {
        name: {
            name: 'Name',
        },
        description: {
            name: 'Description',
            renderer: (input) => stripAnsi(input),
        },
        default: {
            name: 'Default',
            renderer: (input) => input && `\`${input}\``,
        },
        type: {
            name: 'Type',
            renderer: (input) => input && `\`${input}\``,
        },
        required: {
            name: 'Required',
            renderer: (input) => {
                if (input === true) {
                    return 'Yes';
                }
                return 'No';
            },
        },
        canBeEmpty: {
            name: 'Can be empty',
            renderer: (input) => {
                if (input === true) {
                    return 'Yes';
                } else if (input === false) {
                    return 'No';
                }

                return '';
            },
        },
    };

    rows.push('');

    const table = generateTable(body, newHeader, {
        groupTitleWrapper: (groupName, level2) => `${pad(level2 + 3, '#')} ${
            groupName.charAt(0).toUpperCase() + groupName.slice(1)}`,
    });
    if (table) {
        rows.push(table);
    }

    if (commandData.settings) {
        rows.push(`###${'#'.repeat(level)}  Settings options`);
        if (commandData.settings === true) {
            rows.push('_All groups are available._');
            rows = rows.concat(allSettingGroups.sort().map(printGroup));
            rows.push('');
        } else {
            rows = rows.concat(commandData.settings.sort().map(printGroup));
            rows.push('');
        }
    }

    if (commandData.__extensions) {
        rows.push(`###${'#'.repeat(level)}  Defined by extensions`);
        rows.push(commandData.__extensions.join(', '));
        rows.push('');
    }

    return rows;
}
<commit_msg>Only create documentation for commands if we have at least one command<commit_after>import redent from 'redent';
import stripAnsi from 'strip-ansi';
import trimNewlines from 'trim-newlines';

import generateTable from '../generateTable';
import pad from '../helpers/pad';
import getCommandArgumentsAsString from '../../cli/commands/getCommandArgumentsAsString';
import getDefaultOptions from '../../cli/commands/getDefaultOptions';
import onProperty from '../../helpers/onProperty';
import isCommandGroup from '../../cli/commands/helpers/isCommandGroup';
import isCommand from '../../cli/commands/helpers/isCommand';
import getInfoObject from '../../validation/helpers/getInfoObject';
import objectToArray from '../../helpers/objectToArray';

import createStatefulAnchor from './helpers/createStatefulAnchor';

// Table with default options
const header = {
    name: {
        name: 'Name',
    },
    description: {
        name: 'Description',
        renderer: (input) => stripAnsi(input),
    },
    required: {
        name: 'Required',
        renderer: (input) => {
            if (input === true) {
                return 'Yes';
            }
            return 'No';
        },
    },
};

const settings = {
    groupTitleWrapper: (groupName, level) => `${pad(level + 3, '#')} ${
        groupName.charAt(0).toUpperCase() + groupName.slice(1)}`,
};

export default function commandsToMarkdown(
    name,
    config = {},
    commands,
    settingsLink,
    mode,
    hideCommands = [],
    cli = 'roc'
) {
    let rows = [];
    const allSettingGroups = config.settings ?
        Object.keys(config.settings).sort() :
        [];

    const printGroup = (group) => {
        const groupName = settingsLink ?
            `[${group}](${settingsLink}#${group})` :
            group;

        return `* ${groupName}`;
    };

    rows.push(`# Commands for \`${name}\``, '');

    if (commands && Object.keys(commands).length > 0) {
        rows.push('## General Information');
        rows.push('All commands can be called with some additional options illustrated in the table below.', '');

        rows.push(generateTable([{
            name: 'General options',
            level: 0,
            objects: getDefaultOptions('name'),
        }], header, settings));

        rows.push('## Commands');

        const { tableOfContent, content } =
            build(cli, commands, allSettingGroups, printGroup, hideCommands, createStatefulAnchor(mode));

        rows = rows.concat(tableOfContent, '', content, '');
    } else {
        rows.push('__No commands available.__', '');
    }

    return rows.join('\n');
}

function build(cli, commands, allSettingGroups, printGroup, hideCommands, statefulAnchor, parents = [], level = 0) {
    let tableOfContent = [];
    let content = [];

    Object.keys(commands)
        .filter((element) => hideCommands.indexOf(element) === -1)
        .filter((potentialGroup) => isCommand(commands)(potentialGroup))
        .sort()
        .forEach((command) => {
            const spacing = '  '.repeat(level === 0 ? 0 : level + 1);
            tableOfContent.push(`${spacing}* ${statefulAnchor(command)}`);
            content.push(buildCommand(
                cli,
                command,
                commands[command],
                allSettingGroups,
                printGroup,
                parents,
                level
            ).join('\n'));
        });

    Object.keys(commands)
        .filter((element) => hideCommands.indexOf(element) === -1)
        .filter(isCommandGroup(commands))
        .sort()
        .forEach((group) => {
            const spacing = '  '.repeat(level);
            content.push(buildGroup(
                cli,
                group,
                commands[group],
                allSettingGroups,
                printGroup,
                parents,
                level
            ).join('\n'));
            tableOfContent.push(`${spacing}* [${group}](#${group.replace(':', '')})`);
            const { tableOfContent: newTableOfContent, content: newContent } = build(
                    cli,
                    commands[group],
                    allSettingGroups,
                    printGroup,
                    hideCommands,
                    statefulAnchor,
                    parents.concat(group),
                    level + 1
                );
            content = content.concat(newContent);
            tableOfContent = tableOfContent.concat(newTableOfContent);
        });

    return {
        tableOfContent,
        content,
    };
}

function buildGroup(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
    const rows = [];
    rows.push(`##${'#'.repeat(level)} ${command}`);
    if (commandData.__meta && commandData.__meta.name) {
        rows.push(`__${commandData.__meta.name}__`);
        rows.push('');
    }

    rows.push(`\`\`\`\n${cli} ${parents.concat(command).join(' ')} <command>\n\`\`\``);
    if (commandData.__meta) {
        // If we have a markdown property we will use that over description
        if (commandData.__meta.markdown) {
            rows.push(redent(trimNewlines(commandData.__meta.markdown)), '');
        } else if (commandData.__meta.description) {
            rows.push(commandData.__meta.description, '');
        }
    }
    rows.push('');
    return rows;
}

function buildCommand(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
    let rows = [];

    rows.push(`##${'#'.repeat(level)} ${command}`);

    if (commandData.description) {
        rows.push(`__${commandData.description}__`);
    }

    rows.push('');

    rows.push(`\`\`\`\n${cli} ${parents.concat(command).join(' ')}${getCommandArgumentsAsString(commandData)}\n\`\`\``);

    // If we have a markdown property we will use that over help
    if (commandData.markdown) {
        rows.push(redent(trimNewlines(commandData.markdown)));
    } else if (commandData.help) {
        rows.push(redent(trimNewlines(commandData.help)));
    }

    // Create table will Arguments + Command Options
    let body = [];

    // Generate the arguments
    if (commandData.arguments) {
        const objects = objectToArray(commandData.arguments).map((argument) => {
            const infoObject = getInfoObject(argument.validator);
            return {
                name: argument.name,
                description: argument.description || '',
                type: infoObject.type,
                required: infoObject.required,
                canBeEmpty: infoObject.canBeEmpty,
                default: argument.default !== undefined && JSON.stringify(argument.default),
            };
        });

        if (objects.length > 0) {
            body = body.concat({
                name: 'Arguments',
                level,
                objects,
            });
        }
    }

    // Generate the options
    if (commandData.options) {
        const objects = objectToArray(commandData.options).sort(onProperty('name')).map((option) => {
            const infoObject = getInfoObject(option.validator);
            return {
                name: option.alias ? `-${option.alias}, --${option.name}` : `--${option.name}`,
                description: option.description || '',
                type: infoObject.type,
                required: infoObject.required,
                canBeEmpty: infoObject.canBeEmpty,
                default: option.default !== undefined && JSON.stringify(option.default),
            };
        });

        if (objects.length > 0) {
            body = body.concat({
                name: 'Command options',
                level,
                objects,
            });
        }
    }

    const newHeader = {
        name: {
            name: 'Name',
        },
        description: {
            name: 'Description',
            renderer: (input) => stripAnsi(input),
        },
        default: {
            name: 'Default',
            renderer: (input) => input && `\`${input}\``,
        },
        type: {
            name: 'Type',
            renderer: (input) => input && `\`${input}\``,
        },
        required: {
            name: 'Required',
            renderer: (input) => {
                if (input === true) {
                    return 'Yes';
                }
                return 'No';
            },
        },
        canBeEmpty: {
            name: 'Can be empty',
            renderer: (input) => {
                if (input === true) {
                    return 'Yes';
                } else if (input === false) {
                    return 'No';
                }

                return '';
            },
        },
    };

    rows.push('');

    const table = generateTable(body, newHeader, {
        groupTitleWrapper: (groupName, level2) => `${pad(level2 + 3, '#')} ${
            groupName.charAt(0).toUpperCase() + groupName.slice(1)}`,
    });
    if (table) {
        rows.push(table);
    }

    if (commandData.settings) {
        rows.push(`###${'#'.repeat(level)}  Settings options`);
        if (commandData.settings === true) {
            rows.push('_All groups are available._');
            rows = rows.concat(allSettingGroups.sort().map(printGroup));
            rows.push('');
        } else {
            rows = rows.concat(commandData.settings.sort().map(printGroup));
            rows.push('');
        }
    }

    if (commandData.__extensions) {
        rows.push(`###${'#'.repeat(level)}  Defined by extensions`);
        rows.push(commandData.__extensions.join(', '));
        rows.push('');
    }

    return rows;
}
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  grunt.initConfig({
    connect: {
      server: {
        options: {
          base: '.',
          hostname: '*',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          build: process.env.TRAVIS_JOB_ID,
          urls: ['http://localhost:9999/test/'],
          testname: 'Mocha Unit Test for with-promise',
          sauceConfig: {
              tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
              public: 'public'
          },
          detailedError: true,
          concurrency: 2,
          maxPollRetries: 3,
          'max-duration': 300,
          browsers: [
            {browserName: 'chrome'},
            {browserName: 'firefox'},
            {browserName: 'safari', version: 7, platform: 'OS X 10.9'},
            {browserName: 'safari', version: 6, platform: 'OS X 10.8'},
            {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
            {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
            {browserName: 'internet explorer', version: 9, platform: 'Windows 7'},
            {browserName: 'Android', version:'4.4', platform: 'Linux'},
            {browserName: 'Android', version:'4.1', platform: 'Linux'},
            {browserName: 'Android', version:'4.0', platform: 'Linux'},
            {browserName: 'Safari', deviceName: 'iPhone Simulator', platformName: 'iOS', platformVersion:'8.1', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPhone Simulator', platformName: 'iOS', platformVersion:'8.0', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPhone Simulator', platformName: 'iOS', platformVersion:'7.1', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPhone Simulator', platformName: 'iOS', platformVersion:'7.0', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPhone Simulator', platformName: 'iOS', platformVersion:'6.1', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPad Simulator', platformName: 'iOS', platformVersion:'8.1', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPad Simulator', platformName: 'iOS', platformVersion:'8.0', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPad Simulator', platformName: 'iOS', platformVersion:'7.1', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPad Simulator', platformName: 'iOS', platformVersion:'7.0', appiumVersion: '1.3.4'},
            {browserName: 'Safari', deviceName: 'iPad Simulator', platformName: 'iOS', platformVersion:'6.1', appiumVersion: '1.3.4'}
          ]
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-saucelabs');

  grunt.registerTask('default', ['connect:server', 'saucelabs-mocha']);
};
<commit_msg>reviewed grunt-saucelabs and refine the config<commit_after>module.exports = function (grunt) {
  grunt.initConfig({
    connect: {
      server: {
        options: {
          base: '.',
          hostname: '*',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          build: process.env.TRAVIS_JOB_ID,
          urls: ['http://localhost:9999/test/'],
          testname: 'Mocha Unit Test for with-promise',
          sauceConfig: {
              tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
              public: 'public'
          },
          detailedError: true,
          concurrency: 2,
          maxPollRetries: 3,
          'max-duration': 300,
          browsers: [
            {browserName: 'chrome'},
            {browserName: 'firefox'},
            {browserName: 'safari', version: 7, platform: 'OS X 10.9'},
            {browserName: 'safari', version: 6, platform: 'OS X 10.8'},
            {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
            {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
            {browserName: 'internet explorer', version: 9, platform: 'Windows 7'},
            {browserName: 'Android', version:'4.4', platform: 'Linux'},
            {browserName: 'Android', version:'4.1', platform: 'Linux'},
            {browserName: 'Android', version:'4.0', platform: 'Linux'},
            {browserName: 'iphone', version:'8.1', platform: 'OS X 10.10'},
            {browserName: 'iphone', version:'8.0', platform: 'OS X 10.10'},
            {browserName: 'iphone', version:'7.1', platform: 'OS X 10.10'},
            {browserName: 'iphone', version:'7.0', platform: 'OS X 10.9'},
            {browserName: 'iphone', version:'6.1', platform: 'OS X 10.8'},
            {browserName: 'ipad', version:'8.1', platform: 'OS X 10.10'},
            {browserName: 'ipad', version:'8.0', platform: 'OS X 10.10'},
            {browserName: 'ipad', version:'7.1', platform: 'OS X 10.10'},
            {browserName: 'ipad', version:'7.0', platform: 'OS X 10.9'},
            {browserName: 'ipad', version:'6.1', platform: 'OS X 10.8'}
          ]
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-saucelabs');

  grunt.registerTask('default', ['connect:server', 'saucelabs-mocha']);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    concat: {
      dist: {
        src: [
          'lib/melonJS.js',
          'lib/plugins/*.js',
          'src/game.js',
          'src/config.js',
          'build/src/assets.js',
          'src/**/*.js',
        ],
        dest: 'build/src/app.js'
      }
    },

    copy: {
      dist: {
        files: [{
          src: 'index.css',
          dest: 'build/index.css'
        }, {
          src: 'main.js',
          dest: 'build/main.js'
        }, {
          src: 'src/config.js',
          dest: 'build/src/config.js'
        }, {
          src: 'manifest.json',
          dest: 'build/manifest.json'
        }, {
          src: 'package.json',
          dest: 'build/package.json'
        }, {
          src: 'assets/**/*',
          dest: 'build/',
          expand: true
        }]
      }
    },

    clean: {
      app: ['build/src/app.js'],
      dist: ['build/', 'bin/'],
    },

    processhtml: {
      dist: {
        options: {
          process: true,
          data: {
            title: '<%= pkg.name %>',
          }
        },
        files: {
          'build/index.html': ['index.html']
        }
      }
    },

    replace: {
      dist: {
        options: {
          usePrefix: false,
          force: true,
          patterns: [
            {
              match: /this\._super\(\s*([\w\.]+)\s*,\s*["'](\w+)["']\s*(,\s*)?/g,
              replacement: '$1.prototype.$2.apply(this$3'
            },
          ],
        },
        files: [
          {
            src: ['build/src/app.js'],
            dest: 'build/src/app.js'
          }
        ]
      },
    },

    uglify: {
      options: {
        report: 'min',
        preserveComments: 'some'
      },
      dist: {
        files: {
          'build/src/app.min.js': [
            'build/src/app.js'
          ]
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 8000,
          keepalive: false
        }
      }
    },

    'download-electron': {
      version: '1.4.6',
      outputDir: 'bin',
      rebuild: false,
    },

    asar: {
      dist: {
        cwd: 'build',
        src: ['**/*', '!src/app.js'],
        expand: true,
        dest: 'bin/' + (
          process.platform === 'darwin'
            ? 'Electron.app/Contents/Resources/'
            : 'resources/'
        ) + 'app.asar'
      },
    },

    assets: {
      dist: {
        options: {
          dest: 'build/src/assets.js',
          varname: 'game.assets',
        },
        files: [{
          src: ['assets/bgm/**/*.mp3', 'assets/bgm/**/*.ogg', 'assets/sfx/**/*.mp3', 'assets/sfx/**/*.ogg'],
          type: 'audio'
        }, {
          src: ['assets/img/**/*.png', 'assets/img/**/*.gif'],
          type: 'image'
        }, {
          src: ['assets/json/**/*.json'],
          type: 'json'
        }, {
          src: ['assets/map/**/*.tmx', 'assets/map/**/*.json'],
          type: 'tmx'
        }, {
          src: ['assets/map/**/*.tsx'],
          type: 'tsx'
        }]
      }
    },

    watch: {
      resources: {
        files: ['assets/**/*'],
        tasks: ['assets'],
        options: {
          spawn: false,
        },
      },
      code: {
        files: ['lib/**/*.js', 'src/**/*.js'],
        tasks: ['concat'],
        options: {
          spawn: false,
        },
      },
    },

  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-processhtml');
  grunt.loadNpmTasks("grunt-replace");
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-download-electron');
  grunt.loadNpmTasks('grunt-asar');

  // Custom Tasks
  grunt.loadTasks('tasks');

  grunt.registerTask('default', [
    'assets',
    'concat',
    'replace',
    'uglify',
    'copy',
    'processhtml',
  ]);
  grunt.registerTask('dist', ['default', 'download-electron', 'asar']);
  grunt.registerTask('serve', ['assets', 'concat', 'replace', 'connect', 'watch']);
}
<commit_msg>Improved Gruntfile tasks<commit_after>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    concat: {
      dist: {
        src: [
          'lib/melonJS.js',
          'lib/plugins/*.js',
          'src/game.js',
          'src/config.js',
          'build/src/assets.js',
          'src/**/*.js',
        ],
        dest: 'build/src/app.js'
      }
    },

    copy: {
      dist: {
        files: [{
          src: 'index.css',
          dest: 'build/index.css'
        }, {
          src: 'main.js',
          dest: 'build/main.js'
        }, {
          src: 'src/config.js',
          dest: 'build/src/config.js'
        }, {
          src: 'manifest.json',
          dest: 'build/manifest.json'
        }, {
          src: 'package.json',
          dest: 'build/package.json'
        }, {
          src: 'assets/**/*',
          dest: 'build/',
          expand: true
        }]
      }
    },

    clean: {
      app: ['build/src/app.js'],
      dist: ['build/', 'bin/'],
    },

    processhtml: {
      dist: {
        options: {
          process: true,
          data: {
            title: '<%= pkg.name %>',
          }
        },
        files: {
          'build/index.html': ['index.html']
        }
      }
    },

    replace: {
      dist: {
        options: {
          usePrefix: false,
          force: true,
          patterns: [
            {
              match: /this\._super\(\s*([\w\.]+)\s*,\s*["'](\w+)["']\s*(,\s*)?/g,
              replacement: '$1.prototype.$2.apply(this$3'
            },
          ],
        },
        files: [
          {
            src: ['build/src/app.js'],
            dest: 'build/src/app.js'
          }
        ]
      },
    },

    uglify: {
      options: {
        report: 'min',
        preserveComments: 'some'
      },
      dist: {
        files: {
          'build/src/app.min.js': [
            'build/src/app.js'
          ]
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 8000,
          keepalive: false
        }
      }
    },

    'download-electron': {
      version: '1.4.6',
      outputDir: 'bin',
      rebuild: false,
    },

    asar: {
      dist: {
        cwd: 'build',
        src: ['**/*', '!src/app.js'],
        expand: true,
        dest: 'bin/' + (
          process.platform === 'darwin'
            ? 'Electron.app/Contents/Resources/'
            : 'resources/'
        ) + 'app.asar'
      },
    },

    assets: {
      dist: {
        options: {
          dest: 'build/src/assets.js',
          varname: 'game.assets',
        },
        files: [{
          src: ['assets/bgm/**/*.mp3', 'assets/bgm/**/*.ogg', 'assets/sfx/**/*.mp3', 'assets/sfx/**/*.ogg'],
          type: 'audio'
        }, {
          src: ['assets/img/**/*.png', 'assets/img/**/*.gif'],
          type: 'image'
        }, {
          src: ['assets/json/**/*.json'],
          type: 'json'
        }, {
          src: ['assets/map/**/*.tmx', 'assets/map/**/*.json'],
          type: 'tmx'
        }, {
          src: ['assets/map/**/*.tsx'],
          type: 'tsx'
        }]
      }
    },

    watch: {
      assets: {
        files: ['assets/**/*'],
        tasks: ['assets'],
        options: {
          spawn: false,
        },
      },
      js: {
        files: ['lib/**/*.js', 'src/**/*.js'],
        tasks: ['concat'],
        options: {
          spawn: false,
        },
      },
      html: {
        files: ['index.html'],
        tasks: ['processhtml'],
        options: {
          spawn: false,
        },
      },
    },

  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-processhtml');
  grunt.loadNpmTasks("grunt-replace");
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-download-electron');
  grunt.loadNpmTasks('grunt-asar');

  // Custom Tasks
  grunt.loadTasks('tasks');

  grunt.registerTask('default', [
    'clean:dist',
    'assets',
    'concat',
    'replace',
    'uglify',
    'copy',
    'processhtml',
  ]);
  grunt.registerTask('dist', ['default', 'download-electron', 'asar']);
  grunt.registerTask('serve', ['default', 'connect', 'watch']);
}
<|endoftext|>


<commit_before>module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

        clean: {
            build: ['build/'],
            tmp: ['css/tmp/', 'build/css/tmp/']
        },

        sass: {
            dist: {
                options: {
                    style: 'compressed'
                },
                files: {
                    'css/tmp/reset.css': 'scss/reset.scss',
                    'css/tmp/main.css': 'scss/main.scss',
                },
            },
        },

        imageoptim: {
            main: {
                options: {
                    imageAlpha: true,
                    quitAfter: true
                },
                src: ['images']
            },
        },

        watch: {
            jekyll: {
                files: ['**/*', '!build/**/*', '!node_modules/**/*', '!css/**/*'],
                tasks: ['build']
            },
            livereload: {
                files: ['build/**/*', 'css/styles.css'],
                options: {
                    livereload: true
                },
            },
        },

        cssmin: {
            combine: {
                files: {
                    'css/styles.css': ['css/tmp/reset.css', 'css/tmp/main.css']
                },
            },
        },

        /*
        uglify: {
            options: {
                mangle: false
            },
            my_target: {
                files: {
                    'build/js/script.min.js': ['js/custom.js']
                },
            },
        },
        */

        jekyll: {
            dev: {
                options: {
                    src: '.',
                    dest: 'build',
                    config: ['_config.yml']
                },
            },
        },

        connect: {
            server: {
                options: {
                    keepalive: true,
                    port: 4000,
                    base: 'build'
                }
            }
        },

    });

    grunt.registerTask('build', ['sass', 'cssmin', 'jekyll:dev', 'clean:tmp']);
    grunt.registerTask('default', ['imageoptim', 'build']);
};
<commit_msg>Open server on start.<commit_after>module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

        clean: {
            build: ['build/'],
            tmp: ['css/tmp/', 'build/css/tmp/']
        },

        sass: {
            dist: {
                options: {
                    style: 'compressed'
                },
                files: {
                    'css/tmp/reset.css': 'scss/reset.scss',
                    'css/tmp/main.css': 'scss/main.scss',
                },
            },
        },

        imageoptim: {
            main: {
                options: {
                    imageAlpha: true,
                    quitAfter: true
                },
                src: ['images']
            },
        },

        watch: {
            jekyll: {
                files: ['**/*', '!build/**/*', '!node_modules/**/*', '!css/**/*'],
                tasks: ['build']
            },
            livereload: {
                files: ['build/**/*', 'css/styles.css'],
                options: {
                    livereload: true
                },
            },
        },

        cssmin: {
            combine: {
                files: {
                    'css/styles.css': ['css/tmp/reset.css', 'css/tmp/main.css']
                },
            },
        },

        /*
        uglify: {
            options: {
                mangle: false
            },
            my_target: {
                files: {
                    'build/js/script.min.js': ['js/custom.js']
                },
            },
        },
        */

        jekyll: {
            dev: {
                options: {
                    src: '.',
                    dest: 'build',
                    config: ['_config.yml']
                },
            },
        },

        connect: {
            server: {
                options: {
                    keepalive: true,
                    port: 4000,
                    base: 'build',
                    open: true
                }
            }
        },

    });

    grunt.registerTask('build', ['sass', 'cssmin', 'jekyll:dev', 'clean:tmp']);
    grunt.registerTask('default', ['imageoptim', 'build']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

    grunt.initConfig({
        'connect': {
            demo: {
                options: {
                    open: true,
                    keepalive: true
                }
            }
        },
        'gh-pages': {
            options: {
                clone: 'bower_components/input-password'
            },
            src: [
                'bower_components/**/*',
                '!bower_components/input-password/**/*',
                'demo/*', 'src/*', 'index.html'
            ]
        },
        'replace': {
            example: {
                src: ['src/*'],
                dest: 'dist/',
                replacements: [{
                    from: 'bower_components',
                    to: '..'
                }]
            }
        },
        'push': {
            options: {
                files: ['package.json', 'bower.json'],
                updateConfigs: ['pkg', 'bower'],
                push: {
                    releaseBranch: ['develop', 'master']
                },
                add: true,
                addFiles: ['.'], // '.' for all files except ingored files in .gitignore
                commit: true,
                commitMessage: 'Release %VERSION%',
                commitFiles: ['package.json', 'bower.json'], // '-a' for all files
                createTag: true,
                tagName: '%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: true,
                pushTo: 'origin',
                npm: true,
                npmTag: 'Release %VERSION%',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        },
        'uglify': {
            compress: {
                src: 'src/input-password.js',
                dest: 'dist/input-password.js',
                options: {
                    compress: true,
                    preserveComments: false
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-gh-pages');
    grunt.loadNpmTasks('grunt-text-replace');
    grunt.loadNpmTasks('grunt-push-release');

    grunt.registerTask('build',  ['replace', 'uglify']);
    grunt.registerTask('deploy', ['gh-pages']);
    grunt.registerTask('serve', ['connect']);

};
<commit_msg>Fix grunt task push<commit_after>module.exports = function(grunt) {

    grunt.initConfig({
        'connect': {
            demo: {
                options: {
                    open: true,
                    keepalive: true
                }
            }
        },
        'gh-pages': {
            options: {
                clone: 'bower_components/input-password'
            },
            src: [
                'bower_components/**/*',
                '!bower_components/input-password/**/*',
                'demo/*', 'src/*', 'index.html'
            ]
        },
        'replace': {
            example: {
                src: ['src/*'],
                dest: 'dist/',
                replacements: [{
                    from: 'bower_components',
                    to: '..'
                }]
            }
        },
        'push': {
            options: {
                files: ['package.json', 'bower.json'],
                updateConfigs: [],
                push: {
                    releaseBranch: ['develop', 'master']
                },
                add: true,
                addFiles: ['.'], // '.' for all files except ingored files in .gitignore
                commit: true,
                commitMessage: 'Release %VERSION%',
                commitFiles: ['package.json', 'bower.json'], // '-a' for all files
                createTag: true,
                tagName: '%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: true,
                pushTo: 'origin',
                npm: true,
                npmTag: 'Release %VERSION%',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        },
        'uglify': {
            compress: {
                src: 'src/input-password.js',
                dest: 'dist/input-password.js',
                options: {
                    compress: true,
                    preserveComments: false
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-gh-pages');
    grunt.loadNpmTasks('grunt-text-replace');
    grunt.loadNpmTasks('grunt-push-release');

    grunt.registerTask('build',  ['replace', 'uglify']);
    grunt.registerTask('deploy', ['gh-pages']);
    grunt.registerTask('serve', ['connect']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		emberTemplates: {
			compile: {
				options: {
					templateName: function(sourceFile) {
						return sourceFile.split('/').slice(-1).pop();
					}
				},
				files: {
					'dist/templates.js': 'src/mist/io/static/js/app/templates/*.hbs',
				}
			}
		},
		bower_concat: {
			all: {
				dest: 'dist/vendor.js',
                exclude: ['requirejs', 'requirejs-text'],
				bowerOptions: {
					relative: false
				}
			}
		},
		symlink: {
  			jquery: {
    			target: '../bower_components/jquery/dist/',
    			link: 'dist/jquery',
				type: 'dir',
				options: {
					overwrite: true,
					force: true
				}
			},
			jqm: {
				target: '../bower_components/jquery-mobile-bower/',
				link: 'dist/jqm',
				options: {
					overwrite: true,
					force: true
				}
			},
			ember: {
				target: '../bower_components/ember/',
				link: 'dist/ember',
				options: {
					overwrite: true,
					force: true
				}
			},
			requirejs_text: {
				target: '../bower_components/requirejs-text/',
				link: 'dist/requirejs-text',
				options: {
					overwrite: true,
					force: true
				}
			},
			sockjs: {
				target: '../bower_components/sockjs/',
				link: 'dist/sockjs',
				options: {
					overwrite: true,
					force: true
				}
			},
			md5: {
				target: '../bower_components/md5/',
				link: 'dist/md5',
				options: {
					overwrite: true,
					force: true
				}
			},
			d3: {
				target: '../bower_components/d3/',
				link: 'dist/d3',
				options: {
					overwrite: true,
					force: true
				}
			},
			c3: {
				target: '../bower_components/c3/',
				link: 'dist/c3',
				options: {
					overwrite: true,
					force: true
				}
			},
			term: {
				target: '../bower_components/term.js/',
				link: 'dist/term.js',
				options: {
					overwrite: true,
					force: true
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-ember-templates');
	grunt.loadNpmTasks('grunt-bower-concat');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-symbolic-link');

    //grunt.registerTask('js', ['requirejs:accountJS', 'requirejs:manageJS']);
    //grunt.registerTask('css', ['requirejs:accountCSS', 'requirejs:manageCSS']);

	grunt.registerTask('default', ['bower_concat:all', 'emberTemplates', 'symlink']);
};
<commit_msg>fix jquery path<commit_after>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		emberTemplates: {
			compile: {
				options: {
					templateName: function(sourceFile) {
						return sourceFile.split('/').slice(-1).pop();
					}
				},
				files: {
					'dist/templates.js': 'src/mist/io/static/js/app/templates/*.hbs',
				}
			}
		},
		bower_concat: {
			all: {
				dest: 'dist/vendor.js',
                exclude: ['requirejs', 'requirejs-text'],
				bowerOptions: {
					relative: false
				}
			}
		},
		symlink: {
  			jquery: {
    			target: '../bower_components/jquery/',
    			link: 'dist/jquery',
				type: 'dir',
				options: {
					overwrite: true,
					force: true
				}
			},
			jqm: {
				target: '../bower_components/jquery-mobile-bower/',
				link: 'dist/jqm',
				options: {
					overwrite: true,
					force: true
				}
			},
			ember: {
				target: '../bower_components/ember/',
				link: 'dist/ember',
				options: {
					overwrite: true,
					force: true
				}
			},
			requirejs_text: {
				target: '../bower_components/requirejs-text/',
				link: 'dist/requirejs-text',
				options: {
					overwrite: true,
					force: true
				}
			},
			sockjs: {
				target: '../bower_components/sockjs/',
				link: 'dist/sockjs',
				options: {
					overwrite: true,
					force: true
				}
			},
			md5: {
				target: '../bower_components/md5/',
				link: 'dist/md5',
				options: {
					overwrite: true,
					force: true
				}
			},
			d3: {
				target: '../bower_components/d3/',
				link: 'dist/d3',
				options: {
					overwrite: true,
					force: true
				}
			},
			c3: {
				target: '../bower_components/c3/',
				link: 'dist/c3',
				options: {
					overwrite: true,
					force: true
				}
			},
			term: {
				target: '../bower_components/term.js/',
				link: 'dist/term.js',
				options: {
					overwrite: true,
					force: true
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-ember-templates');
	grunt.loadNpmTasks('grunt-bower-concat');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-symbolic-link');

    //grunt.registerTask('js', ['requirejs:accountJS', 'requirejs:manageJS']);
    //grunt.registerTask('css', ['requirejs:accountCSS', 'requirejs:manageCSS']);

	grunt.registerTask('default', ['bower_concat:all', 'emberTemplates', 'symlink']);
};
<|endoftext|>


<commit_before>// Generated on 2015-01-02 using generator-angular-fullstack 2.0.13
'use strict';

module.exports = function (grunt) {
  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    builddir: '.tmp/build',
    tmpdir: '.tmp',
    src: './src/**/*.js',
    pkg: grunt.file.readJSON('package.json'),
    buildtag: '-dev-' + grunt.template.today('yyyy-mm-dd'),
    meta: {
      banner: '/**\n' +
        ' * <%= pkg.name %>\n' +
        ' * Copyright <%= pkg.author %> '+grunt.template.today('yyyy')+'\n' +
        ' * <%= pkg.description %>\n' +
        ' * @version v<%= pkg.version %><%= buildtag %>\n' +
        ' * @link <%= pkg.homepage %>\n' +
        ' * @license <%= pkg.license %>\n' +
        ' */'
    },
    clean: {
      ngdocs: '<%= tmpdir %>/site/**/*'
    },
    concat: {
      options: {
        banner: '<%= meta.banner %>\n\n'+
                '/* commonjs package manager support (eg componentjs) */\n'+
                'if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){\n'+
                '  module.exports = \'ui.router\';\n'+
                '}\n\n'+
                '(function (window, angular, undefined) {\n',
        footer: '})(window, window.angular);'
      },
      build: {
        src: '<%= src %>',
        dest: '<%= builddir %>/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= meta.banner %>\n'
      },
      build: {
        files: {
          '<%= builddir %>/<%= pkg.name %>.min.js': ['<banner:meta.banner>', '<%= concat.build.dest %>']
        }
      }
    },
    release: {
      files: ['<%= pkg.name %>.js', '<%= pkg.name %>.min.js'],
      src: '<%= builddir %>',
      dest: 'release'
    },
    jshint: {
      all: ['Gruntfile.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js'],
      options: {
        eqnull: true
      }
    },
    express: {
      options: {
        port: process.env.PORT || 9000
      },
      dev: {
        options: {
          script: 'example/server.js'
        }
      }
    },
    watch: {
      options:{
        livereload: true
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      ngdoc: {
        files: ['<%= src %>','ngdoc_assets/**/*'],
        tasks: ['docs']
      },
      src: {
        files: ['<%= src %>'],
        tasks: ['build']
      },
      ngapp:{
        files:  [ 'example/app/*' ],
        options:{
          livereload: true
        }
      },
      express: {
        files:  [ 'example/server.js' ],
        tasks:  [ 'express:dev'],
        options: {
          livereload: true,
          spawn: false
        }
      }
    },
    open: {
      server: {
        url: 'http://localhost:<%= express.options.port %>'
      }
    },
    ngdocs: {
      options: {
        dest: '<%= tmpdir %>/site',
        scripts: [
          'angular.js'
        ],
        styles: [ 'ngdoc_assets/stormpath-angular.css' ],
        html5Mode: false,
        title: 'stormpath-sdk-angularjs',
        startPage: '/api/stormpath',
        navTemplate: 'ngdoc_assets/nav.html'
      },
      api: {
        src: ['<%= src %>','ngdoc_assets/index.ngdoc'],
        title: 'API Reference',
        api: true
      },
      example: {
        src: ['ngdoc_assets/example/index.ngdoc'],
        title: 'Example',
        api: false
      }
    },
    copy: {
      dist: {
        src: 'build/*',
        dest: 'dest/',
      },
    }
  });

  grunt.registerTask('docs', function () {
    grunt.task.run(['clean:ngdocs','ngdocs']);
  });

  grunt.registerTask('serve', function () {
    grunt.task.run(['build','express:dev','open','watch']);
  });

  grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify','docs']);

  grunt.registerTask('dist', 'Perform a distribution', ['build', 'copy:dist']);
};
<commit_msg>change the start page for the documentation<commit_after>// Generated on 2015-01-02 using generator-angular-fullstack 2.0.13
'use strict';

module.exports = function (grunt) {
  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    builddir: '.tmp/build',
    tmpdir: '.tmp',
    src: './src/**/*.js',
    pkg: grunt.file.readJSON('package.json'),
    buildtag: '-dev-' + grunt.template.today('yyyy-mm-dd'),
    meta: {
      banner: '/**\n' +
        ' * <%= pkg.name %>\n' +
        ' * Copyright <%= pkg.author %> '+grunt.template.today('yyyy')+'\n' +
        ' * <%= pkg.description %>\n' +
        ' * @version v<%= pkg.version %><%= buildtag %>\n' +
        ' * @link <%= pkg.homepage %>\n' +
        ' * @license <%= pkg.license %>\n' +
        ' */'
    },
    clean: {
      ngdocs: '<%= tmpdir %>/site/**/*'
    },
    concat: {
      options: {
        banner: '<%= meta.banner %>\n\n'+
                '/* commonjs package manager support (eg componentjs) */\n'+
                'if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){\n'+
                '  module.exports = \'ui.router\';\n'+
                '}\n\n'+
                '(function (window, angular, undefined) {\n',
        footer: '})(window, window.angular);'
      },
      build: {
        src: '<%= src %>',
        dest: '<%= builddir %>/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= meta.banner %>\n'
      },
      build: {
        files: {
          '<%= builddir %>/<%= pkg.name %>.min.js': ['<banner:meta.banner>', '<%= concat.build.dest %>']
        }
      }
    },
    release: {
      files: ['<%= pkg.name %>.js', '<%= pkg.name %>.min.js'],
      src: '<%= builddir %>',
      dest: 'release'
    },
    jshint: {
      all: ['Gruntfile.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js'],
      options: {
        eqnull: true
      }
    },
    express: {
      options: {
        port: process.env.PORT || 9000
      },
      dev: {
        options: {
          script: 'example/server.js'
        }
      }
    },
    watch: {
      options:{
        livereload: true
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      ngdoc: {
        files: ['<%= src %>','ngdoc_assets/**/*'],
        tasks: ['docs']
      },
      src: {
        files: ['<%= src %>'],
        tasks: ['build']
      },
      ngapp:{
        files:  [ 'example/app/*' ],
        options:{
          livereload: true
        }
      },
      express: {
        files:  [ 'example/server.js' ],
        tasks:  [ 'express:dev'],
        options: {
          livereload: true,
          spawn: false
        }
      }
    },
    open: {
      server: {
        url: 'http://localhost:<%= express.options.port %>'
      }
    },
    ngdocs: {
      options: {
        dest: '<%= tmpdir %>/site',
        scripts: [
          'angular.js'
        ],
        styles: [ 'ngdoc_assets/stormpath-angular.css' ],
        html5Mode: false,
        title: 'stormpath-sdk-angularjs',
        startPage: '/api',
        navTemplate: 'ngdoc_assets/nav.html'
      },
      api: {
        src: ['<%= src %>','ngdoc_assets/index.ngdoc'],
        title: 'API Reference',
        api: true
      },
      example: {
        src: ['ngdoc_assets/example/index.ngdoc'],
        title: 'Example',
        api: false
      }
    },
    copy: {
      dist: {
        src: 'build/*',
        dest: 'dest/',
      },
    }
  });

  grunt.registerTask('docs', function () {
    grunt.task.run(['clean:ngdocs','ngdocs']);
  });

  grunt.registerTask('serve', function () {
    grunt.task.run(['build','express:dev','open','watch']);
  });

  grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify','docs']);

  grunt.registerTask('dist', 'Perform a distribution', ['build', 'copy:dist']);
};
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * Vitaé®
 * Curriculum Vitaé of Prabhat Kumar — CEO, Founder & Scientist.
 * ___________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/ — The JavaScript Task Runner.
 * ___________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * ___________________________________________________________________________
 *
 * @date      : 30-Nov-2016
 * @license   : MIT
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ___________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "Vitaé®".
 * ___________________________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v
// # Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required NPM modules.
// -----------------------------
var chalk    = require('chalk');
var glob     = require('glob');

///-------------------
// An object literals.
///-------------------
var build = {
  // Nonidentifier property names are quoted.
  "system"    : "SEED™",
  "name"      : "Umeå",
  "year"      : "2016",
  "audience"  : "for all designer and scientist."
};

// Global variables.
// -----------------
var rootPath = './';
var appsPath = './app/';

// Default color defined.
// ----------------------
var noop     = chalk.red;
var yeep     = chalk.green;
var okay     = chalk.blue;

// To get 'version', i.e. required to work on
// SEED™: Grunt based build system. | See: http://seed.sequomics.com/.
var version = process.env.VERSION || require('./package.json').version;

///------------------------
// A smart banner function.
///------------------------
var banner = [
  '/*!                                                                                ',
  ' * Build System — ' + yeep(build.system) + ': ' + okay(build.name) + ' — ' + version                  ,
  ' * ' + noop(build.audience)                                                                           ,
  ' * ---------------------------------------------------------------------------                       ',
  ' * Copyright © 2015 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.  ',
  ' * Available via the Apache, version 2.0. [http://www.apache.org/licenses/]                          ',
  ' * See: http://seed.sequomics.com/ — for details.                                                    ',
  ' * ---------------------------------------------------------------------------                       ',
  ' */                                                                                ',
  '\n',
].map(function(s) {
  return s.replace(/\s+$/, '');
}).join("\n");

// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 30/Nov/2016 | SEED™ — Umeå.
//                           Copyright © 2016, Prabhat Kumar, All rights reserved.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

  // Force use of Unix newlines.
  grunt.util.linefeed = '\n';

  // 1. time-grunt ——> $ npm install time-grunt --save-dev
  // -----------------------------------------------------
  // Display the elapsed execution time of grunt tasks.
  require('time-grunt')(grunt);

  // Utility to load the different option files,
  // based on their names.
  function loadConfig(path) {
    var object = {};
    var key;

    glob.sync('*', {
      cwd: path
    }).forEach(function(option) {
      key = option.replace(/\.js$/,'');
      object[key] = require(path + option);
    });
    return object;
  }

  /// Initial Configurations.
  var config = {
    pkg: grunt.file.readJSON('./package.json')
  };

  /// Loading Externally-Defined Tasks.
  /// http://gruntjs.com/api/grunt
  grunt.loadTasks('tasks');

  /// Loading all the tasks options in tasks/options base on the name:
  /// compass.js => compass{}
  grunt.util._.extend(config, loadConfig('./tasks/options/'));

  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  // Project configuration for -//Vitaé®//- Build.
  // Date: 29-11-2016.
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  grunt.initConfig({
    config,
    appDirectory: 'app',
    // To execute 'shell' command(s).
    shell: {
      makeDir: {
        command: 'mkdir <%= appDirectory %>'
      },
      dirListing: {
        command: 'ls'
      }
    }
  });

  // 2. load-grunt-tasks ——> $ npm install load-grunt-tasks --save-dev
  // -----------------------------------------------------------------
  // Load multiple grunt tasks using globbing patterns.
  require('load-grunt-tasks')(grunt, {
    // Load all grunt-contrib tasks and another non-contrib task.
    pattern: ['grunt-contrib-*', 'grunt-shell'],
    scope: ['devDependencies', 'dependencies'],
    requireResolution: true
  });

  // Writing about Build System.
  grunt.log.writeln(banner);

  // A task to clean build(s) or Temporary file(s) and default cache directories.
  grunt.registerTask('clear', ['clean']);

  // A task to make [./app] directory and file(s).
  // Using: grunt-shell
  grunt.registerTask('make', ['shell']);

  // A task to build SCSS, also to Lint and Minify.
  // --------- http://compass-style.org/ ----------
  grunt.registerTask('build', ['compass', 'csslint', 'cssmin']);

  // A task to build HTML, and Minify.
  grunt.registerTask('html', ['htmlmin']);

  // A task to work on Normalize.css, from: https://github.com/necolas/normalize.css/blob/master/normalize.css
  // to Get and Compare.
  grunt.registerTask('normalize', ['get', 'compare']);

  // A task to build JavaScript, also to Lint, concatenate and Minify.
  grunt.registerTask('script', ['jshint', 'concat', 'uglify']);

  // A task to serve Vitaé®
  // on to default browser.
  grunt.registerTask('serve', ['connect', 'watch']);
<commit_msg>जय हिन्द।<commit_after>#!/usr/bin/env node

/*!
 * Vitaé®
 * Curriculum Vitaé of Prabhat Kumar — CEO, Founder & Scientist.
 * ___________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/ — The JavaScript Task Runner.
 * ___________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * ___________________________________________________________________________
 *
 * @date      : 30-Nov-2016
 * @license   : MIT
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ___________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "Vitaé®".
 * ___________________________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v
// # Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required NPM modules.
// -----------------------------
var chalk    = require('chalk');
var glob     = require('glob');

///-------------------
// An object literals.
///-------------------
var build = {
  // Nonidentifier property names are quoted.
  "system"    : "SEED™",
  "name"      : "Umeå",
  "year"      : "2016",
  "audience"  : "for all designer and scientist."
};

// Global variables.
// -----------------
var rootPath = './';
var appsPath = './app/';

// Default color defined.
// ----------------------
var noop     = chalk.red;
var yeep     = chalk.green;
var okay     = chalk.blue;

// To get 'version', i.e. required to work on
// SEED™: Grunt based build system. | See: http://seed.sequomics.com/.
var version = process.env.VERSION || require('./package.json').version;

///------------------------
// A smart banner function.
///------------------------
var banner = [
  '/*!                                                                                ',
  ' * Build System — ' + yeep(build.system) + ': ' + okay(build.name) + ' — ' + version                  ,
  ' * ' + noop(build.audience)                                                                           ,
  ' * ---------------------------------------------------------------------------                       ',
  ' * Copyright © 2015 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.  ',
  ' * Available via the Apache, version 2.0. [http://www.apache.org/licenses/]                          ',
  ' * See: http://seed.sequomics.com/ — for details.                                                    ',
  ' * ---------------------------------------------------------------------------                       ',
  ' */                                                                                ',
  '\n',
].map(function(s) {
  return s.replace(/\s+$/, '');
}).join("\n");

// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 30/Nov/2016 | SEED™ — Umeå.
//                           Copyright © 2016, Prabhat Kumar, All rights reserved.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

  // Force use of Unix newlines.
  grunt.util.linefeed = '\n';

  // 1. time-grunt ——> $ npm install time-grunt --save-dev
  // -----------------------------------------------------
  // Display the elapsed execution time of grunt tasks.
  require('time-grunt')(grunt);

  // Utility to load the different option files,
  // based on their names.
  function loadConfig(path) {
    var object = {};
    var key;

    glob.sync('*', {
      cwd: path
    }).forEach(function(option) {
      key = option.replace(/\.js$/,'');
      object[key] = require(path + option);
    });
    return object;
  }

  /// Initial Configurations.
  var config = {
    pkg: grunt.file.readJSON('./package.json')
  };

  /// Loading Externally-Defined Tasks.
  /// http://gruntjs.com/api/grunt
  grunt.loadTasks('tasks');

  /// Loading all the tasks options in tasks/options base on the name:
  /// compass.js => compass{}
  grunt.util._.extend(config, loadConfig('./tasks/options/'));

  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  // Project configuration for -//Vitaé®//- Build.
  // Date: 29-11-2016.
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  grunt.initConfig({
    config,
    appDirectory: 'app',
    // To execute 'shell' command(s).
    shell: {
      makeDir: {
        command: 'mkdir <%= appDirectory %>'
      },
      dirListing: {
        command: 'ls'
      }
    }
  });

  // 2. load-grunt-tasks ——> $ npm install load-grunt-tasks --save-dev
  // -----------------------------------------------------------------
  // Load multiple grunt tasks using globbing patterns.
  require('load-grunt-tasks')(grunt, {
    // Load all grunt-contrib tasks and another non-contrib task.
    pattern: ['grunt-contrib-*', 'grunt-shell'],
    scope: ['devDependencies', 'dependencies'],
    requireResolution: true
  });

  // Writing about Build System.
  grunt.log.writeln(banner);

  // A task to clean build(s) or Temporary file(s) and default cache directories.
  grunt.registerTask('clear', ['clean']);

  // A task to make [./app] directory and file(s).
  // Using: grunt-shell
  grunt.registerTask('make', ['shell']);

  // A task to build SCSS, also to Lint and Minify.
  // --------- http://compass-style.org/ ----------
  grunt.registerTask('build', ['compass', 'csslint', 'cssmin']);

  // A task to build HTML, and Minify.
  grunt.registerTask('html', ['htmlmin']);

  // A task to work on Normalize.css, from: https://github.com/necolas/normalize.css/blob/master/normalize.css
  // to Get and Compare.
  grunt.registerTask('normalize', ['get', 'compare']);

  // A task to build JavaScript, also to Lint, concatenate and Minify.
  grunt.registerTask('script', ['jshint', 'concat', 'uglify']);

  // A task to serve Vitaé®
  // on to default browser.
  grunt.registerTask('serve', ['connect', 'watch']);

  // A Default Task is basically a rebuild.
  grunt.registerTask('default', ['clear', 'build', 'html', 'script', 'connect', 'watch']);

};
<|endoftext|>