Skip to content

Commit b424af4

Browse files
authored
Merge pull request #386 from wayofdev/feat/laravel-11
2 parents 4228153 + 5ef9399 commit b424af4

12 files changed

+2804
-212
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: check-added-large-files
10-
- id: fix-encoding-pragma
10+
args: ['--maxkb=600']
1111

1212
- repo: https://github.com/commitizen-tools/commitizen
1313
rev: v3.27.0

Makefile

+46-9
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,43 @@ lint-stan:
248248
$(APP_COMPOSER) stan
249249
.PHONY: lint-stan
250250

251+
lint-stan-ci: ## Runs phpstan – static analysis tool with github output (CI mode)
252+
$(APP_COMPOSER) stan:ci
253+
.PHONY: lint-stan-ci
254+
251255
lint-stan-baseline: ## Runs phpstan to update its baseline
252256
$(APP_COMPOSER) stan:baseline
253257
.PHONY: lint-stan-baseline
254258

259+
lint-psalm: ## Runs vimeo/psalm – static analysis tool
260+
$(APP_COMPOSER) psalm
261+
.PHONY: lint-psalm
262+
263+
lint-psalm-ci: ## Runs vimeo/psalm – static analysis tool with github output (CI mode)
264+
$(APP_COMPOSER) psalm:ci
265+
.PHONY: lint-psalm-ci
266+
267+
lint-psalm-baseline: ## Runs vimeo/psalm to update its baseline
268+
$(APP_COMPOSER) psalm:baseline
269+
.PHONY: lint-psalm-baseline
270+
255271
lint-deps: ## Runs composer-require-checker – checks for dependencies that are not used
256272
$(APP_RUNNER) .phive/composer-require-checker check \
257273
--config-file=/app/composer-require-checker.json \
258274
--verbose
259275
.PHONY: lint-deps
260276

261-
lint-ddd-deps:
262-
$(APP_RUNNER) .phive/deptrac
263-
.PHONY: lint-ddd-deps
277+
lint-deptrac: ## Runs deptrac – static analysis tool
278+
$(APP_RUNNER) .phive/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache
279+
.PHONY: lint-deptrac
280+
281+
lint-deptrac-ci: ## Runs deptrac – static analysis tool with github output (CI mode)
282+
$(APP_RUNNER) .phive/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter github-actions
283+
.PHONY: lint-deptrac-ci
284+
285+
lint-deptrac-gv: ## Runs deptrac – static analysis tool and generates graphviz image
286+
$(APP_RUNNER) .phive/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../assets/deptrac.svg
287+
.PHONY: lint-deptrac-gv
264288

265289
lint-composer: ## Normalize composer.json and composer.lock files
266290
$(APP_RUNNER) .phive/composer-normalize normalize
@@ -273,6 +297,14 @@ lint-audit: ## Runs security checks for composer dependencies
273297
#
274298
# Testing
275299
# ------------------------------------------------------------------------------------
300+
infect: ## Runs mutation tests with infection/infection
301+
$(APP_COMPOSER) infect
302+
.PHONY: infect
303+
304+
infect-ci: ## Runs infection – mutation testing framework with github output (CI mode)
305+
$(APP_COMPOSER) infect:ci
306+
.PHONY: lint-infect-ci
307+
276308
test: ## Run project php-unit and pest tests
277309
$(APP_COMPOSER) test
278310
.PHONY: test
@@ -281,14 +313,15 @@ test-cc: ## Run project php-unit and pest tests in coverage mode and build repor
281313
$(APP_COMPOSER) test:cc
282314
.PHONY: test-cc
283315

284-
api-docs: ## Generate openapi docs specification file
285-
$(APP_EXEC) php artisan open-docs:generate
286-
.PHONY: api-docs
287-
288-
289-
316+
api-docs-public: ## Generate openapi docs specification file for public api
317+
$(APP_EXEC) php artisan open-docs:generate public
318+
.PHONY: api-docs-public
290319

320+
api-docs-admin: ## Generate openapi docs specification file for admin api
321+
$(APP_EXEC) php artisan open-docs:generate admin
322+
.PHONY: api-docs-admin
291323

324+
#
292325
# Database Commands
293326
# ------------------------------------------------------------------------------------
294327
db-wipe: ## Wipe database
@@ -299,7 +332,11 @@ db-refresh: ## Delete migration files, wipe database, create new migrations, run
299332
$(APP_EXEC) php artisan migrate:fresh
300333
.PHONY: db-refresh
301334

335+
db-migrate: ## Run all pending migrations
336+
$(APP_EXEC) php artisan migrate
337+
.PHONY: db-migrate
302338

339+
#
303340
# Deployer Commands
304341
# ------------------------------------------------------------------------------------
305342
dep-staging:

app/composer.json

+47-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@
44
"license": "MIT",
55
"type": "project",
66
"keywords": [
7-
"framework",
8-
"laravel"
7+
"php",
8+
"laravel",
9+
"boilerplate",
10+
"laravel-boilerplate",
11+
"starter-template",
12+
"laravel-package",
13+
"starter-kit",
14+
"laravel-application",
15+
"starter-project",
16+
"laravel-starter-template",
17+
"laravel-starter-kit",
18+
"laravel-api",
19+
"laravel-ddd",
20+
"ddd"
921
],
1022
"require": {
1123
"php": "^8.2",
@@ -17,20 +29,29 @@
1729
"league/fractal": "^0.20.1",
1830
"sentry/sentry-laravel": "^4.5",
1931
"spatie/laravel-fractal": "^6.2",
20-
"spatie/laravel-query-builder": "^5.8",
32+
"spatie/laravel-query-builder": "^6.0",
2133
"spatie/laravel-route-attributes": "^1.22",
2234
"wayofdev/laravel-open-docs": "^2.1"
2335
},
2436
"require-dev": {
37+
"ergebnis/phpunit-slow-test-detector": "^2.14",
2538
"fakerphp/faker": "^1.23",
2639
"larastan/larastan": "^2.9",
2740
"mockery/mockery": "^1.6",
2841
"nunomaduro/collision": "^8.1",
42+
"pestphp/pest": "^2.34",
2943
"pestphp/pest-plugin-laravel": "^2.4",
3044
"phpstan/extension-installer": "^1.3",
45+
"phpstan/phpstan": "^1.11",
3146
"phpstan/phpstan-deprecation-rules": "^1.2",
47+
"phpstan/phpstan-phpunit": "^1.3",
48+
"phpstan/phpstan-strict-rules": "^1.5",
3249
"phpunit/phpunit": "^10.5",
50+
"psalm/plugin-laravel": "^2.11",
51+
"psalm/plugin-phpunit": "~0.19.0",
52+
"roave/infection-static-analysis-plugin": "^1.35",
3353
"spatie/laravel-ignition": "^2.7",
54+
"vimeo/psalm": "^5.23.1",
3455
"wayofdev/cs-fixer-config": "^1.4"
3556
},
3657
"minimum-stability": "dev",
@@ -52,6 +73,7 @@
5273
"config": {
5374
"allow-plugins": {
5475
"ergebnis/composer-normalize": true,
76+
"infection/extension-installer": true,
5577
"pestphp/pest-plugin": true,
5678
"php-http/discovery": true,
5779
"phpstan/extension-installer": true
@@ -88,9 +110,29 @@
88110
"deptrac": "php vendor/bin/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache",
89111
"deptrac:ci": "php vendor/bin/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter github-actions",
90112
"deptrac:gv": "php vendor/bin/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../assets/deptrac.svg",
113+
"infect": [
114+
"Composer\\Config::disableProcessTimeout",
115+
"@putenv XDEBUG_MODE=coverage",
116+
"php -d memory_limit=2G vendor/bin/roave-infection-static-analysis-plugin --threads=2"
117+
],
118+
"infect:ci": [
119+
"Composer\\Config::disableProcessTimeout",
120+
"@putenv XDEBUG_MODE=coverage",
121+
"php -d memory_limit=2G vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ansi --logger-github --ignore-msi-with-no-mutations --only-covered"
122+
],
123+
"psalm": "php vendor/bin/psalm --show-info=true",
124+
"psalm:baseline": "php vendor/bin/psalm --set-baseline=psalm-baseline.xml",
125+
"psalm:ci": "php vendor/bin/psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
91126
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
92127
"stan:baseline": "php vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline",
93-
"test": "php vendor/bin/pest",
94-
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage-clover coverage.xml"
128+
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github",
129+
"test": [
130+
"@putenv XDEBUG_MODE=coverage",
131+
"php vendor/bin/pest --color=always"
132+
],
133+
"test:cc": [
134+
"@putenv XDEBUG_MODE=coverage",
135+
"php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml --color=always"
136+
]
95137
}
96138
}

0 commit comments

Comments
 (0)