beberlei / composer-monorepo-plugin

Integrates Composer into monolithic repositories with many packages.
MIT License
305 stars 41 forks source link

Add support for composer-runtime-api #70

Closed beberlei closed 3 years ago

beberlei commented 3 years ago

In Composer 2, a new magic cmponent composer-runtime-api was added, that when present generates a magic class Composer\InstalledVersions that is available in every script. This must be copied to exist in every component.

That is if either the root package, or any dependency of the monorepo package has a dependency on composer-runtime-api, then Composer\InstalledVersions must be generated as its done in FilesystemRepository: https://github.com/composer/composer/blob/master/src/Composer/Repository/FilesystemRepository.php#L130-L138