<commit_before>module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.initConfig({
        paths: {
            src: {
                app: {
                    voice_registration: 'src/voice_registration.js',
                    voice_public: 'src/voice_public.js',
                    ussd_public: 'src/ussd_public.js',
                    ussd_registration: 'src/ussd_registration.js',
                    sms_inbound: 'src/sms_inbound.js'
                },
                voice_registration: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_registration %>',
                    'src/init.js'
                ],
                voice_public: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_public %>',
                    'src/init.js'
                ],
                ussd_registration: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_registration %>',
                    'src/init.js'
                ],
                sms_inbound: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.sms_inbound %>',
                    'src/init.js'
                ],
                ussd_public: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_public %>',
                    'src/init.js'
                ],
                all: [
                    'src/**/*.js'
                ]
            },
            dest: {
                voice_registration: 'go-voice_registration.js',
                voice_public: 'go-voice_public.js',
                sms_inbound: 'go-sms_inbound.js',
                ussd_public: 'go-ussd_public.js',
                ussd_registration: 'go-ussd_registration.js'
            },
            test: {
                voice_registration: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_registration %>',
                    'test/voice_registration.test.js'
                ],
                voice_public: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_public %>',
                    'test/voice_public.test.js'
                ],
                ussd_registration: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_registration %>',
                    'test/ussd_registration.test.js'
                ],
                sms_inbound: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.sms_inbound %>',
                    'test/sms_inbound.test.js'
                ],
                ussd_public: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_public %>',
                    'test/ussd_public.test.js'
                ]
            }
        },

        jshint: {
            options: {jshintrc: '.jshintrc'},
            all: [
                'Gruntfile.js',
                '<%= paths.src.all %>'
            ]
        },

        watch: {
            src: {
                files: [
                    '<%= paths.src.all %>'
                ],
                tasks: ['default'],
                options: {
                    atBegin: true
                }
            }
        },

        concat: {
            options: {
                banner: [
                    '// WARNING: This is a generated file.',
                    '//          If you edit it you will be sad.',
                    '//          Edit src/app.js instead.',
                    '\n' // Newline between banner and content.
                ].join('\n')
            },
            voice_registration: {
                src: ['<%= paths.src.voice_registration %>'],
                dest: '<%= paths.dest.voice_registration %>'
            },
            voice_public: {
                src: ['<%= paths.src.voice_public %>'],
                dest: '<%= paths.dest.voice_public %>'
            },
            ussd_registration: {
                src: ['<%= paths.src.ussd_registration %>'],
                dest: '<%= paths.dest.ussd_registration %>'
            },
            sms_inbound: {
                src: ['<%= paths.src.sms_inbound %>'],
                dest: '<%= paths.dest.sms_inbound %>'
            },
            ussd_public: {
                src: ['<%= paths.src.ussd_public %>'],
                dest: '<%= paths.dest.ussd_public %>'
            }

        },

        mochaTest: {
            options: {
                reporter: 'spec'
            },
            test_ussd_public: {
                src: ['<%= paths.test.ussd_public %>']
            }
        }
    });

    grunt.registerTask('test', [
        'jshint',
        'build',
        'mochaTest'
    ]);

    grunt.registerTask('build', [
        'concat',
    ]);

    grunt.registerTask('default', [
        'build',
        'test'
    ]);
};
<commit_msg>restore gruntfile<commit_after>module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.initConfig({
        paths: {
            src: {
                app: {
                    voice_registration: 'src/voice_registration.js',
                    voice_public: 'src/voice_public.js',
                    ussd_public: 'src/ussd_public.js',
                    ussd_registration: 'src/ussd_registration.js',
                    sms_inbound: 'src/sms_inbound.js'
                },
                voice_registration: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_registration %>',
                    'src/init.js'
                ],
                voice_public: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_public %>',
                    'src/init.js'
                ],
                ussd_registration: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_registration %>',
                    'src/init.js'
                ],
                sms_inbound: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.sms_inbound %>',
                    'src/init.js'
                ],
                ussd_public: [
                    'src/index.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_public %>',
                    'src/init.js'
                ],
                all: [
                    'src/**/*.js'
                ]
            },
            dest: {
                voice_registration: 'go-voice_registration.js',
                voice_public: 'go-voice_public.js',
                sms_inbound: 'go-sms_inbound.js',
                ussd_public: 'go-ussd_public.js',
                ussd_registration: 'go-ussd_registration.js'
            },
            test: {
                voice_registration: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_registration %>',
                    'test/voice_registration.test.js'
                ],
                voice_public: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.voice_public %>',
                    'test/voice_public.test.js'
                ],
                ussd_registration: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_registration %>',
                    'test/ussd_registration.test.js'
                ],
                sms_inbound: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.sms_inbound %>',
                    'test/sms_inbound.test.js'
                ],
                ussd_public: [
                    'test/setup.js',
                    'src/utils.js',
                    'src/utils_project.js',
                    '<%= paths.src.app.ussd_public %>',
                    'test/ussd_public.test.js'
                ]
            }
        },

        jshint: {
            options: {jshintrc: '.jshintrc'},
            all: [
                'Gruntfile.js',
                '<%= paths.src.all %>'
            ]
        },

        watch: {
            src: {
                files: [
                    '<%= paths.src.all %>'
                ],
                tasks: ['default'],
                options: {
                    atBegin: true
                }
            }
        },

        concat: {
            options: {
                banner: [
                    '// WARNING: This is a generated file.',
                    '//          If you edit it you will be sad.',
                    '//          Edit src/app.js instead.',
                    '\n' // Newline between banner and content.
                ].join('\n')
            },
            voice_registration: {
                src: ['<%= paths.src.voice_registration %>'],
                dest: '<%= paths.dest.voice_registration %>'
            },
            voice_public: {
                src: ['<%= paths.src.voice_public %>'],
                dest: '<%= paths.dest.voice_public %>'
            },
            ussd_registration: {
                src: ['<%= paths.src.ussd_registration %>'],
                dest: '<%= paths.dest.ussd_registration %>'
            },
            sms_inbound: {
                src: ['<%= paths.src.sms_inbound %>'],
                dest: '<%= paths.dest.sms_inbound %>'
            },
            ussd_public: {
                src: ['<%= paths.src.ussd_public %>'],
                dest: '<%= paths.dest.ussd_public %>'
            }

        },

        mochaTest: {
            options: {
                reporter: 'spec'
            },
            test_ussd_registration: {
                src: ['<%= paths.test.ussd_registration %>']
            },
            test_voice_registration: {
                src: ['<%= paths.test.voice_registration %>']
            },
            test_ussd_public: {
                src: ['<%= paths.test.ussd_public %>']
            },
            test_voice_public: {
                src: ['<%= paths.test.voice_public %>']
            },
            test_sms_inbound: {
                 src: ['<%= paths.test.sms_inbound %>']
            }
        }
    });

    grunt.registerTask('test', [
        'jshint',
        'build',
        'mochaTest'
    ]);

    grunt.registerTask('build', [
        'concat',
    ]);

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


<commit_before>'use strict';
var fs = require('fs');
var path = require('path');
var yeoman = require('yeoman-generator');
var yosay = require('yosay');
var bootplate = require('../../common/bootplate-utils.js');
var chalk = require('chalk');

var EnyoGenerator = yeoman.generators.Base.extend({
	constructor: function () {
		this.cwd = process.cwd();
		try {
			yeoman.generators.Base.apply(this, arguments);
			this.options.namespace = "enyo";
			this.argument("path", {
				desc:"Project directory",
				type: String,
				required: true
			});
			this.option("mode", {
				alias: "m",
				desc: "Configuration mode of bootplate (onyx, moonstone, sunstone, garnet, or sampler)",
				type: String
			});
			this.option("bootplate", {
				alias: "b",
				desc: "Specify version of bootplate and libraries to use",
				type: String
			});
			this.option("latest", {
				alias: "l",
				desc: "Use the latest version of bootplate and libraries",
				type: Boolean
			});
			this.option("cordova", {
				desc: "Specify a JSON string or file to add to or override build settings",
				type: Boolean
			});
			this.option("config", {
				alias: "c",
				desc: "Specify a JSON file which adds to or overrides build settings",
				type: String
			});
		} catch(e) {
			this.log(chalk.red(e));
			process.exit(1);
		}
	},

	initializing: function() {
		process.chdir(this.cwd);
		var valStrOpt = function(arg) {
			if(arg && typeof arg==="string") {
				return arg;
			} else {
				return undefined;
			}
		};
		this.param = {
			path: this.path,
			mode: valStrOpt(this.options["mode"]) || valStrOpt(this.options["m"]),
			version: valStrOpt(this.options["bootplate"]) || valStrOpt(this.options["b"]),
			latest: this.options["latest"] || this.options["l"]
		};
		if(this.param.version==="latest" || this.param.version==="edge" || this.param.version==="master"
				 || this.param.version==="nightly") {
			//resolve keywords to latest boolean
			this.param.latest = true;
		}
		var conf = valStrOpt(this.options["config"]) || valStrOpt(this.options["c"]);
		if(conf) {
			try {
				var txt = fs.readFileSync(conf, {encoding:"utf8"});
				var obj = JSON.parse(txt);
				this.param.config = obj;
			} catch(e) {
				this.log(chalk.red("Unable to read/parse config JSON."));
				process.exit(2);
			}
		}
		this.action = "create";
		if(this.options["cordova"]) {
			this.action = "cordova";
		}
	},

	welcome: function() {
		// Have Yeoman greet the user.
		this.log(yosay(
			'Welcome to the Enyo bootplate generator!'
		));
	},

	writing: function() {
		var log = this.log;
		var done = this.async();
		bootplate[this.action](this.param, function(err, opts) {
			log(" ");
			if(err) {
				if(err.message) {
					log(err.message + "\n");
				}
				log(chalk.red("Error: Bootplate generation failed."));
			} else {
				log(chalk.green("Bootplate generation completed successfully"));
				log("Project available at " + path.resolve(opts.project || opts.path));
			}
			done();
		});
	}
});

module.exports = EnyoGenerator;
<commit_msg>Updated to proper help description of cordova flag<commit_after>'use strict';
var fs = require('fs');
var path = require('path');
var yeoman = require('yeoman-generator');
var yosay = require('yosay');
var bootplate = require('../../common/bootplate-utils.js');
var chalk = require('chalk');

var EnyoGenerator = yeoman.generators.Base.extend({
	constructor: function () {
		this.cwd = process.cwd();
		try {
			yeoman.generators.Base.apply(this, arguments);
			this.options.namespace = "enyo";
			this.argument("path", {
				desc:"Project directory",
				type: String,
				required: true
			});
			this.option("mode", {
				alias: "m",
				desc: "Configuration mode of bootplate (onyx, moonstone, sunstone, garnet, or sampler)",
				type: String
			});
			this.option("bootplate", {
				alias: "b",
				desc: "Specify version of bootplate and libraries to use",
				type: String
			});
			this.option("latest", {
				alias: "l",
				desc: "Use the latest version of bootplate and libraries",
				type: Boolean
			});
			this.option("cordova", {
				desc: "Encapsulate bootplate within a Cordova project layer",
				type: Boolean
			});
			this.option("config", {
				alias: "c",
				desc: "Specify a JSON file which adds to or overrides build settings",
				type: String
			});
		} catch(e) {
			this.log(chalk.red(e));
			process.exit(1);
		}
	},

	initializing: function() {
		process.chdir(this.cwd);
		var valStrOpt = function(arg) {
			if(arg && typeof arg==="string") {
				return arg;
			} else {
				return undefined;
			}
		};
		this.param = {
			path: this.path,
			mode: valStrOpt(this.options["mode"]) || valStrOpt(this.options["m"]),
			version: valStrOpt(this.options["bootplate"]) || valStrOpt(this.options["b"]),
			latest: this.options["latest"] || this.options["l"]
		};
		if(this.param.version==="latest" || this.param.version==="edge" || this.param.version==="master"
				 || this.param.version==="nightly") {
			//resolve keywords to latest boolean
			this.param.latest = true;
		}
		var conf = valStrOpt(this.options["config"]) || valStrOpt(this.options["c"]);
		if(conf) {
			try {
				var txt = fs.readFileSync(conf, {encoding:"utf8"});
				var obj = JSON.parse(txt);
				this.param.config = obj;
			} catch(e) {
				this.log(chalk.red("Unable to read/parse config JSON."));
				process.exit(2);
			}
		}
		this.action = "create";
		if(this.options["cordova"]) {
			this.action = "cordova";
		}
	},

	welcome: function() {
		// Have Yeoman greet the user.
		this.log(yosay(
			'Welcome to the Enyo bootplate generator!'
		));
	},

	writing: function() {
		var log = this.log;
		var done = this.async();
		bootplate[this.action](this.param, function(err, opts) {
			log(" ");
			if(err) {
				if(err.message) {
					log(err.message + "\n");
				}
				log(chalk.red("Error: Bootplate generation failed."));
			} else {
				log(chalk.green("Bootplate generation completed successfully"));
				log("Project available at " + path.resolve(opts.project || opts.path));
			}
			done();
		});
	}
});

module.exports = EnyoGenerator;
<|endoftext|>


<commit_before>// Generated on 2015-05-07 using generator-angular 0.11.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/**/*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/**/*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/scripts/**/*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/**/*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/**/*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        exclude: ['bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js'],
        ignorePath:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: './bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          sourcemap: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/**/*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images',
          '<%= yeoman.dist %>/styles'
        ]
      }
    },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['scripts/**/*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'scripts/**/*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: '.',
          src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
          dest: '<%= yeoman.dist %>'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'wiredep',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    // STILL matches angular 1.3.x to 1.4beta
    //'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>Copy font-awesome font files to dist<commit_after>// Generated on 2015-05-07 using generator-angular 0.11.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/**/*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/**/*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/scripts/**/*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/**/*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/**/*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        exclude: ['bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js'],
        ignorePath:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: './bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          sourcemap: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/**/*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images',
          '<%= yeoman.dist %>/styles'
        ]
      }
    },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['scripts/**/*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'scripts/**/*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: '.',
          src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
          dest: '<%= yeoman.dist %>'
        }, {
          expand: true,
          cwd: 'bower_components/font-awesome/fonts',
          src: '*',
          dest: '<%= yeoman.dist %>/fonts'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'wiredep',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    // STILL matches angular 1.3.x to 1.4beta
    //'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<|endoftext|>


<commit_before>'use strict';

const _ = require('lodash');
const fountain = require('fountain-generator');
const conf = require('./conf');
const transforms = require('./transforms');

module.exports = fountain.Base.extend({
  prompting() {
    this.options.modules = 'systemjs';
    this.fountainPrompting();
  },

  configuring: {
    pkg() {
      this.updateJson('package.json', packageJson => {
        packageJson.jspm = {
          dependencies: packageJson.dependencies
        };
        _.forEach(packageJson.jspm.dependencies, (version, name) => {
          packageJson.jspm.dependencies[name] = `npm:${name}@${version}`;
        });
        delete packageJson.dependencies;

        const moveDevDepsToJspm = dep => {
          packageJson.jspm.devDependencies = {
            [dep]: `npm:${dep}@${packageJson.devDependencies[dep]}`
          };
          delete packageJson.devDependencies[dep];
        };

        if (this.props.framework === 'angular1') {
          moveDevDepsToJspm('angular-mocks');
        }
        if (this.props.framework === 'react' && this.props.js === 'typescript') {
          moveDevDepsToJspm('react-addons-test-utils');
        }
        packageJson.jspm.devDependencies = {};
        if (this.props.js === 'typescript') {
          packageJson.jspm.dependencies.typescript = 'npm:typescript@^1.8.7';
        }

        return packageJson;
      });

      this.mergeJson('package.json', {
        devDependencies: {
          'jspm': '^0.17.0-beta.9',
          'systemjs-builder': '^0.14.15',
          'gulp-replace': '^0.5.4'
        }
      });
    },

    configjs() {
      this.copyTemplate('jspm.config.js', 'jspm.config.js', {
        systemConf: conf(this.props)
      });
    }
  },

  writing: {
    transforms,

    gulp() {
      let entry = `conf.path.src('index')`;
      if (this.props.framework === 'angular1') {
        entry = `\`\${${entry}} + \${conf.path.tmp('templateCacheHtml')}\``;
      }
      this.copyTemplate('gulp_tasks', 'gulp_tasks', { entry });
    },

    indexHtml() {
      this.replaceInFileWithTemplate(
        'src/index-head.html',
        'src/index.html',
        /<\/head>/
      );
      this.replaceInFileWithTemplate(
        'src/index-footer.html',
        'src/index.html',
        /<\/html>/
      );
    }
  },

  installing() {
    this.runInstall('jspm');
  }
});
<commit_msg>Run 'jspm install --yes' so that prompt doesn't ask for update confirmation<commit_after>'use strict';

const _ = require('lodash');
const fountain = require('fountain-generator');
const conf = require('./conf');
const transforms = require('./transforms');

module.exports = fountain.Base.extend({
  prompting() {
    this.options.modules = 'systemjs';
    this.fountainPrompting();
  },

  configuring: {
    pkg() {
      this.updateJson('package.json', packageJson => {
        packageJson.jspm = {
          dependencies: packageJson.dependencies
        };
        _.forEach(packageJson.jspm.dependencies, (version, name) => {
          packageJson.jspm.dependencies[name] = `npm:${name}@${version}`;
        });
        delete packageJson.dependencies;

        const moveDevDepsToJspm = dep => {
          packageJson.jspm.devDependencies = {
            [dep]: `npm:${dep}@${packageJson.devDependencies[dep]}`
          };
          delete packageJson.devDependencies[dep];
        };

        if (this.props.framework === 'angular1') {
          moveDevDepsToJspm('angular-mocks');
        }
        if (this.props.framework === 'react' && this.props.js === 'typescript') {
          moveDevDepsToJspm('react-addons-test-utils');
        }
        packageJson.jspm.devDependencies = {};
        if (this.props.js === 'typescript') {
          packageJson.jspm.dependencies.typescript = 'npm:typescript@^1.8.7';
        }

        return packageJson;
      });

      this.mergeJson('package.json', {
        devDependencies: {
          'jspm': '^0.17.0-beta.9',
          'systemjs-builder': '^0.14.15',
          'gulp-replace': '^0.5.4'
        }
      });
    },

    configjs() {
      this.copyTemplate('jspm.config.js', 'jspm.config.js', {
        systemConf: conf(this.props)
      });
    }
  },

  writing: {
    transforms,

    gulp() {
      let entry = `conf.path.src('index')`;
      if (this.props.framework === 'angular1') {
        entry = `\`\${${entry}} + \${conf.path.tmp('templateCacheHtml')}\``;
      }
      this.copyTemplate('gulp_tasks', 'gulp_tasks', { entry });
    },

    indexHtml() {
      this.replaceInFileWithTemplate(
        'src/index-head.html',
        'src/index.html',
        /<\/head>/
      );
      this.replaceInFileWithTemplate(
        'src/index-footer.html',
        'src/index.html',
        /<\/html>/
      );
    }
  },

  installing() {
    this.runInstall('jspm', '', { yes: true });
  }
});
<|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']);
<commit_msg>Initial commit<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']);
<|endoftext|>


<commit_before>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();

    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('Angular 2 Library') + ' generator!'
    ));

    var prompts = [{
      type: 'confirm',
      name: 'someOption',
      message: 'Would you like to enable this option?',
      default: true
    }];

    this.prompt(prompts, function (props) {
      this.props = props;
      // To access props later use this.props.someOption;

      done();
    }.bind(this));
  },

  writing: function () {
    this.fs.copy(
      this.templatePath('dummyfile.txt'),
      this.destinationPath('dummyfile.txt')
    );
  },

  install: function () {
    this.installDependencies();
  }
});
<commit_msg>feat(generator): add generator logic<commit_after>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();

    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('Angular 2 Library') + ' generator!'
    ));

    var prompts = [
      {
        type: 'input',
        name: 'authorName',
        message: 'Your full name:',
        validate: function (input) {
          if (/.+/.test(input)) {
            return true;
          }
          return 'Please enter your full name';
        },
        default: this.user.git.name
      },
      {
        type: 'input',
        name: 'authorEmail',
        message: 'Your email address:',
        validate: function (input) {
          if (/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(input)) {
            return true;
          }
          return 'Please enter a valid email address';
        },
        default: this.user.git.email
      },
      {
        type: 'input',
        name: 'libraryName',
        message: 'Your library name (kebab case)',
        default: 'angular2-library',
        store: true
      },
      {
        type: 'input',
        name: 'gitRepositoryUrl',
        message: 'Git repository url',
        default: 'https://github.com/username/repo',
        store: true
      }
    ];

    this.prompt(prompts, function (props) {

      this.props = {

        author: {
          name: props.authorName,
          email: props.authorEmail
        },

        libraryName: {
          original: props.libraryName,
          kebabCase: props.libraryName
        },

        gitRepositoryUrl: props.gitRepositoryUrl
      };

      done();
    }.bind(this));

  },

  writing: {

    copyGitIgnore: function copyGitIgnore() {
      this.fs.copy(
        this.templatePath('gitignore'),
        this.destinationPath('.gitignore')
      );
    },

    copyNpmIgnore: function copyNpmIgnore() {
      this.fs.copy(
        this.templatePath('npmignore'),
        this.destinationPath('.npmignore')
      );
    },

    copyTravisYml: function copyTravisYml() {
      this.fs.copy(
        this.templatePath('travis.yml'),
        this.destinationPath('.travis.yml')
      );
    },

    copySrc: function copySrc() {
      this.fs.copy(
        this.templatePath('src/**/*'),
        this.destinationPath('src')
      );
    },

    copyTypeScriptConfig: function copyTypeScriptConfig() {
      this.fs.copyTpl(
        this.templatePath('_tsconfig.json'),
        this.destinationPath('tsconfig.json'),
        {
          props: this.props
        }
      );
    },

    copyPackageJson: function copyPackageJson() {
      this.fs.copyTpl(
        this.templatePath('_package.json'),
        this.destinationPath('package.json'),
        {
          props: this.props
        }
      );
    },

    copyMain: function copyMain() {
      this.fs.copy(
        this.templatePath('main.ts'),
        this.destinationPath(this.props.libraryName.kebabCase + '.ts')
      );
    }
  },

  install: function () {
    this.installDependencies({bower: false});
  }
});
<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		clean: {
			build: ["dist"]
		},

		copy: {
			bower: {
				files: [
					{expand: true, flatten: true, src: ['components/jquery/jquery.js'], dest: 'temp/'},
					{expand: true, flatten: true, src: ['components/handlebars/handlebars.runtime.js'], dest: 'temp/'}
				]
			}
		},

		coffee: {
			app: {
				options: {
					bare: true,
					sourceMap: true
				},
				expand: true,
				cwd: 'src',
				src: ['**/*.coffee'],
				dest: 'temp/',
				ext: '.js'
			}
		},

		stylus: {
			compile: {
				options: {
					use: [
						//require('fluidity') // use stylus plugin at compile time
					],
				},
				files: {
					'dist/opensong.css': ['src/opensong.styl'],
					'dist/opensong.demo.css': ['src/opensong.styl', 'src/demo.styl']
				}
			}
		},

		handlebars: {
			compile: {
				options: {
					namespace: "JST"
				},
				files: {
					"temp/opensong.hbs.js": "src/opensong.hbs"
				}
			}
		},

		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
			},
			build: {
				files: {
					'dist/opensong.min.js': ['temp/*.js']
				}
			}
		},

		connect: {
			server: {
				options: {
					port: 9001
				}
			}
		},

		watch: {
			coffee: {
				files: ['src/**/*.coffee', 'spec/**/*.coffee'],
				tasks: ['coffee', 'uglify']
			},
			livereload: {
				files: ['index.html', 'dist/**'],
				options: {
					livereload: true
				}
			}
		}

	});

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-handlebars');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask('compile', ['coffee', 'stylus', 'handlebars']);
	grunt.registerTask('build', ['clean', 'copy', 'compile', 'uglify']);
	grunt.registerTask('dev', ['build', 'connect', 'watch']);

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

};

<commit_msg>auto compile stylus upon change<commit_after>/*global module:false*/
module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		clean: {
			build: ["dist"]
		},

		copy: {
			bower: {
				files: [
					{expand: true, flatten: true, src: ['components/jquery/jquery.js'], dest: 'temp/'},
					{expand: true, flatten: true, src: ['components/handlebars/handlebars.runtime.js'], dest: 'temp/'}
				]
			}
		},

		coffee: {
			app: {
				options: {
					bare: true,
					sourceMap: true
				},
				expand: true,
				cwd: 'src',
				src: ['**/*.coffee'],
				dest: 'temp/',
				ext: '.js'
			}
		},

		stylus: {
			compile: {
				options: {
					use: [
						//require('fluidity') // use stylus plugin at compile time
					],
				},
				files: {
					'dist/opensong.css': ['src/opensong.styl'],
					'dist/opensong.demo.css': ['src/opensong.styl', 'src/demo.styl']
				}
			}
		},

		handlebars: {
			compile: {
				options: {
					namespace: "JST"
				},
				files: {
					"temp/opensong.hbs.js": "src/opensong.hbs"
				}
			}
		},

		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
			},
			build: {
				files: {
					'dist/opensong.min.js': ['temp/*.js']
				}
			}
		},

		connect: {
			server: {
				options: {
					port: 9001
				}
			}
		},

		watch: {
			coffee: {
				files: ['src/**/*.coffee', 'spec/**/*.coffee'],
				tasks: ['coffee', 'uglify']
			},
			stylus: {
				files: ['src/**/*.styl'],
				tasks: ['stylus']
			},
			livereload: {
				files: ['index.html', 'dist/**'],
				options: {
					livereload: true
				}
			}
		}

	});

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-handlebars');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask('compile', ['coffee', 'stylus', 'handlebars']);
	grunt.registerTask('build', ['clean', 'copy', 'compile', 'uglify']);
	grunt.registerTask('dev', ['build', 'connect', 'watch']);

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

};

<|endoftext|>


<commit_before>'use strict'
var yeoman = require('yeoman-generator')
var chalk = require('chalk')
var yosay = require('yosay')
var path = require('path')

module.exports = yeoman.Base.extend({
  initializing: function () {
    this.argument('name', { type: String, required: false })
    this.appName = this.name || path.basename(process.cwd()) || 'kyper-react-starter'
    this.appPath = this.env.options.appPath
    this.version = '0.0.1'
  },
  prompting: function () {
    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('React Firebase') + ' generator!'
    ))

    var prompts = [
      {
        type: 'input',
        name: 'githubUser',
        message: 'Github Username',
        default: 'testuser'
      },
      {
        name: 'firebaseName',
        message: 'Firebase instance (https://' + chalk.red('<your instance>') + '.firebaseio.com)',
        required: true,
        default: 'testing',
        validate: function (input) {
          if (!input) return false
          if (input.match('http') || input.match('firebaseio.com')) return chalk.red('Just include the Firebase name, not the entire URL')
          if (!input.match(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/)) {
            return chalk.red('Your Firebase name may only contain [a-z], [0-9], and hyphen (-). ' +
              'It may not start or end with a hyphen.')
          }
          return true
        }
      },
      {
        type: 'confirm',
        name: 'includeTravis',
        message: 'Would to include config for Travis CI?',
        default: true
      },
      {
        type: 'confirm',
        name: 'includeRedux',
        message: 'Would to include redux for local state-management?',
        default: false
      },
      {
        type: 'list',
        name: 'deployTo',
        choices: [
          {
            name: 'Firebase',
            value: 'firebase'
          },
          {
            name: 'AWS S3',
            value: 's3'
          },
          {
            name: 'Heroku',
            value: 'heroku'
          }
        ],
        message: 'What service are you deploying to?',
        default: [1]
      }
    ]

    return this.prompt(prompts).then(function (props) {
      this.answers = props
      this.githubUser = this.answers.githubUser
      this.firebaseName = this.answers.firebaseName
      this.deployTo = this.answers.deployTo
      this.includeRedux = this.answers.includeRedux
      // To access prompt answers later use this.answers.someOption
    }.bind(this))
  },

  writing: function () {
    let filesArray = [
      { src: '_index.html', dest: 'index.html' },
      { src: 'app/config.js', dest: 'app/config.js' },
      { src: 'app/index.js', dest: 'app/index.js' },
      { src: 'app/theme.js', dest: 'app/theme.js' },
      { src: 'app/routes.js', dest: 'app/routes.js' },
      { src: 'app/utils/**', dest: 'app/utils' },
      { src: 'app/variables.scss', dest: 'app/variables.scss' },
      { src: 'app/components/**', dest: 'app/components' },
      { src: 'app/containers/**', dest: 'app/containers' },
      { src: 'assets/**', dest: 'assets' },
      { src: 'bin/**', dest: 'bin' },
      { src: 'lib/**', dest: 'lib' },
      { src: '_README.md', dest: 'README.md' },
      { src: 'webpack-dev.config.js' },
      { src: 'webpack-production.config.js' },
      { src: 'webpack-server-production.config.js' },
      { src: 'gitignore', dest: '.gitignore' }
    ]
    if (this.answers.includeTravis) filesArray.push({ src: '_travis.yml', dest: '.travis.yml' })
    if (this.deployTo === 'heroku') filesArray.push({ src: 'Procfile', dest: 'Procfile' })
    // if (this.answers.serverSideRendering) filesArray.push({ src: 'app/client.js', dest: 'app/client.js' }) // TODO: Make server side rendering work
    if (this.includeRedux) {
      filesArray.concat([
        { src: 'app/actions/**', dest: 'app/actions' },
        { src: 'app/store/**', dest: 'app/store' },
        { src: 'app/reducers/**', dest: 'app/reducers' },
        { src: '_redux-package.json', dest: 'package.json' },
        { src: 'redux-babelrc', dest: '.babelrc' }
      ])
    } else {
      // Handle files that do not do internal string templateing well
      filesArray.concat([
        { src: '_package.json', dest: 'package.json' },
        { src: 'babelrc', dest: '.babelrc' }
      ])
    }
    this.copyFiles(filesArray)
  },

  install: function () {
    this.npmInstall()
  },

  copyFiles: function (filesArray) {
    if (!filesArray) return // Skip initializing call
    filesArray.forEach(file =>
      this.template(file.src || file, file.dest || file.src || file, this.templateContext)
    )
  }
})
<commit_msg>use filesArray.push() to include package.json (#7)<commit_after>'use strict'
var yeoman = require('yeoman-generator')
var chalk = require('chalk')
var yosay = require('yosay')
var path = require('path')

module.exports = yeoman.Base.extend({
  initializing: function () {
    this.argument('name', { type: String, required: false })
    this.appName = this.name || path.basename(process.cwd()) || 'kyper-react-starter'
    this.appPath = this.env.options.appPath
    this.version = '0.0.1'
  },
  prompting: function () {
    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('React Firebase') + ' generator!'
    ))

    var prompts = [
      {
        type: 'input',
        name: 'githubUser',
        message: 'Github Username',
        default: 'testuser'
      },
      {
        name: 'firebaseName',
        message: 'Firebase instance (https://' + chalk.red('<your instance>') + '.firebaseio.com)',
        required: true,
        default: 'testing',
        validate: function (input) {
          if (!input) return false
          if (input.match('http') || input.match('firebaseio.com')) return chalk.red('Just include the Firebase name, not the entire URL')
          if (!input.match(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/)) {
            return chalk.red('Your Firebase name may only contain [a-z], [0-9], and hyphen (-). ' +
              'It may not start or end with a hyphen.')
          }
          return true
        }
      },
      {
        type: 'confirm',
        name: 'includeTravis',
        message: 'Would to include config for Travis CI?',
        default: true
      },
      {
        type: 'confirm',
        name: 'includeRedux',
        message: 'Would to include redux for local state-management?',
        default: false
      },
      {
        type: 'list',
        name: 'deployTo',
        choices: [
          {
            name: 'Firebase',
            value: 'firebase'
          },
          {
            name: 'AWS S3',
            value: 's3'
          },
          {
            name: 'Heroku',
            value: 'heroku'
          }
        ],
        message: 'What service are you deploying to?',
        default: [1]
      }
    ]

    return this.prompt(prompts).then(function (props) {
      this.answers = props
      this.githubUser = this.answers.githubUser
      this.firebaseName = this.answers.firebaseName
      this.deployTo = this.answers.deployTo
      this.includeRedux = this.answers.includeRedux
      // To access prompt answers later use this.answers.someOption
    }.bind(this))
  },

  writing: function () {
    let filesArray = [
      { src: '_index.html', dest: 'index.html' },
      { src: 'app/config.js', dest: 'app/config.js' },
      { src: 'app/index.js', dest: 'app/index.js' },
      { src: 'app/theme.js', dest: 'app/theme.js' },
      { src: 'app/routes.js', dest: 'app/routes.js' },
      { src: 'app/utils/**', dest: 'app/utils' },
      { src: 'app/variables.scss', dest: 'app/variables.scss' },
      { src: 'app/components/**', dest: 'app/components' },
      { src: 'app/containers/**', dest: 'app/containers' },
      { src: 'assets/**', dest: 'assets' },
      { src: 'bin/**', dest: 'bin' },
      { src: 'lib/**', dest: 'lib' },
      { src: '_README.md', dest: 'README.md' },
      { src: 'webpack-dev.config.js' },
      { src: 'webpack-production.config.js' },
      { src: 'webpack-server-production.config.js' },
      { src: 'gitignore', dest: '.gitignore' }
    ]
    if (this.answers.includeTravis) filesArray.push({ src: '_travis.yml', dest: '.travis.yml' })
    if (this.deployTo === 'heroku') filesArray.push({ src: 'Procfile', dest: 'Procfile' })
    // if (this.answers.serverSideRendering) filesArray.push({ src: 'app/client.js', dest: 'app/client.js' }) // TODO: Make server side rendering work
    if (this.includeRedux) {
      filesArray.push(
        { src: 'app/actions/**', dest: 'app/actions' },
        { src: 'app/store/**', dest: 'app/store' },
        { src: 'app/reducers/**', dest: 'app/reducers' },
        { src: '_redux-package.json', dest: 'package.json' },
        { src: 'redux-babelrc', dest: '.babelrc' }
      )
    } else {
      // Handle files that do not do internal string templateing well
      filesArray.push(
        { src: '_package.json', dest: 'package.json' },
        { src: 'babelrc', dest: '.babelrc' }
      )
    }
    this.copyFiles(filesArray)
  },

  install: function () {
    this.npmInstall()
  },

  copyFiles: function (filesArray) {
    if (!filesArray) return // Skip initializing call
    filesArray.forEach(file =>
      this.template(file.src || file, file.dest || file.src || file, this.templateContext)
    )
  }
})
<|endoftext|>


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

	"use strict";

	// Project configuration.
	grunt.initConfig({
		qunit: {
			files: ["test/index.html"]
		},
		uglify: {
			all: {
				files: {
					"dist/sizzle.min.js": ["sizzle.js"]
				},
				options: {
					sourceMap: "dist/sizzle.min.map"
				},
				beautify: {
					ascii_only: true
				}
			}
		},
		compare_size: {
			files: [ "sizzle.js", "dist/sizzle.min.js" ]
		},
		jshint: {
			source: {
				src: ["sizzle.js"],
				options: {
					jshintrc: ".jshintrc"
				}
			},
			grunt: {
				src: ["Gruntfile.js"],
				options: {
					jshintrc: ".jshintrc"
				}
			},
			speed: {
				src: ["speed/speed.js"],
				options: {
					jshintrc: "speed/.jshintrc"
				}
			},
			tests: {
				src: ["test/unit/*.js"],
				options: {
					jshintrc: "test/.jshintrc"
				}
			}
		},
		watch: {
			files: [
				"<%= jshint.source.src %>",
				"<%= jshint.grunt.src %>",
				"<%= jshint.speed.src %>",
				"<%= jshint.tests.src %>"
			],
			tasks: "default"
		}
	});

	// Load grunt tasks from NPM packages
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-qunit");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-compare-size");
	grunt.loadNpmTasks("grunt-git-authors");

	// Default task.
	grunt.registerTask( "default", [ "jshint", "uglify", "qunit", "compare_size" ] );
};
<commit_msg>Alias abandoned "lint" task to "jshint"<commit_after>module.exports = function( grunt ) {

	"use strict";

	// Project configuration.
	grunt.initConfig({
		qunit: {
			files: ["test/index.html"]
		},
		uglify: {
			all: {
				files: {
					"dist/sizzle.min.js": ["sizzle.js"]
				},
				options: {
					sourceMap: "dist/sizzle.min.map"
				},
				beautify: {
					ascii_only: true
				}
			}
		},
		compare_size: {
			files: [ "sizzle.js", "dist/sizzle.min.js" ]
		},
		jshint: {
			source: {
				src: ["sizzle.js"],
				options: {
					jshintrc: ".jshintrc"
				}
			},
			grunt: {
				src: ["Gruntfile.js"],
				options: {
					jshintrc: ".jshintrc"
				}
			},
			speed: {
				src: ["speed/speed.js"],
				options: {
					jshintrc: "speed/.jshintrc"
				}
			},
			tests: {
				src: ["test/unit/*.js"],
				options: {
					jshintrc: "test/.jshintrc"
				}
			}
		},
		watch: {
			files: [
				"<%= jshint.source.src %>",
				"<%= jshint.grunt.src %>",
				"<%= jshint.speed.src %>",
				"<%= jshint.tests.src %>"
			],
			tasks: "default"
		}
	});

	// Load grunt tasks from NPM packages
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-qunit");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-compare-size");
	grunt.loadNpmTasks("grunt-git-authors");

	// Default task
	grunt.registerTask( "default", [ "jshint", "uglify", "qunit", "compare_size" ] );

	// Task aliases
	grunt.registerTask( "lint", ["jshint"] );
};
<|endoftext|>


<commit_before>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var _ = require('lodash');
var _s = require('underscore.string');
var inquirer = require('inquirer');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();
    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('Angular') + ' generator!'
    ));
    var prompts = [{
      name: 'type',
      message: 'Which type of project would you like to create?',
      type: 'list',
      choices: ['Empty', 'Sample Data', { name: 'Security - Disabled Currently', disabled: true }]
    }];

    inquirer.prompt(prompts, function(props) {
      // this.appName = _s.slugify(props.appName) || 'coder-camps-js';
      // this.appDesc = props.appDesc || 'A MEAN stack application.';
      this.type = props.type;
      done();
    }.bind(this));
  },
  projectfiles: function() {
    // this.template('package.json', 'package.json');
    // this.template('bower.json', 'bower.json');
    // this.template('./views/index.html', './views/index.html');
    // this.template('typings.json', 'typings.json');

    let files = [
      './.vs/config/applicationhost.config',
      './.vs/Generator-CoderCamps-NET/v14/.suo',

      './global.json',
      './Generator-CoderCamps-NET.sln',

      './src/Generator-CoderCamps-NET/.bowerrc',
      './src/Generator-CoderCamps-NET/appsettings.json',
      './src/Generator-CoderCamps-NET/bower.json',
      './src/Generator-CoderCamps-NET/Generator-CoderCamps-NET.xproj',
      './src/Generator-CoderCamps-NET/Generator-CoderCamps-NET.xproj.user',
      './src/Generator-CoderCamps-NET/gulpfile.js',
      './src/Generator-CoderCamps-NET/package.json',
      './src/Generator-CoderCamps-NET/Project_Readme.html',
      './src/Generator-CoderCamps-NET/project.json',
      './src/Generator-CoderCamps-NET/project.lock.json',
      './src/Generator-CoderCamps-NET/Startup.cs',
      './src/Generator-CoderCamps-NET/tsconfig.json',
      './src/Generator-CoderCamps-NET/typings.json',

      './src/Generator-CoderCamps-NET/Controllers/HomeController.cs',
      // Migrations
      './src/Generator-CoderCamps-NET/Migrations/00000000000000_CreateIdentitySchema.cs',
      './src/Generator-CoderCamps-NET/Migrations/00000000000000_CreateIdentitySchema.Designer.cs',
      './src/Generator-CoderCamps-NET/Migrations/ApplicationDbContextModelSnapshot.cs',
      // Models
      './src/Generator-CoderCamps-NET/Models/ApplicationDbContext.cs',
      './src/Generator-CoderCamps-NET/Models/ApplicationUser.cs',
      // Properties
      './src/Generator-CoderCamps-NET/Properties/launchSettings.json',
      // Services
      './src/Generator-CoderCamps-NET/Services/IEmailSender.cs',
      './src/Generator-CoderCamps-NET/Services/ISmsSender.cs',
      './src/Generator-CoderCamps-NET/Services/MessageServices.cs',
      // View Models -- Account
      './src/Generator-CoderCamps-NET/ViewModels/Account/ExternalLoginConfirmationViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/ForgotPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/LoginViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/RegisterViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/ResetPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/SendCodeViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/VerifyCodeViewModel.cs',
      // View Models -- Manage
      './src/Generator-CoderCamps-NET/ViewModels/Manage/AddPhoneNumberViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ChangePasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ConfigureTwoFactorViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/FactorViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/IndexViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ManageLoginsViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/RemoveLoginViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/SetPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/VerifyPhoneNumberViewModel.cs',
      // Views
      './src/Generator-CoderCamps-NET/Views/Home/Index.cshtml',
      // wwwroot
      './src/Generator-CoderCamps-NET/wwwroot/_references.js',
      './src/Generator-CoderCamps-NET/wwwroot/favicon.ico',
      './src/Generator-CoderCamps-NET/wwwroot/web.config',
      // wwwroot -- css
      './src/Generator-CoderCamps-NET/wwwroot/css/site.css',
      './src/Generator-CoderCamps-NET/wwwroot/css/site.min.css',
      // wwwroot -- images
      './src/Generator-CoderCamps-NET/wwwroot/images/ASP-NET-Banners-01.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/ASP-NET-Banners-02.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/Banner-01-Azure.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/Banner-02-VS.png',
      // wwwroot -- js
      './src/Generator-CoderCamps-NET/wwwroot/js/site.js',
      './src/Generator-CoderCamps-NET/wwwroot/js/site.min.js',
      // wwwroot -- ngApp
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/about.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/app.ts',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/controllers.ts',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/home.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/notFound.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/services.ts',
    ];

    for (let file of files) {
      this.fs.copyTpl(
        this.templatePath(file),
        this.destinationPath(file)
      );
    }
  },
  install: function() {
    // this.installDependencies();
    process.chdir(process.cwd() + '/src/Generator-CoderCamps-NET');
    // this.spawnCommandSync('npm', ['--prefix', './src/Generator-CoderCamps-NET', 'install', './src/Generator-CoderCamps-NET']);
    // this.spawnCommandSync('bower', ['install', '--config.cwd=./src/Generator-CoderCamps-NET']);
    this.installDependencies();
    this.spawnCommandSync('typings', ['install']);
  }
});
<commit_msg>removed npm and bower install<commit_after>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var _ = require('lodash');
var _s = require('underscore.string');
var inquirer = require('inquirer');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();
    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the ' + chalk.red('Angular') + ' generator!'
    ));
    var prompts = [{
      name: 'type',
      message: 'Which type of project would you like to create?',
      type: 'list',
      choices: ['Empty', 'Sample Data', { name: 'Security - Disabled Currently', disabled: true }]
    }];

    inquirer.prompt(prompts, function(props) {
      // this.appName = _s.slugify(props.appName) || 'coder-camps-js';
      // this.appDesc = props.appDesc || 'A MEAN stack application.';
      this.type = props.type;
      done();
    }.bind(this));
  },
  projectfiles: function() {
    // this.template('package.json', 'package.json');
    // this.template('bower.json', 'bower.json');
    // this.template('./views/index.html', './views/index.html');
    // this.template('typings.json', 'typings.json');

    let files = [
      './.vs/config/applicationhost.config',
      './.vs/Generator-CoderCamps-NET/v14/.suo',

      './global.json',
      './Generator-CoderCamps-NET.sln',

      './src/Generator-CoderCamps-NET/.bowerrc',
      './src/Generator-CoderCamps-NET/appsettings.json',
      './src/Generator-CoderCamps-NET/bower.json',
      './src/Generator-CoderCamps-NET/Generator-CoderCamps-NET.xproj',
      './src/Generator-CoderCamps-NET/Generator-CoderCamps-NET.xproj.user',
      './src/Generator-CoderCamps-NET/gulpfile.js',
      './src/Generator-CoderCamps-NET/package.json',
      './src/Generator-CoderCamps-NET/Project_Readme.html',
      './src/Generator-CoderCamps-NET/project.json',
      './src/Generator-CoderCamps-NET/project.lock.json',
      './src/Generator-CoderCamps-NET/Startup.cs',
      './src/Generator-CoderCamps-NET/tsconfig.json',
      './src/Generator-CoderCamps-NET/typings.json',

      './src/Generator-CoderCamps-NET/Controllers/HomeController.cs',
      // Migrations
      './src/Generator-CoderCamps-NET/Migrations/00000000000000_CreateIdentitySchema.cs',
      './src/Generator-CoderCamps-NET/Migrations/00000000000000_CreateIdentitySchema.Designer.cs',
      './src/Generator-CoderCamps-NET/Migrations/ApplicationDbContextModelSnapshot.cs',
      // Models
      './src/Generator-CoderCamps-NET/Models/ApplicationDbContext.cs',
      './src/Generator-CoderCamps-NET/Models/ApplicationUser.cs',
      // Properties
      './src/Generator-CoderCamps-NET/Properties/launchSettings.json',
      // Services
      './src/Generator-CoderCamps-NET/Services/IEmailSender.cs',
      './src/Generator-CoderCamps-NET/Services/ISmsSender.cs',
      './src/Generator-CoderCamps-NET/Services/MessageServices.cs',
      // View Models -- Account
      './src/Generator-CoderCamps-NET/ViewModels/Account/ExternalLoginConfirmationViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/ForgotPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/LoginViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/RegisterViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/ResetPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/SendCodeViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Account/VerifyCodeViewModel.cs',
      // View Models -- Manage
      './src/Generator-CoderCamps-NET/ViewModels/Manage/AddPhoneNumberViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ChangePasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ConfigureTwoFactorViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/FactorViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/IndexViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/ManageLoginsViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/RemoveLoginViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/SetPasswordViewModel.cs',
      './src/Generator-CoderCamps-NET/ViewModels/Manage/VerifyPhoneNumberViewModel.cs',
      // Views
      './src/Generator-CoderCamps-NET/Views/Home/Index.cshtml',
      // wwwroot
      './src/Generator-CoderCamps-NET/wwwroot/_references.js',
      './src/Generator-CoderCamps-NET/wwwroot/favicon.ico',
      './src/Generator-CoderCamps-NET/wwwroot/web.config',
      // wwwroot -- css
      './src/Generator-CoderCamps-NET/wwwroot/css/site.css',
      './src/Generator-CoderCamps-NET/wwwroot/css/site.min.css',
      // wwwroot -- images
      './src/Generator-CoderCamps-NET/wwwroot/images/ASP-NET-Banners-01.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/ASP-NET-Banners-02.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/Banner-01-Azure.png',
      './src/Generator-CoderCamps-NET/wwwroot/images/Banner-02-VS.png',
      // wwwroot -- js
      './src/Generator-CoderCamps-NET/wwwroot/js/site.js',
      './src/Generator-CoderCamps-NET/wwwroot/js/site.min.js',
      // wwwroot -- ngApp
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/about.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/app.ts',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/controllers.ts',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/home.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/notFound.html',
      './src/Generator-CoderCamps-NET/wwwroot/ngApp/services.ts',
    ];

    for (let file of files) {
      this.fs.copyTpl(
        this.templatePath(file),
        this.destinationPath(file)
      );
    }
  },
  install: function() {
    process.chdir(process.cwd() + '/src/Generator-CoderCamps-NET');
    // this.installDependencies();
    this.spawnCommandSync('typings', ['install']);
  }
});
<|endoftext|>