forked from guardian/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
126 lines (87 loc) · 3.21 KB
/
makefile
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
# Targets marked '# PRIVATE' will be hidden when running `make help`.
# They're helper targets that you probably only need to know about
# if you've got as far as reading the makefile.
# Lists common tasks.
# Also the default task (`make` === `make help`).
help:
@node tools/messages.js describeMakefile
# Lists *all* targets.
list: # PRIVATE
@node tools/messages.js describeMakefile --all
# *********************** SETUP ***********************
# Install all 3rd party dependencies.
install: check-node check-yarn
@yarn install
# Remove all 3rd party dependencies.
uninstall: # PRIVATE
@rm -rf node_modules
@echo 'All 3rd party dependencies have been uninstalled.'
# Reinstall all 3rd party dependencies from scratch.
# The nuclear option if `make install` hasn't worked.
reinstall: uninstall install
# Make sure we running a recent-enough version of Node.
check-node: # PRIVATE
@./tools/check-node-version.js
# Make sure yarn is installed, at the right version.
check-yarn: # PRIVATE
@./tools/check-yarn.js
# *********************** DEVELOPMENT ***********************
# Watch and automatically compile/reload all JS/SCSS.
# Uses port 3000 insead of 9000.
watch: compile-watch
@./dev/watch.js
# *********************** ASSETS ***********************
# Compile all assets in production.
compile: install
@./tools/task-runner/runner compile
# Compile all assets in development.
compile-dev: install
@./tools/task-runner/runner compile --dev
# Compile all assets for watch.
compile-watch: install # PRIVATE
@./tools/task-runner/runner compile/index.watch
compile-javascript: install # PRIVATE
@./tools/task-runner/runner compile/javascript
compile-javascript-dev: install # PRIVATE
@./tools/task-runner/runner compile/javascript --dev
compile-css: install # PRIVATE
@./tools/task-runner/runner compile/css
compile-images: install # PRIVATE
@./tools/task-runner/runner compile/images
compile-svgs: install # PRIVATE
@./tools/task-runner/runner compile/inline-svgs
compile-fonts: install # PRIVATE
@./tools/task-runner/runner compile/fonts
# * Not ready for primetime use yet... *
pasteup: install # PRIVATE
@cd static/src/stylesheets/pasteup && npm --silent i && node publish.js
# *********************** CHECKS ***********************
# Run the JS test suite.
test: install
@./tools/task-runner/runner test/javascript --verbose
# Run the modern JS test suite in watch mode.
test-watch: install
@yarn test -- --watch --coverage
# Check the JS test suite coverage.
coverage: install
@./tools/task-runner/runner test/javascript/coverage --stdout
# Validate all assets.
validate: install
@./tools/task-runner/runner validate --verbose
# Validate all SCSS.
validate-sass: install # PRIVATE
@./tools/task-runner/runner validate/sass --verbose
# Validate all JS.
validate-javascript: install # PRIVATE
@./tools/task-runner/runner validate/javascript
# Validate all assets.
fix: install
@./tools/task-runner/runner validate/javascript-fix
validate-amp: install # PRIVATE
@cd tools/amp-validation && npm install && NODE_ENV=dev node index.js
# Take screenshots for a visual check.
screenshots: install
@./tools/task-runner/runner screenshot
# *********************** MISC ***********************
es6: install
@node ./tools/es5to6.js