-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
Makefile
197 lines (158 loc) · 6.05 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
################################################################################
#
# 888b 88 88888888888 ,ad8888ba, ad88888ba
# 8888b 88 88 d8"' `"8b d8" "8b
# 88 `8b 88 88 d8' `8b y8,
# 88 `8b 88 88aaaaa 88 88 `y8aaaaa,
# 88 `8b 88 88""""" 88 88 `"""""8b,
# 88 `8b 88 88 y8, ,8p `8b
# 88 `8888 88 y8a. .a8p y8a a8p
# 88 `888 88888888888 `"Y8888Y"' "Y88888P"
#
# <Makefile>
#
# 88 88 88
# 88 88 88
# 88 88 88
# 88 88 88
# 88 88 88
# 88 88 88
# Y8a. .a8P 88
# `"Y8888Y"' 88
#
#
################################################################################
################################################################################
# Make ALL targets phony targets (Rebuild every time)
################################################################################
.PHONY: check-requirements install setup \
build build-watch build-production \
test test-e2e lint lint-js lint-editorconfig \
called-with-version bump-version publish-npm \
clean
################################################################################
# Variables
################################################################################
# Add alias as there are currently some MacOS problems
# and putting it into the $PATH is simply not enough
editorconfigChecker = ./node_modules/.bin/editorconfig-checker
# Define colors
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
################################################################################
# Setup
################################################################################
check-requirements:
@which yarn &>/dev/null || \
(echo yarn is not installed: https://github.com/yarnpkg/yarn && false)
install: ## Install dependencies
yarn install
install-and-verify:
# Validate this project because were using Zero-Installs (slightly safer as we accept external PRs)
yarn install --immutable --immutable-cache --check-cache
setup: check-requirements install build ## Run a clean setup
@echo Please remember to set frontendDevelopmentMode \
to true in your Settings.yaml.
@echo
@echo 'Neos:'
@echo ' Neos:'
@echo ' Ui:'
@echo ' frontendDevelopmentMode: true'
################################################################################
# Builds
################################################################################
# Builds the subpackages for standalone use.
build-subpackages:
yarn workspaces foreach --parallel run build
## Runs the development build.
build:
node esbuild.js
## Watches the source files for changes and runs a build in case.
build-watch:
node esbuild.js --watch
# clean anything before building for production just to be sure
## Runs the production build.
build-production:
node esbuild.js --production
build-e2e-testing:
node esbuild.js --production --e2e-testing
################################################################################
# Code Quality
################################################################################
## Executes the unit test on all source files.
test:
yarn test
## Executes integration tests on saucelabs.
test-e2e-saucelabs:
bash Tests/IntegrationTests/e2e.sh --saucelabs
## Executes integration tests locally.
test-e2e:
bash Tests/IntegrationTests/e2e.sh --browser chrome:--disable-search-engine-choice-screen
## Executes integration tests locally in a docker-compose setup.
#
# Note: On mac os you might need those two additional `/etc/hosts` entries:
# 127.0.0.1 onedimension.localhost
# 127.0.0.1 twodimensions.localhost
test-e2e-docker: build-e2e-testing
@bash Tests/IntegrationTests/e2e-docker.sh $(or $(browser),chrome:--disable-search-engine-choice-screen)
start-neos-dev-instance:
bash Tests/IntegrationTests/start-neos-dev-instance.sh
## Executes make lint-js and make lint-editorconfig.
lint: lint-js lint-editorconfig
## Runs lint test in all subpackages
lint-js:
yarn run lint
## Tests if all files respect the .editorconfig.
lint-editorconfig:
# TODO: editorconfig-checker seems broken in node >14
# see https://github.com/editorconfig-checker/editorconfig-checker/issues/178
# $(editorconfigChecker) -config .ecrc.json
################################################################################
# Releasing
################################################################################
called-with-version:
ifeq ($(VERSION),)
@echo No version information given.
@echo Please run this command like this:
@echo VERSION=9.0.0 make ...
@false
endif
bump-version: called-with-version
yarn workspaces foreach version $(VERSION) --deferred
yarn version apply --all
publish-npm: called-with-version
yarn workspaces foreach --no-private npm publish --access public
################################################################################
# Misc
################################################################################
clean:
@echo you might want to use the following git command to clear some ignored files interactively
@echo ''
@echo git clean -idX
################################################################################
# help command as default
################################################################################
# define indention for descriptions
TARGET_MAX_CHAR_NUM=40
## Show help
help:
@echo ''
@echo '${GREEN}CLI command list of neos-ui:${RESET}'
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z0-9_-]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@echo ''
.DEFAULT_GOAL := help