-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
176 lines (150 loc) · 3.73 KB
/
Gruntfile.coffee
File metadata and controls
176 lines (150 loc) · 3.73 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
webpack = require 'webpack'
module.exports = ( grunt ) ->
# auto load grunt contrib tasks from package.json
require('load-grunt-tasks')(grunt)
grunt.initConfig
jshint:
all:
options:
jshintrc: '.jshintrc'
src: [
'*.json'
'gulpfile.js'
]
examples:
options:
jshintrc: '.jshintrc-client'
src: [
'example/**/*.json'
'example/**/*.js'
]
coffeelint:
options:
configFile: '.coffeelint.json'
gruntfile: [ 'Gruntfile.coffee' ]
app: [
'bin/*.coffee'
'lib/**/*.coffee'
'config/**/*.coffee'
'test/**/*.coffee'
'example/**/*.coffee'
]
yamllint:
all: [
'Sitefile.yaml'
'package.yaml'
'**/*.meta'
]
mochaTest:
test:
options:
reporter: 'spec'
colors: true
require: 'coffee-script/register'
captureFile: 'mocha.out'
quiet: false
clearRequireCache: false # do explicitly as needed
src: ['test/mocha/*.coffee']
webpack:
client:
entry: './lib/sitefile/client/lib/sf-v0'
devtool: 'sourcemap'
output:
filename: 'build/client/sf-v0.js'
library: "sitefile_client"
module:
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel']
},
{
test: /\.coffee$/,
exclude: /node_modules/,
loader: "coffee"
},
{
test: /\.json$/,
loader: "json"
},
{
test: /\.pug$/,
exclude: /node_modules/,
loader: "pug"
},
]
plugins: [
new webpack.IgnorePlugin(/^(markdown|pug|pug-runtime|stylus|pm2|pmx|knex)$/),
new webpack.IgnorePlugin(/\.(css|less)$/),
new webpack.BannerPlugin('require("source-map-support").install();',
{ raw: true, entryOnly: false }),
],
#externals: nodeModules,
resolve:
extensions: [
'', '.coffee', '.js', '.json', '.pug'
]
docco:
debug:
src: [
'lib/**/*.coffee'
'test/**/*.coffee'
'example/**/*.coffee'
'example/**/*.js'
]
options:
output: 'build/docs/docco/'
sass:
options:
outputStyle: 'expanded'
sourceMap: true
dist:
files:
'build/style/default.css': 'lib/sitefile/style/default.sass'
exec:
check_version:
cmd: "git-versioning check"
check_branch_docs:
cmd: "sh ./tools/check-branch-docs.sh"
gulp_dist_build:
cmd: "gulp server-build"
spec_update:
cmd: "sh ./tools/update-spec.sh"
pkg: grunt.file.readJSON 'package.json'
# Static analysis of source files
grunt.registerTask 'lint', [
'coffeelint'
'jshint:all'
'jshint:examples'
'yamllint'
]
grunt.registerTask 'check', [
'exec:check_branch_docs'
'exec:check_version'
'lint'
]
# Tests server-side
grunt.registerTask 'test', [
'mochaTest:test'
]
# Everything
grunt.registerTask 'default', [
'lint'
'test'
]
grunt.registerTask 'build', [ 'build-dev' ]
# Documentation artefacts, some intial publishing
grunt.registerTask 'build-dev', [
'build-test'
'exec:gulp_dist_build'
'exec:spec_update'
]
grunt.registerTask 'client', [
'sass:dist'
# XXX: using rjs cs client for now 'webpack:client'
]
grunt.registerTask 'build-test', [
'client'
'docco:debug'
]