forked from beyond-all-reason/maps-metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (45 loc) · 2.51 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
# Default target ran by make
all: gen/map_list.validated.json gen/mapDetails.lua gen/live_maps.validated.json gen/mapBoxes.conf gen/mapLists.conf gen/custom_map_lists.json gen/discordPresenceThumb
# Rules for doing generic data files conversion, e.g yaml to json
gen/%.json: %.yaml
python scripts/py/yaml_to_json.py $< $@
gen/%.validated.json: gen/%.schema.json gen/%.json
ts-node scripts/js/src/validate_schema.ts $^ $@
gen/types/%.d.ts: gen/%.schema.json
mkdir -p gen/types
json2ts $< > $@
# Output targets
gen/mapDetails.lua: gen/map_list.validated.json gen/types/map_list.d.ts
ts-node scripts/js/src/gen_map_details_lua.ts $@
gen/cdn_maps.json: gen/map_list.validated.json gen/types/map_list.d.ts
ts-node scripts/js/src/gen_cdn_maps.ts $@
gen/live_maps.json: gen/map_list.validated.json gen/types/map_list.d.ts gen/cdn_maps.validated.json gen/types/cdn_maps.d.ts gen/types/live_maps.d.ts
ts-node scripts/js/src/gen_live_maps.ts $@
gen/mapBoxes.conf: gen/map_list.validated.json gen/types/map_list.d.ts
ts-node scripts/js/src/gen_map_boxes_conf.ts $@
gen/mapLists.conf gen/custom_map_lists.json: gen/map_list.validated.json
python scripts/py/gen_nextmap_maplists.py
gen/discordPresenceThumb: gen/map_list.validated.json gen/types/map_list.d.ts
ts-node scripts/js/src/gen_discord_presence_thumbs.ts $@
# Tests on data
test: typecheck_scripts check_startboxes check_photo_aspect_ratio check_archive_not_solid
echo ok
typecheck_scripts: gen/types/map_list.d.ts gen/types/live_maps.d.ts gen/types/cdn_maps.d.ts
cd scripts/js && tsc --noEmit
check_startboxes: gen/types/map_list.d.ts gen/map_list.validated.json
ts-node scripts/js/src/check_startboxes.ts
check_photo_aspect_ratio: gen/types/map_list.d.ts gen/map_list.validated.json
ts-node scripts/js/src/check_photo_aspect_ratio.ts
check_archive_not_solid: gen/types/map_list.d.ts gen/map_list.validated.json
ts-node scripts/js/src/check_archive_not_solid.ts
# Auxiliary build targets
types: gen/types/map_list.d.ts gen/map_list.schema.json
clean:
rm -rf gen/*
update_all_from_rowy: gen/map_list.schema.json
ts-node scripts/js/src/update_from_rowy.ts map_list.yaml all
sync_to_webflow: gen/map_list.validated.json gen/types/map_list.d.ts gen/cdn_maps.validated.json gen/map_list.schema.json gen/types/cdn_maps.d.ts
ts-node scripts/js/src/sync_to_webflow.ts sync
refresh_webflow_types:
ts-node scripts/js/src/gen_webflow_types.ts scripts/js/src/webflow_types.ts
.PHONY: clean test typecheck_scripts check_startboxes types update_all_from_rowy sync_to_webflow refresh_webflow_types