fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

Compatibility with Composer 2.0 #333

Closed liborm85 closed 4 years ago

liborm85 commented 4 years ago

Composer 1.9 deprecated more than one -, . or _ character in package name. And composer 2.0 will throw error. In composer 2.0 cannot be used -- notation for npm @<vendor> (eg. npm-asset/fullcalendar--core).

Composer 1.9 show this deprecation warning: Deprecation warning: require.npm-asset/fullcalendar--core is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*". Make sure you fix this as Composer 2.0 will error.

francoispluchino commented 4 years ago

Maybe test by replacing -- by -slash- (or other?), but in any case, it will break the compatibility with the installed packages.

Example: npm-asset/fullcalendar--core by npm-asset/fullcalendar-slash-core.

It should also be tested if using the replace section does not also add the warning.

filsh commented 4 years ago

Is there any progress to solve the problem?

liborm85 commented 4 years ago

@francoispluchino Change from -- to -slash- sounds sensible. Maybe both variants could be supported, and that would resolve the incompatibility?

francoispluchino commented 4 years ago

Indeed, the best would be to take care of the 2 possibilities, but without futher analysis, I cannot confirm the feasibility.

cebe commented 4 years ago

I made an issue on composer repo to discuss this: https://github.com/composer/composer/issues/8749

cebe commented 4 years ago

This should be solved by https://github.com/composer/composer/pull/8767 now.

francoispluchino commented 4 years ago

I reopen this issue because we must update the plugin implementation for the Composer 2.0.

francoispluchino commented 4 years ago

Issue already created for that: #334.