Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming vendor breaks composer install #519

Open
MCFreddie777 opened this issue Feb 24, 2023 · 2 comments
Open

Renaming vendor breaks composer install #519

MCFreddie777 opened this issue Feb 24, 2023 · 2 comments

Comments

@MCFreddie777
Copy link

MCFreddie777 commented Feb 24, 2023

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.

@MCFreddie777
Copy link
Author

MCFreddie777 commented Feb 24, 2023

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.

@mcaskill
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants