-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
229 lines (192 loc) · 6.91 KB
/
Makefile
File metadata and controls
229 lines (192 loc) · 6.91 KB
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# Default shell
SHELL := /bin/bash
# Default goal
.DEFAULT_GOAL := help
# Variables
MAKE_PHP_8_4_EXE ?= php8.4
MAKE_COMPOSER_EXE ?= /usr/local/bin/composer
MAKE_NPM_EXE ?= npm
MAKE_NODE_EXE ?= node
MAKE_PHP ?= ${MAKE_PHP_8_4_EXE}
MAKE_COMPOSER ?= ${MAKE_PHP} ${MAKE_COMPOSER_EXE}
MAKE_NPM ?= ${MAKE_NPM_EXE}
MAKE_NODE ?= ${MAKE_NODE_EXE}
# Goals
.PHONY: help
help:
@echo 'Usage:'
@echo ' make <target>'
@echo ''
@echo 'Mission-critical delivery flows:'
@echo ' local '
@echo ' Prepare the local developer environment build.'
@echo ' development '
@echo ' Prepare the shared development-ready environment build.'
@echo ' testing '
@echo ' Prepare the QA validation environment build.'
@echo ' staging '
@echo ' Prepare the staging certification environment build.'
@echo ' production '
@echo ' Prepare the production release environment build.'
@echo ''
@echo 'Application runtime interface:'
@echo ' start | serve | up | server'
@echo ' Boot the development HTTP server.'
@echo ''
@echo 'Quality gates & assurance:'
@echo ' check '
@echo ' Execute the end-to-end quality gate before promotion.'
@echo ' test '
@echo ' Run the full automated test campaign.'
@echo ' test_phpunit '
@echo ' Execute the PHPUnit regression suite for the service.'
@echo ' coverage '
@echo ' Host the local web console for the latest coverage run.'
@echo ' lint '
@echo ' Execute all linters across source code and assets.'
@echo ' lint_eslint '
@echo ' Run ESLint across JavaScript/TypeScript sources.'
@echo ' lint_prettier '
@echo ' Verify formatting via Prettier in check mode.'
@echo ' lint_php_cs_fixer '
@echo ' Run php-cs-fixer lint mode for PHP styling.'
@echo ' fix '
@echo ' Autofix style and formatting deviations across stacks.'
@echo ' fix_eslint '
@echo ' Autofix JavaScript/TypeScript issues via ESLint.'
@echo ' fix_prettier '
@echo ' Autofix formatting deviations via Prettier.'
@echo ' fix_php_cs_fixer '
@echo ' Autofix PHP styling via php-cs-fixer.'
@echo ' stan '
@echo ' Run advanced static analysis for the PHP domain.'
@echo ' stan_phpstan '
@echo ' Execute PHPStan with the project configuration.'
@echo ' audit '
@echo ' Assess dependency health and supply-chain posture.'
@echo ' audit_npm '
@echo ' Run npm security audits for JavaScript dependencies.'
@echo ' audit_composer '
@echo ' Run composer audit, platform, and validate checks.'
@echo ''
@echo 'Dependencies & environment:'
@echo ' install '
@echo ' Provision all runtime dependencies for the project.'
@echo ' install_npm '
@echo ' Install frontend dependencies with npm.'
@echo ' install_composer '
@echo ' Install PHP dependencies with composer.'
@echo ' update '
@echo ' Refresh dependencies to the latest approved revisions.'
@echo ' update_npm '
@echo ' Refresh JavaScript dependencies to current policy.'
@echo ' update_composer '
@echo ' Refresh PHP dependencies to approved versions.'
@echo ''
@echo 'Housekeeping & recovery:'
@echo ' clean '
@echo ' Purge build caches and dependency artifacts.'
@echo ''
@echo 'Meta:'
@echo ' help '
@echo ' Show this operational guide.'
.PHONY: local
local: ./vendor
${MAKE_COMPOSER} run dump:development
${MAKE_COMPOSER} run cache:clear
.PHONY: development
development: local
.PHONY: testing
testing: development
${MAKE_COMPOSER} run dump:production
.PHONY: staging
staging: testing
.PHONY: production
production: staging
.PHONY: start serve up server
start serve up server: ./vendor/autoload.php
${MAKE_COMPOSER} run start:development
.PHONY: audit
audit: audit_npm audit_composer
.PHONY: audit_composer
audit_composer: ./vendor ./composer.lock
${MAKE_COMPOSER} run composer:audit
${MAKE_COMPOSER} run composer:platform
${MAKE_COMPOSER} run composer:validate
.PHONY: audit_npm
audit_npm: ./node_modules ./package-lock.json
${MAKE_NPM} run npm:audit
.PHONY: check
check: lint stan test audit
.PHONY: clean
clean:
rm -rf ./.php-cs-fixer.cache
rm -rf ./.phpunit.cache
rm -rf ./.phpunit.coverage
rm -rf ./.phpunit.result.cache
rm -rf ./composer.lock
rm -rf ./node_modules
rm -rf ./package-lock.json
rm -rf ./vendor
.PHONY: coverage
coverage: ./.phpunit.coverage/html
${MAKE_COMPOSER} start:coverage
.PHONY: fix
fix: fix_eslint fix_prettier fix_php_cs_fixer
.PHONY: fix_eslint
fix_eslint: ./node_modules/.bin/eslint ./eslint.config.js
${MAKE_NPM} run fix:eslint
.PHONY: fix_php_cs_fixer
fix_php_cs_fixer: ./vendor/bin/php-cs-fixer ./.php-cs-fixer.php
${MAKE_COMPOSER} run fix:php-cs-fixer
.PHONY: fix_prettier
fix_prettier: ./node_modules/.bin/prettier ./prettier.config.js
${MAKE_NPM} run fix:prettier
.PHONY: lint
lint: lint_eslint lint_prettier lint_php_cs_fixer
.PHONY: lint_eslint
lint_eslint: ./node_modules/.bin/eslint ./eslint.config.js
${MAKE_NPM} run lint:eslint
.PHONY: lint_php_cs_fixer
lint_php_cs_fixer: ./vendor/bin/php-cs-fixer ./.php-cs-fixer.php
${MAKE_COMPOSER} run lint:php-cs-fixer
.PHONY: lint_prettier
lint_prettier: ./node_modules/.bin/prettier ./prettier.config.js
${MAKE_NPM} run lint:prettier
.PHONY: stan
stan: stan_phpstan
.PHONY: stan_phpstan
stan_phpstan: ./vendor/bin/phpstan ./phpstan.neon
${MAKE_COMPOSER} run stan:phpstan
.PHONY: test
test: test_phpunit
.PHONY: test_phpunit
test_phpunit: ./vendor/bin/phpunit ./phpunit.xml
${MAKE_COMPOSER} run dump:development
${MAKE_COMPOSER} run test:phpunit
.PHONY: install
install: install_npm install_composer
.PHONY: install_npm
install_npm: ./package.json
${MAKE_NPM} run npm:install
.PHONY: install_composer
install_composer: ./composer.json
${MAKE_COMPOSER} run composer:install
.PHONY: update
update: update_npm update_composer
.PHONY: update_npm
update_npm: ./package.json
rm -rf ./node_modules
rm -rf ./package-lock.json
${MAKE_NPM} run npm:update
.PHONY: update_composer
update_composer: ./composer.json
rm -rf ./vendor
rm -rf ./composer.lock
${MAKE_COMPOSER} run composer:update
# Dependencies
./.phpunit.coverage/html: test_phpunit
./package-lock.json ./node_modules ./node_modules/.bin/eslint ./node_modules/.bin/prettier:
${MAKE} install
./composer.lock ./vendor ./vendor/bin/php-cs-fixer ./vendor/bin/phpstan ./vendor/bin/phpunit ./vendor/autoload.php:
${MAKE} install