Skip to content
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

[POC][WIP] Pack recipes #917

Closed
wants to merge 2 commits into from
Closed

[POC][WIP] Pack recipes #917

wants to merge 2 commits into from

Conversation

kbond
Copy link
Member

@kbond kbond commented May 27, 2022

Proposal for "scaffolds" as recipes as discussed with @nicolas-grekas and @weaverryan as a possible alternative to symfony/maker-bundle#1085.

  • Scaffolds make sense to be packs as we want their dependencies installed but not the "empty package".
  • Since scaffolds contain both require/require-dev dependencies, I had to modify the unpacker to allow for this.
  • We want pack recipes installed but not unconfigured when the pack is uninstalled.
  • Pack/Scaffold recipes cannot be updated/uninstalled. I think this makes sense as they will likely be heavily modified.

Recipe PR: symfony/recipes#1088

Test:

symfony new project
cd project
export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1088/index.json
composer config repositories.homepage vcs [email protected]:kbond/homepage-scaffold
composer config repositories.flex vcs [email protected]:kbond/flex
composer require symfony/flex:dev-pack-recipes
composer require kbond/homepage-scaffold # installs the "scaffold"
vendor/bin/phpunit # 1 test should run & pass

TODO:

  • If installing a scaffold with --dev, you get all the deps in require-dev.
  • Way to determine if a recipe is a pack on unconfigure.
  • Higher priority for pack recipes. This will allow files in pack recipes to take precedence over their dependency recipes (like metapackages do now).

@@ -72,6 +72,10 @@ public function populateUpdate(RecipeUpdate $recipeUpdate): void

public function unconfigure(Recipe $recipe, Lock $lock)
{
if ('kbond/homepage-scaffold' === $recipe->getPackage()->getName()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not figure out how to determine if the recipe is a pack or not here. $recipe->getPackage()->getType === null.

@kbond
Copy link
Member Author

kbond commented Jun 1, 2022

Closing in favour of #923.

@kbond kbond closed this Jun 1, 2022
@kbond kbond deleted the pack-recipes branch June 1, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant