diff --git a/.github/workflows/recipe.yaml b/.github/workflows/recipe.yaml index 5ad0b29..827b275 100644 --- a/.github/workflows/recipe.yaml +++ b/.github/workflows/recipe.yaml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] - sylius: ["~1.12.0", "~1.13.0"] + php: ['8.1', '8.2', '8.3'] + sylius: ["~1.12.0", "~1.13.0", "1.14.0"] steps: - name: Setup PHP diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 92217ff..a9cee91 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] + php: ['8.1', '8.2', '8.3'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 726cfa3..dfcf019 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] + php: ['8.1', '8.2', '8.3'] env: COMPOSER_ARGS: --prefer-dist diff --git a/.php-version.dist b/.php-version.dist index 2983cad..cf02201 100644 --- a/.php-version.dist +++ b/.php-version.dist @@ -1 +1 @@ -8.2 +8.3 diff --git a/Makefile b/Makefile index bede693..4f9e064 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ .DEFAULT_GOAL := help SHELL=/bin/bash APP_DIR=tests/Application -SYLIUS_VERSION=1.13.0 +SYLIUS_VERSION=1.14.0 SYMFONY=cd ${APP_DIR} && symfony COMPOSER=symfony composer CONSOLE=${SYMFONY} console -export COMPOSE_PROJECT_NAME=sylius_robots_txt_plugin -PLUGIN_NAME=sylius-robots-txt-plugin -COMPOSE=docker-compose +export COMPOSE_PROJECT_NAME=robots-txt +export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusRobotsTxtPlugin\\Migrations +export USER_UID=$(shell id -u) +PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin +COMPOSE=docker compose YARN=yarn -DOCTRINE_MIGRATIONS_NAMESPACE=MonsieurBiz\SyliusRobotsTxtPlugin\Migrations - ### ### DEVELOPMENT @@ -78,14 +78,15 @@ setup_application: $(MAKE) ${APP_DIR}/php.ini (cd ${APP_DIR} && ${COMPOSER} install --no-interaction) $(MAKE) apply_dist - (cd ${APP_DIR} && ${COMPOSER} require --no-progress monsieurbiz/${PLUGIN_NAME}="*@dev") + (cd ${APP_DIR} && ${COMPOSER} require --no-progress --no-interaction monsieurbiz/${PLUGIN_NAME}="*@dev") rm -rf ${APP_DIR}/var/cache - rm -f ${APP_DIR}/public/robots.txt # Remove the default robots.txt file to let our controller render contents ${APP_DIR}/docker-compose.yaml: rm -f ${APP_DIR}/docker-compose.yml rm -f ${APP_DIR}/docker-compose.yaml + rm -f ${APP_DIR}/compose.yml # Remove Sylius file about Docker + rm -f ${APP_DIR}/compose.override.dist.yml # Remove Sylius file about Docker ln -s ../../docker-compose.yaml.dist ${APP_DIR}/docker-compose.yaml .PHONY: ${APP_DIR}/docker-compose.yaml @@ -110,7 +111,7 @@ apply_dist: ### TESTS ### ¯¯¯¯¯ -test.all: test.composer test.phpstan test.phpmd test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once +test.all: test.composer test.phpstan test.phpmd test.phpunit test.phpspec test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once test.composer: ## Validate composer.json ${COMPOSER} validate --strict @@ -121,6 +122,12 @@ test.phpstan: ## Run PHPStan test.phpmd: ## Run PHPMD ${COMPOSER} phpmd +test.phpunit: ## Run PHPUnit + ${COMPOSER} phpunit + +test.phpspec: ## Run PHPSpec + ${COMPOSER} phpspec + test.phpcs: ## Run PHP CS Fixer in dry-run ${COMPOSER} run -- phpcs --dry-run -v @@ -131,29 +138,13 @@ test.container: ## Lint the symfony container ${CONSOLE} lint:container test.yaml: ## Lint the symfony Yaml files - ${CONSOLE} lint:yaml ../../src/Resources/config + ${CONSOLE} lint:yaml ../../src/Resources/config --parse-tags test.schema: ## Validate MySQL Schema ${CONSOLE} doctrine:schema:validate test.twig: ## Validate Twig templates - ${CONSOLE} lint:twig --no-debug templates/ - -### -### MIGRATIONS -### ¯¯¯¯¯¯¯¯¯¯ - -app.doctrine.migration.diff: ## Create a diff migration file for the Test Application - ${CONSOLE} doctrine:migrations:diff --namespace="App\Migrations" -.PHONY: app.doctrine.migration.diff - -doctrine.migration.diff: ## Create a diff migration file for the Plugin itself - ${CONSOLE} doctrine:migrations:diff --namespace="${DOCTRINE_MIGRATIONS_NAMESPACE}" -.PHONY: doctrine.migration.diff - -doctrine.migration.migrate: ## Run migrations - ${CONSOLE} doctrine:migration:migrate -n -.PHONY: doctrine.migration.migrate + ${CONSOLE} lint:twig --no-debug templates/ ../../src/Resources/views/ ### ### SYLIUS @@ -178,6 +169,9 @@ sylius.assets: ## Install all assets with symlinks messenger.setup: ## Setup Messenger transports ${CONSOLE} messenger:setup-transports +doctrine.diff: ## Doctrine diff + ${CONSOLE} doctrine:migration:diff --namespace="${MIGRATIONS_NAMESPACE}" + ### ### PLATFORM ### ¯¯¯¯¯¯¯¯ @@ -215,18 +209,6 @@ server.start: ## Run the local webserver using Symfony server.stop: ## Stop the local webserver ${SYMFONY} local:server:stop -### -### GITHUB CODESPACES -### ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ - -codespace.hostname: ${APP_DIR}/.env.local ## Init the SYLIUS_FIXTURES_HOSTNAME variable in .env.local -ifdef CODESPACES - echo SYLIUS_FIXTURES_HOSTNAME=${CODESPACE_NAME}-8000.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} >> ${APP_DIR}/.env.local -endif - -${APP_DIR}/.env.local: - touch ${APP_DIR}/.env.local - ### ### HELP ### ¯¯¯¯ diff --git a/README.md b/README.md index 35d3cfd..df5f3bc 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,11 @@ Manage your robots.txt from your Sylius admin pannel ## Compatibility -| Sylius Version | PHP Version | -|---|---| -| 1.12 | 8.1 - 8.2 | -| 1.13 | 8.1 - 8.2 | +| Sylius Version | PHP Version | +|----------------|-----------------| +| 1.12 | 8.1 - 8.2 - 8.3 | +| 1.13 | 8.1 - 8.2 - 8.3 | +| 1.14 | 8.1 - 8.2 - 8.3 | ## Installation diff --git a/composer.json b/composer.json index 83efc58..7214969 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "license": "MIT", "require": { "monsieurbiz/sylius-settings-plugin": "^1.2.0", - "php": "^8.0", - "sylius/sylius": ">=1.12 <1.14" + "php": "^8.1", + "sylius/sylius": ">=1.12 <2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.16", @@ -36,9 +36,6 @@ "phpspec": "phpspec run" }, "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - }, "symfony": { "docker": false, "endpoint": ["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master", "flex://defaults"] diff --git a/src/Resources/views/.gitkeep b/src/Resources/views/.gitkeep new file mode 100644 index 0000000..e69de29