feat(install): Install plugin dependencies on URL and path installs#18
Merged
Conversation
Code Review SummaryThis PR significantly improves the 🚀 Key Improvements
💡 Minor Suggestions
|
3804580 to
aa1f9b0
Compare
Installing a plugin from a repository URL or a local path now resolves the dependencies the plugin declares in its own composer.json, so its classes are available at runtime instead of failing with class-not-found errors. Local directory paths are now a supported install source alongside URLs and Composer package names. When the host application merges plugin manifests via composer-merge-plugin the install runs a targeted update; otherwise it falls back to requiring the declared packages, letting Composer resolve them against the host constraints.
aa1f9b0 to
8c1b1e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17.
plugin:installfrom a repository URL or a local path placed the plugin and randiscovery, but never installed the dependencies the plugin declares in its own
composer.json. The plugin's own classes loaded; its dependencies did not, soanything it pulled in (an SDK, a parser) failed with class-not-found at runtime.
The install now reads the placed plugin's
composer.jsonand installs itsrequireinto the host. Platform constraints (php,ext-*,lib-*) areskipped, and any
repositoriesthe plugin declares are registered first so therequires can resolve.
Local directory paths are also a first-class install source now. Previously a
non-URL argument was always treated as a Composer package name, so
plugin:install ./path/to/pluginnever worked.Where the host opts into
wikimedia/composer-merge-pluginfor its pluginsdirectory, the install runs a targeted
composer updateso each plugin keepsowning its dependencies; otherwise it falls back to
composer require. TheComposer call sits behind a small runner interface, so dependency installation
is covered by tests without shelling out.