TYPO3 / CmsComposerInstallers

TYPO3 CMS Composer Installer
GNU General Public License v2.0
58 stars 39 forks source link

[FEATURE] As developer i want to relocate the installer-paths using composer/installers #144

Closed bmoex closed 1 year ago

bmoex commented 1 year ago

The feature of composer/installer that allows for the inclusion of specific extensions located outside the vendor/ folder does not seem to work for TYPO3 extensions.

The purpose of this feature is to enable users to avoid making changes directly in the vendor/ folder. By allowing these private repository extensions to be located elsewhere, it provides a clearer structure for users to make necessary modifications or adjustments.

For example, consider the following configuration in the composer.json file:

{
    "extra": {
        "installer-paths": {
            "extensions/external/{$name}/": ["vendor:my-private-repo"]
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://composer.typo3.org/"
        },
        {
            "type": "composer",
            "url": "https://my.private.satis.com/"
        },
        {
            "type": "path",
            "url": "extensions/custom/*"
        }
    ],
    "require": {
        "composer/installers": "~2.0",
        "typo3/cms-core": "^12.4",

        "my-local/extension": "dev-main",
        "my-private-repo/extension": "dev-main"
    }
}

Currently, it can be resolved by creating symbolic links to the desired directory structure:

/extensions/custom/extension
/extensions/external/extension <-- symlinked
/vendor/typo3/cms-core
/vendor/my-local/extension <-- symlinked
/vendor/my-private/extension

This is a feature provided by the composer/installers package available at https://github.com/composer/installers.

helhum commented 1 year ago

Hey @bmoex I don't think I completely understood what you are suggesting or trying to achieve.

Since typo3/cms-composer-installer v4, TYPO3 does not care any more where extensions are located at all. The vendor folder itself can be customized and it is possible to require composer/installers for a TYPO3 project to customize paths of packages. TYPO3 will pick up the configured extension/package paths and work with them.

That said, I don't think anything needs to be changed here.

Note though, that in general I wouldn't recommended to install packages into different folders.

bmoex commented 1 year ago

Hi Helmut! Thanks for the quick response! You mention: and it is possible to require composer/installers for a TYPO3 project to customize paths of packages. Apparently i don't get this to work.

With my example above, using a private satis repository, i want to customize paths of packages with a specific vendor. This does not seem to work.

helhum commented 1 year ago

i want to customize paths of packages with a specific vendor

I have no clue if composer/installers supports that. If it should, but it does not work for you, maybe check back there. TYPO3 and the package here does nothing with changing install paths any more, so it does not conflict with composer/installers

EDIT: composer/installers does not support this for arbitrary package types:

"The path will still only apply to packages by the vendor with a type in the supported list."

Please consider to simply not do that.

If you still think you'll need this, you may try out oomphinc/composer-installers-extender at your own risk.

For sure such feature will not be implemented here. We worked hard to get rid of custom paths and with TYPO3 v12 finally TYPO3 is working with Composer defaults (vendor). There are no plans to go back.