2018-12-20 14:14:12 -05:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
|
|
|
module.exports = function(grunt) {
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
forever: {
|
|
|
|
app: {
|
|
|
|
options: {
|
2016-12-14 12:44:02 -05:00
|
|
|
index: "app.js"
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2016-12-14 12:44:02 -05:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
execute: {
|
|
|
|
app: {
|
2014-08-15 06:35:22 -04:00
|
|
|
src: "app.js"
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
},
|
2014-08-15 06:35:22 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
coffee: {
|
|
|
|
server: {
|
2014-08-15 05:50:36 -04:00
|
|
|
expand: true,
|
|
|
|
flatten: false,
|
|
|
|
cwd: 'app/coffee',
|
|
|
|
src: ['**/*.coffee'],
|
|
|
|
dest: 'app/js/',
|
|
|
|
ext: '.js'
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
app_server: {
|
2014-08-15 05:50:36 -04:00
|
|
|
expand: true,
|
|
|
|
flatten: false,
|
|
|
|
src: ['app.coffee'],
|
|
|
|
dest: './',
|
|
|
|
ext: '.js'
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
unit_tests: {
|
2014-08-15 05:50:36 -04:00
|
|
|
expand: true,
|
|
|
|
flatten: false,
|
|
|
|
cwd: 'test/unit/coffee',
|
|
|
|
src: ['**/*.coffee'],
|
|
|
|
dest: 'test/unit/js/',
|
|
|
|
ext: '.js'
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
acceptance_tests: {
|
2016-12-14 12:38:14 -05:00
|
|
|
expand: true,
|
|
|
|
flatten: false,
|
|
|
|
cwd: 'test/acceptance/coffee',
|
|
|
|
src: ['**/*.coffee'],
|
|
|
|
dest: 'test/acceptance/js/',
|
|
|
|
ext: '.js'
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
},
|
2016-12-14 12:38:14 -05:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
watch: {
|
|
|
|
server_coffee: {
|
|
|
|
files: ['app/**/*.coffee', 'test/unit/**/*.coffee'],
|
2016-12-14 12:38:14 -05:00
|
|
|
tasks: ['compile:server', 'compile:unit_tests', 'mochaTest']
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
clean: ["app/js", "test/unit/js"],
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
nodemon: {
|
|
|
|
dev: {
|
|
|
|
options: {
|
2014-08-15 05:50:36 -04:00
|
|
|
file: 'app.js'
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
concurrent: {
|
|
|
|
dev: {
|
|
|
|
tasks: ['nodemon', 'watch'],
|
|
|
|
options: {
|
2014-08-15 05:50:36 -04:00
|
|
|
logConcurrentOutput: true
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
mochaTest: {
|
|
|
|
unit: {
|
|
|
|
options: {
|
|
|
|
reporter: process.env.MOCHA_RUNNER || "spec",
|
2014-08-15 05:50:36 -04:00
|
|
|
grep: grunt.option("grep")
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
2016-12-14 12:38:14 -05:00
|
|
|
src: ['test/unit/**/*.js']
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
|
|
|
acceptance: {
|
|
|
|
options: {
|
|
|
|
reporter: process.env.MOCHA_RUNNER || "spec",
|
2016-12-14 12:38:14 -05:00
|
|
|
grep: grunt.option("grep")
|
2018-12-20 14:14:12 -05:00
|
|
|
},
|
2016-12-14 12:38:14 -05:00
|
|
|
src: ['test/acceptance/**/*.js']
|
2018-12-20 14:14:12 -05:00
|
|
|
}
|
|
|
|
},
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
plato: {
|
|
|
|
your_task: {
|
|
|
|
files: {'plato': ['app/js/**/*.js']}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-coffee');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-nodemon');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.loadNpmTasks('grunt-concurrent');
|
|
|
|
grunt.loadNpmTasks('grunt-mocha-test');
|
|
|
|
grunt.loadNpmTasks('grunt-plato');
|
|
|
|
grunt.loadNpmTasks('grunt-execute');
|
|
|
|
grunt.loadNpmTasks('grunt-bunyan');
|
|
|
|
grunt.loadNpmTasks('grunt-forever');
|
2014-08-15 06:35:22 -04:00
|
|
|
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:14:12 -05:00
|
|
|
grunt.registerTask('compile', ['clean', 'coffee']);
|
|
|
|
grunt.registerTask('install', ['compile']);
|
|
|
|
grunt.registerTask('default', ['compile', 'bunyan', 'execute']);
|
|
|
|
grunt.registerTask('test:unit', ['compile', 'mochaTest:unit']);
|
|
|
|
return grunt.registerTask('test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']);
|
|
|
|
};
|
2014-08-15 05:50:36 -04:00
|
|
|
|