Merge pull request #120 from php-flasher/feat/composer-scripts

feat: replace maker with composer script
This commit is contained in:
Younes KHOUBZA
2023-01-21 21:27:23 +01:00
committed by GitHub
8 changed files with 9 additions and 76 deletions
-5
View File
@@ -1,5 +0,0 @@
include make/variables.mk
include make/help.mk
include make/composer.mk
include make/lint.mk
include make/build.mk
+6
View File
@@ -152,5 +152,11 @@
"Flasher\\SweetAlert\\Laravel\\FlasherSweetAlertServiceProvider"
]
}
},
"scripts": {
"check-syntax": "test `find ./src -iname \"*.php\" | xargs -n1 -P6 php -l | grep -Fv \"No syntax errors\" | wc -l` -eq 0",
"normalize-composer": "find src -name \"composer.json\" -exec composer normalize {} \\;",
"normalize-packs": "find packs -name \"composer.json\" -exec composer normalize {} \\;",
"validate-composer": "find src -name \"composer.json\" -exec composer validate --strict {} \\;"
}
}
+3
View File
@@ -1,7 +1,10 @@
grumphp:
ascii: ~
tasks:
composer: ~
composer_normalize: ~
composer_script:
script: check-syntax
phpcsfixer: ~
jsonlint: ~
yamllint: ~
-8
View File
@@ -1,8 +0,0 @@
.PHONY: assets build
## Download local assets from cdn
assets:
bin/assets
# Build a new PHPFlasher version
build: lint assets
-9
View File
@@ -1,9 +0,0 @@
.PHONY: install update
## 🧙‍ Installs the project dependencies and assets
install: composer.lock
$(COMPOSER) install $(COMPOSER_ARGS)
## Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update:
$(COMPOSER) update --lock $(COMPOSER_ARGS)
-27
View File
@@ -1,27 +0,0 @@
.PHONY: help
COLOR_RESET = \033[0m
COLOR_INFO = \033[32m
COLOR_COMMENT = \033[33m
## Help
help:
@printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n"
@printf " make [target]\n\n"
@printf "${COLOR_COMMENT}Available targets:${COLOR_RESET}\n"
@awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${COLOR_INFO}%-16s${COLOR_RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
-15
View File
@@ -1,15 +0,0 @@
.PHONY: lint fix
## Run code style, linters
lint:
test `find ./src -iname "*.php" | xargs -n1 -P6 php -l | grep -Fv "No syntax errors" | wc -l` -eq 0
$(PHP_CS_FIXER) fix --diff --dry-run -v
$(COMPOSER) normalize
find src -name "composer.json" -exec $(COMPOSER) normalize {} \;
$(COMPOSER) validate --strict
find src -name "composer.json" -exec $(COMPOSER) validate --strict {} \;
find packs -name "composer.json" -exec $(COMPOSER) normalize {} \;
## Fix files with php-cs-fixer
fix:
$(PHP_CS_FIXER) fix --allow-risky=yes
-12
View File
@@ -1,12 +0,0 @@
# Executables
EXEC_PHP = php
COMPOSER = composer
# Parameters
COMPOSER_ARGS ?=
# Executables: vendors
PHP_CS_FIXER = ./vendor/bin/php-cs-fixer
# Misc
.DEFAULT_GOAL = help