-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (63 loc) · 2.46 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- coding: utf-8 -*-
TIMESTAMP := $(shell date +%Y%m%d%H%M%S)
MAKEFILE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
OS_NAME := $(shell uname -s)
OPEN_TARGET := http://0.0.0.0:1313/
OPTS :=
.DEFAULT_GOAL := default
.PHONY: default setup open hide reveal start build watch format test ngrok deploy update-dependencies update-theme endorse clean help
default: start ## 常用
setup: ## 初期
ifeq ($(OS_NAME),Darwin)
brew install colordiff
brew install direnv
brew install git-cliff
brew install git-secret
brew install hugo
brew install netlify-cli
brew install --cask ngrok
endif
npm install
npx playwright install
make reveal
direnv allow
@if [ $(OS_NAME) = "Darwin" ]; then say "The setup process is complete." ; fi
open: ## 閲覧
@if [ $(OS_NAME) = "Darwin" ]; then open ${OPEN_TARGET} ; fi
hide: ## 秘匿
git secret hide -vm
reveal: ## 暴露
git secret reveal -vf
start: ## 開始
@if [ $(OS_NAME) = "Darwin" ]; then say "Start the application." ; fi
hugo server --buildDrafts --buildFuture --verbose
build: ## 構築
NODE_ENV=production ./themes/congo/node_modules/tailwindcss/lib/cli.js --config ./themes/congo/tailwind.config.js --input ./themes/congo/assets/css/main.css --output ./assets/css/compiled/main.css --jit
watch: ## 監視
NODE_ENV=development ./themes/congo/node_modules/tailwindcss/lib/cli.js --config ./themes/congo/tailwind.config.js --input ./themes/congo/assets/css/main.css --output ./assets/css/compiled/main.css --jit --watch
format: ## 整形
npx eslint --fix .
npx stylelint --fix '**/*.{css,scss,sass}'
npx prettier --write .
test: ## 試験
npx playwright test --update-snapshots --headed
ngrok: ## 転送
@if [ $(OS_NAME) = "Darwin" ]; then say "Start transfer using ngrok." ; fi
ngrok http 1313
deploy: ## 配備
netlify init
netlify deploy $(OPTS)
@if [ $(OS_NAME) = "Darwin" ]; then say "The deployment process is complete." ; fi
update-dependencies: ## 追随
ncu --upgrade && rm -rfv node_modules && npm install && npx playwright install
update-theme: ## 追随
git submodule update --remote --rebase
cd themes/congo && npm install && git submodule update --remote --rebase
endorse: ## 裏書
./utils/endorse.sh
clean: ## 掃除
rm -rf test-results
rm -rf tests/*.ts-snapshots
@if [ $(OS_NAME) = "Darwin" ]; then say "The cleanup process is complete." ; fi
help: ## 助言
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'