UNPKG

1.98 kBJavaScriptView Raw
1/* global module */
2module.exports = function (grunt) {
3 module.require('time-grunt')(grunt);
4
5 var pkg = grunt.file.readJSON('package.json');
6 grunt.initConfig({
7 pkg: pkg,
8
9 'nice-package': {
10 all: {
11 options: {
12 blankLine: true
13 }
14 }
15 },
16
17 jshint: {
18 'options': {
19 jshintrc: '.jshintrc'
20 },
21 default: {
22 'src': [ '*.js', 'test/*.js' ]
23 }
24 },
25
26 sync: {
27 all: {
28 options: {
29 sync: ['author', 'name', 'version',
30 'private', 'license', 'keywords', 'homepage'],
31 }
32 }
33 },
34
35 concat: {
36 options: {
37 banner: '/**\n' +
38 ' <%= pkg.name %>@<%= pkg.version %>\n' +
39 ' <%= pkg.description %>\n' +
40 ' <%= pkg.author %>\n' +
41 ' <%= pkg.homepage %>\n' +
42 '*/\n\n',
43 process: grunt.template.process
44 },
45 fp: {
46 src: ['fp.js'],
47 dest: 'dist/fp.js'
48 },
49 fpDebug: {
50 src: ['fp-debug.js'],
51 dest: 'dist/fp-debug.js'
52 }
53 },
54
55 mochaTest: {
56 test: {
57 options: {
58 reporter: 'spec'
59 },
60 src: ['test/*.js']
61 }
62 },
63
64 'clean-console': {
65 all: {
66 options: {
67 url: ['index.html'],
68 timeout: 1
69 }
70 }
71 },
72
73 karma: {
74 unit: {
75 configFile: 'karma.conf.js',
76 background: false,
77 singleRun: true,
78 logLevel: 'INFO',
79 browsers: ['PhantomJS']
80 }
81 },
82
83 watch: {
84 options: {
85 atBegin: true
86 },
87 all: {
88 files: ['*.js', 'test/*.js', 'index.html'],
89 tasks: ['jshint', 'test']
90 }
91 }
92 });
93
94 var plugins = module.require('matchdep').filterDev('grunt-*');
95 plugins.forEach(grunt.loadNpmTasks);
96
97 grunt.registerTask('test', ['mochaTest', 'karma', 'clean-console']);
98 grunt.registerTask('default', ['deps-ok', 'nice-package', 'sync', 'jshint', 'concat', 'test']);
99};