-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
69 lines (64 loc) · 2.07 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
YARN = yarn
YARNFLAGS= --frozen-lockfile --mutex network
EXCLUDE = ${exclude}
PROJECTS = $(filter-out $(EXCLUDE),$(patsubst projects/%, %, $(patsubst %/package.json, %, $(wildcard projects/*/package.json))))
.PHONY: list install clean validate-% fix-% test-% build-% validate fix test
#
# install deps
install: $(patsubst %, projects/%/node_modules, $(PROJECTS)) node_modules
projects/%/node_modules: projects/%/yarn.lock
@echo "\n👟 Installing $*\n"
cd $(dir $@) && ${YARN} ${YARNFLAGS}
node_modules: yarn.lock
@echo "\n👟 Installing project tools\n"
${YARN} ${YARNFLAGS}
#
# Build commands
validate: $(patsubst %, validate-%, $(PROJECTS))
fix: $(patsubst %, fix-%, $(PROJECTS))
build: $(patsubst %, build-%, $(PROJECTS))
test: $(patsubst %, test-%, $(PROJECTS))
#
# Overrides
#
build-Mallard:
@echo "\n👟 $@ 🦆\n"
@echo "\nThis is not yet handled by make\n"
validate-Mallard:
@echo "\n👟🧶 $@ ESLINT 🦆\n"
cd projects/Mallard && yarn lint
@echo "\n👟🚂 $@ TSC 🦆\n"
cd projects/Mallard && yarn tsc --noEmit --skipLibCheck
validate-scripts:
@echo "\n👟 $@ 🦆\n"
@echo "\nThis is not yet handled by make\n"
validate-crosswords-bundle:
@echo "\n👟 $@ 🦆\n"
@echo "\nThis is not yet handled by make\n"
#
# Project commands
#
validate-%: projects/%/node_modules node_modules
@echo "\n👟🧶 $@ ESLINT 🦆\n"
yarn eslint 'projects/$*/**/*.{ts,tsx}' --parser-options=project:./projects/$*/tsconfig.json
@echo "\n👟🚂 $@ TSC 🦆\n"
cd projects/$* && yarn tsc --noEmit --skipLibCheck
fix-%: node_modules projects/%/node_modules node_modules
@echo "\n👟 $@ 🦆\n"
yarn eslint 'projects/$*/**/*.{ts,tsx}' --parser-options=project:./projects/$*/tsconfig.json --fix
test-%: projects/%/node_modules
@echo "\n👟 $@ 🦆\n"
cd projects/$* && yarn test
build-%: projects/%/node_modules
@echo "\n👟 $@ 🦆\n"
cd projects/$* && yarn build
#
# Misc
#
list:
@echo $(PROJECTS)
clean:
@echo "\n🗑 cleaning\n"
rm -rf projects/*/node_modules
rm -rf node_modules
rm projects/aws/bin/*.js projects/aws/bin/*.d.ts projects/aws/lib/*.js projects/aws/lib/*.d.ts