Add Makefile for convenient operations (halo-dev/console#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/3445/head
John Niang 2022-10-13 18:00:16 +08:00 committed by GitHub
parent 5b12cf8ce4
commit d089ec63b4
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)