-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update recompose to work better with CWP #145
Update recompose to work better with CWP #145
Conversation
use SilverStripe\Upgrader\Util\ConfigFile; | ||
|
||
/** | ||
* Trait to encapsualte basic logic for retrieving upgrading config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
* @return bool | ||
*/ | ||
protected function recipeCoreTargetIsInstalled(ComposerExec $composer, string $targetRecipeCore): bool | ||
protected function targetsInstalled(ComposerExec $composer, array $targets): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPDoc needs to be updated.
tests/Composer/Rules/RebuildTest.php
Outdated
{ | ||
$composer = new ComposerExec(__DIR__); | ||
$rule = new Rebuild('1.1'); | ||
$rule = new Rebuild(["silverstripe/recipe-core" => "1.1"], $this->recipeEquivalences); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes are preferred.
tests/Composer/Rules/RebuildTest.php
Outdated
@@ -38,74 +48,98 @@ class RebuildTest extends TestCase | |||
'other' => ['composer/semver'], | |||
]; | |||
|
|||
public function testSwitchToRecipeCore() | |||
private $recipeEquivalences = [ | |||
"silverstripe/framework" => ["silverstripe/recipe-core"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes are preferred.
…uire any dependency.
bd0f213
to
bf4e81e
Compare
The purpose of the PR is to enable recompose to work with CWP recipes.
Summary of changes
--cwp-constraint
flag. When this is provided it overrides--recipe-core-constraint
. This means the primary constraint when installing dependency is driven bycwp/cwp-recipe-core
instead of bysilverstripe/recipe-core
.SilverStripe\Upgrader\Composer\Rules\Rebuild
now accepts a list of packages targets. This takes the form of packages that will be locked to a specific version requirements.SilverStripe\Upgrader\Composer\Rules\Rebuild
has been made more flexible when substituting packages for recipes. Therecipe-core
andrecipe-cms
substitution are no longer hard coded in Rebuild. Instead the recipe substitution can be provided to the constructor, which allows us to add cwp rules..upgrade.yml
. The project owner can either do it in their own.upgrade.yml
file or module maintainer could add it to their legacy project. Note that this is bit awkward because this file needs to be added to the SS3 module for it to work, because recompose is called before the project is using SS4 modules.composer.lock
file after eachrequire
call, this makes it less likely that an implicit dependency will conflict with one of explicit dependency ;ComposerExec::TEMP_SCHEMA_CONTENT
now include an explicit conflict onsilverstripe/recipe-core
andsilverstripe/recipe-cms
4.0/4.1, forcing Rebuild to default to the 1.0/1.1 alias.--verbose
flag is set.Parent issue