forked from watcherdm/factoryjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
192 lines (173 loc) · 4.47 KB
/
Gruntfile.coffee
File metadata and controls
192 lines (173 loc) · 4.47 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
pkg = require './package.json'
component = require './bower.json'
requireConfig = require './require-config.json'
requirejsTemplate = require 'grunt-template-jasmine-requirejs'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-bump'
grunt.loadNpmTasks 'grunt-docker'
grunt.loadNpmTasks 'grunt-gitinfo'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-jshint'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.initConfig
pkg: pkg
component: component
connect:
server:
options:
port: 9002
clean:
docs: ['docs/']
dist: ['dist/']
build: ['build/']
coffee:
src:
expand: true
flatten: false
cwd: 'src/'
src: ['**/*.coffee']
dest: 'build/src/'
ext: '.js'
spec:
expand: true
flatten: false
cwd: 'spec/'
src: ['**/*.spec.coffee']
dest: 'build/spec/'
ext: '.spec.js'
helper:
expand: true
flatten: false
cwd: 'spec/'
src: ['**/*.helper.coffee']
dest: 'build/spec/'
ext: '.helper.js'
coffeelint:
app: ['src/**/*.coffee']
jasmine:
normal:
src: ['build/src/**/*.js']
options:
specs: [
'build/spec/**/*.helper.js'
'build/spec/**/*.spec.js'
]
template: requirejsTemplate
templateOptions: {
version: '2.0.6'
requireConfig: requireConfig
}
helpers: [
'bower_components/sinonjs/sinon.js'
'bower_components/jasmine-sinon/lib/jasmine-sinon.js'
'bower_components/jasmine-expect/dist/jasmine-matchers.js'
]
live:
src: ['build/src/**/*.js']
options:
host: 'http://localhost:9002'
specs: [
'build/spec/**/*.helper.js'
'build/spec/**/*.spec.js'
]
styles: ['lib/jscoverage/jscoverage.css']
template: requirejsTemplate
templateOptions: {
version: '2.0.6'
requireConfig: requireConfig
}
keepRunner: true
helpers: [
'bower_components/sinonjs/sinon.js'
'bower_components/jasmine-sinon/lib/jasmine-sinon.js'
'bower_components/jasmine-expect/dist/jasmine-matchers.js'
]
concat:
options:
banner: "/* <%- pkg.name %> <%- pkg.version %> */\n"
process: true
factory:
src: ['build/src/Factory.js']
dest: 'dist/Factory.js'
backbone_factory:
src: ['build/src/BackboneFactory.js']
dest: 'dist/BackboneFactory.js'
uglify:
options:
banner: "/* <%- pkg.name %> <%- pkg.version %> */\n"
factory:
files:
'dist/Factory.min.js': ['build/src/Factory.js']
'dist/BackboneFactory.min.js': ['build/src/BackboneFactory.js']
watch:
docs:
files: ['*.md']
tasks: ['docs']
coffee:
files: ['src/**/*.coffee', 'spec/**/*.coffee']
tasks: ['coffeelint', 'build', 'docs']
scripts:
files: ['build/src/**/*.js']
tasks: ['jshint', 'jasmine:live', 'dist']
options: livereload: true
jshint:
all: ['build/src/*.js']
options:
boss: true
expr: true
eqnull: true
shadow: true
supernew: true
docker:
options:
css: ['assets/css/docker.css']
colourScheme: 'monokai'
factoryjs:
dest: 'docs/'
src: [
'*.md'
'src/**/*.coffee'
]
bump:
options:
push: false
commit: false
createTag: false
files: ['package.json', 'bower.json']
updateConfigs: ['pkg', 'component']
grunt.registerTask 'build', [
'clean:build'
'coffee'
]
grunt.registerTask 'docs', [
'clean:docs'
'docker'
]
grunt.registerTask 'dist', [
'clean:dist'
'gitinfo'
'concat'
'uglify'
]
grunt.registerTask 'default', [
'coffeelint'
'build'
'jshint'
'jasmine:normal'
'dist'
]
grunt.registerTask 'live', [
'coffeelint'
'build'
'jshint'
'connect'
'jasmine:live'
'watch'
'dist'
]