diff --git a/composer.lock b/composer.lock index 96aca5605b..b354639895 100644 --- a/composer.lock +++ b/composer.lock @@ -18796,16 +18796,16 @@ }, { "name": "spryker/application", - "version": "3.36.0", + "version": "3.36.1", "source": { "type": "git", "url": "https://github.com/spryker/application.git", - "reference": "05f84ec7998d359c04294ae54fca6fa9b8d9f6be" + "reference": "d783bfe7cb378129fe20d423e0138b94c3042664" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/application/zipball/05f84ec7998d359c04294ae54fca6fa9b8d9f6be", - "reference": "05f84ec7998d359c04294ae54fca6fa9b8d9f6be", + "url": "https://api.github.com/repos/spryker/application/zipball/d783bfe7cb378129fe20d423e0138b94c3042664", + "reference": "d783bfe7cb378129fe20d423e0138b94c3042664", "shasum": "" }, "require": { @@ -18858,9 +18858,9 @@ ], "description": "Application module", "support": { - "source": "https://github.com/spryker/application/tree/3.36.0" + "source": "https://github.com/spryker/application/tree/3.36.1" }, - "time": "2024-11-04T14:07:47+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/application-extension", @@ -43072,20 +43072,20 @@ }, { "name": "spryker/module-finder", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/spryker/module-finder.git", - "reference": "ee25ba055d2b4af7c80b2c7d3d8800c7d21a78fa" + "reference": "3ee68a0b38e18182647841664c242e86ebab9151" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/module-finder/zipball/ee25ba055d2b4af7c80b2c7d3d8800c7d21a78fa", - "reference": "ee25ba055d2b4af7c80b2c7d3d8800c7d21a78fa", + "url": "https://api.github.com/repos/spryker/module-finder/zipball/3ee68a0b38e18182647841664c242e86ebab9151", + "reference": "3ee68a0b38e18182647841664c242e86ebab9151", "shasum": "" }, "require": { - "php": ">=7.4", + "php": ">=8.2", "spryker/kernel": "^3.33.0", "spryker/laminas": "^1.0.0", "spryker/symfony": "^3.2.0" @@ -43111,9 +43111,9 @@ ], "description": "ModuleFinder module", "support": { - "source": "https://github.com/spryker/module-finder/tree/1.2.0" + "source": "https://github.com/spryker/module-finder/tree/1.3.0" }, - "time": "2021-10-21T12:10:34+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/money", @@ -61236,16 +61236,16 @@ }, { "name": "spryker/router", - "version": "1.22.0", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/spryker/router.git", - "reference": "fac365d14ce148c643241d4852d7264444926c76" + "reference": "884dbda6c5e728980b97390975c256d3517db598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/router/zipball/fac365d14ce148c643241d4852d7264444926c76", - "reference": "fac365d14ce148c643241d4852d7264444926c76", + "url": "https://api.github.com/repos/spryker/router/zipball/884dbda6c5e728980b97390975c256d3517db598", + "reference": "884dbda6c5e728980b97390975c256d3517db598", "shasum": "" }, "require": { @@ -61292,9 +61292,9 @@ ], "description": "Router module", "support": { - "source": "https://github.com/spryker/router/tree/1.22.0" + "source": "https://github.com/spryker/router/tree/1.23.0" }, - "time": "2024-11-28T15:34:08+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/router-extension", @@ -70803,16 +70803,16 @@ }, { "name": "spryker/testify", - "version": "3.57.0", + "version": "3.58.0", "source": { "type": "git", "url": "https://github.com/spryker/testify.git", - "reference": "ce3236d47e23d427e6e4972bcd93b998f1e8e829" + "reference": "124f9090c9d819d579793794ebe70b322d75e8c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/testify/zipball/ce3236d47e23d427e6e4972bcd93b998f1e8e829", - "reference": "ce3236d47e23d427e6e4972bcd93b998f1e8e829", + "url": "https://api.github.com/repos/spryker/testify/zipball/124f9090c9d819d579793794ebe70b322d75e8c8", + "reference": "124f9090c9d819d579793794ebe70b322d75e8c8", "shasum": "" }, "require": { @@ -70874,9 +70874,9 @@ ], "description": "Testify module", "support": { - "source": "https://github.com/spryker/testify/tree/3.57.0" + "source": "https://github.com/spryker/testify/tree/3.58.0" }, - "time": "2024-11-18T13:28:47+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/testify-async-api", @@ -71188,16 +71188,16 @@ }, { "name": "spryker/twig", - "version": "3.25.1", + "version": "3.26.0", "source": { "type": "git", "url": "https://github.com/spryker/twig.git", - "reference": "211af00512f740341689cfd09f842a3042ca26b8" + "reference": "3fbfeb4b5a38bbdfe9fb3ed235a0462e7807ea40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/twig/zipball/211af00512f740341689cfd09f842a3042ca26b8", - "reference": "211af00512f740341689cfd09f842a3042ca26b8", + "url": "https://api.github.com/repos/spryker/twig/zipball/3fbfeb4b5a38bbdfe9fb3ed235a0462e7807ea40", + "reference": "3fbfeb4b5a38bbdfe9fb3ed235a0462e7807ea40", "shasum": "" }, "require": { @@ -71243,9 +71243,9 @@ ], "description": "Twig module", "support": { - "source": "https://github.com/spryker/twig/tree/3.25.1" + "source": "https://github.com/spryker/twig/tree/3.26.0" }, - "time": "2024-12-12T18:25:19+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/twig-extension", @@ -82984,16 +82984,16 @@ }, { "name": "spryker/development", - "version": "3.40.1", + "version": "3.41.0", "source": { "type": "git", "url": "https://github.com/spryker/development.git", - "reference": "2123aa9425ac84ac24510603de64fc148a687883" + "reference": "6e85228bc1e95a625c4dc5fe4d71ea0112d52f35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/development/zipball/2123aa9425ac84ac24510603de64fc148a687883", - "reference": "2123aa9425ac84ac24510603de64fc148a687883", + "url": "https://api.github.com/repos/spryker/development/zipball/6e85228bc1e95a625c4dc5fe4d71ea0112d52f35", + "reference": "6e85228bc1e95a625c4dc5fe4d71ea0112d52f35", "shasum": "" }, "require": { @@ -83040,9 +83040,9 @@ ], "description": "Development module", "support": { - "source": "https://github.com/spryker/development/tree/3.40.1" + "source": "https://github.com/spryker/development/tree/3.41.0" }, - "time": "2024-11-11T15:26:08+00:00" + "time": "2025-01-07T16:05:54+00:00" }, { "name": "spryker/docker-chromedriver", diff --git a/config/Shared/config_default.php b/config/Shared/config_default.php index ef65506350..0c66fe8cc3 100644 --- a/config/Shared/config_default.php +++ b/config/Shared/config_default.php @@ -166,6 +166,7 @@ ]; $config[KernelConstants::CORE_NAMESPACES] = [ 'SprykerShop', + 'SprykerFeature', 'SprykerEco', 'Spryker', 'SprykerSdk', diff --git a/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/DocumentationGeneratorRestApiBusinessFactory.php b/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/DocumentationGeneratorRestApiBusinessFactory.php new file mode 100644 index 0000000000..11bfb7eca0 --- /dev/null +++ b/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/DocumentationGeneratorRestApiBusinessFactory.php @@ -0,0 +1,32 @@ +getFinder(), + $this->getTextInflector(), + $this->getConfig()->getAnnotationSourceDirectories(), + ); + } +} diff --git a/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/Finder/GlueControllerFinder.php b/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/Finder/GlueControllerFinder.php new file mode 100644 index 0000000000..36b8aa1c57 --- /dev/null +++ b/src/Pyz/Zed/DocumentationGeneratorRestApi/Business/Finder/GlueControllerFinder.php @@ -0,0 +1,93 @@ + + */ + public function getGlueControllerFilesFromPlugin(ResourceRoutePluginInterface $plugin): array + { + $controllerNamespace = $this->getPluginControllerClass($plugin); + $controllerNamespaceExploded = explode('\\', $controllerNamespace); + + $moduleName = array_slice($controllerNamespaceExploded, -3)[0]; + $existingDirectories = $this->getMonoRepositoryControllerSourceDirectories($moduleName, $moduleName); + if (!$existingDirectories) { + $existingDirectories = $this->getMonoRepositoryControllerSourceDirectories( + $this->toSingular($this->removeRestApiSuffix($moduleName)), + $moduleName, + ); + } + + if (!$existingDirectories) { + return []; + } + + $finder = clone $this->finder; + $finder->in($existingDirectories)->name(sprintf(static::PATTERN_CONTROLLER_FILENAME, end($controllerNamespaceExploded))); + + return iterator_to_array($finder); + } + + /** + * @param string $moduleDirectory + * @param string $moduleName + * + * @return array + */ + protected function getMonoRepositoryControllerSourceDirectories(string $moduleDirectory, string $moduleName): array + { + $directories = array_map(function ($directory) use ($moduleDirectory, $moduleName) { + return sprintf($directory, $moduleDirectory, $moduleName); + }, $this->sourceDirectories); + + return $this->getExistingSourceDirectories($directories); + } + + /** + * @param string $moduleName + * + * @return string + */ + protected function removeRestApiSuffix(string $moduleName): string + { + return str_replace('RestApi', '', $moduleName); + } + + /** + * @param string $moduleName + * + * @return string + */ + protected function toSingular(string $moduleName): string + { + $rules = [ + '/(s|x|z|ch|sh)es$/i' => '$1', + '/ies$/i' => 'y', + '/ves$/i' => 'f', + '/s$/i' => '', + ]; + + foreach ($rules as $pattern => $replacement) { + if (preg_match($pattern, $moduleName)) { + return preg_replace($pattern, $replacement, $moduleName); + } + } + + return $moduleName; + } +} diff --git a/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php index 912a646bf9..ead9b9215f 100644 --- a/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php +++ b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php @@ -43,6 +43,7 @@ 'SprykerShop', 'SprykerEco', 'Spryker', + 'SprykerFeature', ]; $config[KernelConstants::PROJECT_NAMESPACE] = 'Pyz'; diff --git a/tests/travis_check_touched_modules.sh b/tests/ci_check_touched_modules.sh similarity index 96% rename from tests/travis_check_touched_modules.sh rename to tests/ci_check_touched_modules.sh index 64e94d026a..3c7e61fc41 100755 --- a/tests/travis_check_touched_modules.sh +++ b/tests/ci_check_touched_modules.sh @@ -34,8 +34,8 @@ validateModuleTransfers() { let "TRANSFER_TOTAL_MODULES_PROCESSED_COUNT+=1" - echo $2.$module - output=$(vendor/bin/spryker-dev-console dev:validate-module-transfers -v -m $2.$module) + echo $module + output=$(vendor/bin/spryker-dev-console dev:validate-module-transfers -v -m $module) if [ $? -ne 0 ]; then echo $output EXITCODE=1 @@ -63,8 +63,8 @@ validateModuleArchitecture() { let "ARCHITECTURE_TOTAL_MODULES_PROCESSED_COUNT+=1" - echo $2.$module - output=$(vendor/bin/console code:sniff:architecture -v -m $2.$module) + echo $module + output=$(vendor/bin/console code:sniff:architecture -v -m $module) if [ $? -ne 0 ]; then echo $output EXITCODE=1 diff --git a/tests/travis_check_untracked.sh b/tests/ci_check_untracked.sh similarity index 100% rename from tests/travis_check_untracked.sh rename to tests/ci_check_untracked.sh diff --git a/tests/touched_modules_list.sh b/tests/touched_modules_list.sh index cf8a71aa27..a66570dfd3 100755 --- a/tests/touched_modules_list.sh +++ b/tests/touched_modules_list.sh @@ -1 +1,11 @@ -echo $(git -C vendor/spryker/$1 diff --name-only --diff-filter=ACMRTUXB master... | grep "^Bundles\/" | cut -d "/" -f2- | cut -d "/" -f1 | sort | uniq) +modules=$(git -C vendor/spryker/$1 diff --name-only --diff-filter=ACMRTUXB master... | grep -E "^Bundles\/|^Features\/" | cut -d "/" -f2- | cut -d "/" -f1 | sort | uniq) + +for module in $modules; do + if git -C vendor/spryker/$1 diff --name-only --diff-filter=ACMRTUXB master... | grep -q "^Bundles\/$module"; then + echo "Spryker.$module" + elif git -C vendor/spryker/$1 diff --name-only --diff-filter=ACMRTUXB master... | grep -q "^Features\/$module"; then + if [[ -d "Features/$module/src/" || -d "Features/$module/tests/" ]]; then + echo "SprykerFeature.$module" + fi + fi +done