Skip to content

Commit

Permalink
chore: add make commands (release-2.7) (#2488)
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Rudloff <philipp.rudloff@konghq.com>
  • Loading branch information
Philipp Rudloff authored Apr 24, 2024
1 parent cbca7d0 commit be68aad
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
trim_trailing_whitespace = true

[{Makefile,**.mk}]
indent_style = tab
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions mk/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: build
build:
yarn run build

.PHONY: build/sync
build/sync:
make build
15 changes: 15 additions & 0 deletions mk/help.mk
Original file line number Diff line number Diff line change
@@ -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

19 changes: 19 additions & 0 deletions mk/install.mk
Original file line number Diff line number Diff line change
@@ -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 '{}' +

0 comments on commit be68aad

Please sign in to comment.