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

  var path = require('path');

  function paths() {
    return require('./patternlab-config.json').paths;
  }

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        stripBanners: true,
        banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n'
      },
      patternlab: {
        src: './core/lib/patternlab.js',
        dest: './core/lib/patternlab.js'
      },
      object_factory: {
        src: './core/lib/object_factory.js',
        dest: './core/lib/object_factory.js'
      },
      lineage: {
        src: './core/lib/lineage_hunter.js',
        dest: './core/lib/lineage_hunter.js'
      },
      media_hunter: {
        src: './core/lib/media_hunter.js',
        dest: './core/lib/media_hunter.js'
      },
      patternlab_grunt: {
        src: './core/lib/patternlab_grunt.js',
        dest: './core/lib/patternlab_grunt.js'
      },
      patternlab_gulp: {
        src: './core/lib/patternlab_gulp.js',
        dest: './core/lib/patternlab_gulp.js'
      },
      parameter_hunter: {
        src: './core/lib/parameter_hunter.js',
        dest: './core/lib/parameter_hunter.js'
      },
      pattern_exporter: {
        src: './core/lib/pattern_exporter.js',
        dest: './core/lib/pattern_exporter.js'
      },
      pattern_assembler: {
        src: './core/lib/pattern_assembler.js',
        dest: './core/lib/pattern_assembler.js'
      },
      pseudopattern_hunter: {
        src: './core/lib/pseudopattern_hunter.js',
        dest: './core/lib/pseudopattern_hunter.js'
      },
      list_item_hunter: {
        src: './core/lib/list_item_hunter.js',
        dest: './core/lib/list_item_hunter.js'
      },
      style_modifier_hunter: {
        src: './core/lib/style_modifier_hunter.js',
        dest: './core/lib/style_modifier_hunter.js'
      }
    },
    copy: {
      main: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.js),
          src: '*.js',
          dest: path.resolve(paths().public.js)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.css),
          src: '*.css',
          dest: path.resolve(paths().public.css)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.images),
          src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'],
          dest: path.resolve(paths().public.images)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.fonts),
          src: '*',
          dest: path.resolve(paths().public.fonts)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.data),
          src: 'annotations.js',
          dest: path.resolve(paths().public.data)
        }]
      },
      styleguide: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.styleguide),
          src: ['*.*', '**/*.*'],
          dest: path.resolve(paths().public.styleguide)
        }]
      }
    },
    watch: {
      all: {
        files: [
          path.resolve(paths().source.css + '**/*.scss'),
          path.resolve(paths().source.styleguide + 'css/*.css'),
          path.resolve(paths().source.patterns + '**/*.mustache'),
          path.resolve(paths().source.patterns + '**/*.json'),
          path.resolve(paths().source.fonts + '/*'),
          path.resolve(paths().source.images + '/*'),
          path.resolve(paths().source.data + '*.json'),
          path.resolve(paths().source.js + '/*.js')
        ],
        tasks: ['default', 'bsReload:css']
      }
    },
    nodeunit: {
      all: ['test/*_tests.js']
    },
    browserSync: {
      dev: {
        options: {
          server: path.resolve(paths().public.root),
          watchTask: true,
          watchOptions: {
            ignoreInitial: true,
            ignored: '*.html'
          },
          snippetOptions: {
            // Ignore all HTML files within the templates folder
            blacklist: ['/index.html', '/', '/?*']
          },
          plugins: [{
            module: 'bs-html-injector',
            options: {
              files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
            }
          }],
          notify: {
            styles: [
              'display: none',
              'padding: 15px',
              'font-family: sans-serif',
              'position: fixed',
              'font-size: 1em',
              'z-index: 9999',
              'bottom: 0px',
              'right: 0px',
              'border-top-left-radius: 5px',
              'background-color: #1B2032',
              'opacity: 0.4',
              'margin: 0',
              'color: white',
              'text-align: center'
            ]
          }
        }
      }
    },
    eslint: {
      options: {
        configFile: './.eslintrc'
      },
      target: ['./core/lib/*']
    },
    bsReload: {
      css: path.resolve(paths().public.root + '**/*.css')
    },
    sass: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          'source/css/style.css': 'source/css/style.scss'
        }
      }
    }
  });

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  //load the patternlab task
  grunt.task.loadTasks('./core/lib/');

  grunt.registerTask('default', ['patternlab', 'sass', 'copy:main', 'copy:styleguide']);

  // travis CI task
  grunt.registerTask('travis', ['nodeunit', 'eslint', 'patternlab']);

  grunt.registerTask('serve', ['patternlab', 'sass', 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);

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

};<commit_msg>add task to copy styles to wordpress<commit_after>module.exports = function(grunt) {

  var path = require('path');

  function paths() {
    return require('./patternlab-config.json').paths;
  }

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        stripBanners: true,
        banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n'
      },
      patternlab: {
        src: './core/lib/patternlab.js',
        dest: './core/lib/patternlab.js'
      },
      object_factory: {
        src: './core/lib/object_factory.js',
        dest: './core/lib/object_factory.js'
      },
      lineage: {
        src: './core/lib/lineage_hunter.js',
        dest: './core/lib/lineage_hunter.js'
      },
      media_hunter: {
        src: './core/lib/media_hunter.js',
        dest: './core/lib/media_hunter.js'
      },
      patternlab_grunt: {
        src: './core/lib/patternlab_grunt.js',
        dest: './core/lib/patternlab_grunt.js'
      },
      patternlab_gulp: {
        src: './core/lib/patternlab_gulp.js',
        dest: './core/lib/patternlab_gulp.js'
      },
      parameter_hunter: {
        src: './core/lib/parameter_hunter.js',
        dest: './core/lib/parameter_hunter.js'
      },
      pattern_exporter: {
        src: './core/lib/pattern_exporter.js',
        dest: './core/lib/pattern_exporter.js'
      },
      pattern_assembler: {
        src: './core/lib/pattern_assembler.js',
        dest: './core/lib/pattern_assembler.js'
      },
      pseudopattern_hunter: {
        src: './core/lib/pseudopattern_hunter.js',
        dest: './core/lib/pseudopattern_hunter.js'
      },
      list_item_hunter: {
        src: './core/lib/list_item_hunter.js',
        dest: './core/lib/list_item_hunter.js'
      },
      style_modifier_hunter: {
        src: './core/lib/style_modifier_hunter.js',
        dest: './core/lib/style_modifier_hunter.js'
      }
    },
    copy: {
      main: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.js),
          src: '*.js',
          dest: path.resolve(paths().public.js)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.css),
          src: '*.css',
          dest: path.resolve(paths().public.css)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.images),
          src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'],
          dest: path.resolve(paths().public.images)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.fonts),
          src: '*',
          dest: path.resolve(paths().public.fonts)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.data),
          src: 'annotations.js',
          dest: path.resolve(paths().public.data)
        }]
      },
      styleguide: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.styleguide),
          src: ['*.*', '**/*.*'],
          dest: path.resolve(paths().public.styleguide)
        }]
      },
      wordpress: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().public.css),
          src: '*.css',
          dest: "/Users/edwin/Dropbox/ClionaJoyce/vagrant-local/www/wordpress-default/wp-content/themes/ClionaJoyce"
        }]
      }
    },
    watch: {
      all: {
        files: [
          path.resolve(paths().source.css + '**/*.scss'),
          path.resolve(paths().source.styleguide + 'css/*.css'),
          path.resolve(paths().source.patterns + '**/*.mustache'),
          path.resolve(paths().source.patterns + '**/*.json'),
          path.resolve(paths().source.fonts + '/*'),
          path.resolve(paths().source.images + '/*'),
          path.resolve(paths().source.data + '*.json'),
          path.resolve(paths().source.js + '/*.js')
        ],
        tasks: ['default', 'bsReload:css']
      }
    },
    nodeunit: {
      all: ['test/*_tests.js']
    },
    browserSync: {
      dev: {
        options: {
          server: path.resolve(paths().public.root),
          watchTask: true,
          watchOptions: {
            ignoreInitial: true,
            ignored: '*.html'
          },
          snippetOptions: {
            // Ignore all HTML files within the templates folder
            blacklist: ['/index.html', '/', '/?*']
          },
          plugins: [{
            module: 'bs-html-injector',
            options: {
              files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
            }
          }],
          notify: {
            styles: [
              'display: none',
              'padding: 15px',
              'font-family: sans-serif',
              'position: fixed',
              'font-size: 1em',
              'z-index: 9999',
              'bottom: 0px',
              'right: 0px',
              'border-top-left-radius: 5px',
              'background-color: #1B2032',
              'opacity: 0.4',
              'margin: 0',
              'color: white',
              'text-align: center'
            ]
          }
        }
      }
    },
    eslint: {
      options: {
        configFile: './.eslintrc'
      },
      target: ['./core/lib/*']
    },
    bsReload: {
      css: path.resolve(paths().public.root + '**/*.css')
    },
    sass: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          'source/css/style.css': 'source/css/style.scss'
        }
      }
    }
  });

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  //load the patternlab task
  grunt.task.loadTasks('./core/lib/');

  grunt.registerTask('default', ['patternlab', 'sass', 'copy:main', 'copy:styleguide', 'copy:wordpress']);

  // travis CI task
  grunt.registerTask('travis', ['nodeunit', 'eslint', 'patternlab']);

  grunt.registerTask('serve', ['patternlab', 'sass', 'copy:main', 'copy:styleguide', 'copy:wordpress', 'browserSync', 'watch:all']);

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

};<|endoftext|>


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

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

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

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

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

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

		recess: {
			options: {
				compile: true
			},
			bootstrap: {
				src: ['src/bootstrap.less'],
				dest: 'dist/bootstrap.custom.css'
			},
			min: {
				options: {
					compress: true
				},
				src: ['dist/opensong.css', 'dist/bootstrap.custom.css'],
				dest: 'dist/opensong.min.css'
			}
		},

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

		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
				sourceMap: 'dist/opensong.min.map',
				sourceMapRoot: 'temp/src/' // the location to find your original source
			//	sourceMapIn: 'temp/opensong.map'  // input sourcemap from a previous compilation
			},
			build: {
				files: {
					'dist/opensong.min.js': ['temp/src/*.js']
				}
			}
		},

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

		watch: {
			coffee_app: {
				files: ['src/**/*.coffee'],
				tasks: ['coffee:app', 'uglify']
			},
			coffee_specs: {
				files: ['spec/**/*.coffee'],
				tasks: ['coffee:specs']
			},
			handlebars: {
				files: ['src/**/*.hbs'],
				tasks: ['handlebars', 'uglify']
			},
			stylus: {
				files: ['src/**/*.styl'],
				tasks: ['stylus']
			},
			specs: {
				files: ['temp/spec/**/*.js', 'dist/**/*.js'],
				tasks: ['jasmine']
			},
			livereload: {
				files: ['index.html', 'dist/**'],
				options: {
					livereload: true
				}
			}
		},

		jasmine: {
			testing: {
				src: 'dist/opensong.min.js',
				options: {
					specs: 'temp/spec/*Spec.js',
					helpers: 'temp/spec/*Helper.js'
				}
			}
		},

		open: {
			dev: {
				path: 'http://127.0.0.1:9001'
			}
		},

		'gh-pages': {
			src: ['index.html', 'dist/**/*', 'demo/*']
		}
	});

	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.loadNpmTasks('grunt-contrib-jasmine');
	grunt.loadNpmTasks('grunt-recess');
	grunt.loadNpmTasks('grunt-open');
	grunt.loadNpmTasks('grunt-gh-pages');

	grunt.registerTask('compile', ['coffee', 'stylus', 'recess', 'handlebars']);
	grunt.registerTask('build', ['clean', 'copy', 'compile', 'uglify']);
	grunt.registerTask('dev', ['build', 'connect', 'open', 'watch']);
	grunt.registerTask('test', ['build', 'jasmine']);
	grunt.registerTask('deploy', ['test', 'gh-pages']);

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

};

// vim: set noexpandtab :
<commit_msg>open dev server for all<commit_after>/*global module:false*/
module.exports = function(grunt) {

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

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

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

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

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

		recess: {
			options: {
				compile: true
			},
			bootstrap: {
				src: ['src/bootstrap.less'],
				dest: 'dist/bootstrap.custom.css'
			},
			min: {
				options: {
					compress: true
				},
				src: ['dist/opensong.css', 'dist/bootstrap.custom.css'],
				dest: 'dist/opensong.min.css'
			}
		},

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

		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
				sourceMap: 'dist/opensong.min.map',
				sourceMapRoot: 'temp/src/' // the location to find your original source
			//	sourceMapIn: 'temp/opensong.map'  // input sourcemap from a previous compilation
			},
			build: {
				files: {
					'dist/opensong.min.js': ['temp/src/*.js']
				}
			}
		},

		connect: {
			server: {
				options: {
					hostname: "*",
					port: 9001
				}
			}
		},

		watch: {
			coffee_app: {
				files: ['src/**/*.coffee'],
				tasks: ['coffee:app', 'uglify']
			},
			coffee_specs: {
				files: ['spec/**/*.coffee'],
				tasks: ['coffee:specs']
			},
			handlebars: {
				files: ['src/**/*.hbs'],
				tasks: ['handlebars', 'uglify']
			},
			stylus: {
				files: ['src/**/*.styl'],
				tasks: ['stylus']
			},
			specs: {
				files: ['temp/spec/**/*.js', 'dist/**/*.js'],
				tasks: ['jasmine']
			},
			livereload: {
				files: ['index.html', 'dist/**'],
				options: {
					livereload: true
				}
			}
		},

		jasmine: {
			testing: {
				src: 'dist/opensong.min.js',
				options: {
					specs: 'temp/spec/*Spec.js',
					helpers: 'temp/spec/*Helper.js'
				}
			}
		},

		open: {
			dev: {
				path: 'http://127.0.0.1:9001'
			}
		},

		'gh-pages': {
			src: ['index.html', 'dist/**/*', 'demo/*']
		}
	});

	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.loadNpmTasks('grunt-contrib-jasmine');
	grunt.loadNpmTasks('grunt-recess');
	grunt.loadNpmTasks('grunt-open');
	grunt.loadNpmTasks('grunt-gh-pages');

	grunt.registerTask('compile', ['coffee', 'stylus', 'recess', 'handlebars']);
	grunt.registerTask('build', ['clean', 'copy', 'compile', 'uglify']);
	grunt.registerTask('dev', ['build', 'connect', 'open', 'watch']);
	grunt.registerTask('test', ['build', 'jasmine']);
	grunt.registerTask('deploy', ['test', 'gh-pages']);

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

};

// vim: set noexpandtab :
<|endoftext|>


<commit_before>/*!
 * Bootstrap's Gruntfile
 * https://getbootstrap.com
 * Copyright 2013-2017 The Bootstrap Authors
 * CopyrLicensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

var APNSCP_PATH = "/usr/local/apnscp",
	THEME_PATH = APNSCP_PATH + "/public/css/themes",
	THEME = process.env['THEME'] || "apnscp",
	BUILD_JS = process.env['JS'] || false;
var es2015 = require('babel-preset-es2015');

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

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

    RegExp.quote = function (string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
    }

    var path = require('path')
    var isTravis = require('is-travis')

    grunt.loadNpmTasks('grunt-browserify');
    var webpack = require("webpack");
    var webpackConfig = require("./webpack.config.js");

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*!\n' +
        ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
        ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
        ' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
        ' */\n',

        // Task configuration.
        clean: {
            dist: 'dist',
        },
        webpack: {
            options: webpackConfig,
            build: {}
        },

        // CSS build configuration
        copy: {
            webpack: {
                expand: true,
                cwd: 'js/src/',
                src: ['master.js', 'jquery.js', 'apnscp_init.js', 'apnscp.js', 'jquery_ui.js', 'clipboard.js'],
                dest: 'dist/js/'
            },
            js: {
                expand: true,
                cwd: 'dist/js/',
                src: [
                    '*'
                ],
                dest: APNSCP_PATH + '/public/js'
            },
            css: {
                expand: true,
                cwd: 'dist/css/',
                src: [
                    '*'
                ],
                dest: APNSCP_PATH + '/public/css/themes'
            }
        },

        watch: {
            src: {
                files: 'js/src/*.js',
                tasks: ['concat', 'copy:webpack', 'browserify', 'copy:js']
            },
            sass: {
                files: 'scss/**/*.scss',
                tasks: ['sass-compile', 'copy:css']
            },
        },

        exec: {
            'clean-css': {
                command: 'cleancss --skip-advanced --source-map --output dist/css/' + THEME + '.min.css dist/css/' + THEME + '.css'
            },
            postcss: {
                command: 'npm run postcss'
            },
            "sass": {
                command: "node-sass --sass-output-style expanded --source-map true --precision 6 scss/themes/" + THEME + ".scss " +
                    "dist/css/" + THEME + ".css"
            },
			'scss-clean': {
                command: "cleancss --skip-advanced --source-map --output dist/css/" + THEME + ".min.css dist/css/" + THEME + ".css"
			},
            'scss-lint': {
                command: 'npm run scss-lint'
            },
            uglify: {
                command: 'npm run uglify'
            },
        },

        compress: {
            main: {
                options: {
                    archive: 'apnscp-' + THEME + '-<%= pkg.version %>-dist.zip',
                    mode: 'zip',
                    level: 9,
                    pretty: true
                },
                files: [
                    {
                        expand: true,
                        cwd: 'dist/',
                        src: ['**'],
                        dest: 'apnscp-' + THEME + '-<%= pkg.version %>-dist'
                    }
                ]
            }
        }

    })

    require('jit-grunt')(grunt)
    require('time-grunt')(grunt)

    //grunt.registerTask('dist-js', ['babel:dev', 'concat', 'copy:webpack', 'babel:dist', 'browserify', 'copy:js', /*'exec:uglify'*/])
	grunt.registerTask('clean', ['exec:scss-clean']);
    grunt.registerTask('test-scss', ['exec:scss-lint'])
	grunt.registerTask('js-compile', ['babel:dev', 'concat', 'copy:webpack', 'copy:js']);
    grunt.registerTask('sass-compile', ['exec:sass', 'copy:css'])
    grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'copy:css'])

    // Full distribution task.
    grunt.registerTask('dist', ['clean:dist', 'dist-css'])

    grunt.registerTask('default', ['dist']);
    grunt.registerTask('prep-release', ['dist', 'compress'])
}
<commit_msg>dangling task<commit_after>/*!
 * Bootstrap's Gruntfile
 * https://getbootstrap.com
 * Copyright 2013-2017 The Bootstrap Authors
 * CopyrLicensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

var APNSCP_PATH = "/usr/local/apnscp",
	THEME_PATH = APNSCP_PATH + "/public/css/themes",
	THEME = process.env['THEME'] || "apnscp",
	BUILD_JS = process.env['JS'] || false;
var es2015 = require('babel-preset-es2015');

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

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

    RegExp.quote = function (string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
    }

    var path = require('path')
    var isTravis = require('is-travis')

    grunt.loadNpmTasks('grunt-browserify');
    var webpack = require("webpack");
    var webpackConfig = require("./webpack.config.js");

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*!\n' +
        ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
        ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
        ' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
        ' */\n',

        // Task configuration.
        clean: {
            dist: 'dist',
        },
        webpack: {
            options: webpackConfig,
            build: {}
        },

        // CSS build configuration
        copy: {
            webpack: {
                expand: true,
                cwd: 'js/src/',
                src: ['master.js', 'jquery.js', 'apnscp_init.js', 'apnscp.js', 'jquery_ui.js', 'clipboard.js'],
                dest: 'dist/js/'
            },
            js: {
                expand: true,
                cwd: 'dist/js/',
                src: [
                    '*'
                ],
                dest: APNSCP_PATH + '/public/js'
            },
            css: {
                expand: true,
                cwd: 'dist/css/',
                src: [
                    '*'
                ],
                dest: APNSCP_PATH + '/public/css/themes'
            }
        },

        watch: {
            src: {
                files: 'js/src/*.js',
                tasks: ['concat', 'copy:webpack', 'browserify', 'copy:js']
            },
            sass: {
                files: 'scss/**/*.scss',
                tasks: ['sass-compile', 'copy:css']
            },
        },

        exec: {
            'clean-css': {
                command: 'cleancss --skip-advanced --source-map --output dist/css/' + THEME + '.min.css dist/css/' + THEME + '.css'
            },
            postcss: {
                command: 'npm run postcss'
            },
            "sass": {
                command: "node-sass --sass-output-style expanded --source-map true --precision 6 scss/themes/" + THEME + ".scss " +
                    "dist/css/" + THEME + ".css"
            },
			'scss-clean': {
                command: "cleancss --skip-advanced --source-map --output dist/css/" + THEME + ".min.css dist/css/" + THEME + ".css"
			},
            'scss-lint': {
                command: 'npm run scss-lint'
            },
            uglify: {
                command: 'npm run uglify'
            },
        },

        compress: {
            main: {
                options: {
                    archive: 'apnscp-' + THEME + '-<%= pkg.version %>-dist.zip',
                    mode: 'zip',
                    level: 9,
                    pretty: true
                },
                files: [
                    {
                        expand: true,
                        cwd: 'dist/',
                        src: ['**'],
                        dest: 'apnscp-' + THEME + '-<%= pkg.version %>-dist'
                    }
                ]
            }
        }

    })

    require('jit-grunt')(grunt)
    require('time-grunt')(grunt)

    //grunt.registerTask('dist-js', ['babel:dev', 'concat', 'copy:webpack', 'babel:dist', 'browserify', 'copy:js', /*'exec:uglify'*/])
    grunt.registerTask('test-scss', ['exec:scss-lint'])
	grunt.registerTask('js-compile', ['babel:dev', 'concat', 'copy:webpack', 'copy:js']);
    grunt.registerTask('sass-compile', ['exec:sass', 'copy:css'])
    grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'copy:css'])

    // Full distribution task.
    grunt.registerTask('dist', ['clean:dist', 'dist-css'])

    grunt.registerTask('default', ['dist']);
    grunt.registerTask('prep-release', ['dist', 'compress'])
}
<|endoftext|>


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

  var bower = grunt.file.readJSON('bower.json');
  var components = [];
  for (var i in bower.concat.app) {
    components.push('components/' + bower.concat.app[i] + '/**/*.js');
  }
  components.push('components/' + 'webaudiorecorder/lib/WebAudioRecorder.js');

  var libtextsecurecomponents = [];
  for (i in bower.concat.libtextsecure) {
    libtextsecurecomponents.push('components/' + bower.concat.libtextsecure[i] + '/**/*.js');
  }

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      components: {
        src: components,
        dest: 'js/components.js',
      },
      libtextsecurecomponents: {
        src: libtextsecurecomponents,
        dest: 'libtextsecure/components.js',
      },
      test: {
        src: [
          'components/mocha/mocha.js',
          'components/chai/chai.js',
          'test/_test.js'
        ],
        dest: 'test/test.js',
      },
      //TODO: Move errors back down?
      libtextsecure: {
        options: {
          banner: ";(function() {\n",
          footer: "})();\n",
        },
        src: [
          'libtextsecure/errors.js',
          'libtextsecure/libsignal-protocol.js',
          'libtextsecure/protocol_wrapper.js',

          'libtextsecure/crypto.js',
          'libtextsecure/storage.js',
          'libtextsecure/storage/user.js',
          'libtextsecure/storage/groups.js',
          'libtextsecure/protobufs.js',
          'libtextsecure/websocket-resources.js',
          'libtextsecure/helpers.js',
          'libtextsecure/stringview.js',
          'libtextsecure/event_target.js',
          'libtextsecure/api.js',
          'libtextsecure/account_manager.js',
          'libtextsecure/message_receiver.js',
          'libtextsecure/outgoing_message.js',
          'libtextsecure/sendmessage.js',
          'libtextsecure/sync_request.js',
          'libtextsecure/contacts_parser.js',
          'libtextsecure/ProvisioningCipher.js',
        ],
        dest: 'js/libtextsecure.js',
      },
      libtextsecuretest: {
        src: [
          'components/jquery/dist/jquery.js',
          'components/mock-socket/dist/mock-socket.js',
          'components/mocha/mocha.js',
          'components/chai/chai.js',
          'libtextsecure/test/_test.js'
        ],
        dest: 'libtextsecure/test/test.js',
      }
    },
    sass: {
        stylesheets: {
            files: {
                'stylesheets/manifest.css': 'stylesheets/manifest.scss',
                'stylesheets/options.css': 'stylesheets/options.scss'
            }
        }
    },
    jshint: {
      files: [
        'Gruntfile.js',
        'js/**/*.js',
        '!js/libtextsecure.js',
        '!js/WebAudioRecorderMp3.js',
        '!js/Mp3LameEncoder.min.js',
        '!js/libsignal-protocol-worker.js',
        '!js/components.js',
        '!js/signal_protocol_store.js',
        '_locales/**/*'
      ],
      options: { jshintrc: '.jshintrc' },
    },
    dist: {
      src: [
        'manifest.json',
        'background.html',
        'index.html',
        'options.html',
        '_locales/**',
        'protos/*',
        'js/**',
        'stylesheets/*.css',
        '!js/register.js'
      ],
      res: [
        'audio/**',
        'images/**',
        'fonts/*',
      ]
    },
    copy: {
      res: {
        files: [{ expand: true, dest: 'dist/', src: ['<%= dist.res %>'] }],
      },
      src: {
        files: [{ expand: true, dest: 'dist/', src: ['<%= dist.src %>'] }],
        options: {
          process: function(content, srcpath) {
            if (srcpath.match('background.js')) {
              return content.replace(
                /textsecure-service-staging.whispersystems.org/g,
                'textsecure-service-ca.whispersystems.org');
            } else if (srcpath.match('expire.js')) {
              var gitinfo = grunt.config.get('gitinfo');
              var commited = gitinfo.local.branch.current.lastCommitTime;
              var time = Date.parse(commited) + 1000 * 60 * 60 * 24 * 90;
              return content.replace(
                /var BUILD_EXPIRATION = 0/,
                "var BUILD_EXPIRATION = " + time
              );
            } else {
              return content;
            }
          }
        }
      }
    },
    jscs: {
      all: {
        src: [
        'Gruntfile',
        'js/**/*.js',
        '!js/libtextsecure.js',
        '!js/WebAudioRecorderMp3.js',
        '!js/Mp3LameEncoder.min.js',
        '!js/libsignal-protocol-worker.js',
        '!js/components.js',
        'test/**/*.js',
        '!test/blanket_mocha.js',
        '!test/test.js',
        ]
      }
    },
    watch: {
      sass: {
        files: ['./stylesheets/*.scss'],
        tasks: ['sass']
      },
      libtextsecure: {
        files: ['./libtextsecure/*.js', './libtextsecure/storage/*.js'],
        tasks: ['concat:libtextsecure']
      },
      dist: {
        files: ['<%= dist.src %>', '<%= dist.res %>'],
        tasks: ['copy_dist']
      },
      scripts: {
        files: ['<%= jshint.files %>', './js/**/*.js'],
        tasks: ['jshint']
      },
      style: {
        files: ['<%= jscs.all.src %>', './js/**/*.js'],
        tasks: ['jscs']
      },
    },
    connect: {
      server: {
        options: {
          base: '.',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          urls: [
            'http://127.0.0.1:9999/test/index.html',
            'http://127.0.0.1:9999/libtextsecure/test/index.html',
          ],
          build: process.env.TRAVIS_JOB_ID,
          browsers: [
            { browserName: 'chrome', version: '41' },
            { platform: 'linux', browserName: 'firefox', version: '34' }
          ],
          testname: 'TextSecure-Browser Tests',
          'max-duration': 300,
          statusCheckAttempts: 200
        }
      }
    },
    exec: {
      'tx-pull': {
        cmd: 'tx pull'
      }
    },
    gitinfo: {} // to be populated by grunt gitinfo
  });

  Object.keys(grunt.config.get('pkg').devDependencies).forEach(function(key) {
    if (/^grunt(?!(-cli)?$)/.test(key)) {  // ignore grunt and grunt-cli
      grunt.loadNpmTasks(key);
    }
  });

  // Transifex does not understand placeholders, so this task patches all non-en
  // locales with missing placeholders
  grunt.registerTask('locale-patch', function(){
    var en = grunt.file.readJSON('_locales/en/messages.json');
    grunt.file.recurse('_locales', function(abspath, rootdir, subdir, filename){
      if (subdir === 'en' || filename !== 'messages.json'){
        return;
      }
      var messages = grunt.file.readJSON(abspath);

      for (var key in messages){
        if (en[key] !== undefined && messages[key] !== undefined){
          if (en[key].placeholders !== undefined && messages[key].placeholders === undefined){
            messages[key].placeholders = en[key].placeholders;
          }
        }
      }

      grunt.file.write(abspath, JSON.stringify(messages, null, 4) + '\n');
    });
  });

  grunt.registerTask('tx', ['exec:tx-pull', 'locale-patch']);
  grunt.registerTask('dev', ['default', 'connect', 'watch']);
  grunt.registerTask('test', ['jshint', 'jscs', 'connect', 'saucelabs-mocha']);
  grunt.registerTask('copy_dist', ['gitinfo', 'copy']);
  grunt.registerTask('default', ['concat', 'sass', 'copy_dist']);

};
<commit_msg>Fix missing emojis in production build<commit_after>module.exports = function(grunt) {
  'use strict';

  var bower = grunt.file.readJSON('bower.json');
  var components = [];
  for (var i in bower.concat.app) {
    components.push('components/' + bower.concat.app[i] + '/**/*.js');
  }
  components.push('components/' + 'webaudiorecorder/lib/WebAudioRecorder.js');

  var libtextsecurecomponents = [];
  for (i in bower.concat.libtextsecure) {
    libtextsecurecomponents.push('components/' + bower.concat.libtextsecure[i] + '/**/*.js');
  }

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      components: {
        src: components,
        dest: 'js/components.js',
      },
      libtextsecurecomponents: {
        src: libtextsecurecomponents,
        dest: 'libtextsecure/components.js',
      },
      test: {
        src: [
          'components/mocha/mocha.js',
          'components/chai/chai.js',
          'test/_test.js'
        ],
        dest: 'test/test.js',
      },
      //TODO: Move errors back down?
      libtextsecure: {
        options: {
          banner: ";(function() {\n",
          footer: "})();\n",
        },
        src: [
          'libtextsecure/errors.js',
          'libtextsecure/libsignal-protocol.js',
          'libtextsecure/protocol_wrapper.js',

          'libtextsecure/crypto.js',
          'libtextsecure/storage.js',
          'libtextsecure/storage/user.js',
          'libtextsecure/storage/groups.js',
          'libtextsecure/protobufs.js',
          'libtextsecure/websocket-resources.js',
          'libtextsecure/helpers.js',
          'libtextsecure/stringview.js',
          'libtextsecure/event_target.js',
          'libtextsecure/api.js',
          'libtextsecure/account_manager.js',
          'libtextsecure/message_receiver.js',
          'libtextsecure/outgoing_message.js',
          'libtextsecure/sendmessage.js',
          'libtextsecure/sync_request.js',
          'libtextsecure/contacts_parser.js',
          'libtextsecure/ProvisioningCipher.js',
        ],
        dest: 'js/libtextsecure.js',
      },
      libtextsecuretest: {
        src: [
          'components/jquery/dist/jquery.js',
          'components/mock-socket/dist/mock-socket.js',
          'components/mocha/mocha.js',
          'components/chai/chai.js',
          'libtextsecure/test/_test.js'
        ],
        dest: 'libtextsecure/test/test.js',
      }
    },
    sass: {
        stylesheets: {
            files: {
                'stylesheets/manifest.css': 'stylesheets/manifest.scss',
                'stylesheets/options.css': 'stylesheets/options.scss'
            }
        }
    },
    jshint: {
      files: [
        'Gruntfile.js',
        'js/**/*.js',
        '!js/libtextsecure.js',
        '!js/WebAudioRecorderMp3.js',
        '!js/Mp3LameEncoder.min.js',
        '!js/libsignal-protocol-worker.js',
        '!js/components.js',
        '!js/signal_protocol_store.js',
        '_locales/**/*'
      ],
      options: { jshintrc: '.jshintrc' },
    },
    dist: {
      src: [
        'manifest.json',
        'background.html',
        'index.html',
        'options.html',
        '_locales/**',
        'protos/*',
        'js/**',
        'stylesheets/*.css',
        '!js/register.js'
      ],
      res: [
        'audio/**',
        'images/**/*',
        'fonts/*',
      ]
    },
    copy: {
      res: {
        files: [{ expand: true, dest: 'dist/', src: ['<%= dist.res %>'] }],
      },
      src: {
        files: [{ expand: true, dest: 'dist/', src: ['<%= dist.src %>'] }],
        options: {
          process: function(content, srcpath) {
            if (srcpath.match('background.js')) {
              return content.replace(
                /textsecure-service-staging.whispersystems.org/g,
                'textsecure-service-ca.whispersystems.org');
            } else if (srcpath.match('expire.js')) {
              var gitinfo = grunt.config.get('gitinfo');
              var commited = gitinfo.local.branch.current.lastCommitTime;
              var time = Date.parse(commited) + 1000 * 60 * 60 * 24 * 90;
              return content.replace(
                /var BUILD_EXPIRATION = 0/,
                "var BUILD_EXPIRATION = " + time
              );
            } else {
              return content;
            }
          }
        }
      }
    },
    jscs: {
      all: {
        src: [
        'Gruntfile',
        'js/**/*.js',
        '!js/libtextsecure.js',
        '!js/WebAudioRecorderMp3.js',
        '!js/Mp3LameEncoder.min.js',
        '!js/libsignal-protocol-worker.js',
        '!js/components.js',
        'test/**/*.js',
        '!test/blanket_mocha.js',
        '!test/test.js',
        ]
      }
    },
    watch: {
      sass: {
        files: ['./stylesheets/*.scss'],
        tasks: ['sass']
      },
      libtextsecure: {
        files: ['./libtextsecure/*.js', './libtextsecure/storage/*.js'],
        tasks: ['concat:libtextsecure']
      },
      dist: {
        files: ['<%= dist.src %>', '<%= dist.res %>'],
        tasks: ['copy_dist']
      },
      scripts: {
        files: ['<%= jshint.files %>', './js/**/*.js'],
        tasks: ['jshint']
      },
      style: {
        files: ['<%= jscs.all.src %>', './js/**/*.js'],
        tasks: ['jscs']
      },
    },
    connect: {
      server: {
        options: {
          base: '.',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          urls: [
            'http://127.0.0.1:9999/test/index.html',
            'http://127.0.0.1:9999/libtextsecure/test/index.html',
          ],
          build: process.env.TRAVIS_JOB_ID,
          browsers: [
            { browserName: 'chrome', version: '41' },
            { platform: 'linux', browserName: 'firefox', version: '34' }
          ],
          testname: 'TextSecure-Browser Tests',
          'max-duration': 300,
          statusCheckAttempts: 200
        }
      }
    },
    exec: {
      'tx-pull': {
        cmd: 'tx pull'
      }
    },
    gitinfo: {} // to be populated by grunt gitinfo
  });

  Object.keys(grunt.config.get('pkg').devDependencies).forEach(function(key) {
    if (/^grunt(?!(-cli)?$)/.test(key)) {  // ignore grunt and grunt-cli
      grunt.loadNpmTasks(key);
    }
  });

  // Transifex does not understand placeholders, so this task patches all non-en
  // locales with missing placeholders
  grunt.registerTask('locale-patch', function(){
    var en = grunt.file.readJSON('_locales/en/messages.json');
    grunt.file.recurse('_locales', function(abspath, rootdir, subdir, filename){
      if (subdir === 'en' || filename !== 'messages.json'){
        return;
      }
      var messages = grunt.file.readJSON(abspath);

      for (var key in messages){
        if (en[key] !== undefined && messages[key] !== undefined){
          if (en[key].placeholders !== undefined && messages[key].placeholders === undefined){
            messages[key].placeholders = en[key].placeholders;
          }
        }
      }

      grunt.file.write(abspath, JSON.stringify(messages, null, 4) + '\n');
    });
  });

  grunt.registerTask('tx', ['exec:tx-pull', 'locale-patch']);
  grunt.registerTask('dev', ['default', 'connect', 'watch']);
  grunt.registerTask('test', ['jshint', 'jscs', 'connect', 'saucelabs-mocha']);
  grunt.registerTask('copy_dist', ['gitinfo', 'copy']);
  grunt.registerTask('default', ['concat', 'sass', 'copy_dist']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  "use strict";

  var releaseConfig = {
    appRoot: "/hakemisto/"
  };

  grunt.initConfig({
    // Wipe out previous builds and test reporting.
    clean: ["dist/", "test/reports"],

    // Run your source code through JSHint's defaults.
    jshint: ["app/**/*.js"],

    // This task uses James Burke's excellent r.js AMD builder to take all
    // modules and concatenate them into a single file.
    requirejs: {
      release: {
        options: {
          mainConfigFile: "app/config.js",
          generateSourceMaps: true,
          include: ["main"],
          out: "dist/source.min.js",
          optimize: "uglify2",

          // Since we bootstrap with nested `require` calls this option allows
          // R.js to find them.
          findNestedDependencies: true,

          // Include a minimal AMD implementation shim.
          name: "almond",

          // Setting the base url to the distribution directory allows the
          // Uglify minification process to correctly map paths for Source
          // Maps.
          baseUrl: "dist/app",

          // Wrap everything in an IIFE.
          wrap: true,

          // Modules to stub out in the optimized file.
          stubModules: ['text', 'hbars'],

          // This is needed for the require-handlebars library
          onBuildWrite : function(moduleName, path, content){
              // replace handlebars with the runtime version
              if (moduleName === 'Handlebars') {
                  path = path.replace('handlebars.js','handlebars.runtime.js');
                  content = grunt.file.read(path).toString();
                  // Set Handlebars as a grobal variable
                  content = content.replace('var Handlebars', 'window.Handlebars');
              }
              return content;
          },

          // Do not preserve any license comments when working with source
          // maps.  These options are incompatible.
          preserveLicenseComments: false,

        }
      }
    },

    // This task simplifies working with CSS inside Backbone Boilerplate
    // projects.  Instead of manually specifying your stylesheets inside the
    // HTML, you can use `@imports` and this task will concatenate only those
    // paths.
    styles: {
      // Out the concatenated contents of the following styles into the below
      // development file path.
      "dist/styles.css": {
        // Point this to where your `index.css` file is location.
        src: "app/styles/index.css",

        // The relative path to use for the @imports.
        paths: ["app/styles"],

        // Rewrite image paths during release to be relative to the `img`
        // directory.
        forceRelative: "/talkoohakemisto/app/img/"
      }
    },

    // Minify the distribution CSS.
    cssmin: {
      release: {
        files: {
          "dist/styles.min.css": ["dist/styles.css"]
        }
      }
    },

    server: {
      options: {
        host: "0.0.0.0",
        port: 8000
      },

      development: {},

      release: {
        options: {
          prefix: "dist"
        }
      },

      test: {
        options: {
          forever: false,
          port: 8001
        }
      }
    },

    watch: {
      options: {
        spawn: true
      },
      livereload: {
        files: [
          'app/**/*',
          '*.html'
        ],
        options: {
          livereload: true
        }
      }
    },

    // Enables running several task at the same time
    concurrent: {
      options: {
        logConcurrentOutput: true,
      },
      watch: [
        'watch',
        'server',
        //'talkooserver'
      ]
    },

    processhtml: {
      release: {
        files: {
          "dist/index.html": ["index.html"]
        }
      }
    },

    // Move vendor and app logic during a build.
    copy: {
      release: {
        files: [
          { src: ["app/**"], dest: "dist/" },
          { src: "vendor/**", dest: "dist/" },
          { src: "etc/.htaccess", dest: "dist/.htaccess" },
          { src: "index.php", dest: "dist/" }
        ]
      }
    },

    compress: {
      release: {
        options: {
          archive: "dist/source.min.js.gz"
        },

        files: ["dist/source.min.js"]
      }
    },

    /** Replace some path references for build **/
    replace: {
      appJs: {
        src: ['dist/app/app.js'],             // source files array (supports minimatch)
        dest: 'dist/app/',             // destination directory or file
        replacements: [{
          from: 'app.root = "/";',                   // string replacement
          to: 'app.root = "' + releaseConfig.appRoot + '";'
        }]
      },
      html: {
        src: ['dist/*.html'],
        dest: 'dist/',
        replacements: [{
          from: '/-APP_ROOT-/',
          to: releaseConfig.appRoot
        }]
      }
    }
  });

  // Grunt contribution tasks.
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-contrib-jshint");
  grunt.loadNpmTasks("grunt-contrib-cssmin");
  grunt.loadNpmTasks("grunt-contrib-copy");
  grunt.loadNpmTasks("grunt-contrib-compress");
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Third-party tasks.
  grunt.loadNpmTasks("grunt-processhtml");
  grunt.loadNpmTasks('grunt-text-replace');
  grunt.loadNpmTasks('grunt-concurrent');

  // Grunt BBB tasks.
  grunt.loadNpmTasks("grunt-bbb-server");
  grunt.loadNpmTasks("grunt-bbb-requirejs");
  grunt.loadNpmTasks("grunt-bbb-styles");

  // Local jsonapi database server for testing (at 127.0.0.1:1337)
  // grunt.loadNpmTasks("../etc/grunt-talkoo-server");

  // When running the default Grunt command, just lint the code.
  grunt.registerTask("default", [
    "clean",
    "jshint",
    "processhtml",
    "copy",
    "replace",
    "requirejs",
    "styles",
    "cssmin",
  ]);

  grunt.registerTask("dev", [
    "concurrent"
  ]);
};
<commit_msg>added ftp_push<commit_after>module.exports = function(grunt) {
  "use strict";

  var releaseConfig = {
    appRoot: "/hakemisto/"
  };

  grunt.initConfig({
    // Wipe out previous builds and test reporting.
    clean: ["dist/", "test/reports"],

    // Run your source code through JSHint's defaults.
    jshint: ["app/**/*.js"],

    // This task uses James Burke's excellent r.js AMD builder to take all
    // modules and concatenate them into a single file.
    requirejs: {
      release: {
        options: {
          mainConfigFile: "app/config.js",
          generateSourceMaps: true,
          include: ["main"],
          out: "dist/source.min.js",
          optimize: "uglify2",

          // Since we bootstrap with nested `require` calls this option allows
          // R.js to find them.
          findNestedDependencies: true,

          // Include a minimal AMD implementation shim.
          name: "almond",

          // Setting the base url to the distribution directory allows the
          // Uglify minification process to correctly map paths for Source
          // Maps.
          baseUrl: "dist/app",

          // Wrap everything in an IIFE.
          wrap: true,

          // Modules to stub out in the optimized file.
          stubModules: ['text', 'hbars'],

          // This is needed for the require-handlebars library
          onBuildWrite : function(moduleName, path, content){
              // replace handlebars with the runtime version
              if (moduleName === 'Handlebars') {
                  path = path.replace('handlebars.js','handlebars.runtime.js');
                  content = grunt.file.read(path).toString();
                  // Set Handlebars as a grobal variable
                  content = content.replace('var Handlebars', 'window.Handlebars');
              }
              return content;
          },

          // Do not preserve any license comments when working with source
          // maps.  These options are incompatible.
          preserveLicenseComments: false,

        }
      }
    },

    // This task simplifies working with CSS inside Backbone Boilerplate
    // projects.  Instead of manually specifying your stylesheets inside the
    // HTML, you can use `@imports` and this task will concatenate only those
    // paths.
    styles: {
      // Out the concatenated contents of the following styles into the below
      // development file path.
      "dist/styles.css": {
        // Point this to where your `index.css` file is location.
        src: "app/styles/index.css",

        // The relative path to use for the @imports.
        paths: ["app/styles"],

        // Rewrite image paths during release to be relative to the `img`
        // directory.
        forceRelative: "/talkoohakemisto/app/img/"
      }
    },

    // Minify the distribution CSS.
    cssmin: {
      release: {
        files: {
          "dist/styles.min.css": ["dist/styles.css"]
        }
      }
    },

    server: {
      options: {
        host: "0.0.0.0",
        port: 8000
      },

      development: {},

      release: {
        options: {
          prefix: "dist"
        }
      },

      test: {
        options: {
          forever: false,
          port: 8001
        }
      }
    },

    watch: {
      options: {
        spawn: true
      },
      livereload: {
        files: [
          'app/**/*',
          '*.html'
        ],
        options: {
          livereload: true
        }
      }
    },

    // Enables running several task at the same time
    concurrent: {
      options: {
        logConcurrentOutput: true,
      },
      watch: [
        'watch',
        'server',
        //'talkooserver'
      ]
    },

    processhtml: {
      release: {
        files: {
          "dist/index.html": ["index.html"]
        }
      }
    },

    // Move vendor and app logic during a build.
    copy: {
      release: {
        files: [
          { src: ["app/**"], dest: "dist/" },
          { src: "vendor/**", dest: "dist/" },
          { src: "etc/.htaccess", dest: "dist/.htaccess" },
          { src: "index.php", dest: "dist/" }
        ]
      }
    },

    compress: {
      release: {
        options: {
          archive: "dist/source.min.js.gz"
        },

        files: ["dist/source.min.js"]
      }
    },

    /** Replace some path references for build **/
    replace: {
      appJs: {
        src: ['dist/app/app.js'],             // source files array (supports minimatch)
        dest: 'dist/app/',             // destination directory or file
        replacements: [{
          from: 'app.root = "/";',                   // string replacement
          to: 'app.root = "' + releaseConfig.appRoot + '";'
        }]
      },
      html: {
        src: ['dist/*.html'],
        dest: 'dist/',
        replacements: [{
          from: '/-APP_ROOT-/',
          to: releaseConfig.appRoot
        }]
      }
    },
    ftp_push: {
      your_target: {
        options: {
          authKey: "hakemisto",
	  host: "talkoot.fi",
          dest: "/",
          port: 21
        },
        files: [
          {expand: true, cwd: 'dist', src: ['**/*']}
        ]
      }
    }
  });

  // Grunt contribution tasks.
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-contrib-jshint");
  grunt.loadNpmTasks("grunt-contrib-cssmin");
  grunt.loadNpmTasks("grunt-contrib-copy");
  grunt.loadNpmTasks("grunt-contrib-compress");
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Third-party tasks.
  grunt.loadNpmTasks("grunt-processhtml");
  grunt.loadNpmTasks('grunt-text-replace');
  grunt.loadNpmTasks('grunt-concurrent');

  // Grunt BBB tasks.
  grunt.loadNpmTasks("grunt-bbb-server");
  grunt.loadNpmTasks("grunt-bbb-requirejs");
  grunt.loadNpmTasks("grunt-bbb-styles");

  // Local jsonapi database server for testing (at 127.0.0.1:1337)
  // grunt.loadNpmTasks("../etc/grunt-talkoo-server");

  // When running the default Grunt command, just lint the code.
  grunt.registerTask("default", [
    "clean",
    "jshint",
    "processhtml",
    "copy",
    "replace",
    "requirejs",
    "styles",
    "cssmin",
  ]);

  grunt.registerTask("dev", [
    "concurrent"
  ]);

  grunt.loadNpmTasks('grunt-ftp-push');
};
<|endoftext|>


<commit_before>'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        name: 'gstorage',
        src: 'src',
        dist: 'dist',
        lib: 'lib',
        example:'examples'
    };

    try {
        yeomanConfig.src = require('./component.json').appPath || yeomanConfig.src;
    } catch (e) {}

    grunt.initConfig({
        yeoman: yeomanConfig,
        livereload:{
            port: 35723
        },
        watch: {
            livereload: {
                files: [
                    '<%= yeoman.src %>/{,*/}*.html',
                    '{.tmp,<%= yeoman.src %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.src %>}/scripts/{,*/}*.js',
                    '<%= yeoman.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.src),
                            mountFolder(connect, yeomanConfig.lib),
                            mountFolder(connect, yeomanConfig.example)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dev:{
                options: {}
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.src %>/{,*/}*.js'
            ]
        },
        karma: {
            options: {
                configFile: 'karma.conf.js',
                runnerPort: 9999,
                browsers: ['Chrome', 'Firefox']
            },
            unit: {
                reporters: 'dots'
            },
            continuous: {
                singleRun: true,
                browsers: ['PhantomJS']
            },
            ci: {
                singleRun: true,
                browsers: ['PhantomJS']
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/<%= yeoman.name %>.js': [
                        '.tmp/{,*/}*.js',
                        '<%= yeoman.src %>/{,*/}*.js'
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/<%= yeoman.name %>.min.js': [
                        '<%= yeoman.dist %>/<%= yeoman.name %>.js'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.src %>',
                    dest: '<%= yeoman.dist %>',
                    src: []
                }]
            }
        },
        //https://github.com/vojtajina/grunt-bump
        bump: {
            options: {
                files: ['package.json', 'bower.json', 'component.json'],
                updateConfigs: [],
                commit: true,
                commitMessage: 'Release v%VERSION%',
                commitFiles: ['package.json', 'bower.json', 'component.json'], // '-a' for all files
                createTag: true,
                tagName: 'v%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: true,
                pushTo: 'upstream',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        }
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

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

    grunt.registerTask('build', [
        'clean:dist',
        'jshint',
        'test',
        'concat',
        'copy',
        'uglify',
    ]);

    grunt.registerTask('default', ['build']);
};
<commit_msg>Gruntfile: Updated options. Simplify...<commit_after>'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function(connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function(grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var config = {
        name: 'gl10n',
        src: 'src',
        lib: 'lib',
        dist: 'dist',
        example: 'examples'
    };

    try {
        config.src = require('./component.json').appPath || config.src;
    } catch (e) {}

    grunt.initConfig({
        config: config,
        livereload: {
            port: 35723
        },
        watch: {
            livereload: {
                files: [
                    '<%= config.example %>/{,*/}*.html',
                    '{.tmp,<%= config.example %>}/{,*/}*.css',
                    '<%= config.example %>/{,*/}*.js',
                    '{.tmp,<%= config.src %>}/{,*/}*.js'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, config.lib),
                            mountFolder(connect, config.src),
                            mountFolder(connect, config.example)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function(connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dev: {
                options: {}
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= config.dist %>/*',
                        '!<%= config.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= config.src %>/{,*/}*.js'
            ]
        },
        karma: {
            options: {
                configFile: 'karma.conf.js',
                runnerPort: 9999
            },
            unit: {
                reporters: 'dots'
            },
            debug: {
                singleRun: false,
                browsers: ['Chrome']
            },
            ci: {
                singleRun: true,
                browsers: ['PhantomJS']
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= config.dist %>/<%= config.name %>.js': [
                        '.tmp/{,*/}*.js',
                        '<%= config.src %>/{,*/}*.js'
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= config.dist %>/<%= config.name %>.min.js': [
                        '<%= config.dist %>/<%= config.name %>.js'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.src %>',
                    dest: '<%= config.dist %>',
                    src: []
                }]
            }
        },
        bower: {
            install: {
                options: {
                    targetDir: './<%= config.lib %>',
                    install: true,
                    verbose: true,
                    cleanTargetDir: false,
                    cleanBowerDir: false,
                    bowerOptions: {},
                    layout: function(type, component) {
                        console.warn(type, component);
                        //grunt-bower-install wants to do component/type/file but
                        //we need component/file
                        var path = require('path');
                        var renamedType = type;
                        console.warn(path);
                        console.warn(type);
                        if (type === 'js') renamedType = '';
                        return path.join(component, renamedType);
                    }
                }
            }
        },
        //https://github.com/vojtajina/grunt-bump
        bump: {
            options: {
                files: ['package.json', 'bower.json', 'component.json'],
                updateConfigs: [],
                commit: true,
                commitMessage: 'Release v%VERSION%',
                commitFiles: ['package.json', 'bower.json', 'component.json'], // '-a' for all files
                createTag: true,
                tagName: 'v%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: true,
                pushTo: 'origin',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        }
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

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

    grunt.registerTask('build', [
        'clean:dist',
        'jshint',
        'test',
        'concat',
        'copy',
        'uglify',
    ]);

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


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

  var banner = '/* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n';

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

    jshint: {
      files: [
        'gruntfile.js',
        'src/**/*.js',
        '!src/vendor/*.js',
        'test/test/*.js'],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    clean: ['tmp'],

    copy: {
      main: {
        files: [{
          expand: true,
          cwd:'src',
          src: ['**/*.js'],
          dest: 'tmp/javascript/'
        }]
      }
    },

    transpile: {
      main: {
        type: 'amd',
        moduleName: function(path) {
          return grunt.config.process('<%= pkg.moduleName %>/') + path;
        },
        files: [{
          expand: true,
          cwd: 'tmp/javascript/',
          src: ['**/*.js'],
          dest: 'tmp/transpiled/'
        }]
      }
    },

    concat: {
      options: {
        banner: banner
      },
      dist: {
        src: ['tmp/transpiled/**/*.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },

    uglify: {
      options: {
        banner: banner
      },
      dist: {
        files: {
          'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
        }
      }
    },

    qunit: {
      files: ['test/**/*.html']
    },

    watch: {
      lint: {
        files: ['<%= jshint.files %>'],
        tasks: ['jshint', 'qunit']
      },
      build: {
        files: ['src/**/*.js'],
        tasks: ['clean', 'copy', 'transpile', 'concat', 'uglify']
      }
    },
    concurrent: {
      options: {
        logConcurrentOutput: true
      },
      watches: {
        tasks: ["watch:lint", "watch:build"]
      }
    }
  });

  // Load the plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-concurrent');
  grunt.loadNpmTasks('grunt-es6-module-transpiler');

  // tasks
  grunt.registerTask('test', ['jshint', 'qunit']);
  grunt.registerTask('build', ['clean', 'copy', 'transpile', 'concat', 'uglify']);
  grunt.registerTask('watchBuild', ['test', 'build', 'concurrent:watches']);
  grunt.registerTask('default', ['watchBuild']);
};<commit_msg>need to build to test<commit_after>module.exports = function(grunt) {

  var banner = '/* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n';

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

    jshint: {
      files: [
        'gruntfile.js',
        'src/**/*.js',
        '!src/vendor/*.js',
        'test/test/*.js'],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    clean: ['tmp'],

    copy: {
      main: {
        files: [{
          expand: true,
          cwd:'src',
          src: ['**/*.js'],
          dest: 'tmp/javascript/'
        }]
      }
    },

    transpile: {
      main: {
        type: 'amd',
        moduleName: function(path) {
          return grunt.config.process('<%= pkg.moduleName %>/') + path;
        },
        files: [{
          expand: true,
          cwd: 'tmp/javascript/',
          src: ['**/*.js'],
          dest: 'tmp/transpiled/'
        }]
      }
    },

    concat: {
      options: {
        banner: banner
      },
      dist: {
        src: ['tmp/transpiled/**/*.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },

    uglify: {
      options: {
        banner: banner
      },
      dist: {
        files: {
          'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
        }
      }
    },

    qunit: {
      files: ['test/**/*.html']
    },

    watch: {
      lint: {
        files: ['<%= jshint.files %>'],
        tasks: ['jshint', 'qunit']
      },
      build: {
        files: ['src/**/*.js'],
        tasks: ['clean', 'copy', 'transpile', 'concat', 'uglify']
      }
    },
    concurrent: {
      options: {
        logConcurrentOutput: true
      },
      watches: {
        tasks: ["watch:lint", "watch:build"]
      }
    }
  });

  // Load the plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-concurrent');
  grunt.loadNpmTasks('grunt-es6-module-transpiler');

  // tasks
  grunt.registerTask('test', ['jshint', 'build', 'qunit']);
  grunt.registerTask('build', ['clean', 'copy', 'transpile', 'concat', 'uglify']);
  grunt.registerTask('watchBuild', ['jshint', 'build', 'qunit', 'concurrent:watches']);
  grunt.registerTask('default', ['watchBuild']);
};<|endoftext|>


<commit_before>/**
 * Created by bantonides on 11/27/13.
 */
module.exports = function(grunt) {

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

  grunt.initConfig({
    /**
     * We read in our `package.json` file so we can access the package name and
     * version. It's already there, so we don't repeat ourselves here.
     */
    pkg: grunt.file.readJSON('package.json'),
    sass: {
      dist: {
        files: {
          'public/assets/css/app.css': 'public/assets/css/app.scss'
        }
      }
    },
    watch: {
      css: {
        files: '**/*.scss',
        tasks: ['sass'],
        options: {
          livereload: true
        }
      },
      html: {
        files: '**/*.html',
        options: {
          livereload: true
        }
      },
      js: {
        files: 'public/**/*.js'
      }

    },
    gjslint: {
      options: {
        flags: [
          '--disable 220', //ignore error code 220 from gjslint
          '--max_line_length 120'//,
          //'--jslint_error all'
        ],
        reporter: {
          name: 'console'
        }
      },
      all: {
        src: ['*.js',
          'public/assets/js/app/**/*.js']
      }
    },
    // start the app, instead of typing `node app.js`
    nodemon: {
      dev: {
        options: {
          file: 'app.js',
          ignoredFiles: ['public/**', '.sass-cache/**', '.git/**', 'newrelic_agent.log', 'sessions/*']
        }
      },
      prod_like: {
        options: {
          file: 'app.js',
          ignoredFiles: ['*']
        }
      }
    },
    bower: {
      install: {
        // copy dependent packages from bower.json
      }
    },
    replace: {
      auth0: {
        src: ['public/assets/js/app/config.js.template'],
        dest: 'public/assets/js/app/config.js',
        replacements: [{
          from: 'AUTH0_CLIENT_ID_DASHBOARD',
          to: process.env.AUTH0_CLIENT_ID_DASHBOARD
        },
        {
          from: 'AUTH0_DOMAIN_DASHBOARD',
          to: process.env.AUTH0_DOMAIN_DASHBOARD
        },
        {
          from: 'AUTH0_REDIRECT_URI_DASHBOARD',
          to: process.env.AUTH0_REDIRECT_URI_DASHBOARD
        },
        {
          from: 'AUTH0_AUDIENCE_DASHBOARD',
          to: process.env.AUTH0_AUDIENCE_DASHBOARD
        }]
      }
    },
    run: {
      production: {
        cmd: 'node',
        args: ['-u', 'node', 'app.js']
      },
      migrate: {
        cmd: 'node_modules/.bin/db-migrate',
        args: ['up']
      }
    },
    // Run blocking grunt tasks concurrently
    concurrent: {
      dev_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['bower:install', 'replace:auth0']
      },
      dev_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['watch', 'nodemon:dev']
      },
      migrate: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:migrate']
      },
      prod_like_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['sass', 'replace:auth0']
      },
      prod_like_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:production']
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-task');

  grunt.registerTask('default', ['concurrent:dev_configure', 'concurrent:migrate', 'concurrent:dev_run']);
  grunt.registerTask('staging', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
  grunt.registerTask('production', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
};
<commit_msg>revert node user<commit_after>/**
 * Created by bantonides on 11/27/13.
 */
module.exports = function(grunt) {

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

  grunt.initConfig({
    /**
     * We read in our `package.json` file so we can access the package name and
     * version. It's already there, so we don't repeat ourselves here.
     */
    pkg: grunt.file.readJSON('package.json'),
    sass: {
      dist: {
        files: {
          'public/assets/css/app.css': 'public/assets/css/app.scss'
        }
      }
    },
    watch: {
      css: {
        files: '**/*.scss',
        tasks: ['sass'],
        options: {
          livereload: true
        }
      },
      html: {
        files: '**/*.html',
        options: {
          livereload: true
        }
      },
      js: {
        files: 'public/**/*.js'
      }

    },
    gjslint: {
      options: {
        flags: [
          '--disable 220', //ignore error code 220 from gjslint
          '--max_line_length 120'//,
          //'--jslint_error all'
        ],
        reporter: {
          name: 'console'
        }
      },
      all: {
        src: ['*.js',
          'public/assets/js/app/**/*.js']
      }
    },
    // start the app, instead of typing `node app.js`
    nodemon: {
      dev: {
        options: {
          file: 'app.js',
          ignoredFiles: ['public/**', '.sass-cache/**', '.git/**', 'newrelic_agent.log', 'sessions/*']
        }
      },
      prod_like: {
        options: {
          file: 'app.js',
          ignoredFiles: ['*']
        }
      }
    },
    bower: {
      install: {
        // copy dependent packages from bower.json
      }
    },
    replace: {
      auth0: {
        src: ['public/assets/js/app/config.js.template'],
        dest: 'public/assets/js/app/config.js',
        replacements: [{
          from: 'AUTH0_CLIENT_ID_DASHBOARD',
          to: process.env.AUTH0_CLIENT_ID_DASHBOARD
        },
        {
          from: 'AUTH0_DOMAIN_DASHBOARD',
          to: process.env.AUTH0_DOMAIN_DASHBOARD
        },
        {
          from: 'AUTH0_REDIRECT_URI_DASHBOARD',
          to: process.env.AUTH0_REDIRECT_URI_DASHBOARD
        },
        {
          from: 'AUTH0_AUDIENCE_DASHBOARD',
          to: process.env.AUTH0_AUDIENCE_DASHBOARD
        }]
      }
    },
    run: {
      production: {
        cmd: 'node',
        args: ['app.js']
      },
      migrate: {
        cmd: 'node_modules/.bin/db-migrate',
        args: ['up']
      }
    },
    // Run blocking grunt tasks concurrently
    concurrent: {
      dev_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['bower:install', 'replace:auth0']
      },
      dev_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['watch', 'nodemon:dev']
      },
      migrate: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:migrate']
      },
      prod_like_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['sass', 'replace:auth0']
      },
      prod_like_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:production']
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-task');

  grunt.registerTask('default', ['concurrent:dev_configure', 'concurrent:migrate', 'concurrent:dev_run']);
  grunt.registerTask('staging', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
  grunt.registerTask('production', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
};
<|endoftext|>


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

  // check task runtime
  require('time-grunt')(grunt);

  // load generic configs
  var configs = require('dalek-build-tools');

  grunt.initConfig({

    // load module meta data
    pkg: grunt.file.readJSON('package.json'),

    // define a src set of files for other tasks
    src: {
      lint: ['Gruntfile.js', 'index.js', 'lib/**/*.js', 'test/*.js'],
      complexity: ['index.js', 'lib/**/*.js'],
      test: ['test/*.js'],
      src: ['index.js', 'lib/**/*.js']
    },

    // clean automatically generated helper files & docs
    clean: configs.clean,

    // speed up build by defining concurrent tasks
    concurrent: configs.concurrent,

    // linting
    jshint: configs.jshint,

    // testing
    mochaTest: configs.mocha,

    // code metrics
    complexity: configs.complexity,
    plato: configs.plato(grunt.file.readJSON('.jshintrc')),

    // api docs
    yuidoc: configs.yuidocs(),

    // up version, tag & commit
    bump: configs.bump({
      pushTo: 'git@github.com:dalekjs/dalek-driver-sauce.git',
      files: ['package.json', 'CONTRIBUTORS.md', 'CHANGELOG.md']
    }),

    // generate contributors file
    contributors: configs.contributors,

    // compress artifacts
    compress: configs.compress,

    // user docs
    documantix: {
      options: {
        header: 'dalekjs/dalekjs.com/master/assets/header.html',
        footer: 'dalekjs/dalekjs.com/master/assets/footer.html',
        target: 'report/docs',
        vars: {
          title: 'DalekJS - Documentation - Driver Sauce Labs',
          desc: 'DalekJS - Documentation - Driver Sauce Labs',
          docs: true
        }
      },
      src: ['index.js']
    },

    // add current timestamp to the html document
    includereplace: {
      dist: {
        options: {
          globals: {
            timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
          },
        },
        src: 'report/docs/*.html',
        dest: '.'
      }
    },

    // prepare files for grunt-plato to
    // avoid error messages (weird issue...)
    preparePlato: {
      options: {
        folders: [
          'coverage',
          'report',
          'report/complexity',
          'report/complexity/files',
          'report/complexity/files/test',
          'report/complexity/files/index_js',
          'report/complexity/files/lib_browser_js',
          'report/complexity/files/lib_commands_cookie_js',
          'report/complexity/files/lib_commands_element_js',
          'report/complexity/files/lib_commands_frame_js',
          'report/complexity/files/lib_commands_page_js',
          'report/complexity/files/lib_commands_screenshot_js',
          'report/complexity/files/lib_commands_window_js',
          'report/complexity/files/lib_commands_url_js'
        ],
        files: [
          'report.history.json',
          'files/report.history.json',
          'files/index_js/report.history.json',
          'files/lib_commands_cookie_js/report.history.json',
          'files/lib_browser_js/report.history.json',
          'files/lib_commands_element_js/report.history.json',
          'files/lib_commands_frame_js/report.history.json',
          'files/lib_commands_page_js/report.history.json',
          'files/lib_commands_screenshot_js/report.history.json',
          'files/lib_commands_url_js/report.history.json',
          'files/lib_commands_window_js/report.history.json'
        ]
      }
    },

    // prepare files & folders for coverage
    prepareCoverage: {
      options: {
        folders: ['coverage', 'report', 'report/coverage'],
        pattern: '[require("fs").realpathSync(__dirname + "/../index.js"), require("fs").realpathSync(__dirname + "/../lib/")]'
      }
    },

    // add current timestamp to the html document
    includereplace: {
      dist: {
        options: {
          globals: {
            timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
          },
        },
        src: 'report/docs/*.html',
        dest: '.'
      }
    },

    // archive docs
    archive: {
      options: {
        files: ['sauce.html']
      }
    },

    // release canary version
    'release-canary': {
      options: {
        files: []
      }
    }

  });

  // load 3rd party tasks
  require('load-grunt-tasks')(grunt);
  grunt.loadTasks('./node_modules/dalek-build-tools/tasks');
  grunt.loadNpmTasks('grunt-documantix');

  // define runner tasks
  grunt.registerTask('lint', 'jshint');

  // split test & docs for speed
  grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'concurrent:test', 'generateCoverageBadge']);
  grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'concurrent:docs', 'documantix', 'includereplace', 'compress']);

  // release tasks
  grunt.registerTask('releasePatch', ['test', 'bump-only:patch', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMinor', ['test', 'bump-only:minor', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMajor', ['test', 'bump-only:major', 'contributors', 'changelog', 'bump-commit']);

  // clean, test, generate docs (the CI task)
  grunt.registerTask('all', ['clean', 'test', 'docs']);
};
<commit_msg>chore(gruntfile): fixed includeReplace task<commit_after>module.exports = function (grunt) {
  'use strict';

  // check task runtime
  require('time-grunt')(grunt);

  // load generic configs
  var configs = require('dalek-build-tools');

  grunt.initConfig({

    // load module meta data
    pkg: grunt.file.readJSON('package.json'),

    // define a src set of files for other tasks
    src: {
      lint: ['Gruntfile.js', 'index.js', 'lib/**/*.js', 'test/*.js'],
      complexity: ['index.js', 'lib/**/*.js'],
      test: ['test/*.js'],
      src: ['index.js', 'lib/**/*.js']
    },

    // clean automatically generated helper files & docs
    clean: configs.clean,

    // speed up build by defining concurrent tasks
    concurrent: configs.concurrent,

    // linting
    jshint: configs.jshint,

    // testing
    mochaTest: configs.mocha,

    // code metrics
    complexity: configs.complexity,
    plato: configs.plato(grunt.file.readJSON('.jshintrc')),

    // api docs
    yuidoc: configs.yuidocs(),

    // up version, tag & commit
    bump: configs.bump({
      pushTo: 'git@github.com:dalekjs/dalek-driver-sauce.git',
      files: ['package.json', 'CONTRIBUTORS.md', 'CHANGELOG.md']
    }),

    // generate contributors file
    contributors: configs.contributors,

    // compress artifacts
    compress: configs.compress,

    // user docs
    documantix: {
      options: {
        header: 'dalekjs/dalekjs.com/master/assets/header.html',
        footer: 'dalekjs/dalekjs.com/master/assets/footer.html',
        target: 'report/docs',
        vars: {
          title: 'DalekJS - Documentation - Driver Sauce Labs',
          desc: 'DalekJS - Documentation - Driver Sauce Labs',
          docs: true
        }
      },
      src: ['index.js']
    },

    // prepare files for grunt-plato to
    // avoid error messages (weird issue...)
    preparePlato: {
      options: {
        folders: [
          'coverage',
          'report',
          'report/complexity',
          'report/complexity/files',
          'report/complexity/files/test',
          'report/complexity/files/index_js',
          'report/complexity/files/lib_browser_js',
          'report/complexity/files/lib_commands_cookie_js',
          'report/complexity/files/lib_commands_element_js',
          'report/complexity/files/lib_commands_frame_js',
          'report/complexity/files/lib_commands_page_js',
          'report/complexity/files/lib_commands_screenshot_js',
          'report/complexity/files/lib_commands_window_js',
          'report/complexity/files/lib_commands_url_js'
        ],
        files: [
          'report.history.json',
          'files/report.history.json',
          'files/index_js/report.history.json',
          'files/lib_commands_cookie_js/report.history.json',
          'files/lib_browser_js/report.history.json',
          'files/lib_commands_element_js/report.history.json',
          'files/lib_commands_frame_js/report.history.json',
          'files/lib_commands_page_js/report.history.json',
          'files/lib_commands_screenshot_js/report.history.json',
          'files/lib_commands_url_js/report.history.json',
          'files/lib_commands_window_js/report.history.json'
        ]
      }
    },

    // prepare files & folders for coverage
    prepareCoverage: {
      options: {
        folders: ['coverage', 'report', 'report/coverage'],
        pattern: '[require("fs").realpathSync(__dirname + "/../index.js"), require("fs").realpathSync(__dirname + "/../lib/")]'
      }
    },

    // add current timestamp to the html document
    includereplace: {
      dist: {
        options: {
          globals: {
            timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
          },
        },
        src: 'report/docs/*.html',
        dest: '.'
      }
    },

    // archive docs
    archive: {
      options: {
        files: ['sauce.html']
      }
    },

    // release canary version
    'release-canary': {
      options: {
        files: []
      }
    }

  });

  // load 3rd party tasks
  require('load-grunt-tasks')(grunt);
  grunt.loadTasks('./node_modules/dalek-build-tools/tasks');
  grunt.loadNpmTasks('grunt-documantix');

  // define runner tasks
  grunt.registerTask('lint', 'jshint');

  // split test & docs for speed
  grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'concurrent:test', 'generateCoverageBadge']);
  grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'concurrent:docs', 'documantix', 'includereplace', 'compress']);

  // release tasks
  grunt.registerTask('releasePatch', ['test', 'bump-only:patch', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMinor', ['test', 'bump-only:minor', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMajor', ['test', 'bump-only:major', 'contributors', 'changelog', 'bump-commit']);

  // clean, test, generate docs (the CI task)
  grunt.registerTask('all', ['clean', 'test', 'docs']);
};
<|endoftext|>


<commit_before>/*
* grunt-iojs-api-docs
* https://github.com/nodenica/grunt-iojs-api-docs.git
*
* Copyright (c) 2015 Paulo McNally <paulomcnally@gmail.com>
* Licensed under the MIT license.
*/

'use strict';

var version = '5.5.0';

module.exports = function(grunt) {
  // load all npm grunt tasks
  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // Configuration to be run (and then tested).
    docs: {
      'default_options': {
        options: {
          version: version,
          dest: './dest/'
        },

      }
    },
    copy: {
      main: {
        files: [
          // includes files within path
          {
            expand: true,
            cwd: 'dest/' + version,
            src: [ '**' ],
            dest: '/home/polin/github/nodenica/node-documentation-android-pro/app/src/main/assets/en'
          },
          {
            expand: true,
            cwd: 'dest/' + version,
            src: [ '**' ],
            dest: '/home/polin/github/nodenica/node-documentation-android-free/app/src/main/assets/en'
          }
        ],
      },
    }
  });
  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');
  // By default, lint and run all tests.
  grunt.registerTask('default', [
    'docs',
    'copy'
  ]);
};
<commit_msg>v5.6.0<commit_after>/*
* grunt-iojs-api-docs
* https://github.com/nodenica/grunt-iojs-api-docs.git
*
* Copyright (c) 2015 Paulo McNally <paulomcnally@gmail.com>
* Licensed under the MIT license.
*/

'use strict';

var version = '5.6.0';

module.exports = function(grunt) {
  // load all npm grunt tasks
  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // Configuration to be run (and then tested).
    docs: {
      'default_options': {
        options: {
          version: version,
          dest: './dest/'
        },

      }
    },
    copy: {
      main: {
        files: [
          // includes files within path
          {
            expand: true,
            cwd: 'dest/' + version,
            src: [ '**' ],
            dest: '/home/polin/github/nodenica/node-documentation-android-pro/app/src/main/assets/en'
          },
          {
            expand: true,
            cwd: 'dest/' + version,
            src: [ '**' ],
            dest: '/home/polin/github/nodenica/node-documentation-android-free/app/src/main/assets/en'
          }
        ],
      },
    }
  });
  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');
  // By default, lint and run all tests.
  grunt.registerTask('default', [
    'docs',
    'copy'
  ]);
};
<|endoftext|>