diff --git a/.gitignore b/.gitignore index df7f62d..c836b56 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ *GENERATED* .ddev /.php-cs-fixer.cache +/Build/rector/composer.json.testing +/Build/rector/composer.lock diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 0fe1760..a90cc1c 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -44,6 +44,7 @@ Options: - composer: "composer" with all remaining arguments dispatched. - composerNormalize: "composer normalize" - composerUpdate: "composer update", handy if host has no PHP + - composerUpdateRector: "composer update", for rector subdirectory - composerValidate: "composer validate" - lint: PHP linting - phpstan: PHPStan static analysis @@ -276,6 +277,19 @@ case ${TEST_SUITE} in cp ${ROOT_DIR}/composer.json ${ROOT_DIR}/composer.json.testing mv ${ROOT_DIR}/composer.json.orig ${ROOT_DIR}/composer.json ;; + + composerUpdateRector) + rm -rf Build/rector/.Build/bin/ Build/rector/.Build/vendor Build/rector/composer.lock + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.orig + if [ -f "${ROOT_DIR}/Build/rector/composer.json.testing" ]; then + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.orig + fi + COMMAND=(composer require --working-dir=${ROOT_DIR}/Build/rector --no-ansi --no-interaction --no-progress) + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.testing + mv ${ROOT_DIR}/Build/rector/composer.json.orig ${ROOT_DIR}/Build/rector/composer.json + ;; composerValidate) COMMAND=(composer validate "$@") ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" @@ -298,9 +312,9 @@ case ${TEST_SUITE} in ;; rector) if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then - COMMAND=(php -dxdebug.mode=off .Build/bin/rector -n --config=Build/rector/rector.php --clear-cache "$@") + COMMAND=(php -dxdebug.mode=off Build/rector/.Build/bin/rector -n --config=Build/rector/rector.php --clear-cache "$@") else - COMMAND=(php -dxdebug.mode=off .Build/bin/rector --config=Build/rector/rector.php --clear-cache "$@") + COMMAND=(php -dxdebug.mode=off Build/rector/.Build/bin/rector --config=Build/rector/rector.php --clear-cache "$@") fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name rector-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? diff --git a/Build/rector/composer.json b/Build/rector/composer.json new file mode 100644 index 0000000..6e8d897 --- /dev/null +++ b/Build/rector/composer.json @@ -0,0 +1,20 @@ +{ + "name": "t3docs/blog-example-rector", + "description": "Rector in its own package to avoid compability issues.", + "license": "GPL-2.0-or-later", + "type": "typo3-cms-extension", + "authors": [ + { + "name": "TYPO3 Documentation Team and contributors", + "role": "Developer" + } + ], + "require": { + "ssch/typo3-rector": "^2.3" + }, + "config": { + "bin-dir": ".Build/bin", + "sort-packages": true, + "vendor-dir": ".Build/vendor" + } +} diff --git a/Classes/Upgrades/ExtbasePluginListTypeToCTypeUpdate.php b/Classes/Upgrades/ExtbasePluginListTypeToCTypeUpdate.php new file mode 100644 index 0000000..29cdb44 --- /dev/null +++ b/Classes/Upgrades/ExtbasePluginListTypeToCTypeUpdate.php @@ -0,0 +1,44 @@ + 'examples_error', + 'examples_htmlparser' => 'examples_htmlparser', + 'examples_falexamples' => 'examples_falexamples', + ]; + } + + public function getTitle(): string + { + return 'Migrate Example Extbase plugins'; + } + + public function getDescription(): string + { + return 'Migrate Example Extbase plugins from deprecated registration via "list-type" to "CType"'; + } +} diff --git a/Classes/Upgrades/HaikuPluginListTypeToCTypeUpdate.php b/Classes/Upgrades/HaikuPluginListTypeToCTypeUpdate.php new file mode 100644 index 0000000..25d2f1c --- /dev/null +++ b/Classes/Upgrades/HaikuPluginListTypeToCTypeUpdate.php @@ -0,0 +1,43 @@ + 'examples_haiku_list', + 'examples_haiku_detail' => 'examples_haiku_detail', + ]; + } + + public function getTitle(): string + { + return 'Migrate Example Haiku plugins'; + } + + public function getDescription(): string + { + return 'Migrate Example Haiku plugins from deprecated registration via "list-type" to "CType"'; + } +} diff --git a/Makefile b/Makefile index 516de31..3649fbe 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,10 @@ phpstan: ## Run phpstan tests phpstan-baseline: ## Update the phpstan baseline Build/Scripts/runTests.sh -s phpstanBaseline +.PHONY: install +install: composerUpdate ## Update composer dependencies + .PHONY: composerUpdate composerUpdate: ## Update composer dependencies Build/Scripts/runTests.sh -s composerUpdate + Build/Scripts/runTests.sh -s composerUpdateRector diff --git a/composer.json b/composer.json index 8204211..bcbc918 100644 --- a/composer.json +++ b/composer.json @@ -13,20 +13,20 @@ ], "require": { "php": "^8.2", - "typo3/cms-backend": "^13.2 || dev-main", - "typo3/cms-core": "^13.2 || dev-main", - "typo3/cms-extbase": "^13.2 || dev-main", - "typo3/cms-fluid": "^13.2 || dev-main", - "typo3/cms-fluid-styled-content": "^13.2 || dev-main", - "typo3/cms-impexp": "^13.2 || dev-main", - "typo3/cms-linkvalidator": "^13.2 || dev-main", - "typo3/cms-reactions": "^13.2 || dev-main" + "typo3/cms-backend": "dev-main", + "typo3/cms-core": "dev-main", + "typo3/cms-extbase": "dev-main", + "typo3/cms-fluid": "dev-main", + "typo3/cms-fluid-styled-content": "dev-main", + "typo3/cms-impexp": "dev-main", + "typo3/cms-install": "dev-main", + "typo3/cms-linkvalidator": "dev-main", + "typo3/cms-reactions": "dev-main" }, "require-dev": { "ergebnis/composer-normalize": "~2.42.0", "friendsofphp/php-cs-fixer": "^3.52", - "phpstan/phpstan": "^1.10", - "ssch/typo3-rector": "^2.3" + "phpstan/phpstan": "^1.10" }, "minimum-stability": "dev", "prefer-stable": true,