-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
66 lines (51 loc) · 1.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# System Setup
SHELL = bash
APP := $(shell basename $(PWD) | tr '[:upper:]' '[:lower:]')
GITHUB_SHA ?= $(shell git rev-parse HEAD)
GIT_COMMIT_HASH := $(GITHUB_SHA)
GH_URL := 'https://api.github.com'
TR_URL := 'https://api.travis-ci.com'
NO_COLOR := \033[0m
INFO_COLOR := \033[0;36m
.PHONY: all
all: test
.PHONY: build
build: clean ## Build the project
GH_URL=$(GH_URL) \
TR_URL=$(TR_URL) \
GIT_COMMIT_HASH=$(GIT_COMMIT_HASH) \
npx webpack -p
.PHONY: clean
clean: ## Cleanup all running and generated items
-@rm -rf dist
-@rm -rf coverage
-@rm -f *-debug.log *-error.log
.PHONY: deploy
deploy: ## Deploy the generated site
firebase deploy
.PHONY: dev
dev: ## Run the dev test server
@GH_URL=$(GH_URL) \
TR_URL=$(TR_URL) \
GIT_COMMIT_HASH=$(GIT_COMMIT_HASH) \
npx webpack-dev-server --port 8080 --hot --progress --host 0.0.0.0
.PHONY: help
help: ## Show This Help
@for line in $$(cat Makefile | grep "##" | grep -v "grep" | sed "s/:.*##/:/g" | sed "s/\ /!/g"); do verb=$$(echo $$line | cut -d ":" -f 1); desc=$$(echo $$line | cut -d ":" -f 2 | sed "s/!/\ /g"); printf "%-30s--%s\n" "$$verb" "$$desc"; done
.PHONY: install
install: ## Install dependencies
@npm install
.PHONY: linters
linters: ## Run all linters
npx eslint src/**/*.js
.PHONY: story
story: ## Run storybook
npx start-storybook -p 9001 -c .storybook
.PHONY: test
test: ## Run all tests available
.PHONY: snapshots
snapshots: ## Run snapshot tests
npx jest --config jest.snapshot.config.js
.PHONY: update_snapshots
update_snapshots: ## Run snapshots to update the save state
npx jest --config jest.snapshot.config.js -u