Renaming vendor breaks composer install
MCFreddie777 opened this issue · comments
Steps to reproduce:
- Use path mapping
"web/app/plugins/{$name}/": ["type:wordpress-plugin"]
- Change package name e.g. from
a/my-package
tob/my-package
composer remove a/my-package && composer require b/my-package
- Run
composer install
What happens:
Composer uninstalls a/my-package
, then installs b/my-package
, but as a last step, it removes my-package
directory (therefore removes the newly installed one)`.
Expected behaviour:
Old package will be removed, and new plugin will be installed.
One thing that actually helps is using vendor names in custom path, e.g.
"web/app/plugins/{$vendor}/{$name}/": ["type:wordpress-plugin"],
but that violates wordpress plugin directory structure as plugins should be flat.
What I've been doing in WordPress projects is prepending the vendor name to the package/install name:
"web/app/plugins/{$vendor}-{$name}/": [ "type:wordpress-plugin" ]
I avoid this for wpackagist/*
plugins and any plugin that expects a specific plugin name (often the case with plugins that have add-ons).