symfony / flex

Composer plugin for Symfony
MIT License
4.15k stars 181 forks source link

Can we load a recipe that isn't pulled via composer? #955

Closed dmill-bz closed 1 year ago

dmill-bz commented 1 year ago

We have a use case where we do not wish to load bundles via composer. Those bundles are already present within the project and we're just looking for an easy way to load/unload them. Not that this is relevant but I will state that these bundles are part of a private mono-repo project which means that we most definitely cannot use the default multi-repo/composer setup that flex is expecting. There's more to it, and a reason why we're using bundles but I'll spare you the details.

Ultimately we are looking to just process a recipe file. So something like, (pseudo command) symfony recipe:load /path/to/recipe/file

Is anything like that already possible?

Thanks for your help.

stof commented 1 year ago

There is nothing like that possible. Flex is architectured to apply recipes for packages managed by composer.

dmill-bz commented 1 year ago

@stof Thanks for clarifying that. Is there a class we can leverage for some tasks like adding a bundle to the bundles.php file and other tasks that flex routinely performs? Or would we need to prep everything from scratch?

alexander-schranz commented 1 year ago

@PommeVerte keep in mind you can use also composer for local packages, which I think would already be required for you that autoloader works as expected:

    "repositories": [
        {
            "type": "path",
            "url": "./../../TemplateRenderer",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
         "your-vendor/your-local-package": "^1.0"
    },

Using this in my own Templating Monorepository Project

And you can create your own "recipes" repository for any packages e.g.:

https://github.com/alexander-schranz/symfony-php-skeleton/blob/f1b40a8f79d558aba0119dd6d282d1f349ffc2ab/composer.json#L71-L75