Add Makefile for convenient operations (#641)

#### 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
```
pull/642/head
John Niang 2022-10-13 18:00:16 +08:00 committed by GitHub
parent 8b15196a33
commit e419ddc617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

26
Makefile Normal file
View File

@ -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)