-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
150 lines (110 loc) · 3.48 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
.SILENT:
.PHONY: build
include ./.make/text.mk
include ./.make/help.mk
###########
# Install #
###########
## Install dependencies
install: install.composer install.npm install.assets
install.composer:
symfony composer install
install.npm:
npm install
install.assets:
symfony console importmap:install
## Update dependencies
update: update.composer
update.composer:
symfony composer update
###############
# Development #
###############
## Dev - Start the whole application for development purposes (local only)
serve: clear.assets
# https://www.npmjs.com/package/concurrently
npx concurrently "make serve.php" "make serve.assets" --names="Symfony,Assets" --prefix=name --kill-others --kill-others-on-fail
## Dev - Start Symfony server
serve.php:
symfony server:start --no-tls
## Dev - Build Saas files
serve.assets:
symfony console sass:build --watch
## Clear - Clear the assets
clear.assets:
rm -rf public/assets
## Clear - Clear the build dir and assets
clear.build: clear.assets
rm -rf build
## Clear - Clear resized images cache
clear.images:
rm -rf public/resized
## Clear - Clear symfony cache
clear.cache:
symfony console cache:clear
#########
# Build #
#########
## Build - Build assets
build.assets: export APP_ENV = prod
build.assets:
symfony console sass:build
symfony console asset-map:compile
## Build - Build static site
build.content: export APP_ENV = prod
build.content: clear.images clear.cache
symfony console stenope:build
## Build - Build static site without resizing images, for moar speed
build.content.without-images: export APP_ENV = prod
build.content.without-images: export GLIDE_PRE_GENERATE_CACHE = 0
build.content.without-images: clear.cache
symfony console stenope:build
## Build - Build static site with assets
build.static: export APP_ENV = prod
build.static: clear.cache build.assets build.content
## Serve - Serve the static version
serve.static:
open http://localhost:8000
symfony php -S localhost:8000 -t build
########
# Lint #
########
## Lint - Lint
lint: lint.php-cs-fixer lint.phpstan lint.twig lint.yaml lint.eslint lint.container lint.composer
lint.composer:
symfony composer validate --no-check-publish
lint.composer@integration:
symfony composer validate --no-check-publish --ansi --no-interaction
lint.container:
symfony console lint:container
lint.container@integration:
symfony console lint:container --ansi --no-interaction
lint.php-cs-fixer:
symfony php vendor/bin/php-cs-fixer fix
lint.php-cs-fixer@integration:
symfony php vendor/bin/php-cs-fixer fix --dry-run --diff
lint.twig: lint.twig@integration
lint.twig@integration:
symfony console lint:twig templates --show-deprecations --ansi --no-interaction
lint.yaml: lint.yaml@integration
lint.yaml@integration:
symfony console lint:yaml config content --parse-tags --ansi --no-interaction
lint.phpstan: export APP_ENV = test
lint.phpstan:
symfony console cache:clear --ansi
symfony console cache:warmup --ansi
symfony php vendor/bin/phpstan analyse --memory-limit=-1
lint.phpstan@integration: export APP_ENV = test
lint.phpstan@integration:
symfony php vendor/bin/phpstan --no-progress --no-interaction analyse
lint.eslint:
npx eslint assets --ext .js,.json --fix
lint.eslint@integration:
npx eslint assets --ext .js,.json
########
# Test #
########
## Test - Most basic test: check the build command, without images
test: build.content.without-images
test:
$(call message_success, Most basic tests succeeded. You can ensure a \`make build.content\` is successful for more complete tests.)