From e419ddc61739c365284894cfae341e7731b04eda Mon Sep 17 00:00:00 2001 From: John Niang Date: Thu, 13 Oct 2022 18:00:16 +0800 Subject: [PATCH] Add Makefile for convenient operations (#641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature /area console #### What this PR does / why we need it: ```bash ╰─❯ make help all lint and test code install install dependencies build build console lint lint code test run tests help print this help ``` #### Does this PR introduce a user-facing change? ```release-note None ``` --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d38d674c --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +SHELL := /usr/bin/env bash -o errexit -o pipefail -o nounset + +.PHONY: all +all: lint test ## lint and test code + +.PHONY: install +install: ## install dependencies + pnpm install + +.PHONY: build +build: install ## build console + pnpm build:packages + pnpm build + +.PHONY: lint +lint: install ## lint code + pnpm lint + pnpm typecheck + +.PHONY: test +test: install ## run tests + pnpm test:unit + +.PHONY: help +help: ## print this help + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)