This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
102 lines (79 loc) · 2.88 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
### Defensive settings for make:
# https://tech.davis-hansson.com/p/make/
SHELL:=bash
.ONESHELL:
.SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c
.SILENT:
.DELETE_ON_ERROR:
MAKEFLAGS+=--warn-undefined-variables
MAKEFLAGS+=--no-builtin-rules
IMAGE_NAME=ghcr.io/kitconcept/kitconcept-intranet-frontend
IMAGE_TAG=latest
NODEBIN = ./node_modules/.bin
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
.PHONY: help
help: ## This help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: clean
clean: ## Clean installation
@echo "Clean installation"
rm -Rf node_modules
.PHONY: build
build: install ## Build the frontend
@echo "Build Frontend"
yarn build
.PHONY: start
start: ## Start Frontend
yarn start
.PHONY: format-prettier
format-prettier: ## Format Code with Prettier
yarn run prettier:fix
.PHONY: format-stylelint
format-stylelint: ## Format Code with Stylelint
yarn run stylelint:fix
.PHONY: format-lint
format-lint: ## Format Code with Lint
yarn run lint:fix
.PHONY: format
format: format-prettier format-lint format-stylelint ## Format the codebase according to our standards
.PHONY: install
install: ## Install the frontend
@echo "Install frontend"
$(MAKE) omelette
$(MAKE) preinstall
yarn install
.PHONY: preinstall
preinstall: ## Preinstall task, checks if missdev (mrs-developer) is present and runs it
if [ -f $$(pwd)/mrs.developer.json ]; then make develop; fi
.PHONY: develop
develop: ## Runs missdev in the local project (mrs.developer.json should be present)
if [ -f $$(pwd)/tsconfig.json ]; then npx -p mrs-developer missdev --config=tsconfig.json --output=addons --fetch-https; else npx -p mrs-developer missdev --config=jsconfig.json --output=addons --fetch-https;fi
.PHONY: omelette
omelette: ## Creates the omelette folder that contains a link to the installed version of Volto (a softlink pointing to node_modules/@plone/volto)
if [ ! -d omelette ]; then ln -sf node_modules/@plone/volto omelette; fi
.PHONY: patches
patches:
/bin/bash patches/patchit.sh > /dev/null 2>&1 ||true
.PHONY: i18n
i18n: ## Sync i18n
yarn i18n
.PHONY: i18n-ci
i18n-ci: ## Check if i18n is not synced
yarn i18n && git diff -G'^[^\"POT]' --exit-code
.PHONY: test
test: ## Run tests
CI=true yarn test
.PHONY: storybook
storybook: ## Generate Storybook
yarn storybook
.PHONY: build-image
build-image: ## Build Docker Image
@DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile
# Acceptance tests
.PHONY: test-acceptance
test-acceptance: ## Start Core Cypress Acceptance Tests
NODE_ENV=production CYPRESS_API=plone $(NODEBIN)/cypress open
.PHONY: test-acceptance-headless
test-acceptance-headless: ## Start Core Cypress Acceptance Tests in headless mode
NODE_ENV=production CYPRESS_API=plone $(NODEBIN)/cypress run