Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Update interdependency only for monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfejfar committed Oct 7, 2022
1 parent b778da7 commit 28f12fe
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symplify\MonorepoBuilder\DependencyUpdater;
use Symplify\MonorepoBuilder\FileSystem\ComposerJsonProvider;
use Symplify\MonorepoBuilder\Package\PackageNamesProvider;
use Symplify\MonorepoBuilder\Validator\SourcesPresenceValidator;
use Symplify\PackageBuilder\Console\Command\AbstractSymplifyCommand;
use Symplify\SymplifyKernel\Exception\ShouldNotHappenException;
Expand All @@ -23,7 +24,7 @@ final class BumpInterdependencyCommand extends AbstractSymplifyCommand
public function __construct(
private DependencyUpdater $dependencyUpdater,
private ComposerJsonProvider $composerJsonProvider,
private SourcesPresenceValidator $sourcesPresenceValidator
private PackageNamesProvider $packageNamesProvider
) {
parent::__construct();
}
Expand All @@ -41,23 +42,11 @@ protected function configure(): void

protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->sourcesPresenceValidator->validateRootComposerJsonName();

/** @var string $version */
$version = $input->getArgument(self::VERSION_ARGUMENT);

$rootComposerJson = $this->composerJsonProvider->getRootComposerJson();

// @todo resolve better for only found packages
// see https://github.com/symplify/symplify/pull/1037/files
$vendorName = $rootComposerJson->getVendorName();
if ($vendorName === null) {
throw new ShouldNotHappenException();
}

$this->dependencyUpdater->updateFileInfosWithVendorAndVersion(
$this->dependencyUpdater->updateFileInfosWithPackagesAndVersion(
$this->composerJsonProvider->getPackagesComposerFileInfos(),
$vendorName,
$this->packageNamesProvider->provide(),
$version
);

Expand Down

0 comments on commit 28f12fe

Please sign in to comment.