-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Package naming in 2.0 and the asset ecosystem #8749
Comments
Just to have this request complete, I'd like to show how small the change is to make everyone happy :) fixes composer#8749
fixes composer#8749 1.10 implementation of composer#8750
should the regex be added to the json schema? composer/res/composer-schema.json Lines 8 to 11 in 40a35ab
|
Yup that'd probably make sense for 2.0, it might make it a hard fail by default as well and allow us to remove the rest of the validation code, not sure. But anyway should be a separate PR afterwards I guess. |
Keeping open as the schema change should probably still happen in master, and we should also check whether it errors correctly when a require or name is defined with an invalid package name. |
While checking the docs about naming, I also found the following thing: edited, made a separate issue: #8778 |
Thank you, @Seldaek! |
@Seldaek Thank you! |
Hi, I wanted to make you aware of an impact of the package naming restriction in 2.0, which is going to affect users of https://asset-packagist.org/ and composer-asset-plugin. This is not about whether one should use these (I know your opinion on this @Seldaek 😃) but the fact that upgrading to Composer 2.0 becomes really hard (currently impossible) for people on this ecosystem.
The issue
Composer 2.0 will restrict the use of
-
(dashes). When converting npm package names which include a vendor name (vendor/package
) we can not keep the/
because having multiple/
in a package name has obvious issues (as discussed in #7975). Currently the/
is converted to--
(see docs). Double dashes however are not valid anymore in Composer 2.0.How to solve this issue?
There are two ways to solve this:
composer-asset-plugin
.Given that we find a replacement that matches the naming restrictions and does not cause other problems (which is already quite hard), this also means a lot of upgrade work as people need to rename all their package requirements.
We also we need a breaking change in the repository of asset-packagist as well as a new major version of composer-asset-plugin, which is incompatible with the current version, meaning a composer.json file will work either with version 1 or 2 but never with both. The fact that the plugin needs to be installed globally will make it very hard to work on two projects with different state.
Allowing multiple dashes in package names is not a huge problem for composer and does not introduce any overhead as far as I see. Compared to the amount of work needed to make the composer-asset-plugin/asset-packagist ecosystem compatible with Composer 2.0.
Thank you!
Btw, docs should be adjusted:
https://github.com/composer/composer/blob/master/doc/04-schema.md#name
(I can help with that once this issue is solved)
The text was updated successfully, but these errors were encountered: