First Time CPAN Contributor - v0.1

Adam M Dutko

Before I get started ...

Sponsor

Atomic Learning

Prizes

Why you might be here?

About Me

Adam

  • The CPAN

  • Part 0: Where do I start?

    YAPC::NA 2014

    Today's Presentation

    Dist::Zilla

    Process Improvement

    Dist::Zilla - Ready Made

    New Approach

    Part 2: Working Example

    Starting Fresh

      $ dzil new Pod::Generate::Recursive 
    
      [DZ] making target dir ./Pod-Generate-Recursive
      [DZ] writing files to /Users/adam/Pod-Generate-Recursive
      [DZ] dist minted in ./Pod-Generate-Recursive
    
      vi ./Pod-Generate-Recursive/dist.ini
    
      vi ./Pod-Generate-Recursive/lib/Pod/Generate/Recursive.pm
    
      

    Existing Code Base

      Changes
    
      Makefile.PL 
    
      README 
    
      lib
    
      MANIFEST
    
      ignore.txt
    
      t
      

    Makefile.PL

      use ExtUtils::MakeMaker;
    
      WriteMakefile(
          NAME             => 'Pod::Generate::Recursive',
          AUTHOR           => q{Adam M Dutko },
          VERSION_FROM     => 'lib/Pod/Generate/Recursive.pm',
          ABSTRACT_FROM    => 'lib/Pod/Generate/Recursive.pm',
          LICENSE          => 'Perl_5',
          PL_FILES         => {},
          MIN_PERL_VERSION => 5.006,
          CONFIGURE_REQUIRES => {
          'ExtUtils::MakeMaker' => 0,
      },
      

    Cleanup Existing

      rm Makefile.PL 
      rm MANIFEST
      rm ignore.txt
      rm README
    
      ...  
    
      [DZ] attempt to add README multiple times;
    
      ...
    
      aborting; duplicate files would be produced
    
      

    Cleaned Code Base

      Changes  
      README   
      lib      
      t
      

    dist.ini

      name    = Pod-Generate-Recursive 
      version = 0.3 
      author  = Adam M Dutko 
      license = Perl_5
      copyright_holder = Adam M Dutko
    
      [GatherDir]
      [MetaYAML]
      [MakeMaker]
      [Manifest]
    
      ... {more to come } ...
      

    Cleaned Code Base

      Changes  
      README  
      dist.ini 
      lib      
      t
      

    Minimum Build

    dzil clean

    
      {blank} - first run 
      
      ...
    
      $ dzil clean
      [DZ] clean: removing .build
      [DZ] clean: removing Pod-Generate-Recursive-0.3
      [DZ] clean: removing Pod-Generate-Recursive-0.3.tar.gz
    
      

    dzil build

    
      $ dzil build
    
      [DZ] beginning to build Pod-Generate-Recursive
      [DZ] guessing dist's main_module is 
           lib/Pod/Generate/Recursive.pm
      [DZ] writing Pod-Generate-Recursive in 
           Pod-Generate-Recursive-0.3
      [DZ] building archive with Archive::Tar; 
           install Archive::Tar::Wrapper 0.15 or newer for 
           improved speed
      [DZ] writing archive to Pod-Generate-Recursive-0.3.tar.gz
      [DZ] built in Pod-Generate-Recursive-0.3
    
      

    What about prereqs?

    
      Declare???
    
      [Prereqs]
      File::Find          = 0
      File::Path          = 0
      Pod::POM            = 0
      Pod::POM::View::Pod = 0
      
      Output the same as before 
      

    Automatic

    Testing

      
      [Prereqs]
      -phase = test
    
      File::Find = 0
    
      OR
    
      [Prereqs / TestRequires]
      File::Find = 0
      

    Testing Cont.

    
      Preferred Approach 
    
      [Prereqs / ... ]
    
      RunTimeRequires
      TestRequires
      ConfigureRequires
      BuildRequires
    
      

    dzil test

    
      $ dzil test
    
      [DZ] building distribution under .build/r2k6Aw490J 
           for installation
      ...
      [DZ] guessing dist's main_module is 
           lib/Pod/Generate/Recursive.pm
      [DZ] writing Pod-Generate-Recursive in .build/r2k6Aw490J
      Checking if your kit is complete...
      Looks good 
      ...
      [DZ] all's well; removing .build/r2k6Aw490J
    
      

    Shrink dist.ini

      name    = Pod-Generate-Recursive
      version = 0.3
      author  = Adam M Dutko 
      license = Perl_5
      copyright_holder = Adam M Dutko
    
      [@Basic]
      [AutoPrereqs]
    
      

    @Basic Does Much

      Dist::Zilla::Plugin::GatherDir
      Dist::Zilla::Plugin::PruneCruft
      Dist::Zilla::Plugin::ManifestSkip
      Dist::Zilla::Plugin::MetaYAML
      Dist::Zilla::Plugin::License
      Dist::Zilla::Plugin::Readme
      Dist::Zilla::Plugin::ExtraTests
      Dist::Zilla::Plugin::ExecDir
      Dist::Zilla::Plugin::ShareDir
      Dist::Zilla::Plugin::MakeMaker
      Dist::Zilla::Plugin::Manifest
      Dist::Zilla::Plugin::TestRelease
      Dist::Zilla::Plugin::ConfirmRelease
      Dist::Zilla::Plugin::UploadToCPAN
      

    Good Practice

      
      dzil authordeps --missing | cpanm
    
      ...
      name    = Pod-Generate-Recursive
      version = 0.3
      author  = Adam M Dutko 
      ...
    
      [Test::Perl::Critic]
      [PodCoverageTests]
      [PodSyntaxTests]
      

    dzil build

      $ dzil build
    
      [DZ] beginning to build Pod-Generate-Recursive
      [ExtraTests] rewriting author test xt/author/critic.t
      [ExtraTests] rewriting release test xt/release/pod-coverage.t
      [ExtraTests] rewriting release test xt/release/pod-syntax.t
      [DZ] guessing dist's main_module 
           is lib/Pod/Generate/Recursive.pm
      ...
      [DZ] writing archive to Pod-Generate-Recursive-0.3.tar.gz
      [DZ] built in Pod-Generate-Recursive-0.3
      

    Versioning

    New dist.ini

      name    = Pod-Generate-Recursive
      author  = Adam M Dutko 
      license = Perl_5
      copyright_holder = Adam M Dutko
    
      [@Basic]
      [AutoPrereqs]
      [VersionFromModule]
    
      [Test::Perl::Critic]
      [PodCoverageTests]
      [PodSyntaxTests]
      

    dzil release

    dzil release cont.

      Result: PASS
      [@Basic/ConfirmRelease] *** Preparing to release 
          Pod-Generate-Recursive-0.4-TRIAL.tar.gz 
              with @Basic/UploadToCPAN ***
      Do you want to continue the release process? [y/N]:y
      ...
      [@Basic/UploadToCPAN] registering upload with PAUSE 
          web server
      [@Basic/UploadToCPAN] POSTing upload for 
          Pod-Generate-Recursive-0.4-TRIAL.tar.gz to 
              https://pause.perl.org/pause/authenquery
        [@Basic/UploadToCPAN] PAUSE add message sent ok [200]
      

    dist.ini

      name    = Pod-Generate-Recursive
      author  = Adam M Dutko 
      license = Perl_5
      copyright_holder = Adam M Dutko
    
      [@Basic]
      [AutoPrereqs]
      [VersionFromModule]
    
      [Test::Perl::Critic]
      [PodCoverageTests]
      [PodSyntaxTests]
      

    More Information

    More Links

    Need help?

    Thank you Perl



        Aviation is the branch of engineering 
        that is least forgiving of mistakes.
    
        {Aren't you happy you write software?!}
    
        -- Freeman Dyson