Fork of github.com/did-method-plc/did-method-plc
1
2SHELL = /bin/bash
3.SHELLFLAGS = -o pipefail -c
4
5.PHONY: help
6help: ## Print info about all commands
7 @echo "Helper Commands:"
8 @echo
9 @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
10 @echo
11 @echo "NOTE: dependencies between commands are not automatic. Eg, you must run 'deps' and 'build' first, and after any changes"
12
13.PHONY: build
14build: ## Compile all modules
15 yarn build
16
17.PHONY: test
18test: ## Run all tests
19 yarn test
20
21.PHONY: fmt
22fmt: ## Run syntax re-formatting
23 yarn prettier
24
25.PHONY: lint
26lint: ## Run style checks and verify syntax
27 yarn verify
28
29.PHONY: nvm-setup
30nvm-setup: ## Use NVM to install and activate node+yarn
31 nvm install 18
32 nvm use 18
33 npm install --global yarn
34
35.PHONY: deps
36deps: ## Installs dependent libs using 'yarn install'
37 yarn install --frozen-lockfile
38
39.PHONY: run-dev-plc
40run-dev-plc: ## Run PLC server "dev" config (needs local PostgreSQL)
41 if [ ! -f "packages/server/.dev.env" ]; then cp packages/server/example.dev.env packages/server/.dev.env; fi
42 cd packages/server; ENV=dev yarn run start | yarn exec pino-pretty