UNPKG

1.95 kBJavaScriptView Raw
1module.exports = function(grunt) {
2 'use strict';
3
4 grunt.initConfig({
5 pkg: grunt.file.readJSON('package.json'),
6
7 jshint: {
8 all: [
9 'src/ng-describe.js'
10 ],
11 specs: ['test/*-spec.js'],
12 options: {
13 jshintrc: '.jshintrc'
14 }
15 },
16
17 jsonlint: {
18 all: {
19 src: ['package.json']
20 }
21 },
22
23 concat: {
24 dist: {
25 src: [
26 'utils/stop-code-coverage.js',
27 // 3rd party dependencies
28 'node_modules/es5-shim/es5-shim.js',
29 'node_modules/check-types/src/check-types.js',
30 'node_modules/check-more-types/check-more-types.js',
31 'node_modules/lazy-ass/index.js',
32 'utils/start-code-coverage.js',
33 // the library itself
34 'src/ng-describe.js'
35 ],
36 dest: 'dist/ng-describe.js',
37 },
38 },
39
40 sync: {
41 all: {
42 options: {
43 sync: ['author', 'name', 'version',
44 'private', 'license', 'keywords', 'homepage'],
45 }
46 }
47 },
48
49 toc: {
50 api: {
51 options: {
52 heading: '\n'
53 },
54 files: {
55 './docs/toc.md': './README.md'
56 }
57 }
58 },
59
60 readme: {
61 options: {
62 readme: './docs/README.tmpl.md',
63 docs: '.',
64 templates: './docs'
65 }
66 },
67
68 karma: {
69 unit: {
70 configFile: 'test/karma.conf.js'
71 }
72 },
73
74 watch: {
75 options: {
76 atBegin: true
77 },
78 all: {
79 files: ['*.js', 'src/*.js', 'test/*.js', 'package.json'],
80 tasks: ['jshint', 'concat', 'test']
81 }
82 }
83 });
84
85 var plugins = require('matchdep').filterDev('grunt-*');
86 plugins.forEach(grunt.loadNpmTasks);
87
88 grunt.registerTask('test', ['karma']);
89 grunt.registerTask('doc', ['readme', 'toc', 'readme']);
90 grunt.registerTask('default', [
91 'nice-package', 'deps-ok', 'sync', 'jsonlint', 'jshint',
92 'concat', 'test', 'doc'
93 ]);
94};