diff --git a/.editorconfig b/.editorconfig index 3dce4145f..2f0504c2a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,7 @@ indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true -trim_trailing_whitespace = true \ No newline at end of file +trim_trailing_whitespace = true + +[{Makefile,**.mk}] +indent_style = tab diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..2988b1a01 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +SHELL := /usr/bin/env bash + +## make help: if you're aren't sure use `make help` +include mk/help.mk +include mk/install.mk +include mk/build.mk diff --git a/mk/build.mk b/mk/build.mk new file mode 100644 index 000000000..6e919e080 --- /dev/null +++ b/mk/build.mk @@ -0,0 +1,7 @@ +.PHONY: build +build: + yarn run build + +.PHONY: build/sync +build/sync: + make build diff --git a/mk/help.mk b/mk/help.mk new file mode 100644 index 000000000..ae40305f8 --- /dev/null +++ b/mk/help.mk @@ -0,0 +1,15 @@ +.PHONY: help +help: ## Display this help screen + @# Display top-level targets since they are the ones most developers will need. + @grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -k1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + @# Now show hierarchical targets in separate sections. + @grep -h -E '^[a-zA-Z0-9_-]+/[a-zA-Z0-9/_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk '{print $$1}' | \ + awk -F/ '{print $$1}' | \ + sort -u | \ + while read section ; do \ + echo; \ + grep -h -E "^$$section/[^:]+:.*?## .*$$" $(MAKEFILE_LIST) | sort -k1 | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' ; \ + done + diff --git a/mk/install.mk b/mk/install.mk new file mode 100644 index 000000000..07349ff44 --- /dev/null +++ b/mk/install.mk @@ -0,0 +1,19 @@ +.PHONY: install +install: + yarn install + +.PHONY: install/sync +install/sync: + make install + +.PHONY: clean-install +clean-install: + yarn install --frozen-lockfile + +.PHONY: clean-install/sync +clean-install/sync: + make clean-install + +.PHONY: clean +clean: ## Delete all node_modules directories + find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +