/
makefile
130 lines (95 loc) · 3.45 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
127
128
129
130
# 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
# Add phony targets
.PHONY: sbt
# *********************** SETUP ***********************
# Install all 3rd party dependencies.
install: check-node-env
@yarn install
@./tools/sync-githooks.js
# 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 the local node env is up to scratch.
check-node-env: # PRIVATE
@./tools/check-node-env.js
# *********************** DEVELOPMENT ***********************
# Watch and automatically compile/reload all JS/SCSS.
# Uses port 3000 insead of 9000.
watch: compile-watch
@./dev/watch.js
sbt: # PRIVATE
./sbt
# *********************** ASSETS ***********************
# Compile all assets in production.
compile: install
@NODE_ENV=production ./tools/task-runner/runner compile
# Compile all assets in development.
compile-dev: install
@NODE_ENV=development ./tools/task-runner/runner compile --dev
# Compile atom-specific JS
compile-atoms: install
@./tools/task-runner/runner compile/javascript/index.atoms
# Compile all assets for watch.
compile-watch: install # PRIVATE
@NODE_ENV=development ./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
# *********************** 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
@yarn prettier */test/resources/*.json --check
# 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
# Fix JS linting errors.
fix: install
@./tools/task-runner/runner validate/javascript-fix
@yarn prettier */test/resources/*.json --write
# Fix committed JS linting errors.
fix-commits: install
@./tools/task-runner/runner validate-head/javascript-fix
validate-a11y: install # PRIVATE
@./tools/task-runner/runner validate/a11y
# Take screenshots for a visual check.
screenshots: install
@./tools/task-runner/runner screenshot
# Update caniuse db used by browserslist
# https://github.com/browserslist/update-db
update-caniusedb: install
@npx --yes update-browserslist-db@latest