composer / installers

A Multi-Framework Composer Library Installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Renaming vendor breaks composer install

MCFreddie777 opened this issue · comments

Steps to reproduce:

  1. Use path mapping "web/app/plugins/{$name}/": ["type:wordpress-plugin"]
  2. Change package name e.g. from a/my-package to b/my-package
  3. composer remove a/my-package && composer require b/my-package
  4. 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).