forked from dbrekalo/json-api-normalize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
110 lines (95 loc) · 2.88 KB
/
Copy pathGruntfile.js
File metadata and controls
110 lines (95 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
var attire = require('attire');
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
min: {
files: [{
expand: true,
cwd: 'src',
src: '**/*.js',
dest: 'dist',
ext: '.min.js'
}]
}
},
copy: {
jsFiles: {
files: [{
expand: true,
cwd: 'src',
src: ['**/*.js'],
dest: 'dist'
}]
}
},
eslint: {
options: {
configFile: '.eslintrc.js'
},
target: [
['src/**/*.js'],
'Gruntfile.js'
]
},
watch: {
jsFiles: {
expand: true,
files: ['src/**/*.js'],
tasks: ['eslint', 'uglify', 'copy'],
options: {
spawn: false
}
},
readme: {
expand: true,
files: ['README.md'],
tasks: ['buildDemo'],
options: {
spawn: false
}
},
},
bump: {
options: {
files: ['package.json', 'bower.json'],
commitFiles: ['package.json', 'bower.json'],
tagName: '%VERSION%',
push: false
}
}
});
grunt.registerTask('buildDemo', function() {
var done = this.async();
attire.buildDemo({
file: 'README.md',
dest: 'index.html',
title: 'JSON api normalize',
description: 'Normalize JSON api dataset',
canonicalUrl: 'http://dbrekalo.github.io/json-api-normalize/',
githubUrl: 'https://github.com/dbrekalo/json-api-normalize',
userRepositories: {
user: 'dbrekalo',
onlyWithPages: true
},
author: {
caption: 'Damir Brekalo',
url: 'https://github.com/dbrekalo',
image: 'https://s.gravatar.com/avatar/32754a476fb3db1c5a1f9ad80c65d89d?s=80',
email: 'dbrekalo@gmail.com',
github: 'https://github.com/dbrekalo',
twitter: 'https://twitter.com/dbrekalo'
},
afterParse: function($) {
$('p').first().remove();
$('a').first().parent().remove();
},
inlineCss: true,
}).then(function() {
done();
grunt.log.ok(['Demo builded']);
});
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['build', 'watch']);
grunt.registerTask('build', ['eslint', 'uglify', 'copy', 'buildDemo']);
};