Dist::Zilla::PluginBundle::Starter - A new way to start using Dist::Zilla
Tags: perl
Published: 2021-03-08 20:04:20

[Dist::Zilla](https://metacpan.org/pod/Dist::Zilla) is an extremely powerful and versatile CPAN authoring tool, which has enabled me to reliably publish many [distributions](https://metacpan.org/author/DBOOK) with minimal fuss. It has the ability to automate your entire distribution building, testing, and releasing process, customized to almost any workflow, but this ability does not come without cost. One of the biggest difficulties newcomers face is sorting out the overwhelming number of available plugins and how to use them together effectively. A good way to start is with the tutorials at [dzil.org](http://dzil.org) and the standard [@Basic](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Basic) plugin bundle. Unfortunately, the `@Basic` bundle is out of date; notably, it does not include the [[MetaJSON]](https://metacpan.org/pod/Dist::Zilla::Plugin::MetaJSON) plugin, to generate META.json which is now the preferred metadata format for CPAN distributions. For backwards compatibility reasons the bundle itself can't easily be updated with new plugins.

[@Starter](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Starter) is an attempt at an improved, more customizable beginner's plugin bundle, with a revision feature to try to avoid the problem of stagnation while being able to retain backwards compatibility. The revision defaults to 1 unless set explicitly, and future incompatible changes will be made by adding new revisions, which must then be selected by the author using the bundle. Also, the popular PluginRemover and Config::Slicer plugin bundle roles are composed in, allowing the author to remove or configure bundled plugins as desired.

The first revision also includes a number of improvements and updates to `@Basic`, while remaining unopinionated and unobtrusive. The previously mentioned [MetaJSON] is included by default, as well as a few plugins for more [complete](https://metacpan.org/pod/Dist::Zilla::Plugin::MetaConfig) [distribution](https://metacpan.org/pod/Dist::Zilla::Plugin::MetaProvides::Package) [metadata](https://metacpan.org/pod/Dist::Zilla::Plugin::MetaNoIndex), and a few plugins that add basic sanity tests to the build. Two of the tests are author-only tests that check that the [pod syntax is valid](https://metacpan.org/pod/Dist::Zilla::Plugin::PodSyntaxTests) and the [modules compile](https://metacpan.org/pod/Dist::Zilla::Plugin::Test::Compile). The third is a simple test that prints a [report of the installed prerequisites](https://metacpan.org/pod/Dist::Zilla::Plugin::Test::ReportPrereqs), useful for diagnosing test failures. [[RunExtraTests]](https://metacpan.org/pod/Dist::Zilla::Plugin::RunExtraTests) is included instead of [[ExtraTests]](https://metacpan.org/pod/Dist::Zilla::Plugin::ExtraTests), because instead of moving and rewriting your extra tests (tests in xt/), it leaves them there and modifies Dist::Zilla's testing routines to run them directly. Finally, [[ReadmeAnyFromPod]](https://metacpan.org/pod/Dist::Zilla::Plugin::ReadmeAnyFromPod) is used instead of [[Readme]](https://metacpan.org/pod/Dist::Zilla::Plugin::Readme) to generate a text README from your main module's documentation, rather than a generic README.

These plugins are sufficient to build and release a complete distribution reliably, but there are many more tasks Dist::Zilla can automate for you, like maintaining your module versions and automatically managing git or other version control. The ["EXTENDING"](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Starter#EXTENDING) section of the documentation describes some of the available options. Many of these are features of miyagawa's excellent [Dist::Milla](https://metacpan.org/pod/Dist::Milla) bundle, which is much more opinionated, but can be another great way to start using Dist::Zilla if you use git version control, and heavily influenced [my own author bundle](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Author::DBOOK).

I hope this new bundle is useful to those getting started with Dist::Zilla or just looking for an updated bundle similar to `@Basic`, and as with all matters Dist::Zilla, please stop by [#distzilla on irc.perl.org](https://kiwiirc.com/nextclient/#irc://irc.perl.org/#distzilla) if you need help!

*Since the original publication of this post, `@Starter` has reached revision 5 and the [@Starter::Git](https://metacpan.org/pod/Dist::Zilla::PluginBundle::Starter::Git) variant bundle has been added for additional convenience. I will be republishing my other posts on `@Starter` in the coming week.*