<commit_before>/* jshint node:true */

function mixin(destination) {
	for (var i = 1; i < arguments.length; i++) {
		var source = arguments[i];
		for (var key in source) {
			destination[key] = source[key];
		}
	}
	return destination;
}

module.exports = function (grunt) {
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-release');
	grunt.loadNpmTasks('grunt-text-replace');
	grunt.loadNpmTasks('grunt-ts');
	grunt.loadNpmTasks('grunt-tslint');
	grunt.loadNpmTasks('dts-generator');
	grunt.loadNpmTasks('intern');
	grunt.loadNpmTasks('remap-istanbul');

	grunt.loadTasks('tasks');

	var tsconfigContent = grunt.file.read('tsconfig.json');
	var tsconfig = JSON.parse(tsconfigContent);
	var tsOptions = mixin({}, tsconfig.compilerOptions, {
		failOnTypeErrors: true,
		fast: 'never'
	});
	tsconfig.filesGlob = tsconfig.filesGlob.map(function (glob) {
		if (/^\.\//.test(glob)) {
			// Remove the leading './' from the glob because grunt-ts
			// sees it and thinks it needs to create a .baseDir.ts which
			// messes up the "dist" compilation
			return glob.slice(2);
		}
		return glob;
	});
	var packageJson = grunt.file.readJSON('package.json');
	var staticTestFiles = [ 'tests/**', '!tests/**/*.js*' ];
	var staticExampleFiles = [ 'src/examples/**', '!src/examples/**/*.js' ];

	grunt.initConfig({
		name: packageJson.name,
		version: packageJson.version,
		tsconfig: tsconfig,
		tsconfigContent: tsconfigContent,
		packageJson: packageJson,
		all: [ '<%= tsconfig.filesGlob %>' ],
		skipTestsAndExamples: [ '<%= all %>' , '!tests/**/*.ts', '!src/examples/**/*.ts' ],
		devDirectory: '<%= tsconfig.compilerOptions.outDir %>',
		istanbulIgnoreNext: '/* istanbul ignore next */',

		clean: {
			dist: {
				src: [ 'dist/' ]
			},
			dev: {
				src: [ '<%= devDirectory %>' ]
			},
			src: {
				src: [ '{src,tests}/**/*.js' ],
				filter: function (path) {
					// Only clean the .js file if a .js.map file also exists
					var mapPath = path + '.map';
					if (grunt.file.exists(mapPath)) {
						grunt.file.delete(mapPath);
						return true;
					}
					return false;
				}
			},
			report: {
				src: [ 'html-report/', 'coverage-final.json' ]
			},
			coverage: {
				src: [ 'coverage-unmapped.json' ]
			}
		},

		copy: {
			staticFiles: {
				expand: true,
				cwd: '.',
				src: [ 'README.md', 'LICENSE', 'package.json', 'bower.json' ],
				dest: 'dist/'
			},
			staticTestFiles: {
				expand: true,
				cwd: '.',
				src: staticTestFiles,
				dest: '<%= devDirectory %>'
			},
			staticExampleFiles: {
				expand: true,
				cwd: '.',
				src: staticExampleFiles,
				dest: '<%= devDirectory %>'
			},
			staticDistFiles: {
				expand: true,
				cwd: 'src/',
				src: [ 'examples/**', 'themes/**/*.styl', '!examples/**/*.{js,ts}' ],
				dest: 'dist/'
			},
			typings: {
				expand: true,
				cwd: 'typings/',
				src: [ '**/*.d.ts', '!tsd.d.ts' ],
				dest: 'dist/typings/'
			}
		},

		dtsGenerator: {
			options: {
				baseDir: 'src',
				name: '<%= name %>'
			},
			dist: {
				options: {
					out: 'dist/typings/<%= name %>/<%= name %>-<%= version %>.d.ts'
				},
				src: [ '<%= skipTestsAndExamples %>' ]
			}
		},

		intern: {
			options: {
				runType: 'runner',
				config: '<%= devDirectory %>/tests/intern',
				reporters: [ 'Runner' ]
			},
			browserstack: {},
			saucelabs: {
				options: {
					config: '<%= devDirectory %>/tests/intern-saucelabs'
				}
			},
			remote: {},
			local: {
				options: {
					config: '<%= devDirectory %>/tests/intern-local'
				}
			},
			node: {
				options: {
					runType: 'client'
				}
			},
			proxy: {
				options: {
					proxyOnly: true
				}
			}
		},

		release: {
			options: {
				// Update the bower.json version as well
				additionalFiles: [ 'bower.json' ],
				// Run tasks after the version has been updated in package.json and bower.json
				afterBump: [ 'clean', 'dist' ],
				// Publish the "dist/" directory to npm
				folder: 'dist/',
				commitMessage: 'Updating source version to <%= version %>',
				tagMessage: 'Release <%= version %>',
				// Update the `version` property on the `packageJson` object.
				updateVars: [ packageJson ]
			}
		},

		rename: {
			sourceMaps: {
				expand: true,
				cwd: 'dist/',
				src: [ '**/*.js.map', '!_debug/**/*.js.map' ],
				dest: 'dist/_debug/'
			}
		},

		rewriteSourceMaps: {
			dist: {
				src: [ 'dist/_debug/**/*.js.map' ]
			}
		},

		replace: {
			addIstanbulIgnore: {
				src: [ '<%= devDirectory %>/**/*.js' ],
				overwrite: true,
				replacements: [
					{
						from: /^(var __(?:extends|decorate) = )/gm,
						to: '$1<%= istanbulIgnoreNext %> '
					},
					{
						from: /^(\()(function \(deps, )/m,
						to: '$1<%= istanbulIgnoreNext %> $2'
					}
				]
			}
		},

		stylus: {
			dev: {
				options: {},
				files: [ {
					expand: true,
					src: 'src/themes/**/*.styl',
					ext: '.css',
					dest: '_build/'
				} ]
			},
			dist: {
				options: {},
				files: [ {
					expand: true,
					cwd: 'src/',
					src: 'themes/**/*.styl',
					ext: '.css',
					dest: 'dist/'
				}]
			}
		},

		ts: {
			options: tsOptions,
			dev: {
				outDir: '<%= devDirectory %>',
				src: [ '<%= all %>' ]
			},
			dist: {
				options: {
					mapRoot: '../dist/_debug',
					sourceMap: true,
					inlineSourceMap: false,
					inlineSources: true
				},
				outDir: 'dist',
				src: [ '<%= skipTestsAndExamples %>' ]
			}
		},

		tslint: {
			options: {
				configuration: grunt.file.readJSON('tslint.json')
			},
			src: {
				src: [
					'<%= all %>',
					'!typings/**/*.ts',
					'!tests/typings/**/*.ts',
					'!node_modules/**/*.ts'
				]
			}
		},

		watch: {
			grunt: {
				options: {
					reload: true
				},
				files: [ 'Gruntfile.js', 'tsconfig.json' ]
			},
			src: {
				options: {
					atBegin: true
				},
				files: [ '<%= all %>' ].concat(staticTestFiles),
				tasks: [
					'dev'
				]
			}
		},

		remapIstanbul: {
			coverage: {
				options: {
					reports: {
						'html': 'html-report',
						'text': null
					}
				},
				src: [ 'coverage-unmapped.json' ]
			},
			ci: {
				options: {
					reports: {
						'lcovonly': 'coverage-final.lcov',
						'text': null
					}
				},
				src: [ 'coverage-unmapped.json' ]
			}
		}
	});

	// Set some Intern-specific options if specified on the command line.
	[ 'suites', 'functionalSuites', 'grep' ].forEach(function (option) {
		var value = grunt.option(option);
		if (value) {
			if (option !== 'grep') {
				value = value.split(',').map(function (string) { return string.trim(); });
			}
			grunt.config('intern.options.' + option, value);
		}
	});

	function setCombined(combined) {
		if (combined) {
			grunt.config('intern.options.reporters', [
				{ id: 'tests/support/Reporter', file: 'coverage-unmapped.json' }
			]);
		}
	}
	setCombined(grunt.option('combined'));

	grunt.registerTask('test', function () {
		var flags = Object.keys(this.flags);

		if (!flags.length) {
			flags.push('node');
		}

		grunt.option('force', true);
		grunt.task.run('clean:coverage');
		grunt.task.run('dev');
		setCombined(true);
		flags.forEach(function (flag) {
			grunt.task.run('intern:' + flag);
		});
		grunt.task.run('remapIstanbul:coverage');
		grunt.task.run('clean:coverage');
	});

	grunt.registerTask('dev', [
		'tslint',
		'ts:dev',
		'stylus:dev',
		'copy:staticTestFiles',
		'copy:staticExampleFiles',
		'replace:addIstanbulIgnore',
		'updateTsconfig'
	]);
	grunt.registerTask('dist', [
		'clean:dist',
		'tslint',
		'ts:dist',
		'stylus:dist',
		'rename:sourceMaps',
		'rewriteSourceMaps',
		'copy:typings',
		'copy:staticFiles',
		'copy:staticDistFiles',
		'dtsGenerator:dist',
		'updatePackageJson'
	]);
	grunt.registerTask('test-proxy', [ 'dev', 'intern:proxy' ]);
	grunt.registerTask('default', [ 'clean', 'dev' ]);
};
<commit_msg>Remove version number for distribution typings.<commit_after>/* jshint node:true */

function mixin(destination) {
	for (var i = 1; i < arguments.length; i++) {
		var source = arguments[i];
		for (var key in source) {
			destination[key] = source[key];
		}
	}
	return destination;
}

module.exports = function (grunt) {
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-release');
	grunt.loadNpmTasks('grunt-text-replace');
	grunt.loadNpmTasks('grunt-ts');
	grunt.loadNpmTasks('grunt-tslint');
	grunt.loadNpmTasks('dts-generator');
	grunt.loadNpmTasks('intern');
	grunt.loadNpmTasks('remap-istanbul');

	grunt.loadTasks('tasks');

	var tsconfigContent = grunt.file.read('tsconfig.json');
	var tsconfig = JSON.parse(tsconfigContent);
	var tsOptions = mixin({}, tsconfig.compilerOptions, {
		failOnTypeErrors: true,
		fast: 'never'
	});
	tsconfig.filesGlob = tsconfig.filesGlob.map(function (glob) {
		if (/^\.\//.test(glob)) {
			// Remove the leading './' from the glob because grunt-ts
			// sees it and thinks it needs to create a .baseDir.ts which
			// messes up the "dist" compilation
			return glob.slice(2);
		}
		return glob;
	});
	var packageJson = grunt.file.readJSON('package.json');
	var staticTestFiles = [ 'tests/**', '!tests/**/*.js*' ];
	var staticExampleFiles = [ 'src/examples/**', '!src/examples/**/*.js' ];

	grunt.initConfig({
		name: packageJson.name,
		version: packageJson.version,
		tsconfig: tsconfig,
		tsconfigContent: tsconfigContent,
		packageJson: packageJson,
		all: [ '<%= tsconfig.filesGlob %>' ],
		skipTestsAndExamples: [ '<%= all %>' , '!tests/**/*.ts', '!src/examples/**/*.ts' ],
		devDirectory: '<%= tsconfig.compilerOptions.outDir %>',
		istanbulIgnoreNext: '/* istanbul ignore next */',

		clean: {
			dist: {
				src: [ 'dist/' ]
			},
			dev: {
				src: [ '<%= devDirectory %>' ]
			},
			src: {
				src: [ '{src,tests}/**/*.js' ],
				filter: function (path) {
					// Only clean the .js file if a .js.map file also exists
					var mapPath = path + '.map';
					if (grunt.file.exists(mapPath)) {
						grunt.file.delete(mapPath);
						return true;
					}
					return false;
				}
			},
			report: {
				src: [ 'html-report/', 'coverage-final.json' ]
			},
			coverage: {
				src: [ 'coverage-unmapped.json' ]
			}
		},

		copy: {
			staticFiles: {
				expand: true,
				cwd: '.',
				src: [ 'README.md', 'LICENSE', 'package.json', 'bower.json' ],
				dest: 'dist/'
			},
			staticTestFiles: {
				expand: true,
				cwd: '.',
				src: staticTestFiles,
				dest: '<%= devDirectory %>'
			},
			staticExampleFiles: {
				expand: true,
				cwd: '.',
				src: staticExampleFiles,
				dest: '<%= devDirectory %>'
			},
			staticDistFiles: {
				expand: true,
				cwd: 'src/',
				src: [ 'examples/**', 'themes/**/*.styl', '!examples/**/*.{js,ts}' ],
				dest: 'dist/'
			},
			typings: {
				expand: true,
				cwd: 'typings/',
				src: [ '**/*.d.ts', '!tsd.d.ts' ],
				dest: 'dist/typings/'
			}
		},

		dtsGenerator: {
			options: {
				baseDir: 'src',
				name: '<%= name %>'
			},
			dist: {
				options: {
					out: 'dist/typings/<%= name %>/<%= name %>.d.ts'
				},
				src: [ '<%= skipTestsAndExamples %>' ]
			}
		},

		intern: {
			options: {
				runType: 'runner',
				config: '<%= devDirectory %>/tests/intern',
				reporters: [ 'Runner' ]
			},
			browserstack: {},
			saucelabs: {
				options: {
					config: '<%= devDirectory %>/tests/intern-saucelabs'
				}
			},
			remote: {},
			local: {
				options: {
					config: '<%= devDirectory %>/tests/intern-local'
				}
			},
			node: {
				options: {
					runType: 'client'
				}
			},
			proxy: {
				options: {
					proxyOnly: true
				}
			}
		},

		release: {
			options: {
				// Update the bower.json version as well
				additionalFiles: [ 'bower.json' ],
				// Run tasks after the version has been updated in package.json and bower.json
				afterBump: [ 'clean', 'dist' ],
				// Publish the "dist/" directory to npm
				folder: 'dist/',
				commitMessage: 'Updating source version to <%= version %>',
				tagMessage: 'Release <%= version %>',
				// Update the `version` property on the `packageJson` object.
				updateVars: [ packageJson ]
			}
		},

		rename: {
			sourceMaps: {
				expand: true,
				cwd: 'dist/',
				src: [ '**/*.js.map', '!_debug/**/*.js.map' ],
				dest: 'dist/_debug/'
			}
		},

		rewriteSourceMaps: {
			dist: {
				src: [ 'dist/_debug/**/*.js.map' ]
			}
		},

		replace: {
			addIstanbulIgnore: {
				src: [ '<%= devDirectory %>/**/*.js' ],
				overwrite: true,
				replacements: [
					{
						from: /^(var __(?:extends|decorate) = )/gm,
						to: '$1<%= istanbulIgnoreNext %> '
					},
					{
						from: /^(\()(function \(deps, )/m,
						to: '$1<%= istanbulIgnoreNext %> $2'
					}
				]
			}
		},

		stylus: {
			dev: {
				options: {},
				files: [ {
					expand: true,
					src: 'src/themes/**/*.styl',
					ext: '.css',
					dest: '_build/'
				} ]
			},
			dist: {
				options: {},
				files: [ {
					expand: true,
					cwd: 'src/',
					src: 'themes/**/*.styl',
					ext: '.css',
					dest: 'dist/'
				}]
			}
		},

		ts: {
			options: tsOptions,
			dev: {
				outDir: '<%= devDirectory %>',
				src: [ '<%= all %>' ]
			},
			dist: {
				options: {
					mapRoot: '../dist/_debug',
					sourceMap: true,
					inlineSourceMap: false,
					inlineSources: true
				},
				outDir: 'dist',
				src: [ '<%= skipTestsAndExamples %>' ]
			}
		},

		tslint: {
			options: {
				configuration: grunt.file.readJSON('tslint.json')
			},
			src: {
				src: [
					'<%= all %>',
					'!typings/**/*.ts',
					'!tests/typings/**/*.ts',
					'!node_modules/**/*.ts'
				]
			}
		},

		watch: {
			grunt: {
				options: {
					reload: true
				},
				files: [ 'Gruntfile.js', 'tsconfig.json' ]
			},
			src: {
				options: {
					atBegin: true
				},
				files: [ '<%= all %>' ].concat(staticTestFiles),
				tasks: [
					'dev'
				]
			}
		},

		remapIstanbul: {
			coverage: {
				options: {
					reports: {
						'html': 'html-report',
						'text': null
					}
				},
				src: [ 'coverage-unmapped.json' ]
			},
			ci: {
				options: {
					reports: {
						'lcovonly': 'coverage-final.lcov',
						'text': null
					}
				},
				src: [ 'coverage-unmapped.json' ]
			}
		}
	});

	// Set some Intern-specific options if specified on the command line.
	[ 'suites', 'functionalSuites', 'grep' ].forEach(function (option) {
		var value = grunt.option(option);
		if (value) {
			if (option !== 'grep') {
				value = value.split(',').map(function (string) { return string.trim(); });
			}
			grunt.config('intern.options.' + option, value);
		}
	});

	function setCombined(combined) {
		if (combined) {
			grunt.config('intern.options.reporters', [
				{ id: 'tests/support/Reporter', file: 'coverage-unmapped.json' }
			]);
		}
	}
	setCombined(grunt.option('combined'));

	grunt.registerTask('test', function () {
		var flags = Object.keys(this.flags);

		if (!flags.length) {
			flags.push('node');
		}

		grunt.option('force', true);
		grunt.task.run('clean:coverage');
		grunt.task.run('dev');
		setCombined(true);
		flags.forEach(function (flag) {
			grunt.task.run('intern:' + flag);
		});
		grunt.task.run('remapIstanbul:coverage');
		grunt.task.run('clean:coverage');
	});

	grunt.registerTask('dev', [
		'tslint',
		'ts:dev',
		'stylus:dev',
		'copy:staticTestFiles',
		'copy:staticExampleFiles',
		'replace:addIstanbulIgnore',
		'updateTsconfig'
	]);
	grunt.registerTask('dist', [
		'clean:dist',
		'tslint',
		'ts:dist',
		'stylus:dist',
		'rename:sourceMaps',
		'rewriteSourceMaps',
		'copy:typings',
		'copy:staticFiles',
		'copy:staticDistFiles',
		'dtsGenerator:dist',
		'updatePackageJson'
	]);
	grunt.registerTask('test-proxy', [ 'dev', 'intern:proxy' ]);
	grunt.registerTask('default', [ 'clean', 'dev' ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        // contrib-watch
        watch: {
            all: {
                files: ['src/**/*.js', 'lib/**/*.js', 'test/**/*.js', 'Gruntfile.js'],
                tasks: ['test', 'build']
            }
        },
        // contrib-jshint
        jshint: {
            all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js']
        },
        // contrib-qunit
        qunit: {
            all: 'test/**/*.html'
        },
        // contrib-uglify
        uglify: {
            options: {
                preserveComments: function(node, comment) {
                    // Preserve the license banner
                    return comment.col === 0 && comment.pos === 0;
                }
            },
            all: {
                files: {
                    'src/jquery.countdown.min.js': ['src/jquery.countdown.js']
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');

    // Project tasks
    grunt.registerTask('license', function() {

    });

    grunt.registerTask('test',      ['jshint', 'qunit']);
    grunt.registerTask('build',     ['license', 'uglify']);
    grunt.registerTask('default',   ['test', 'build', 'watch']);
};<commit_msg>Remove lint from minified version<commit_after>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        // contrib-watch
        watch: {
            all: {
                files: ['src/**/*.js', 'lib/**/*.js', 'test/**/*.js', 'Gruntfile.js'],
                tasks: ['test', 'build']
            }
        },
        // contrib-jshint
        jshint: {
            all: ['Gruntfile.js', 'src/jquery.countdown.js', 'test/**/*.js']
        },
        // contrib-qunit
        qunit: {
            all: 'test/**/*.html'
        },
        // contrib-uglify
        uglify: {
            options: {
                preserveComments: function(node, comment) {
                    // Preserve the license banner
                    return comment.col === 0 && comment.pos === 0;
                }
            },
            all: {
                files: {
                    'src/jquery.countdown.min.js': ['src/jquery.countdown.js']
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');

    // Project tasks
    grunt.registerTask('license', function() {

    });

    grunt.registerTask('test',      ['jshint', 'qunit']);
    grunt.registerTask('build',     ['license', 'uglify']);
    grunt.registerTask('default',   ['test', 'build', 'watch']);
};<|endoftext|>


<commit_before>"use strict";

module.exports = function (grunt) {
    // Load grunt tasks automatically
    require("jit-grunt")(grunt, {
        nugetpack: "grunt-nuget",
        nugetpush: "grunt-nuget",
        buildcontrol: "grunt-build-control"
    });
    require("time-grunt")(grunt); // Time how long tasks take. Can help when optimizing build times

    var pkg = require("./package.json");

    grunt.initConfig({
        pkg: pkg,
        // Configurable paths
        paths: {
            bin: "bin",
            lib: "lib",
            tmpl: "template",
            build: "build",
            dist: "dist",
            all: "{<%= paths.bin %>,<%= paths.lib %>,<%= paths.tmpl %>}",
            defs: "typings/_definitions.d.ts",
            temp: "temp"
        },

        typescript: {
            options: {
                target: "es5",
                module: "commonjs",
                sourceMap: true,
                declaration: false,
                removeComments: false
            },
            src: {
                src: ["<%= paths.defs %>", "<%= paths.all %>/**/*.ts", "./*.ts"]
            },
            dist: {
                src: ["<%= typescript.src.src %>"],
                options: {
                    sourceMap: false
                }
            }
        },

        jsdoc : {
            typescript : {
                src: ["node_modules/typescript/bin/typescript.d.ts"],
                dest: "<%= paths.dist %>/typescript",
                options: { configure: "<%= paths.build %>/conf.typescript.json" }
            },
            lib : {
                src: ["node_modules/typescript/bin/lib.d.ts"],
                dest: "<%= paths.dist %>/lib",
                options: { configure: "<%= paths.build %>/conf.lib.json" }
            },
            node : {
                src: ["typings/node/node.d.ts"],
                dest: "<%= paths.dist %>/node",
                options: { configure: "<%= paths.build %>/conf.node.json" }
            }
        },

        tslint: {
            options: {
                configuration: grunt.file.readJSON("tslint.json")
            },
            src: {
                src: ["<%= paths.all %>/**/*.ts", "./*.ts"]
            }
        },

        clean: {
            src: [
                "<%= paths.all %>/**/*.{d.ts,js,js.map}",
                "./*.{d.ts,js,js.map}",
                "!<%= paths.tmpl %>/static/**",
                "!./Gruntfile.js",
            ],
            dist: "<%= paths.dist %>",
            temp: "<%= paths.temp %>"
        },

        connect: {
            options: {
                port: "8080",
                livereload: 56765
            },
            dist: {
                options: {
                    base: "<%= paths.dist %>"
                }
            }
        },

        watch: {
            tslint: { files: ["<%= tslint.src.src %>"], tasks: ["tslint:src"] },
            typescript: { files: ["<%= typescript.src.src %>"], tasks: ["typescript:src"] },
            gruntfile: { files: ["Gruntfile.js"] },

            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: ["<%= paths.dist %>/**/*.{js,html,css}"]
            }
        },

        buildcontrol: {
            options: {
                dir: "<%= paths.dist %>",
                commit: true,
                push: true,
                branch: "gh-pages",
                message: "Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%"
            },
            dist: { }
        }
    });

    grunt.registerTask("dev", ["tslint:src", "clean:src", "typescript:src"]);
    grunt.registerTask("build", ["tslint:src", "clean:src", "typescript:dist"]);
    grunt.registerTask("doc", ["clean:dist", "jsdoc:typescript", "jsdoc:node"]);

    grunt.registerTask("serve", ["dev", "doc", "connect:dist", "watch"]);

    grunt.registerTask("publish", ["build", "buildcontrol:publish"]);

    grunt.registerTask("default", ["build"]);
};<commit_msg>Fix issue in gh-pages generation<commit_after>"use strict";

module.exports = function (grunt) {
    // Load grunt tasks automatically
    require("jit-grunt")(grunt, {
        nugetpack: "grunt-nuget",
        nugetpush: "grunt-nuget",
        buildcontrol: "grunt-build-control"
    });
    require("time-grunt")(grunt); // Time how long tasks take. Can help when optimizing build times

    var pkg = require("./package.json");

    grunt.initConfig({
        pkg: pkg,
        // Configurable paths
        paths: {
            bin: "bin",
            lib: "lib",
            tmpl: "template",
            build: "build",
            dist: "dist",
            all: "{<%= paths.bin %>,<%= paths.lib %>,<%= paths.tmpl %>}",
            defs: "typings/_definitions.d.ts",
            temp: "temp"
        },

        typescript: {
            options: {
                target: "es5",
                module: "commonjs",
                sourceMap: true,
                declaration: false,
                removeComments: false
            },
            src: {
                src: ["<%= paths.defs %>", "<%= paths.all %>/**/*.ts", "./*.ts"]
            },
            dist: {
                src: ["<%= typescript.src.src %>"],
                options: {
                    sourceMap: false
                }
            }
        },

        jsdoc : {
            typescript : {
                src: ["node_modules/typescript/bin/typescript.d.ts"],
                dest: "<%= paths.dist %>/typescript",
                options: { configure: "<%= paths.build %>/conf.typescript.json" }
            },
            lib : {
                src: ["node_modules/typescript/bin/lib.d.ts"],
                dest: "<%= paths.dist %>/lib",
                options: { configure: "<%= paths.build %>/conf.lib.json" }
            },
            node : {
                src: ["typings/node/node.d.ts"],
                dest: "<%= paths.dist %>/node",
                options: { configure: "<%= paths.build %>/conf.node.json" }
            }
        },

        tslint: {
            options: {
                configuration: grunt.file.readJSON("tslint.json")
            },
            src: {
                src: ["<%= paths.all %>/**/*.ts", "./*.ts"]
            }
        },

        clean: {
            src: [
                "<%= paths.all %>/**/*.{d.ts,js,js.map}",
                "./*.{d.ts,js,js.map}",
                "!<%= paths.tmpl %>/static/**",
                "!./Gruntfile.js",
            ],
            dist: "<%= paths.dist %>",
            temp: "<%= paths.temp %>"
        },

        connect: {
            options: {
                port: "8080",
                livereload: 56765
            },
            dist: {
                options: {
                    base: "<%= paths.dist %>"
                }
            }
        },

        watch: {
            tslint: { files: ["<%= tslint.src.src %>"], tasks: ["tslint:src"] },
            typescript: { files: ["<%= typescript.src.src %>"], tasks: ["typescript:src"] },
            gruntfile: { files: ["Gruntfile.js"] },

            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: ["<%= paths.dist %>/**/*.{js,html,css}"]
            }
        },

        buildcontrol: {
            docs: {
                options: {
                    dir: "<%= paths.dist %>",
                    commit: true,
                    push: true,
                    branch: "gh-pages",
                    message: "Built documentations %sourceName% from commit %sourceCommit% on branch %sourceBranch%"
                }
            }
        }
    });

    grunt.registerTask("dev", ["tslint:src", "clean:src", "typescript:src"]);
    grunt.registerTask("build", ["tslint:src", "clean:src", "typescript:dist"]);
    grunt.registerTask("doc", ["clean:dist", "jsdoc:typescript", "jsdoc:node"]);

    grunt.registerTask("serve", ["dev", "doc", "connect:dist", "watch"]);

    grunt.registerTask("publish", ["build", "doc", "buildcontrol:docs"]);

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


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

  // Project configuration.
  grunt.initConfig({

    // Project settings
    simg: {
      // configurable paths
      scriptPath: 'src',
      distPath: 'dist',
      bowerPath: 'lib',
      testPath: 'test'
    },

    pkg: grunt.file.readJSON('package.json'),

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
        report: 'gzip'
      },
      build: {
        src: [
            '<%= simg.scriptPath %>/simg.js'
        ],
        dest: '<%= simg.distPath %>/simg.min.js'
      }
    },

    jshint: {
      options: {
          jshintrc: true
      },
      all: [
        '<%= simg.scriptPath %>/*.js'
      ]
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  grunt.registerTask('default', ['uglify']);
  grunt.registerTask('lint', ['jshint']);
};
<commit_msg>Fix uglify script no longer running.<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    // Project settings
    simg: {
      // configurable paths
      scriptPath: 'src',
      distPath: 'dist',
      bowerPath: 'lib',
      testPath: 'test'
    },

    pkg: grunt.file.readJSON('package.json'),

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
        report: 'min'
      },
      build: {
        src: [
            '<%= simg.scriptPath %>/simg.js'
        ],
        dest: '<%= simg.distPath %>/simg.min.js'
      }
    },

    jshint: {
      options: {
          jshintrc: true
      },
      all: [
        '<%= simg.scriptPath %>/*.js'
      ]
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');

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


<commit_before>/* File: GruntFile.js
 *
 * Copyright (c) 2014
 * Centre National d’Enseignement à Distance (Cned), Boulevard Nicephore Niepce, 86360 CHASSENEUIL-DU-POITOU, France
 * (direction-innovation@cned.fr)
 *
 * GNU Affero General Public License (AGPL) version 3.0 or later version
 *
 * This file is part of a program which is free software: you can
 * redistribute it and/or modify it under the terms of the
 * GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this program.
 * If not, see <http://www.gnu.org/licenses/>.
 *
 */

'use strict';

var path = require('path');

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

    // configurable paths
    var yeomanConfig = {
        app: '.',
        dist: 'dist',
        generated: 'generated'
    };

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

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            main: {
                files: ['app/**/*.{html,css,png,jpeg,GIF,jpg,eot,svg,ttf,woff}'],
            },
            options: {
                livereload: true,
                port: 3000,
                key: grunt.file.read('../sslcert/key.pem'),
                cert: grunt.file.read('../sslcert/cert.pem')
            }
        },
        express: {
            options: {
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    server: path.resolve('./app.js'),
                    livereload: true,
                    serverreload: false,
                    bases: [path.resolve('./.tmp'), path.resolve(__dirname, yeomanConfig.app)],
                    spawn: false
                }
            },
            test: {
                options: {
                    server: path.resolve('./app.js'),
                    bases: [path.resolve('./.tmp'), path.resolve(__dirname, 'test')]
                }
            },
            dist: {
                options: {
                    server: path.resolve('./app.js'),
                    bases: path.resolve(__dirname, yeomanConfig.dist)
                }
            },
            server: {
                options: {
                    port: 80
                }
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= express.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '<%= yeoman.generated %>/*',
                        '!<%= yeoman.dist %>/.git*']
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: 'checkstyle',
                reporterOutput: 'generated/jshint/resultJSHint.xml'
            },
            all: {
                src: ['Gruntfile.js', 'app/scripts/**/*.js', 'api/**/*.js', 'test/spec/**/*.js']
            }
        },
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                        '<%= yeoman.dist %>/styles/fonts/*']
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            // By default, your `index.html` <!-- Usemin Block --> will take care of
            // minification. This option is pre-configured if you do not wish to use
            // Usemin blocks.
            // dist: {
            //   files: {
            //     '<%= yeoman.dist %>/styles/main.css': [
            //       '.tmp/styles/{,*/}*.css',
            //       '<%= yeoman.app %>/styles/{,*/}*.css'
            //     ]
            //   }
            // }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                     // https://github.com/yeoman/grunt-usemin/issues/44
                     //collapseWhitespace: true,
                     collapseBooleanAttributes: true,
                     removeAttributeQuotes: true,
                     removeRedundantAttributes: true,
                     useShortDoctype: true,
                     removeEmptyAttributes: true,
                     removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: ['*.html', 'views/*.html'],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        'app/**/*.{html,css,png,jpeg,GIF,jpg,eot,svg,ttf,woff}',
                        'app/bower_components/**/*.js',
                        'api/**/*',
                        'models/**/*',
                        'routes/**/*',
                        'custom_node_modules/**',
                        'app.js',
                        'Gruntfile.js',
                        'package.json',
                        'files/**/**/**',
                        'po/**']
                }, {
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: ['env/config.<%= [NODE_ENV] %>.json'],
                    rename: function(dest) {
                        return dest + '/env/config.json';
                    }
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*']
                }]
            }
        },
        concurrent: {
            dist: [
                'imagemin',
                'svgmin']
        },
        ngmin: {
            controllers: {
                expand: true,
                cwd: 'app',
                src: ['scripts/**/*.js'],
                dest: 'generated/'
            }
        },
        uglify: {
            build: {
                src: ' <%= yeoman.generated %>/scripts/**/*.js',
                dest: '<%= yeoman.dist %>/app/scripts/front.js'
            }
        },
        karma: {
            unit: {
                configFile: 'karma.conf.js',
                singleRun: true
            }
        },
        cdnify: {
            dist: {
                html: ['<%= yeoman.dist %>/*.html']
            }
        },
        nggettext_extract: {
            pot: {
                files: {
                    'po/template.pot': ['app/views/**/*.html']
                }
            }
        },
        nggettext_compile: {
            all: {
                files: {
                    'app/scripts/translations.js': ['po/*.po']
                }
            }
        },
        /**
         * Specification de chaque configuration d'un ENV comme task
         */
        env: {
            dev: {
                src: 'env/config.json'
            },
            test: {
                src: 'env/config.test.json'
            },
            integ: {
                src: 'env/config.integ.json'
            },
            recette: {
                src: 'env/config.recette.json'
            },
            prod: {
                src: 'env/config.prod.json'
            }
        },
        /**
         *  Generation des fichiers avec
         *  des liens absoluts selon l'environnement
         */
        template: {
            'generate-from-tpl': {
                options: {
                    data: {
                        'URL_REQUEST': '<%= [URL_REQUEST] %>'
                    }
                },
                files: {
                    './app/index.html': ['./app/index.html.tpl'],
                    './app/scripts/app.js': ['./app/scripts/app.js.tpl'],
                    './app/scripts/services/config.js': ['./app/scripts/services/config.js.tpl']
                }
            },
            'replace-custom-node-modules': {
                files: {
                    './node_modules/passport-local/lib/passport-local/strategy.js': ['./custom_node_modules/passport-local/lib/passport-local/strategy.js']
                }
            }
        }

    });

    grunt.registerTask('build', [
        'clean:dist',
        'copy:dist',
        'useminPrepare',
        'ngmin',
        'uglify',
        'usemin']);

    grunt.registerTask('setEnv', function() {
        grunt.config('NODE_ENV', process.env.NODE_ENV);
        grunt.config('URL_REQUEST', process.env.URL_REQUEST);
        console.log('ENV = ' + process.env.NODE_ENV);
    });

    grunt.registerTask('build-dev', [
        'env:dev',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-integ', [
        'env:integ',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-recette', [
        'env:recette',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-prod', [
        'env:prod',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('server', function(target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'express:dist:keepalive']);
        }

        var env = grunt.file.readJSON('./env/config.json').NODE_ENV;
        if (env === 'dev') {
            grunt.task.run([
                'env:dev',
                'setEnv',
                'template:generate-from-tpl',
                'template:replace-custom-node-modules',
                'clean:server',
                'express:livereload',
                'watch:main']);
            //'concurrent:server',
        } else {
            grunt.task.run([
                'template:replace-custom-node-modules',
                'clean:server',
            //'concurrent:server',
            'express:livereload',
                'watch:main']);
        }
    });

    grunt.registerTask('generate-test', [
        'env:test',
        'setEnv',
        'template:generate-from-tpl',
        'template:replace-custom-node-modules']);

    grunt.registerTask('test', [
        'env:test',
        'setEnv',
        'template:generate-from-tpl',
        'template:replace-custom-node-modules',
        'clean:server',
        'express:test',
        'jshint:all',
        'karma']);
};<commit_msg>Enlever la configuration SSL du Build<commit_after>/* File: GruntFile.js
 *
 * Copyright (c) 2014
 * Centre National d’Enseignement à Distance (Cned), Boulevard Nicephore Niepce, 86360 CHASSENEUIL-DU-POITOU, France
 * (direction-innovation@cned.fr)
 *
 * GNU Affero General Public License (AGPL) version 3.0 or later version
 *
 * This file is part of a program which is free software: you can
 * redistribute it and/or modify it under the terms of the
 * GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this program.
 * If not, see <http://www.gnu.org/licenses/>.
 *
 */

'use strict';

var path = require('path');

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

    // configurable paths
    var yeomanConfig = {
        app: '.',
        dist: 'dist',
        generated: 'generated'
    };

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

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            main: {
                files: ['app/**/*.{html,css,png,jpeg,GIF,jpg,eot,svg,ttf,woff}'],
            },
            options: {
                livereload: true/*,
                port: 3000,
                key: grunt.file.read('../sslcert/key.pem'),
                cert: grunt.file.read('../sslcert/cert.pem')*/
            }
        },
        express: {
            options: {
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    server: path.resolve('./app.js'),
                    livereload: true,
                    serverreload: false,
                    bases: [path.resolve('./.tmp'), path.resolve(__dirname, yeomanConfig.app)],
                    spawn: false
                }
            },
            test: {
                options: {
                    server: path.resolve('./app.js'),
                    bases: [path.resolve('./.tmp'), path.resolve(__dirname, 'test')]
                }
            },
            dist: {
                options: {
                    server: path.resolve('./app.js'),
                    bases: path.resolve(__dirname, yeomanConfig.dist)
                }
            },
            server: {
                options: {
                    port: 80
                }
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= express.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '<%= yeoman.generated %>/*',
                        '!<%= yeoman.dist %>/.git*']
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: 'checkstyle',
                reporterOutput: 'generated/jshint/resultJSHint.xml'
            },
            all: {
                src: ['Gruntfile.js', 'app/scripts/**/*.js', 'api/**/*.js', 'test/spec/**/*.js']
            }
        },
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                        '<%= yeoman.dist %>/styles/fonts/*']
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            // By default, your `index.html` <!-- Usemin Block --> will take care of
            // minification. This option is pre-configured if you do not wish to use
            // Usemin blocks.
            // dist: {
            //   files: {
            //     '<%= yeoman.dist %>/styles/main.css': [
            //       '.tmp/styles/{,*/}*.css',
            //       '<%= yeoman.app %>/styles/{,*/}*.css'
            //     ]
            //   }
            // }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                     // https://github.com/yeoman/grunt-usemin/issues/44
                     //collapseWhitespace: true,
                     collapseBooleanAttributes: true,
                     removeAttributeQuotes: true,
                     removeRedundantAttributes: true,
                     useShortDoctype: true,
                     removeEmptyAttributes: true,
                     removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: ['*.html', 'views/*.html'],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        'app/**/*.{html,css,png,jpeg,GIF,jpg,eot,svg,ttf,woff}',
                        'app/bower_components/**/*.js',
                        'api/**/*',
                        'models/**/*',
                        'routes/**/*',
                        'custom_node_modules/**',
                        'app.js',
                        'Gruntfile.js',
                        'package.json',
                        'files/**/**/**',
                        'po/**']
                }, {
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: ['env/config.<%= [NODE_ENV] %>.json'],
                    rename: function(dest) {
                        return dest + '/env/config.json';
                    }
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: [
                        'generated/*']
                }]
            }
        },
        concurrent: {
            dist: [
                'imagemin',
                'svgmin']
        },
        ngmin: {
            controllers: {
                expand: true,
                cwd: 'app',
                src: ['scripts/**/*.js'],
                dest: 'generated/'
            }
        },
        uglify: {
            build: {
                src: ' <%= yeoman.generated %>/scripts/**/*.js',
                dest: '<%= yeoman.dist %>/app/scripts/front.js'
            }
        },
        karma: {
            unit: {
                configFile: 'karma.conf.js',
                singleRun: true
            }
        },
        cdnify: {
            dist: {
                html: ['<%= yeoman.dist %>/*.html']
            }
        },
        nggettext_extract: {
            pot: {
                files: {
                    'po/template.pot': ['app/views/**/*.html']
                }
            }
        },
        nggettext_compile: {
            all: {
                files: {
                    'app/scripts/translations.js': ['po/*.po']
                }
            }
        },
        /**
         * Specification de chaque configuration d'un ENV comme task
         */
        env: {
            dev: {
                src: 'env/config.json'
            },
            test: {
                src: 'env/config.test.json'
            },
            integ: {
                src: 'env/config.integ.json'
            },
            recette: {
                src: 'env/config.recette.json'
            },
            prod: {
                src: 'env/config.prod.json'
            }
        },
        /**
         *  Generation des fichiers avec
         *  des liens absoluts selon l'environnement
         */
        template: {
            'generate-from-tpl': {
                options: {
                    data: {
                        'URL_REQUEST': '<%= [URL_REQUEST] %>'
                    }
                },
                files: {
                    './app/index.html': ['./app/index.html.tpl'],
                    './app/scripts/app.js': ['./app/scripts/app.js.tpl'],
                    './app/scripts/services/config.js': ['./app/scripts/services/config.js.tpl']
                }
            },
            'replace-custom-node-modules': {
                files: {
                    './node_modules/passport-local/lib/passport-local/strategy.js': ['./custom_node_modules/passport-local/lib/passport-local/strategy.js']
                }
            }
        }

    });

    grunt.registerTask('build', [
        'clean:dist',
        'copy:dist',
        'useminPrepare',
        'ngmin',
        'uglify',
        'usemin']);

    grunt.registerTask('setEnv', function() {
        grunt.config('NODE_ENV', process.env.NODE_ENV);
        grunt.config('URL_REQUEST', process.env.URL_REQUEST);
        console.log('ENV = ' + process.env.NODE_ENV);
    });

    grunt.registerTask('build-dev', [
        'env:dev',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-integ', [
        'env:integ',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-recette', [
        'env:recette',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('build-prod', [
        'env:prod',
        'setEnv',
        'template:generate-from-tpl',
        'build']);

    grunt.registerTask('server', function(target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'express:dist:keepalive']);
        }

        var env = grunt.file.readJSON('./env/config.json').NODE_ENV;
        if (env === 'dev') {
            grunt.task.run([
                'env:dev',
                'setEnv',
                'template:generate-from-tpl',
                'template:replace-custom-node-modules',
                'clean:server',
                'express:livereload',
                'watch:main']);
            //'concurrent:server',
        } else {
            grunt.task.run([
                'template:replace-custom-node-modules',
                'clean:server',
            //'concurrent:server',
            'express:livereload',
                'watch:main']);
        }
    });

    grunt.registerTask('generate-test', [
        'env:test',
        'setEnv',
        'template:generate-from-tpl',
        'template:replace-custom-node-modules']);

    grunt.registerTask('test', [
        'env:test',
        'setEnv',
        'template:generate-from-tpl',
        'template:replace-custom-node-modules',
        'clean:server',
        'express:test',
        'jshint:all',
        'karma']);
};<|endoftext|>


<commit_before>/* jshint node: true */
var _ = require('lodash');
var path = require('path');

module.exports = function(grunt) {

  var NW_VERSION = '0.11.6';
  var BUILD_DIR = 'build';
  var BUILD_TARGETS = {
    linux_ia32: true,
    linux_x64: true,
    win: true,
    osx: false
  };
  var PKG = grunt.file.readJSON('package.json');
  var PKG_OVERWRITE = {
    window: {
      toolbar: false
    }
  };

  // Create build tasks options
  var buildOptions = _.merge({
    runtimeVersion: NW_VERSION
  }, BUILD_TARGETS);

  // Define copy:build tasks files
  var snapFiles = [];
  _(BUILD_TARGETS).forEach(function(isEnabled, target) {

    if(!isEnabled) {
      return;
    }

    var arch = 'ia32';
    var platform = target;
    if(platform.indexOf('linux') !== -1) {
      arch = platform.split('_')[1];
      platform = 'linux';
    }
    var dirName = PKG.name + '-' + PKG.version + '-' + platform + '-' + arch;
    var destPath = path.join(BUILD_DIR, dirName + '/');

    // Add lib
    snapFiles.push({src: 'lib/**', dest: destPath});

    // Add themes
    snapFiles.push({src: 'themes/**', dest: destPath});

    // Add apps to build
    snapFiles.push({src: 'apps/**', dest: destPath});

    // Add snap dependencies
    var modules = _.map(PKG.dependencies, function(version, moduleName) {
      return path.join('node_modules', moduleName, '**');
    });
    snapFiles.push({src: modules, dest: destPath});

    // Add package.json
    snapFiles.push({src: 'package.json', dest: destPath});

    // Add main files, licence, & config
    snapFiles.push({
      src: ['index.html', 'app.js', 'config/defaults.yaml', 'LICENSE'],
      dest: destPath}
    );

  });

  // Apps with bower dependencies
  var bowerApps = [
    'apps/chat',
    'apps/home',
    'apps/user_profile',
    'themes/default'
  ];

  // Configure tasks
  grunt.initConfig({

    pkg: PKG,

    download: {
      options: {
        runtimeVersion: NW_VERSION
      }
    },

    run: {
      options: {
        nwArgs: ['.'],
        runtimeVersion: NW_VERSION
      }
    },

    build: {
      options: buildOptions
    },

    clean: {
      build: [BUILD_DIR]
    },

    copy: {
      build: {
        files: snapFiles,
        options: {
          noProcess: ['**','!package.json'],
          process: function() {
            var pkg = _.merge(PKG, PKG_OVERWRITE);
            return JSON.stringify(pkg, null, 2);
          }
        }
      }
    },

    shell: {
      'bower-install': {
        command: _.map(bowerApps, function(appPath) {
          return 'cd "'+path.join(process.cwd(), appPath)+'"; bower install';
        }).join('&&')
      },
      options: {
        execOptions: {
          cwd: process.cwd(),
          failOnError: true
        }
      }
    }

  });

  grunt.registerTask('snap:run',  ['download', 'run']);
  grunt.registerTask(
    'snap:build',
    ['download', 'shell:bower-install', 'clean:build', 'build', 'copy:build']
  );
  grunt.registerTask('default', ['snap:run']);

  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-nw');

};
<commit_msg>Ajout app 'Todos' dans la liste des apps bower<commit_after>/* jshint node: true */
var _ = require('lodash');
var path = require('path');

module.exports = function(grunt) {

  var NW_VERSION = '0.11.6';
  var BUILD_DIR = 'build';
  var BUILD_TARGETS = {
    linux_ia32: true,
    linux_x64: true,
    win: true,
    osx: false
  };
  var PKG = grunt.file.readJSON('package.json');
  var PKG_OVERWRITE = {
    window: {
      toolbar: false
    }
  };

  // Create build tasks options
  var buildOptions = _.merge({
    runtimeVersion: NW_VERSION
  }, BUILD_TARGETS);

  // Define copy:build tasks files
  var snapFiles = [];
  _(BUILD_TARGETS).forEach(function(isEnabled, target) {

    if(!isEnabled) {
      return;
    }

    var arch = 'ia32';
    var platform = target;
    if(platform.indexOf('linux') !== -1) {
      arch = platform.split('_')[1];
      platform = 'linux';
    }
    var dirName = PKG.name + '-' + PKG.version + '-' + platform + '-' + arch;
    var destPath = path.join(BUILD_DIR, dirName + '/');

    // Add lib
    snapFiles.push({src: 'lib/**', dest: destPath});

    // Add themes
    snapFiles.push({src: 'themes/**', dest: destPath});

    // Add apps to build
    snapFiles.push({src: 'apps/**', dest: destPath});

    // Add snap dependencies
    var modules = _.map(PKG.dependencies, function(version, moduleName) {
      return path.join('node_modules', moduleName, '**');
    });
    snapFiles.push({src: modules, dest: destPath});

    // Add package.json
    snapFiles.push({src: 'package.json', dest: destPath});

    // Add main files, licence, & config
    snapFiles.push({
      src: ['index.html', 'app.js', 'config/defaults.yaml', 'LICENSE'],
      dest: destPath}
    );

  });

  // Apps with bower dependencies
  var bowerApps = [
    'apps/chat',
    'apps/home',
    'apps/user_profile',
    'apps/todos',
    'themes/default'
  ];

  // Configure tasks
  grunt.initConfig({

    pkg: PKG,

    download: {
      options: {
        runtimeVersion: NW_VERSION
      }
    },

    run: {
      options: {
        nwArgs: ['.'],
        runtimeVersion: NW_VERSION
      }
    },

    build: {
      options: buildOptions
    },

    clean: {
      build: [BUILD_DIR]
    },

    copy: {
      build: {
        files: snapFiles,
        options: {
          noProcess: ['**','!package.json'],
          process: function() {
            var pkg = _.merge(PKG, PKG_OVERWRITE);
            return JSON.stringify(pkg, null, 2);
          }
        }
      }
    },

    shell: {
      'bower-install': {
        command: _.map(bowerApps, function(appPath) {
          return 'cd "'+path.join(process.cwd(), appPath)+'"; bower install';
        }).join('&&')
      },
      options: {
        execOptions: {
          cwd: process.cwd(),
          failOnError: true
        }
      }
    }

  });

  grunt.registerTask('snap:run',  ['download', 'run']);
  grunt.registerTask(
    'snap:build',
    ['download', 'shell:bower-install', 'clean:build', 'build', 'copy:build']
  );
  grunt.registerTask('default', ['snap:run']);

  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-nw');

};
<|endoftext|>


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

  "use strict";

  grunt.initConfig({

    libFiles: [
      "src/**/*.purs",
      "bower_components/purescript-*/src/**/*.purs",
    ],

    clean: ["output"],

    pscMake: ["<%=libFiles%>"],
    dotPsci: ["<%=libFiles%>"],
    pscDocs: {
        readme: {
            src: "src/**/*.purs",
            dest: "README.md"
        }
    },

    psc: {
      options: {
        main: true,
        modules: "Main"
      },
      example: {
        src: ["examples/Test.purs", "<%=libFiles%>"],
        dest: "tmp/Test.js"
      }
    },

    execute: {
      example: {
        src: "tmp/Test.js"
      },
    }

  });

  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-purescript");
  grunt.loadNpmTasks("grunt-execute");

  grunt.registerTask("example", ["psc", "execute"]);
  grunt.registerTask("make", ["pscMake", "dotPsci", "pscDocs"]);
  grunt.registerTask("default", ["make"]);
};
<commit_msg>Switching to pulp<commit_after><|endoftext|>


<commit_before>module.exports = function(grunt) {
    // Chargement automatique de tous nos modules
    require('load-grunt-tasks')(grunt);

    // Configuration des plugins
    grunt.initConfig({
        // Concat and compress CSS
        cssmin: {
            combine: {
                options:{
                    report: 'gzip',
                    keepSpecialComments: 0
                },
                files: {
                    'web/built/min.css': [
                        'web/vendor/foundation/css/normalize.css',
                        'web/vendor/foundation/css/foundation.css',
                        'web/vendor/mapbox.js/mapbox.css',
                        'src/Bonnes/*/Resources/public/css/style.css'
                    ]
                }
            }
        },

        // Minify JS
        uglify: {
            options: {
                mangle: false,
                sourceMap: true,
                sourceMapName: 'web/built/app.map'
            },
            dist: {
                files: {
                    'web/built/app.min.js':[
                        'web/vendor/modernizr/modernizr.js',
                        'web/vendor/mapbox.js/mapbox.js',
                        'web/bundles/fosjsrouting/js/router.js'
                    ]
                }
            }
        },

        // Allow the grunt watch command
        watch: {
            css: {
                files: ['src/Bonnes/*/Resources/public/css/*.css'],
                tasks: ['css']
            },
            javascript: {
                files: ['src/Bonnes/*/Resources/public/js/*.js'],
                tasks: ['javascript']
            }
        }
    });

    grunt.registerTask('default', ['css', 'javascript']);
    grunt.registerTask('css', ['cssmin']);
    grunt.registerTask('javascript', ['uglify']);
};
<commit_msg>Add a command to copy MapBox assets<commit_after>module.exports = function(grunt) {
    // Chargement automatique de tous nos modules
    require('load-grunt-tasks')(grunt);

    // Configuration des plugins
    grunt.initConfig({
        // Concat and compress CSS
        cssmin: {
            combine: {
                options:{
                    report: 'gzip',
                    keepSpecialComments: 0
                },
                files: {
                    'web/built/min.css': [
                        'web/vendor/foundation/css/normalize.css',
                        'web/vendor/foundation/css/foundation.css',
                        'web/vendor/mapbox.js/mapbox.css',
                        'src/Bonnes/*/Resources/public/css/style.css'
                    ]
                }
            }
        },

        // Minify JS
        uglify: {
            options: {
                mangle: false,
                sourceMap: true,
                sourceMapName: 'web/built/app.map'
            },
            dist: {
                files: {
                    'web/built/app.min.js':[
                        'web/vendor/modernizr/modernizr.js',
                        'web/vendor/mapbox.js/mapbox.js',
                        'web/bundles/fosjsrouting/js/router.js'
                    ]
                }
            }
        },

        // Allow the grunt watch command
        watch: {
            css: {
                files: ['src/Bonnes/*/Resources/public/css/*.css'],
                tasks: ['css']
            },
            javascript: {
                files: ['src/Bonnes/*/Resources/public/js/*.js'],
                tasks: ['javascript']
            }
        },

        copy: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'web/vendor/mapbox.js/images',
                    dest: 'web/built/images',
                    src: ['**']
                }]
            }
        }
    });

    grunt.registerTask('default', ['css', 'javascript']);
    grunt.registerTask('css', ['cssmin']);
    grunt.registerTask('javascript', ['uglify']);
    grunt.registerTask('cp', ['copy']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
  grunt.initConfig({
    'string-replace': {
      version: {
        files: {
          'dist/': 'dist/**/*.js',
        },
        options: {
          replacements: [{
            pattern: /{{ VERSION }}/g,
            replacement: '<%= pkg.version %>'
          }]
        }
      }
    },
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        sourceMap: true
      },
      dist: {
        dest: 'dist/jsoneditor.js',
        src: [
          // License & version info, start the containing closure
          'src/intro.js',

          // Simple inheritance
          'src/class.js',

          // IE9 polyfills
          'src/ie9.js',

          // Utils like extend, each, and trigger
          'src/utilities.js',

          // The main JSONEditor class
          'src/core.js',

          // JSON Schema validator
          'src/validator.js',

          // All the editors
          'src/editor.js',
          'src/editors/null.js',
          'src/editors/string.js',
          'src/editors/hidden.js',
          'src/editors/number.js',
          'src/editors/integer.js',
          'src/editors/rating.js',
          'src/editors/object.js',
          'src/editors/array.js',
          'src/editors/table.js',
          'src/editors/multiple.js',
          'src/editors/enum.js',
          'src/editors/select.js',
          'src/editors/selectize.js',
          'src/editors/multiselect.js',
          'src/editors/base64.js',
          'src/editors/upload.js',
          'src/editors/checkbox.js',
          'src/editors/array/selectize.js',
          'src/editors/starrating.js',
          'src/editors/datetime.js',
          'src/editors/signature.js',

          // All the themes and iconlibs
          'src/theme.js',
          'src/themes/*.js',
          'src/iconlib.js',
          'src/iconlibs/*.js',

          // The JS templating engines
          'src/templates/*.js',

          // Set the defaults
          'src/defaults.js',

          // Wrapper for $.fn style initialization
          'src/jquery.js',

          // End the closure
          'src/outro.js'
        ],
      }
    },
    uglify: {
      dist: {
        src: 'dist/jsoneditor.js',
        dest: 'dist/jsoneditor.min.js'
      },
      options: {
        preserveComments: 'some',
        sourceMap: true
      }
    },
    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1
      },
      combine: {
        files: {
          'dist/css/jsoneditor.min.css': ['src/styles/*.css']
        }
      }
    },
    watch: {
      scripts: {
        files: ["src/**/*.js"],
        tasks: ["concat"]
      }
    },
    jshint: {
      options: {
        browser: true,
        indent: 2,
        devel:true,
        nonbsp: true,
        nonew: true,
        immed: true,
        latedef: true,
        globals: {
            "module": true,
            "define": true,
        }
      },
      beforeconcat: [
        'src/class.js',
        'src/ie9.js',

        // Utils like extend, each, and trigger
        'src/utilities.js',

        // The main JSONEditor class
        'src/core.js',

        // JSON Schema validator
        'src/validator.js',

        // All the editors
        'src/editor.js',
        'src/editors/*.js',

        // All the themes and iconlibs
        'src/theme.js',
        'src/themes/*.js',
        'src/iconlib.js',
        'src/iconlibs/*.js',

        // The JS templating engines
        'src/templates/*.js',

        // Set the defaults
        'src/defaults.js',

        // Wrapper for $.fn style initialization
        'src/jquery.js'
      ],
      afterconcat: {
        options: {
          undef: true
        },
        files: {
          src: ['dist/jsoneditor.js']
        }
      }
    },
    connect: {
        default: {
            options: {
                port: 9000,
                hostname: '0.0.0.0',
                debug: true,
                keepalive: true
            }
        },
        testing: {
            options: {
                port: 9001,
                hostname: '0.0.0.0',
                debug: true,
                keepalive: true
            }
        }
    },
    run: {
        options: {
            // Task-specific options
        },
        mocha: {
            cmd: 'mocha',
            args: [
                'tests/selenium/*.js',
                '--reporter=nyan'
            ]
        }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-string-replace');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-run');

  // Serve files
  grunt.registerTask('serve', 'connect:default');
  grunt.registerTask('serve-test', 'connect:testing');

  // Run mocha tests
  grunt.registerTask('test', ['run:mocha']);

    // Default task.
  grunt.registerTask('default', ['jshint:beforeconcat','concat','jshint:afterconcat','uglify','cssmin']);

  grunt.registerTask('rawbuild', ['concat','uglify','cssmin']);

};
<commit_msg>corrected uglify preserveComments<commit_after>'use strict';

module.exports = function(grunt) {
  grunt.initConfig({
    'string-replace': {
      version: {
        files: {
          'dist/': 'dist/**/*.js',
        },
        options: {
          replacements: [{
            pattern: /{{ VERSION }}/g,
            replacement: '<%= pkg.version %>'
          }]
        }
      }
    },
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        sourceMap: true
      },
      dist: {
        dest: 'dist/jsoneditor.js',
        src: [
          // License & version info, start the containing closure
          'src/intro.js',

          // Simple inheritance
          'src/class.js',

          // IE9 polyfills
          'src/ie9.js',

          // Utils like extend, each, and trigger
          'src/utilities.js',

          // The main JSONEditor class
          'src/core.js',

          // JSON Schema validator
          'src/validator.js',

          // All the editors
          'src/editor.js',
          'src/editors/null.js',
          'src/editors/string.js',
          'src/editors/hidden.js',
          'src/editors/number.js',
          'src/editors/integer.js',
          'src/editors/rating.js',
          'src/editors/object.js',
          'src/editors/array.js',
          'src/editors/table.js',
          'src/editors/multiple.js',
          'src/editors/enum.js',
          'src/editors/select.js',
          'src/editors/selectize.js',
          'src/editors/multiselect.js',
          'src/editors/base64.js',
          'src/editors/upload.js',
          'src/editors/checkbox.js',
          'src/editors/array/selectize.js',
          'src/editors/starrating.js',
          'src/editors/datetime.js',
          'src/editors/signature.js',

          // All the themes and iconlibs
          'src/theme.js',
          'src/themes/*.js',
          'src/iconlib.js',
          'src/iconlibs/*.js',

          // The JS templating engines
          'src/templates/*.js',

          // Set the defaults
          'src/defaults.js',

          // Wrapper for $.fn style initialization
          'src/jquery.js',

          // End the closure
          'src/outro.js'
        ],
      }
    },
    uglify: {
      dist: {
        src: 'dist/jsoneditor.js',
        dest: 'dist/jsoneditor.min.js'
      },
      options: {
        preserveComments: function(node, comment) {
          return /^!|@preserve|@license|@cc_on/i.test(comment.value)
        },
        sourceMap: true
      }
    },
    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1
      },
      combine: {
        files: {
          'dist/css/jsoneditor.min.css': ['src/styles/*.css']
        }
      }
    },
    watch: {
      scripts: {
        files: ["src/**/*.js"],
        tasks: ["concat"]
      }
    },
    jshint: {
      options: {
        browser: true,
        indent: 2,
        devel:true,
        nonbsp: true,
        nonew: true,
        immed: true,
        latedef: true,
        globals: {
            "module": true,
            "define": true,
        }
      },
      beforeconcat: [
        'src/class.js',
        'src/ie9.js',

        // Utils like extend, each, and trigger
        'src/utilities.js',

        // The main JSONEditor class
        'src/core.js',

        // JSON Schema validator
        'src/validator.js',

        // All the editors
        'src/editor.js',
        'src/editors/*.js',

        // All the themes and iconlibs
        'src/theme.js',
        'src/themes/*.js',
        'src/iconlib.js',
        'src/iconlibs/*.js',

        // The JS templating engines
        'src/templates/*.js',

        // Set the defaults
        'src/defaults.js',

        // Wrapper for $.fn style initialization
        'src/jquery.js'
      ],
      afterconcat: {
        options: {
          undef: true
        },
        files: {
          src: ['dist/jsoneditor.js']
        }
      }
    },
    connect: {
        default: {
            options: {
                port: 9000,
                hostname: '0.0.0.0',
                debug: true,
                keepalive: true
            }
        },
        testing: {
            options: {
                port: 9001,
                hostname: '0.0.0.0',
                debug: true,
                keepalive: true
            }
        }
    },
    run: {
        options: {
            // Task-specific options
        },
        mocha: {
            cmd: 'mocha',
            args: [
                'tests/selenium/*.js',
                '--reporter=nyan'
            ]
        }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-string-replace');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-run');

  // Serve files
  grunt.registerTask('serve', 'connect:default');
  grunt.registerTask('serve-test', 'connect:testing');

  // Run mocha tests
  grunt.registerTask('test', ['run:mocha']);

    // Default task.
  grunt.registerTask('default', ['jshint:beforeconcat','concat','jshint:afterconcat','uglify','cssmin']);

  grunt.registerTask('rawbuild', ['concat','uglify','cssmin']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    pkg : grunt.file.readJSON("package.json"),
    watch : {
      scripts : {
        files : ['coffee/**'],
        tasks : ['default'],
        options : {
          spawn : false
        }
      }
    },
    coffee : {
      compile : {
        files : {
          './src/jennifer-chart.js' : "./coffee/jennifer-chart.coffee"
        }
      }
    },

    docco: {
        debug: {
            src: ['coffee/jennifer-chart.coffee'],
              options: {
                  output: 'docs/'
              }
          }
    },

    concat : {
      dist: {
        src: [
          // util

          "coffee/util/TimeUtil.coffee",
          "coffee/util/DomUtil.coffee",
          "coffee/util/dom/Transform.coffee",
          "coffee/util/dom/Path.coffee",
          "coffee/util/dom/Svg.coffee",
          "coffee/util/dom/Polygon.coffee",
          "coffee/util/dom/Polyline.coffee" ,
           "coffee/util/MathUtil.coffee",
           "coffee/util/ColorUtil.coffee",
           "coffee/util/scale/Scale.coffee",
           "coffee/util/scale/LinearScale.coffee",
           "coffee/util/scale/OrdinalScale.coffee",
           "coffee/util/scale/TimeScale.coffee",

           // chart (core)
           "coffee/chart/draw.coffee",
           "coffee/chart/ChartBuilder.coffee",

           // chart.theme
           "coffee/chart/theme/jennifer.coffee",
           "coffee/chart/theme/gradient.coffee", // jennifer gradient style
           "coffee/chart/theme/dark.coffee",
           "coffee/chart/theme/pastel.coffee",

           // chart.grid
           "coffee/chart/grid/Grid.coffee",
           "coffee/chart/grid/BlockGrid.coffee",
           "coffee/chart/grid/DateGrid.coffee",
           "coffee/chart/grid/RadarGrid.coffee",
           "coffee/chart/grid/RangeGrid.coffee",
           "coffee/chart/grid/RuleGrid.coffee",

           // chart.brush
           "coffee/chart/brush/Brush.coffee",
           "coffee/chart/brush/BarBrush.coffee",
           "coffee/chart/brush/BubbleBrush.coffee",
           "coffee/chart/brush/CandleStickBrush.coffee",
           "coffee/chart/brush/OhlcBrush.coffee",
           "coffee/chart/brush/ColumnBrush.coffee",
           "coffee/chart/brush/DonutBrush.coffee",
           "coffee/chart/brush/EqualizerBrush.coffee",
           "coffee/chart/brush/FullStackBrush.coffee",
           "coffee/chart/brush/LineBrush.coffee",
           "coffee/chart/brush/PathBrush.coffee",/*,,,,
           "coffee/chart/brush/pie.coffee",
           "coffee/chart/brush/scatter.coffee",
           "coffee/chart/brush/scatterpath.coffee",
           "coffee/chart/brush/stackbar.coffee",
           "coffee/chart/brush/stackcolumn.coffee",
           "coffee/chart/brush/bargauge.coffee",
           "coffee/chart/brush/circlegauge.coffee",
           "coffee/chart/brush/fillgauge.coffee",
           "coffee/chart/brush/area.coffee", // extends line
           "coffee/chart/brush/stackline.coffee", // extends line
           "coffee/chart/brush/stackarea.coffee", // extends area
           "coffee/chart/brush/stackscatter.coffee", // extends scatter
           "coffee/chart/brush/gauge.coffee", // extends donut
           "coffee/chart/brush/fullgauge.coffee", // extends donut
           "coffee/chart/brush/stackgauge.coffee", // extends donut
             */

           // chart.widget
           "coffee/chart/widget/Widget.coffee",
           "coffee/chart/widget/TitleWidget.coffee",
           "coffee/chart/widget/LegendWidget.coffee",

            "coffee/Module.coffee"
        ],
        dest: "coffee/jennifer-chart.coffee"
      }
    }
  })

  grunt.loadNpmTasks('grunt-contrib-coffee')
  grunt.loadNpmTasks('grunt-contrib-concat')
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-contrib-watch')

  grunt.registerTask("default", ["concat", "coffee", "docco"]);
  grunt.registerTask("compile", ["concat", "coffee"]);
}
<commit_msg>implement many brushes<commit_after>module.exports = function(grunt) {
  grunt.initConfig({
    pkg : grunt.file.readJSON("package.json"),
    watch : {
      scripts : {
        files : ['coffee/**'],
        tasks : ['default'],
        options : {
          spawn : false
        }
      }
    },
    coffee : {
      compile : {
        files : {
          './src/jennifer-chart.js' : "./coffee/jennifer-chart.coffee"
        }
      }
    },

    docco: {
        debug: {
            src: ['coffee/jennifer-chart.coffee'],
              options: {
                  output: 'docs/'
              }
          }
    },

    concat : {
      dist: {
        src: [
          // util

          "coffee/util/TimeUtil.coffee",
          "coffee/util/DomUtil.coffee",
          "coffee/util/dom/Transform.coffee",
          "coffee/util/dom/Path.coffee",
          "coffee/util/dom/Svg.coffee",
          "coffee/util/dom/Polygon.coffee",
          "coffee/util/dom/Polyline.coffee" ,
           "coffee/util/MathUtil.coffee",
           "coffee/util/ColorUtil.coffee",
           "coffee/util/scale/Scale.coffee",
           "coffee/util/scale/LinearScale.coffee",
           "coffee/util/scale/OrdinalScale.coffee",
           "coffee/util/scale/TimeScale.coffee",

           // chart (core)
           "coffee/chart/draw.coffee",
           "coffee/chart/ChartBuilder.coffee",

           // chart.theme
           "coffee/chart/theme/jennifer.coffee",
           "coffee/chart/theme/gradient.coffee", // jennifer gradient style
           "coffee/chart/theme/dark.coffee",
           "coffee/chart/theme/pastel.coffee",

           // chart.grid
           "coffee/chart/grid/Grid.coffee",
           "coffee/chart/grid/BlockGrid.coffee",
           "coffee/chart/grid/DateGrid.coffee",
           "coffee/chart/grid/RadarGrid.coffee",
           "coffee/chart/grid/RangeGrid.coffee",
           "coffee/chart/grid/RuleGrid.coffee",

           // chart.brush
           "coffee/chart/brush/Brush.coffee",
           "coffee/chart/brush/BarBrush.coffee",
           "coffee/chart/brush/BubbleBrush.coffee",
           "coffee/chart/brush/CandleStickBrush.coffee",
           "coffee/chart/brush/OhlcBrush.coffee",
           "coffee/chart/brush/ColumnBrush.coffee",
           "coffee/chart/brush/DonutBrush.coffee",
           "coffee/chart/brush/EqualizerBrush.coffee",
           "coffee/chart/brush/FullStackBrush.coffee",
           "coffee/chart/brush/LineBrush.coffee",
           "coffee/chart/brush/PathBrush.coffee",/*,,,,
           "coffee/chart/brush/pie.coffee",
           "coffee/chart/brush/scatter.coffee",
           "coffee/chart/brush/scatterpath.coffee",
           "coffee/chart/brush/stackbar.coffee",
           "coffee/chart/brush/stackcolumn.coffee",
           "coffee/chart/brush/bargauge.coffee",
           "coffee/chart/brush/circlegauge.coffee",
           "coffee/chart/brush/fillgauge.coffee",
           "coffee/chart/brush/area.coffee", // extends line
           "coffee/chart/brush/stackline.coffee", // extends line
           "coffee/chart/brush/stackarea.coffee", // extends area
           "coffee/chart/brush/stackscatter.coffee", // extends scatter
           "coffee/chart/brush/gauge.coffee", // extends donut
           "coffee/chart/brush/fullgauge.coffee", // extends donut
           "coffee/chart/brush/stackgauge.coffee", // extends donut
             */

           // chart.widget
           "coffee/chart/widget/Widget.coffee",
           "coffee/chart/widget/TitleWidget.coffee",
           "coffee/chart/widget/LegendWidget.coffee",

            "coffee/Module.coffee"
        ],
        dest: "coffee/jennifer-chart.coffee"
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-coffee');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask("default", ["concat", "coffee", "docco"]);
  grunt.registerTask("compile", ["concat", "coffee"]);
};
<|endoftext|>