mirror of
https://github.com/chenasraf/nextcloud-autocurrency.git
synced 2026-05-17 17:28:06 +00:00
build: update build files
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
module.exports = {
|
||||
'*.{ts,vue}': ['eslint --fix'],
|
||||
'*.{scss,vue,ts,md,json}': ['prettier --write'],
|
||||
'*.php': [
|
||||
'php vendor-bin/cs-fixer/vendor/php-cs-fixer/shim/php-cs-fixer.phar --config=.php-cs-fixer.dist.php fix',
|
||||
],
|
||||
'ApiController.php': [() => 'make openapi'],
|
||||
'src/*.{scss,vue,ts,md,json}': ['prettier --write'],
|
||||
'*.php': [() => 'make php-cs-fixer'],
|
||||
'*Controller.php': [() => 'make openapi', () => 'git add openapi.json'],
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ $config
|
||||
->notPath('node_modules')
|
||||
->notPath('src')
|
||||
->notPath('vendor')
|
||||
->notPath('gen')
|
||||
->in(__DIR__);
|
||||
|
||||
return $config;
|
||||
|
||||
30
Makefile
30
Makefile
@@ -47,6 +47,7 @@ appstore_build_directory=$(CURDIR)/build/artifacts/appstore
|
||||
appstore_package_name=$(appstore_build_directory)/$(app_name)
|
||||
pnpm=$(shell which pnpm 2> /dev/null)
|
||||
composer=$(shell which composer 2> /dev/null)
|
||||
composer_phar=build/tools/composer.phar
|
||||
|
||||
all: build
|
||||
|
||||
@@ -73,10 +74,13 @@ ifeq (, $(composer))
|
||||
@echo "No composer command available, downloading a copy from the web"
|
||||
mkdir -p $(build_tools_directory)
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
mv composer.phar $(build_tools_directory)
|
||||
php $(build_tools_directory)/composer.phar install --prefer-dist
|
||||
mv composer.phar $(composer_phar)
|
||||
endif
|
||||
ifneq ("$(wildcard vendor)","")
|
||||
@echo "Vendor directory already exists, skipping composer install"
|
||||
else
|
||||
composer install --prefer-dist
|
||||
@echo "Installing composer dependencies..."
|
||||
$(if $(composer),$(composer),php $(composer_phar)) install --prefer-dist
|
||||
endif
|
||||
|
||||
# Installs pnpm dependencies
|
||||
@@ -172,17 +176,29 @@ test: composer
|
||||
.PHONY: lint
|
||||
lint:
|
||||
pnpm lint
|
||||
build/tools/composer.phar run lint
|
||||
$(composer_phar) run lint
|
||||
|
||||
.PHONY: php-cs-fixer
|
||||
php-cs-fixer:
|
||||
@echo "\x1b[33mFixing PHP files...\x1b[0m"
|
||||
@FILES=$$(git diff --cached --name-only --diff-filter=ACM | grep '\.php$$' | grep -v '^gen/'); \
|
||||
if [ -z "$$FILES" ]; then \
|
||||
echo "No PHP files staged."; \
|
||||
else \
|
||||
echo "Running CS fixer on:" $$FILES; \
|
||||
php -l $$FILES || exit 1; \
|
||||
PHP_CS_FIXER_IGNORE_ENV=true php vendor-bin/cs-fixer/vendor/php-cs-fixer/shim/php-cs-fixer.phar --config=.php-cs-fixer.dist.php fix $$FILES || exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
pnpm format
|
||||
PHP_CS_FIXER_IGNORE_ENV=true build/tools/composer.phar run cs:fix
|
||||
PHP_CS_FIXER_IGNORE_ENV=true $(composer_phar) run cs:fix
|
||||
|
||||
.PHONY: openapi
|
||||
openapi: composer
|
||||
openapi:
|
||||
@echo "\x1b[33mGenerating OpenAPI documentation...\x1b[0m"
|
||||
build/tools/composer.phar run openapi
|
||||
$(if $(composer),$(composer),php $(composer_phar)) run openapi
|
||||
@echo "\x1b[32mOpenAPI documentation generated at build/openapi/openapi.json\x1b[0m"
|
||||
|
||||
.PHONY: sign
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"post-update-cmd": [
|
||||
"@composer bin all update --ansi"
|
||||
],
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './gen/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
|
||||
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||
"cs:fix": "php-cs-fixer fix",
|
||||
"psalm": "psalm --threads=1 --no-cache",
|
||||
|
||||
Reference in New Issue
Block a user