Package name alias #11851
Replies: 2 comments 2 replies
-
A metapackage may help with this transition. You could rename your package, and publish a metapackage at the old name, which simply requires (an) appropriate version(s) of the new package name. Maybe also set an |
Beta Was this translation helpful? Give feedback.
-
You can use However, you would still need to have one place in your dependency graph requiring the actual package name and not only the aliased name (this was not true in early composer version, but the restriction was put in place based on security rules to prevent arbitrary package highjacking). |
Beta Was this translation helpful? Give feedback.
-
The problem
We have a package that is used by many teams. We did some refactoring and there are better names that describe what the package is for than the current name. We don't have space to force all the teams to update right now but my team would like to use new name. Also changing the main name will probably break some CI and that would require time to adjust.
The solution
I would like to give my package two names. Let's say I have
vendor/package-foo
a the moment. I would like to have second namevendor/package-foo-alias
. Thencomposer require vendor/package-foo
andcomposer require vendor/package-foo-alias
would install the same package.I imagine it could look something like that in composer.json:
Is it possible at the current state of Composer?
Beta Was this translation helpful? Give feedback.
All reactions