Dist::Zilla::Plugin::Rinci::AddPrereqs - Add prerequisites from Rinci metadata
This document describes version 0.145 of Dist::Zilla::Plugin::Rinci::AddPrereqs (from Perl distribution Dist-Zilla-Plugin-Rinci-AddPrereqs), released on 2020-06-10.
In dist.ini:
dist.ini
[Rinci::AddPrereqs]
This plugin will first collect Rinci metadata from the following:
%SPEC variable in all modules of the distribution
Perinci::CmdLine scripts
This plugin will also search all Perinci::CmdLine-based scripts, request Rinci function metadata from all local Riap URI's used by the scripts. Plus, will add a dependency to the module mentioned in the local Riap URI. For example, in Perinci::CmdLine-based script:
url => '/MyApp/myfunc',
The plugin will retrieve the Rinci metadata in MyApp module as well as add a runtime-requires dependency to the MyApp module (unless MyApp is in the same/current distribution).
MyApp
The following prereqs will be added according to information in Rinci function metadata.
Additional property module
If the Rinci metadata contains non-standard properties, which require corresponding Perinci::Sub::Property::NAME modules, then these modules will be added as prereqs.
Perinci::Sub::Property::NAME
schema
Currently will only do this for Rinci metadata for CLI scripts.
The plugin will compile every schema of function argument using Data::Sah, then add a prereq to each module required by the generated argument validator produced by Data::Sah. For example, in Rinci metadata:
args => { arg1 => { schema => 'color::rgb24*', ... }, ... }
When the color::rgb24 schema is compiled, the following modules are required: Sah::Schema::color::rgb24, Data::Sah::Coerce::perl::To_str::From_str::rgb24_from_colorname_X_or_code. The generated validator code requires these modules: strict, warnings, Graphics::ColorNames, Graphics::ColorNames::X. All of which will be added as prereq.
color::rgb24
x.schema.entity, x.schema.element_entity
For every entity mentioned in x.schema.entity or x.schema.element_entity in argument specification in function metadata, the plugin will add a prereq to Perinci::Sub::ArgEntity::NAME. For example, in Rinci metadata:
x.schema.entity
x.schema.element_entity
Perinci::Sub::ArgEntity::NAME
args => { arg1 => { 'x.schema.entity' => 'dirname', ... }, ... }
(Note that x.schema.entity is deprecated.)
x.completion, x.element_completion
For every completion mentioned in x.completion or x.element_completion in argument specification in function metadata, which can have the value of NAME or [NAME, ARGS], the plugin will add a prereq to corresponding Perinci::Sub::XCompletion::NAME. For example, in Rinci metadata:
x.completion
x.element_completion
NAME
[NAME, ARGS]
Perinci::Sub::XCompletion::NAME
args => { arg1 => { 'schema' => 'str*', 'x.completion' => 'colorname', ... }, ... }
Please visit the project's homepage at https://metacpan.org/release/Dist-Zilla-Plugin-Rinci-AddPrereqs.
Source repository is at https://github.com/perlancar/perl-Dist-Zilla-Plugin-Rinci-AddPrereqs.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Rinci-AddPrereqs
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Rinci
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2019, 2018, 2016, 2015 by perlancar@cpan.org.
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::Rinci::AddPrereqs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Rinci::AddPrereqs
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Rinci::AddPrereqs
For more information on module installation, please visit the detailed CPAN module installation guide.