Dist::Zilla::Plugin::Prereqs::Recommend::MatchInstalled - Advertise versions of things you have as soft dependencies
version 0.003003
[Prereqs::MatchInstalled] was a good concept, but its application seemed too strong for some things.
[Prereqs::MatchInstalled]
This is a variation on the same theme, but instead of upgrading dependencies in-place, it propagates the upgrade to a different relation, to produce a softer dependency map.
Below shows the defaults expanded by hand.
[Prereqs::Recommend::MatchInstalled] applyto_phase = configure applyto_phase = runtime applyto_phase = test applyto_phase = build applyto_phase = develop source_relation = requires target_relation = recommends
And add these stanzas for example:
modules = Module::Build modules = Moose
And you have yourself a distribution that won't needlessly increase the dependencies on either, but will add increased dependencies to the recommends phase.
recommends
This way, people doing
cpanm YourModule
Get only what they need
While
cpanm --with-recommends YourModule
Will get more recent things upgraded
The [Prereqs::Recommend::MatchInstalled] is a tool for authors who wish to keep end users informed of which versions of critical dependencies the author has themselves used, as an encouragement for the users to consume at least that version, but without making it a hard requirement.
[Prereqs::Recommend::MatchInstalled]
In practice this can be used for anything, but this modules author currently recommends you restrict this approach only to development dependencies, mostly because even a system of auto-recommendation is still too aggressive for most modules, or if you insist this concept on CPAN, use something with "but not larger than" mechanics like [Prereqs::Upgrade]
CPAN
[Prereqs::Upgrade]
applyto_phase
[Prereqs::Recommend::MatchInstalled] applyto_phase = SOMEPHASE applyto_phase = SOMEPHASE
This attribute can be specified multiple times.
Valuable values are:
build test runtime configure develop
And those are the default values too.
source_relation
[Prereqs::Recommend::MatchInstalled] source_relation = requires
This attribute specifies the prerequisites to skim for modules to recommend upgrades on.
requires recommends suggests
Lastly:
conflicts
Will probably do something, but I have no idea if that means anything. If you want to conflict with what you've installed with, ... go right ahead.
target_relation
[Prereqs::Recommend::MatchInstalled] target_relation = recommends
This attribute specifies the relationship type to inject upgrades into.
applyto_map
[Prereqs::Recommend::MatchInstalled] applyto_map = runtime.requires = runtime.recommends
This attribute is the advanced internals of the other attributes, and it exists for insane, advanced, and niché applications.
General format is:
applyto_map = <source_phase>.<source_relation> = <target_phase>.<target_relation>
And you can probably do everything with this.
You could also conceivably emulate [Prereqs::MatchInstalled] in entirety by using this feature excessively.
applyto_map may be declared multiple times.
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::Prereqs::Recommend::MatchInstalled, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Prereqs::Recommend::MatchInstalled
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Prereqs::Recommend::MatchInstalled
For more information on module installation, please visit the detailed CPAN module installation guide.