FriendsOfTYPO3 / extension_builder

TYPO3 extension to kickstart and maintain TYPO3 extensions
https://docs.typo3.org/p/friendsoftypo3/extension-builder/11.0/en-us/
GNU General Public License v2.0
115 stars 79 forks source link

Set typo3/cms-extbase as dependency for created extensions #729

Open PKuhlmay opened 8 months ago

PKuhlmay commented 8 months ago

As typo3/cms-extbase could be a non-default in the future, the created extensions should include this as a dependency, as these use extbase. If typo3/cms-extbase is not required anymore, this could lead to some problems.

DavidBruchmann commented 7 months ago

in the template for the ext_emconf we've this code:

        'depends' => [<f:for each="{extension.dependencies}" as="version" key="extensionKey">
            '{extensionKey}' => '{version}',</f:for>
        ],

which is quite straight forward, but clarifies that in EBT\ExtensionBuilder\Service\FileGenerator every dependency has to be assigned with extensionKey and version constraints in the old way, for testing and demo like this:

        $dependencies = $this->extension->getDependencies();
        if (!array_key_exists('extbase', $dependencies)) {
            $dependencies['extbase'] = '12.4.0-12.4.99';
        }
        $this->extension->setDependencies($dependencies);
        $this->generateComposerJson();

The Composer file is created with ignoring all dependencies, the core is just statically assigned.

So actually we need a larger array for the dependencies like:

$dependencies = [];
$dependencies[$extensionKey] = [
    'composerName' => 'typo3/cms-extbase',
    'composerConstraint' => '^12.4',
    'extensionKey' => $extensionKey,
    'legacyConstraint' => '12.4.0-12.4.99'
];

This has to be reflected in the GUI too for assigning any dependencies.